Community
Participate
Working Groups
I have a group of tests which require the platform to be started before each test. For example: String[] testNames = { "test1", "test2", {test3"); for (int i = 0; i < testNames.length; i++) { ... new Main().run (<argument list including "-application " + testNames[i]>); } This fails when trying to start up the second run (for test2) with the following: java.lang.Error: factory already defined at java.net.URL.setURLStreamHandlerFactory(URL.java:880) at org.eclipse.core.internal.boot.PlatformURLHandlerFactory.startup(PlatformURLHandlerFactory.java:52) at org.eclipse.core.internal.boot.InternalBootLoader.initialize(InternalBootLoader.java:552) at org.eclipse.core.internal.boot.InternalBootLoader.startup(InternalBootLoader.java:912) at org.eclipse.core.internal.boot.InternalBootLoader.run(InternalBootLoader.java:808) at org.eclipse.core.boot.BootLoader.run(BootLoader.java:285) at java.lang.reflect.Method.invoke(Native Method) at org.eclipse.core.launcher.Main.basicRun(Main.java:119) at org.eclipse.core.launcher.Main.run(Main.java:466) at org.eclipse.core.tests.harness.launcher.Main.run(Main.java:195) at org.eclipse.core.tests.internal.plugins.AllPluginRuntimeTests.main(AllPluginRuntimeTests.java:48) Exception in thread "main" NOTES:
PRODUCT VERSION: R0.9
The solution is to launch each invocation of the platform in a separate VM. I have created a simple framework for doing this. See the new classes SessionTestLauncher, WorkspaceSessionTest, and RunNewSessionTests in the ZZDJTest project. See me for more details...