Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ui/org.eclipse.pde.junit.runtime/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
Expand Up @@ -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)",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,34 @@ protected Enumeration<URL> 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();
Expand All @@ -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) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand Down
Loading