Community
Participate
Working Groups
The org.eclipse.gmf.tests.runtime.emf.core JUnit test suite doesn't run on Linux, but fails with a NoClassDefFoundError on the MListener class. This is not reproducible on Windows. Stack tracke: Failed to invoke suite():java.lang.NoClassDefFoundError: org/eclipse/gmf/runtime/emf/core/edit/MListener org.eclipse.test.EclipseTestRunner$TestFailedException: Failed to invoke suite():java.lang.NoClassDefFoundError: org/eclipse/gmf/runtime/emf/core/edit/MListener at org.eclipse.test.EclipseTestRunner.runFailed(EclipseTestRunner.java:269) at org.eclipse.test.EclipseTestRunner.getTest(EclipseTestRunner.java:256) at org.eclipse.test.EclipseTestRunner.<init>(EclipseTestRunner.java:213) at org.eclipse.test.EclipseTestRunner.run(EclipseTestRunner.java:197) at org.eclipse.test.CoreTestApplication.runTests(CoreTestApplication.java:35) at org.eclipse.test.CoreTestApplication.run(CoreTestApplication.java:31) at org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:226) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:376) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:163) at org.eclipse.core.launcher.Main.invokeFramework(Main.java:334) at org.eclipse.core.launcher.Main.basicRun(Main.java:278) at org.eclipse.core.launcher.Main.run(Main.java:973) at org.eclipse.core.launcher.Main.main(Main.java:948)
Created attachment 28456 [details] Patch to fix test plug-in The problem in running the tests traces to a ClassCircularityError in initializing the MListener class. This error is thrown - when the MetamodelProviderTestCase's inner-class provider is being asked whether it provides for the Ecore package - when the MSLAdapterFactoryManager forces initialization of all providers by asking for the provider for the Ecore package - when the MSLPlugin (o.e.g.runtime.emf.core) is initializing - when the o.e.g.tests.runtime.emf.core.AllTests class is initializing one of its test cases which depends on MListener and is, therefore, already trying to initialize MListener The re-entrance into the initialization of the MListener class is the circularity in question. The simplest fix is just to force the initialization of the o.e.g.runtime.emf.core plug-in before initializing any of the test classes.
Just to clarify the remark about "this is not reproducible on Windows": the problem is not actually a platform issue, but a VM-dependent issue. The Sun VM manifests the problem because of an apparently more aggressive class verification strategy, which causes classes to be loaded sooner than in some other VMs such as the IBM runtime.
Committed the patch to CVS
[GMF Restructure] Bug 319140 : product GMF and component Runtime EMF was the original product and component for this bug