testng-team / testng-eclipse

Eclipse plug-in for TestNG
https://testng.org
194 stars 164 forks source link

Can't run tests in Eclipse. The option doesn't appear in the contextual menu #550

Closed jnioche closed 1 year ago

jnioche commented 1 year ago

Problem Statement

Can't run tests in Eclipse. The option doesn't appear in the contextual menu

Any relate message in "Error Log" view

!SESSION 2023-04-25 14:25:55.243 -----------------------------------------------
eclipse.buildId=4.27.0.20230309-1200
java.version=17.0.6
java.vendor=Eclipse Adoptium
BootLoader constants: OS=linux, ARCH=x86_64, WS=gtk, NL=en_GB
Framework arguments:  -product org.eclipse.epp.package.java.product
Command-line arguments:  -data file:/home/julien/.eclipse-workspace/ -os linux -ws gtk -arch x86_64 -product org.eclipse.epp.package.java.product

!ENTRY ch.qos.logback.classic 1 0 2023-04-25 14:25:57.648
!MESSAGE Activated before the state location was initialized. Retry after the state location is initialized.

!ENTRY org.testng.eclipse 4 0 2023-04-25 14:25:57.766
!MESSAGE FrameworkEvent ERROR
!STACK 0
org.osgi.framework.BundleException: Could not resolve module: org.testng.eclipse [649]
  Unresolved requirement: Require-Bundle: org.testng; bundle-version="[6.9.12,8.0.0)"
    -> Bundle-SymbolicName: org.testng; bundle-version="7.6.1.r202207070546"
       org.testng [640]
         Unresolved requirement: Import-Package: com.google.inject; version="[1.2.0,5.0.0)"; resolution:="optional"
         Unresolved requirement: Require-Capability: osgi.ee; filter:="(osgi.ee=UNKNOWN)"

    at org.eclipse.osgi.container.Module.start(Module.java:463)
    at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel$2.run(ModuleContainer.java:1852)
    at org.eclipse.osgi.internal.framework.EquinoxContainerAdaptor$1$1.execute(EquinoxContainerAdaptor.java:136)
    at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1845)
    at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1786)
    at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.doContainerStartLevel(ModuleContainer.java:1750)
    at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1672)
    at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1)
    at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:234)
    at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventManager.java:345)

The Dependency Management tool for your project

Eclipse Buildpath (aka. Use "TestNG Library" for your project in Eclipse)

Operating System

Linux

missedone commented 1 year ago

how did you install the testng eclipse plugin? seems the dependent libs were missing

jnioche commented 1 year ago

I followed these instructions

Install from update site
Select Help / Install New Software...
Enter the update site URL in "Work with:" field:
Update site for release: https://testng.org/testng-eclipse-update-site.
Make sure the check box next to URL is checked and click Next.
Eclipse will then guide you through the process.

It used to work but for some reason totally stopped; could be related to an update of the plugins in Eclipse? Anyway, I uninstalled, reinstalled but that did not help either.

missedone commented 1 year ago

ok, i can reproduce the issue on eclipse 4.27

however, it worked on 4.26 let me so some research

missedone commented 1 year ago

Pls try with the latest plug-in version 7.8.0

jnioche commented 1 year ago

@missedone I am now able to run tests, thanks for fixing it