Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support launching with features and plugins selected #1607

Open
jonahgraham opened this issue Feb 10, 2025 · 3 comments
Open

Support launching with features and plugins selected #1607

jonahgraham opened this issue Feb 10, 2025 · 3 comments

Comments

@jonahgraham
Copy link
Contributor

Tested on SDK-I20250207-1800. This is not a regression, I don't think this ever worked.

  1. Create a plugin + test fragment
  • example zip - but you can just run the following wizards for the same effect, new Plug-in project, new Fragment, new JUnit test
  1. Create a JUnit Plug-in test launch configuration
  • e.g. right-click on the test created in 1 and choose Run As -> JUnit Plug-in test
  1. Open the launch configuration
  2. In plug-ins tab, choose Launch with: Features selected below
  3. Press Select Plug-ins

Expected: The test fragment created in 1 is available to select
Actual: Only plugins are available

The fallback/workaround is to use Launch with Plug-ins selected below which does allow the fragment to be selected, but other configuration is trickier.

Screenshots:

"Launch with: Features selected below" missing mytestfragment

Image

Stack trace:

If I try to run the launch configuration I get the following exception because mytestbundle isn't included (this is expected since we couldn't add it above):

Class not found mytestfragment.MyTest
java.lang.ClassNotFoundException: mytestfragment.MyTest cannot be found by mybundle_1.0.0.qualifier
	at org.eclipse.osgi.internal.loader.BundleLoader.generateException(BundleLoader.java:567)
	at org.eclipse.osgi.internal.loader.BundleLoader.findClass0(BundleLoader.java:562)
	at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:438)
	at org.eclipse.osgi.internal.loader.ModuleClassLoader.loadClass(ModuleClassLoader.java:195)
	at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:526)
	at org.eclipse.osgi.internal.framework.EquinoxBundle.loadClass(EquinoxBundle.java:652)
	at org.eclipse.pde.internal.junit.runtime.RemotePluginTestRunner$BundleClassLoader.findClass(RemotePluginTestRunner.java:52)
	at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:593)
	at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:526)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.loadClass(RemoteTestRunner.java:758)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.loadClasses(RemoteTestRunner.java:481)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:504)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:748)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:443)
	at org.eclipse.pde.internal.junit.runtime.RemotePluginTestRunner.main(RemotePluginTestRunner.java:83)
	at org.eclipse.pde.internal.junit.runtime.PlatformUITestHarness.lambda$0(PlatformUITestHarness.java:45)
@laeubi
Copy link
Contributor

laeubi commented Feb 10, 2025

Create a plugin + test fragment

I can just always emphasize that there is no such thing as "test fragment" neither in PDE nor OSGi, so this is just a usual fragment.

"Launch with: Features selected below" missing mytestfragment

You need to include the fragment in the feature if you want to launch with features.

The fallback/workaround is to use Launch with Plug-ins selected below which does allow the fragment to be selected, but other configuration is trickier

I think one actually wants something else here that is similar to what we offer for products and such an option would read:

Launch with Plug-ins and Features selected below

@jonahgraham
Copy link
Contributor Author

I think one actually wants something else here that is similar to what we offer for products and such an option would read:

Launch with Plug-ins and Features selected below

Yes, I think this is what is needed.

"Launch with: Features selected below" missing mytestfragment

You need to include the fragment in the feature if you want to launch with features.

I think this is a good workaround until the above is fixed.

@laeubi laeubi changed the title JUnit Plug-in test, Launch with features, does not allow adding test fragments Support launching with features and plugins selected Feb 11, 2025
@laeubi
Copy link
Contributor

laeubi commented Feb 11, 2025

I changed the title because I also found this sometimes missing (not only for fragments).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants