Community
Participate
Working Groups
See Junit-test below. When getAllTestClasses() returns the AllJavaModelTests.class before the dom tests, the dom tests fail. When the order is switched, the dom tests & model tests pass. If this doesn't repro, please ping me. package repro; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; public class DomModelFailure extends TestCase { public DomModelFailure(String testName) { super(testName); } public static Class[] getAllTestClasses() { Class[] classes = { org.eclipse.jdt.core.tests.dom.RunAllTests.class, org.eclipse.jdt.core.tests.model.AllJavaModelTests.class }; return classes; } public static TestSuite suite() { TestSuite ts = new TestSuite( DomModelFailure.class.getName() ); Class[] testClasses = getAllTestClasses(); for( int i = 0; i < testClasses.length; i++ ) { Class testClass = testClasses[i]; // call the suite() method and add the resulting suite // to the suite try { Method suiteMethod = testClass.getDeclaredMethod( "suite", new Class[0] ); //$NON-NLS-1$ Test suite = ( Test ) suiteMethod.invoke( null, new Object [0] ); ts.addTest( suite ); } catch( IllegalAccessException e ) { e.printStackTrace(); throw new RuntimeException(e); } catch( InvocationTargetException e ) { e.getTargetException().printStackTrace(); throw new RuntimeException(e); } catch( NoSuchMethodException e ) { e.printStackTrace(); throw new RuntimeException(e); } } return ts; } }
With the latest reorganization of the tests, this doesn't seem to be an issue anymore. I could run the test suite below having: Class[] classes = { org.eclipse.jdt.core.tests.model.AllJavaModelTests.class org.eclipse.jdt.core.tests.dom.RunAllTests.class, }; It worked fine.
The problem might come from org.eclipse.jdt.core.tests.model.OptionTests.testBug72214b() which has been disabled.
Frederic, I think your changes for bug 91497 also fixed this issue.
Correct. As getDefaultPreferences() is not longer accessible through JavaCore, I've removed this offending test while fixing bug 91497
Verified for 3.1 M7 using build I20050509-2010 + jdt.core HEAD.