bndtools / bnd

Bnd/Bndtools. Tooling to build OSGi bundles including Eclipse, Maven, and Gradle plugins.
https://bndtools.org
Other
527 stars 305 forks source link

Unable to Run As OSGi JUnit Test when using Maven #2792

Closed timothyjward closed 5 years ago

timothyjward commented 6 years ago

If I'm using the bnd-testing-maven-plugin then I don't need to use a standalone index. If the plugin is configured for it then all of my maven dependencies are made available for resolve and run by the testing plugin, so no indexes are actually needed in that mode

This is great from the command line, but the resulting bndrun cannot be run from Bndtools. The main error is about a missing launcher plugin, but additional failures occur due to the lack of a Bndtools project nature. This also causes the Run As OSGi JUnit Test... option to disappear from the right click menu of the test class.

timothyjward commented 6 years ago

Note that even when using the bnd-indexer-maven-plugin and the -standalone: instruction I am still unable to right click the test class to run it. If I try I get an error about being unable to find the workspace.

rotty3000 commented 6 years ago

this is true, at best I'm able to run the full suite, then from the Junit view I can select and run/debug a particular method, but I have to run the full suite first.

On Fri, May 4, 2018 at 11:52 AM, Tim Ward notifications@github.com wrote:

Note that even when using the bnd-indexer-maven-plugin and the -standalone: instruction I am still unable to right click the test class to run it. If I try I get an error about being unable to find the workspace.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/bndtools/bndtools/issues/1884#issuecomment-386644364, or mute the thread https://github.com/notifications/unsubscribe-auth/AAI9TBd-bdRridZ0XT1_qdQR-I07o5nRks5tvHkkgaJpZM4TxiCO .

-- Raymond Augé http://www.liferay.com/web/raymond.auge/profile (@rotty3000) Senior Software Architect Liferay, Inc. http://www.liferay.com (@Liferay) Board Member & EEG Co-Chair, OSGi Alliance http://osgi.org (@OSGiAlliance)

rotty3000 commented 5 years ago

@timothyjward I fixed this with the reorganization the bndrun/resolve logic. This should be fully integrated into m2e support now. Please have a look again?

rotty3000 commented 5 years ago

Ok so after review, what currently works is:

What does NOT work is:

either of those operations lead to some form of the following error:

Status ERROR: bndtools.core code=0 Error initialising bnd launcher java.lang.Exception: Cannot load Bnd project for directory <project path>: no Bnd workspace found
java.lang.Exception: Cannot load Bnd project for directory <project path>: no Bnd workspace found
    at bndtools.launch.util.LaunchUtils.createRun(LaunchUtils.java:115)
    at bndtools.launch.util.LaunchUtils.createRun(LaunchUtils.java:100)
    at bndtools.launch.AbstractOSGiLaunchDelegate.buildForLaunch(AbstractOSGiLaunchDelegate.java:133)
    at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:832)
    at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:720)
    at org.eclipse.debug.internal.ui.DebugUIPlugin.buildAndLaunch(DebugUIPlugin.java:1029)
    at org.eclipse.debug.internal.ui.DebugUIPlugin$2.run(DebugUIPlugin.java:1243)
    at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63)