Bug 91438 - Need definitive set of jdt-core tests checked into cvs
Summary: Need definitive set of jdt-core tests checked into cvs
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.1   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.1 M7   Edit
Assignee: Jerome Lanneluc CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-04-14 14:35 EDT by Mike Kaufman CLA
Modified: 2005-05-11 10:34 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mike Kaufman CLA 2005-04-14 14:35:56 EDT
Right now, the set of JDT core tests to run is not checked into cvs.  jdt-core 
team has an internal class to run all the tests, but these contain some 
proprietary stuff that can't be in cvs.  

We need to get something into CVS that defines the set of all public jdt-core 
tests. 

Here's a starting point:




/******************************************************************************
*
 * Copyright (c) 2005 BEA Systems, Inc. 
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *    mkaufman@bea.com - initial API and implementation
 *    
 
*******************************************************************************
/

package org.eclipse.jdt.apt.tests.jdtcoretests;

import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;

import junit.framework.Test;
import junit.framework.TestCase;
import junit.framework.TestSuite;

public class AllJdtCoreTests extends TestCase {
	
    public AllJdtCoreTests(String testName) 
    {
        super(testName);
    }
	

    public static Class[] getAllTestClasses()
    {
        //
        // please be careful of the ordering of the test classes below. 
        // the tests passing successfully seems to be dependent on the order
        // the test classes are specified.
        //
        Class[] classes = { 
            org.eclipse.jdt.core.tests.builder.Tests.class,
            
org.eclipse.jdt.core.tests.formatter.FormatterRegressionTests.class,
            org.eclipse.jdt.core.tests.dom.RunAllTests.class,
            org.eclipse.jdt.core.tests.model.AllJavaModelTests.class,	
		 
            org.eclipse.jdt.core.tests.compiler.parser.TestAll.class,
            org.eclipse.jdt.core.tests.eval.TestAll.class,
            org.eclipse.jdt.core.tests.compiler.regression.TestAll.class
        };
		
        return classes;
    }

    public static TestSuite suite()
    {
        TestSuite ts = new TestSuite( AllJdtCoreTests.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();
            }
            catch( InvocationTargetException e )
            {
                e.getTargetException().printStackTrace();
            }
            catch( NoSuchMethodException e )
            {

            }
        }
        return ts;
    }

}
Comment 1 Jerome Lanneluc CLA 2005-04-15 07:35:08 EDT
Added the following helper test runners in org.eclipse.jdt.core.tests.model:
- RunBuilderTests
- RunCompilerTests
- RunDOMTests
- RunFormatterTests
- RunModelTests
- RunJDTCoreTests

So to run all public JDT Core tests, run
org.eclipse.jdt.core.tests.model/org.eclipse.jdt.core.tests.RunJDTCoreTests
Comment 2 Frederic Fusier CLA 2005-05-11 10:34:42 EDT
Verified for 3.1 M7 using build I20050509-2010 + jdt.core HEAD.