@@ -0,0 +1,3497 @@
+/*%0A *  Licensed to the Apache Software Foundation (ASF) under one%0A *  or more contributor license agreements.  See the NOTICE file%0A *  distributed with this work for additional information%0A *  regarding copyright ownership.  The ASF licenses this file%0A *  to you under the Apache License, Version 2.0 (the%0A *  %22License%22); you may not use this file except in compliance%0A *  with the License.  You may obtain a copy of the License at%0A *%0A *    http://www.apache.org/licenses/LICENSE-2.0%0A *%0A *  Unless required by applicable law or agreed to in writing,%0A *  software distributed under the License is distributed on an%0A *  %22AS IS%22 BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY%0A *  KIND, either express or implied.  See the License for the%0A *  specific language governing permissions and limitations%0A *  under the License.%0A */%0Apackage groovy.util;%0A%0Aimport groovy.lang.GroovyClassLoader;%0Aimport groovy.lang.Script;%0Aimport junit.framework.Test;%0Aimport junit.framework.TestSuite;%0Aimport junit.textui.TestRunner;%0Aimport org.apache.groovy.test.ScriptTestAdapter;%0A%0Aimport java.io.File;%0Aimport java.security.AccessController;%0Aimport java.security.PrivilegedAction;%0A%0A%0A/**%0A * A TestSuite which will run a Groovy unit test case inside any Java IDE%0A * either as a unit test case or as an application.%0A * %3Cp%3E%0A * You can specify the GroovyUnitTest to run by running this class as an application%0A * and specifying the script to run on the command line.%0A * %3Ccode%3E%0A * java groovy.util.GroovyTestSuite src/test/Foo.groovy%0A * %3C/code%3E%0A * Or to run the test suite as a unit test suite in an IDE you can use%0A * the 'test' system property to define the test script to run.%0A * e.g.&#160;pass this into the JVM when the unit test plugin runs...%0A * %3Ccode%3E%0A * -Dtest=src/test/Foo.groovy%0A * %3C/code%3E%0A */%0Apublic class GroovyTestSuite extends TestSuite %7B%0A%0A    protected static String file = null;%0A%0A    protected final GroovyClassLoader loader =%0A            AccessController.doPrivileged(%0A                    new PrivilegedAction%3CGroovyClassLoader%3E() %7B%0A                        @Override%0A                        public GroovyClassLoader run() %7B%0A                            return new GroovyClassLoader(GroovyTestSuite.class.getClassLoader());%0A                        %7D%0A                    %7D%0A            );%0A%0A    public static void main(String%5B%5D args) %7B%0A        if (args.length %3E 0) %7B%0A            file = args%5B0%5D;%0A        %7D%0A        TestRunner.run(suite());%0A    %7D%0A%0A    public static Test suite() %7B%0A        GroovyTestSuite suite = new GroovyTestSuite();%0A        try %7B%0A            suite.loadTestSuite();%0A        %7D catch (Exception e) %7B%0A            throw new RuntimeException(%22Could not create the test suite: %22 + e, e);%0A        %7D%0A        return suite;%0A    %7D%0A%0A    public void loadTestSuite() throws Exception %7B%0A        String fileName = System.getProperty(%22test%22, file);%0A        if (fileName == null) %7B%0A            throw new RuntimeException(%22No filename given in the 'test' system property so cannot run a Groovy unit test%22);%0A        %7D%0A        System.out.println(%22Compiling: %22 + fileName);%0A        Class type = compile(fileName);%0A        String%5B%5D args = %7B%7D;%0A        if (!Test.class.isAssignableFrom(type) && Script.class.isAssignableFrom(type)) %7B%0A            // let's treat the script as a Test%0A            addTest(new ScriptTestAdapter(type, args));%0A        %7D else %7B%0A            addTestSuite(type);%0A        %7D%0A    %7D%0A%0A    public Class compile(String fileName) throws Exception %7B%0A        return loader.parseClass(new File(fileName));%0A    %7D%0A%7D%0A

Split history main/java/groovy/util/GroovyTestSuite.java to main/java/groovy/test - resolve conflict and keep both files