diff --git a/ui/org.eclipse.pde.junit.runtime/META-INF/MANIFEST.MF b/ui/org.eclipse.pde.junit.runtime/META-INF/MANIFEST.MF index 35cbed40639..15482f9ed52 100644 --- a/ui/org.eclipse.pde.junit.runtime/META-INF/MANIFEST.MF +++ b/ui/org.eclipse.pde.junit.runtime/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: org.eclipse.pde.junit.runtime; singleton:=true -Bundle-Version: 3.8.100.qualifier +Bundle-Version: 3.8.200.qualifier Bundle-Vendor: %providerName Bundle-Localization: plugin Require-Bundle: org.eclipse.jdt.junit.runtime;bundle-version="[3.4.0,4.0.0)", diff --git a/ui/org.eclipse.pde.junit.runtime/src/org/eclipse/pde/internal/junit/runtime/RemotePluginTestRunner.java b/ui/org.eclipse.pde.junit.runtime/src/org/eclipse/pde/internal/junit/runtime/RemotePluginTestRunner.java index ab87c59cd62..fcedfd3d0a7 100644 --- a/ui/org.eclipse.pde.junit.runtime/src/org/eclipse/pde/internal/junit/runtime/RemotePluginTestRunner.java +++ b/ui/org.eclipse.pde.junit.runtime/src/org/eclipse/pde/internal/junit/runtime/RemotePluginTestRunner.java @@ -72,6 +72,34 @@ protected Enumeration findResources(String name) throws IOException { * @see RemoteTestRunner */ public static void main(String[] args) { + BundleContext bundleContext = FrameworkUtil.getBundle(RemotePluginTestRunner.class).getBundleContext(); + if (bundleContext != null) { + Bundle[] bundles = bundleContext.getBundles(); + int failures = 0; + for (Bundle bundle : bundles) { + int state = bundle.getState(); + if (state != Bundle.ACTIVE && state != Bundle.RESOLVED && state != Bundle.STARTING) { + if (failures == 0) { + System.err.println("##################################################"); //$NON-NLS-1$ + System.out.println(); + System.err.println("WARNING: There are failing bundles:"); //$NON-NLS-1$ + } + System.err.println(String.format(" %s %s can't be resolved!", bundle.getSymbolicName(), bundle.getVersion())); //$NON-NLS-1$ + failures++; + } + } + if (failures > 0) { + System.err.println(); + System.err.println("Current Framework state is:"); //$NON-NLS-1$ + for (Bundle bundle : bundles) { + System.err.println(String.format(" [%s][%d] %s %s", getState(bundle.getState()), bundle.getBundleId(), bundle.getSymbolicName(), bundle.getVersion())); //$NON-NLS-1$ + } + System.err.println(); + System.err.println(String.format("%d bundle(s) fail to resolve!", failures)); //$NON-NLS-1$ + System.out.println(); + System.err.println("##################################################"); //$NON-NLS-1$ + } + } RemotePluginTestRunner testRunner = new RemotePluginTestRunner(); testRunner.init(args); ClassLoader currentTCCL = Thread.currentThread().getContextClassLoader(); @@ -86,6 +114,24 @@ public static void main(String[] args) { } } + private static String getState(int state) { + switch (state) { + case Bundle.ACTIVE : + return "ACTIVE "; //$NON-NLS-1$ + case Bundle.INSTALLED : + return "INSTALLED "; //$NON-NLS-1$ + case Bundle.RESOLVED : + return "RESOLVED "; //$NON-NLS-1$ + case Bundle.STARTING : + return "STARTING "; //$NON-NLS-1$ + case Bundle.STOPPING : + return "STOPPING "; //$NON-NLS-1$ + case Bundle.UNINSTALLED : + return "UNINSTALLED"; //$NON-NLS-1$ + } + return Integer.toString(state); + } + private static ClassLoader createJUnit5PluginClassLoader(String testPluginName) { Bundle testBundle = Platform.getBundle(testPluginName); if (testBundle == null) { diff --git a/ui/org.eclipse.pde.launching/src/org/eclipse/pde/launching/JUnitLaunchConfigurationDelegate.java b/ui/org.eclipse.pde.launching/src/org/eclipse/pde/launching/JUnitLaunchConfigurationDelegate.java index 6544a6e0bc7..e1524a05bcc 100644 --- a/ui/org.eclipse.pde.launching/src/org/eclipse/pde/launching/JUnitLaunchConfigurationDelegate.java +++ b/ui/org.eclipse.pde.launching/src/org/eclipse/pde/launching/JUnitLaunchConfigurationDelegate.java @@ -235,7 +235,7 @@ protected void collectExecutionArguments(ILaunchConfiguration configuration, Lis //if this is a junit container project it means a user can use additional classes (from the junit container and possible other) that //are not required to be imported, we compute a fragment manifest here to add additional imports ... try (PdeProjectAnalyzer analyzer = new PdeProjectAnalyzer(javaProject.getProject(), true)) { - analyzer.setImportPackage("*;resolution:=optional"); //$NON-NLS-1$ + analyzer.setImportPackage("*"); //$NON-NLS-1$ String bsn = testPlugin.getId() + "-additional-test-probe-imports"; //$NON-NLS-1$ analyzer.setBundleSymbolicName(bsn); analyzer.set(Constants.FRAGMENT_HOST, testPlugin.getId());