From: mwebster Date: Sun, 30 Jul 2006 18:20:50 +0000 (+0000) Subject: Bug 113948 "Repackage AspectJ" (move module root suites out of default package) X-Git-Tag: pre_pr_153572~39 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=eb31ec6c3d7016f7b57210f61c27daa54118c263;p=aspectj.git Bug 113948 "Repackage AspectJ" (move module root suites out of default package) --- diff --git a/ajbrowser/testsrc/AjbrowserModuleTests.java b/ajbrowser/testsrc/AjbrowserModuleTests.java deleted file mode 100644 index 2522be10b..000000000 --- a/ajbrowser/testsrc/AjbrowserModuleTests.java +++ /dev/null @@ -1,29 +0,0 @@ -/* ******************************************************************* - * Copyright (c) 1999-2001 Xerox Corporation, - * 2002 Palo Alto Research Center, Incorporated (PARC). - * 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: - * Xerox/PARC initial implementation - * ******************************************************************/ - - -// default package - -import junit.framework.*; - -public class AjbrowserModuleTests extends TestCase { - - public static TestSuite suite() { - TestSuite suite = new TestSuite(AjbrowserModuleTests.class.getName()); - suite.addTest(org.aspectj.tools.ajbrowser.AjbrowserTests.suite()); - return suite; - } - - public AjbrowserModuleTests(String name) { super(name); } - -} diff --git a/ajbrowser/testsrc/org/aspectj/tools/ajbrowser/AjbrowserModuleTests.java b/ajbrowser/testsrc/org/aspectj/tools/ajbrowser/AjbrowserModuleTests.java new file mode 100644 index 000000000..d0d87f133 --- /dev/null +++ b/ajbrowser/testsrc/org/aspectj/tools/ajbrowser/AjbrowserModuleTests.java @@ -0,0 +1,30 @@ +package org.aspectj.tools.ajbrowser; +/* ******************************************************************* + * Copyright (c) 1999-2001 Xerox Corporation, + * 2002 Palo Alto Research Center, Incorporated (PARC). + * 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: + * Xerox/PARC initial implementation + * ******************************************************************/ + + +// default package + +import junit.framework.*; + +public class AjbrowserModuleTests extends TestCase { + + public static TestSuite suite() { + TestSuite suite = new TestSuite(AjbrowserModuleTests.class.getName()); + suite.addTest(org.aspectj.tools.ajbrowser.AjbrowserTests.suite()); + return suite; + } + + public AjbrowserModuleTests(String name) { super(name); } + +} diff --git a/ajde/testsrc/AjdeModuleTests.java b/ajde/testsrc/AjdeModuleTests.java deleted file mode 100644 index aa06eefa3..000000000 --- a/ajde/testsrc/AjdeModuleTests.java +++ /dev/null @@ -1,31 +0,0 @@ -/* ******************************************************************* - * Copyright (c) 1999-2001 Xerox Corporation, - * 2002 Palo Alto Research Center, Incorporated (PARC). - * 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: - * Xerox/PARC initial implementation - * ******************************************************************/ - - -// default package - -import junit.framework.*; - -public class AjdeModuleTests extends TestCase { - - public static TestSuite suite() { - TestSuite suite = new TestSuite(AjdeModuleTests.class.getName()); - suite.addTest(org.aspectj.ajde.AjdeTests.suite()); - suite.addTest(org.aspectj.ajde.internal.AjdeInternalTests.suite()); - suite.addTest(org.aspectj.ajde.ui.AjdeUiTests.suite()); - return suite; - } - - public AjdeModuleTests(String name) { super(name); } - -} diff --git a/ajde/testsrc/org/aspectj/ajde/AjdeModuleTests.java b/ajde/testsrc/org/aspectj/ajde/AjdeModuleTests.java new file mode 100644 index 000000000..6a243c62b --- /dev/null +++ b/ajde/testsrc/org/aspectj/ajde/AjdeModuleTests.java @@ -0,0 +1,32 @@ +package org.aspectj.ajde; +/* ******************************************************************* + * Copyright (c) 1999-2001 Xerox Corporation, + * 2002 Palo Alto Research Center, Incorporated (PARC). + * 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: + * Xerox/PARC initial implementation + * ******************************************************************/ + + +// default package + +import junit.framework.*; + +public class AjdeModuleTests extends TestCase { + + public static TestSuite suite() { + TestSuite suite = new TestSuite(AjdeModuleTests.class.getName()); + suite.addTest(org.aspectj.ajde.AjdeTests.suite()); + suite.addTest(org.aspectj.ajde.internal.AjdeInternalTests.suite()); + suite.addTest(org.aspectj.ajde.ui.AjdeUiTests.suite()); + return suite; + } + + public AjdeModuleTests(String name) { super(name); } + +} diff --git a/ajdoc/testsrc/AjdocModuleTests.java b/ajdoc/testsrc/AjdocModuleTests.java deleted file mode 100644 index b3585f0e1..000000000 --- a/ajdoc/testsrc/AjdocModuleTests.java +++ /dev/null @@ -1,27 +0,0 @@ -/* ******************************************************************* - * Copyright (c) 2003 Contributors. - * 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: - * Mik Kersten initial implementation - * ******************************************************************/ - -import junit.framework.Test; -import junit.framework.TestSuite; - -import org.aspectj.tools.ajdoc.AjdocTests; - -/** - * @author Mik Kersten - */ -public class AjdocModuleTests { - public static Test suite() { - TestSuite suite = new TestSuite(AjdocModuleTests.class.getName()); - suite.addTest(AjdocTests.suite()); - return suite; - } -} diff --git a/ajdoc/testsrc/org/aspectj/tools/ajdoc/AjdocModuleTests.java b/ajdoc/testsrc/org/aspectj/tools/ajdoc/AjdocModuleTests.java new file mode 100644 index 000000000..19202e9e3 --- /dev/null +++ b/ajdoc/testsrc/org/aspectj/tools/ajdoc/AjdocModuleTests.java @@ -0,0 +1,27 @@ +package org.aspectj.tools.ajdoc; +/* ******************************************************************* + * Copyright (c) 2003 Contributors. + * 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: + * Mik Kersten initial implementation + * ******************************************************************/ + +import junit.framework.Test; +import junit.framework.TestSuite; + + +/** + * @author Mik Kersten + */ +public class AjdocModuleTests { + public static Test suite() { + TestSuite suite = new TestSuite(AjdocModuleTests.class.getName()); + suite.addTest(AjdocTests.suite()); + return suite; + } +} diff --git a/asm/testsrc/AsmModuleTests.java b/asm/testsrc/AsmModuleTests.java deleted file mode 100644 index b7a0f1ff6..000000000 --- a/asm/testsrc/AsmModuleTests.java +++ /dev/null @@ -1,30 +0,0 @@ -/* ******************************************************************* - * Copyright (c) 1999-2001 Xerox Corporation, - * 2002 Palo Alto Research Center, Incorporated (PARC). - * 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: - * Xerox/PARC initial implementation - * ******************************************************************/ - - -// default package - -import junit.framework.*; - -public class AsmModuleTests extends TestCase { - - public static TestSuite suite() { - TestSuite suite = new TestSuite(AsmModuleTests.class.getName()); - suite.addTestSuite(AsmModuleTests.class); - return suite; - } - - public AsmModuleTests(String name) { super(name); } - - public void testNothing() {} -} diff --git a/asm/testsrc/org/aspectj/asm/AsmModuleTests.java b/asm/testsrc/org/aspectj/asm/AsmModuleTests.java new file mode 100644 index 000000000..52f424d99 --- /dev/null +++ b/asm/testsrc/org/aspectj/asm/AsmModuleTests.java @@ -0,0 +1,31 @@ +package org.aspectj.asm; +/* ******************************************************************* + * Copyright (c) 1999-2001 Xerox Corporation, + * 2002 Palo Alto Research Center, Incorporated (PARC). + * 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: + * Xerox/PARC initial implementation + * ******************************************************************/ + + +// default package + +import junit.framework.*; + +public class AsmModuleTests extends TestCase { + + public static TestSuite suite() { + TestSuite suite = new TestSuite(AsmModuleTests.class.getName()); + suite.addTestSuite(AsmModuleTests.class); + return suite; + } + + public AsmModuleTests(String name) { super(name); } + + public void testNothing() {} +} diff --git a/aspectj5rt/testsrc/Aspectj5rtModuleTests.java b/aspectj5rt/testsrc/Aspectj5rtModuleTests.java deleted file mode 100644 index 6681a2f11..000000000 --- a/aspectj5rt/testsrc/Aspectj5rtModuleTests.java +++ /dev/null @@ -1,32 +0,0 @@ -/* ******************************************************************* - * Copyright (c) 2005 Contributors. - * 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://eclipse.org/legal/epl-v10.html - * - * Contributors: - * Wes Isberg initial implementation - * ******************************************************************/ - -// default package -import org.aspectj.testing.util.TestUtil; - -import junit.framework.Test; -import junit.framework.TestCase; -import junit.framework.TestSuite; - -public class Aspectj5rtModuleTests extends TestCase { - - public static Test suite() { - TestSuite suite = new TestSuite("Aspectj5rt module tests"); - if (TestUtil.is15VMOrGreater()) { - TestUtil.loadTestsReflectively(suite, "Aspectj5rt15ModuleTests", true); - } else { - suite.addTest(TestUtil.skipTest("for aspectj5rt that need 1.5")); - } - return suite; - } - -} diff --git a/aspectj5rt/testsrc/org/aspectj/runtime/Aspectj5rtModuleTests.java b/aspectj5rt/testsrc/org/aspectj/runtime/Aspectj5rtModuleTests.java new file mode 100644 index 000000000..3eb333fe5 --- /dev/null +++ b/aspectj5rt/testsrc/org/aspectj/runtime/Aspectj5rtModuleTests.java @@ -0,0 +1,33 @@ +package org.aspectj.runtime; +/* ******************************************************************* + * Copyright (c) 2005 Contributors. + * 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://eclipse.org/legal/epl-v10.html + * + * Contributors: + * Wes Isberg initial implementation + * ******************************************************************/ + +// default package +import org.aspectj.testing.util.TestUtil; + +import junit.framework.Test; +import junit.framework.TestCase; +import junit.framework.TestSuite; + +public class Aspectj5rtModuleTests extends TestCase { + + public static Test suite() { + TestSuite suite = new TestSuite("Aspectj5rt module tests"); + if (TestUtil.is15VMOrGreater()) { + TestUtil.loadTestsReflectively(suite, "Aspectj5rt15ModuleTests", true); + } else { + suite.addTest(TestUtil.skipTest("for aspectj5rt that need 1.5")); + } + return suite; + } + +} diff --git a/bridge/testsrc/BridgeModuleTests.java b/bridge/testsrc/BridgeModuleTests.java deleted file mode 100644 index c15de60ce..000000000 --- a/bridge/testsrc/BridgeModuleTests.java +++ /dev/null @@ -1,34 +0,0 @@ -/* ******************************************************************* - * Copyright (c) 1999-2001 Xerox Corporation, - * 2002 Palo Alto Research Center, Incorporated (PARC). - * 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: - * Xerox/PARC initial implementation - * ******************************************************************/ - - -// default package - -import org.aspectj.bridge.context.CompilationAndWeavingContextTest; - -import junit.framework.Test; -import junit.framework.TestCase; -import junit.framework.TestSuite; - -public class BridgeModuleTests extends TestCase { - - public static Test suite() { - TestSuite suite = new TestSuite(BridgeModuleTests.class.getName()); - suite.addTest(org.aspectj.bridge.BridgeTests.suite()); - suite.addTestSuite(CompilationAndWeavingContextTest.class); - return suite; - } - - public BridgeModuleTests(String name) { super(name); } - -} diff --git a/bridge/testsrc/org/aspectj/bridge/BridgeModuleTests.java b/bridge/testsrc/org/aspectj/bridge/BridgeModuleTests.java new file mode 100644 index 000000000..5811f987d --- /dev/null +++ b/bridge/testsrc/org/aspectj/bridge/BridgeModuleTests.java @@ -0,0 +1,35 @@ +package org.aspectj.bridge; +/* ******************************************************************* + * Copyright (c) 1999-2001 Xerox Corporation, + * 2002 Palo Alto Research Center, Incorporated (PARC). + * 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: + * Xerox/PARC initial implementation + * ******************************************************************/ + + +// default package + +import org.aspectj.bridge.context.CompilationAndWeavingContextTest; + +import junit.framework.Test; +import junit.framework.TestCase; +import junit.framework.TestSuite; + +public class BridgeModuleTests extends TestCase { + + public static Test suite() { + TestSuite suite = new TestSuite(BridgeModuleTests.class.getName()); + suite.addTest(org.aspectj.bridge.BridgeTests.suite()); + suite.addTestSuite(CompilationAndWeavingContextTest.class); + return suite; + } + + public BridgeModuleTests(String name) { super(name); } + +} diff --git a/build/junit-patterns.properties b/build/junit-patterns.properties index fb980f3a6..dc2c4a44c 100644 --- a/build/junit-patterns.properties +++ b/build/junit-patterns.properties @@ -3,7 +3,7 @@ junit.leaves=false # define the root suite for for each module testsrc/ -junit.rootSuites=*ModuleTests.java +junit.rootSuites=**/*ModuleTests.java # define leaf tests for each module testsrc/ junit.includes=**/*Tests.java,**/*TestCase.java diff --git a/build/testsrc/BuildModuleTests.java b/build/testsrc/BuildModuleTests.java deleted file mode 100644 index d5a88c91e..000000000 --- a/build/testsrc/BuildModuleTests.java +++ /dev/null @@ -1,289 +0,0 @@ -/* ******************************************************************* - * Copyright (c) 1999-2001 Xerox Corporation, - * 2002 Palo Alto Research Center, Incorporated (PARC). - * 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: - * Xerox/PARC initial implementation - * ******************************************************************/ - - -// default package - -import org.aspectj.internal.tools.ant.taskdefs.Checklics; -import org.aspectj.internal.tools.build.Builder; -import org.aspectj.internal.tools.build.Util; -import org.aspectj.internal.tools.build.UtilsTest; -import org.aspectj.internal.build.BuildModuleTest; -import org.aspectj.internal.build.ModulesTest; - -import java.io.File; -import java.io.FileFilter; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collections; -import java.util.Iterator; -import java.util.List; -import java.util.StringTokenizer; - -import junit.framework.*; - -/** - * Master suite for build module - * and test of all source directories for correct licenses and known file types. - */ -public class BuildModuleTests extends TestCase { - - /** if true, then replace old headers with new first */ - private static final boolean replacing = false; // XXX never to enable again... - - /** replace commented out below - if any replace failed, halt all */ - private static boolean replaceFailed = false; - - private static final String BASE_DIR = ".." + File.separator; - private static final String[] JDT_SOURCE_DIRS = new String[] {}; - - public static Test suite() { - TestSuite suite = new TestSuite("Build module tests"); - suite.addTestSuite(BuildModuleTests.class); - suite.addTestSuite(BuildModuleTest.class); - suite.addTestSuite(ModulesTest.class); - suite.addTestSuite(UtilsTest.class); - return suite; - } - - /** @return String tag of license if not default */ - public static String getLicense(String module) { - return null; // use permissive default - } - - final static List SOURCE_NAMES = Collections.unmodifiableList( - Arrays.asList(new String[]{"src", "testsrc", "java5-src", "aspectj-src"})); - - /** - * @param moduleDir - * @return - */ - private static File[] findSourceRoots(File moduleDir) { - ArrayList result = new ArrayList(); - for (Iterator iter = SOURCE_NAMES.iterator(); iter.hasNext();) { - String name = (String) iter.next(); - File srcDir = new File(moduleDir, name); - if (srcDir.canRead() && srcDir.isDirectory()) { - result.add(srcDir); - } - } - return (File[]) result.toArray(new File[0]); - } - - public BuildModuleTests(String name) { super(name); } - - public void testSuffixList() { - if (!UnknownFileCheck.STATIC_ERRORS.isEmpty()) { - fail("" + UnknownFileCheck.STATIC_ERRORS); - } - } - public void testLicense_ajbrowser() { - checkLicense("ajbrowser"); - } - public void testLicense_ajde() { - checkLicense("ajde"); - } - public void testLicense_aspectj5rt() { - checkLicense("aspectj5rt"); - } - public void testLicense_asm() { - checkLicense("asm"); - } - - public void testLicense_bridge() { - checkLicense("bridge"); - } - public void testLicense_build() { - checkLicense("build"); - } - public void testLicense_org_aspectj_ajdt_core() { - checkLicense("org.aspectj.ajdt.core"); - } - public void testLicense_org_aspectj_lib() { - checkLicense("org.aspectj.lib"); - } - public void testLicense_org_eclipse_jdt_core() { - final String mod = "org.eclipse.jdt.core"; - final String pre = BASE_DIR + mod + File.separator; - for (int i = 0; i < JDT_SOURCE_DIRS.length; i++) { - checkSourceDirectory(new File(pre + JDT_SOURCE_DIRS[i]), mod); - } - } - - public void testLicense_runtime() { - checkLicense("runtime"); - } - public void testLicense_taskdefs() { - checkLicense("taskdefs"); - } - public void testLicense_testing() { - checkLicense("testing"); - } - public void testLicense_testing_client() { - checkLicense("testing-client"); - } - public void testLicense_testing_drivers() { - checkLicense("testing-drivers"); - } - public void testLicense_testing_util() { - checkLicense("testing-util"); - } - public void testLicense_util() { - checkLicense("util"); - } - public void testLicense_weaver() { - String module = "weaver"; - checkSourceDirectory(new File(Util.path(new String[] {"..", module, "src"})), module); - checkSourceDirectory(new File(Util.path(new String[] {"..", module, "testsrc", "org"})), module); - } - - void checkLicense(String module) { - File moduleDir = new File(Util.path("..", module)); - File[] srcDirs = findSourceRoots(moduleDir); - for (int i = 0; i < srcDirs.length; i++) { - checkSourceDirectory(srcDirs[i], module); - } - } - - void checkSourceDirectory(File srcDir, String module) { - final String label = "source dir " + srcDir + " (module " + module + ")"; - assertTrue(label, (srcDir.exists() && srcDir.isDirectory())); - String license = getLicense(module); -// if (replacing) { -// if (replacing && true) { -// throw new Error("replacing done - code left for other replaces"); -// } -// assertTrue("aborting - replace failed", !replaceFailed); -// // do the replace -// int fails = Checklics.runDirect(moduleDir.getPath(), "replace-headers"); -// replaceFailed = (0 != fails); -// assertTrue(!replaceFailed); -// license = Checklics.CPL_IBM_PARC_XEROX_TAG; -// } - int fails = Checklics.runDirect(srcDir.getPath(), license, true); - if (0 != fails) { - if (replacing) { - BuildModuleTests.replaceFailed = true; - } - assertTrue(label + " fails", !BuildModuleTests.replaceFailed); - } - - // separate check to verify all file types (suffixes) are known - if (!"testsrc".equals(srcDir.getName())) { - ArrayList unknownFiles = new ArrayList(); - UnknownFileCheck.SINGLETON.unknownFiles(srcDir, unknownFiles); - if (!unknownFiles.isEmpty()) { - String s = "unknown files (see readme-build-module.html to " - + "update Builder.properties resource patterns): "; - fail(s + unknownFiles); - } - } - } - /** - * Check tree for files not managed by the build system - * (either source files or managed as resources). - * This should pick up situations where new kinds of resources are added - * to the tree without updating the build script patterns to pick them - * up. - * @see Builder#BINARY_SOURCE_PATTERN - * @see Builder#RESOURCE_PATTERN - * @see org.aspectj.util.FileUtil#SOURCE_SUFFIXES - */ - static class UnknownFileCheck implements FileFilter { - private static final UnknownFileCheck SINGLETON = new UnknownFileCheck(); - private static final ArrayList STATIC_ERRORS = new ArrayList(); - // Builder.BINARY_SOURCE_PATTERN and Builder.RESOURCE_PATTERN - public static final List KNOWN_SUFFIXES; - - static { - List suffixes = new ArrayList(); - // sources from org.aspectj.util.FileUtil.SOURCE_SUFFIXES - suffixes.add(".aj"); - suffixes.add(".java"); - - // just because we know... - suffixes.add(".html"); - - // others from Builder - final String input = Builder.BINARY_SOURCE_PATTERN - + "," + Builder.RESOURCE_PATTERN; - StringTokenizer st = new StringTokenizer(input, ","); - while (st.hasMoreTokens()) { - String token = st.nextToken().trim(); - if (0 == token.length()) { - continue; - } - if (token.startsWith("**/*.")) { - token = token.substring(4); - } else if (token.startsWith("*.")) { - token = token.substring(1); - } else { - String s = input + " at \"" + token + "\""; - STATIC_ERRORS.add("unable to read pattern: " + s); - } - suffixes.add(token); - } - KNOWN_SUFFIXES = Collections.unmodifiableList(suffixes); - } - - private UnknownFileCheck() { - - } - /** - * Return true if input File file is a valid path to a directory - * or to a file - * which is not hidden (starts with .) - * and does not have a known suffix. - * Caller is responsible for pruning CVS directories - * @return true iff unknown or a directory - */ - public boolean accept(File file) { - if (null == file) { - return false; - } - if (file.isDirectory()) { - return file.canRead(); - } - - String name = file.getName(); - if ("CVS".equals(name) || name.startsWith(".")) { - return false; - } - // to do not accepting uppercase suffixes... - for (Iterator iter = KNOWN_SUFFIXES.iterator(); iter.hasNext();) { - String suffix = (String) iter.next(); - if (name.endsWith(suffix)) { - return false; - } - } - return true; - - } - void unknownFiles(File dir, ArrayList results) { - File[] files = dir.listFiles(this); - for (int j = 0; j < files.length; j++) { - File file = files[j]; - if (file.isDirectory()) { - String name = file.getName(); - if (!("CVS".equals(name))) { - unknownFiles(file, results); - } - } else { - results.add(file); - } - } - } - - } -} - diff --git a/build/testsrc/org/aspectj/build/BuildModuleTests.java b/build/testsrc/org/aspectj/build/BuildModuleTests.java new file mode 100644 index 000000000..30b41899d --- /dev/null +++ b/build/testsrc/org/aspectj/build/BuildModuleTests.java @@ -0,0 +1,290 @@ +package org.aspectj.build; +/* ******************************************************************* + * Copyright (c) 1999-2001 Xerox Corporation, + * 2002 Palo Alto Research Center, Incorporated (PARC). + * 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: + * Xerox/PARC initial implementation + * ******************************************************************/ + + +// default package + +import org.aspectj.internal.tools.ant.taskdefs.Checklics; +import org.aspectj.internal.tools.build.Builder; +import org.aspectj.internal.tools.build.Util; +import org.aspectj.internal.tools.build.UtilsTest; +import org.aspectj.internal.build.BuildModuleTest; +import org.aspectj.internal.build.ModulesTest; + +import java.io.File; +import java.io.FileFilter; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.Iterator; +import java.util.List; +import java.util.StringTokenizer; + +import junit.framework.*; + +/** + * Master suite for build module + * and test of all source directories for correct licenses and known file types. + */ +public class BuildModuleTests extends TestCase { + + /** if true, then replace old headers with new first */ + private static final boolean replacing = false; // XXX never to enable again... + + /** replace commented out below - if any replace failed, halt all */ + private static boolean replaceFailed = false; + + private static final String BASE_DIR = ".." + File.separator; + private static final String[] JDT_SOURCE_DIRS = new String[] {}; + + public static Test suite() { + TestSuite suite = new TestSuite("Build module tests"); + suite.addTestSuite(BuildModuleTests.class); + suite.addTestSuite(BuildModuleTest.class); + suite.addTestSuite(ModulesTest.class); + suite.addTestSuite(UtilsTest.class); + return suite; + } + + /** @return String tag of license if not default */ + public static String getLicense(String module) { + return null; // use permissive default + } + + final static List SOURCE_NAMES = Collections.unmodifiableList( + Arrays.asList(new String[]{"src", "testsrc", "java5-src", "aspectj-src"})); + + /** + * @param moduleDir + * @return + */ + private static File[] findSourceRoots(File moduleDir) { + ArrayList result = new ArrayList(); + for (Iterator iter = SOURCE_NAMES.iterator(); iter.hasNext();) { + String name = (String) iter.next(); + File srcDir = new File(moduleDir, name); + if (srcDir.canRead() && srcDir.isDirectory()) { + result.add(srcDir); + } + } + return (File[]) result.toArray(new File[0]); + } + + public BuildModuleTests(String name) { super(name); } + + public void testSuffixList() { + if (!UnknownFileCheck.STATIC_ERRORS.isEmpty()) { + fail("" + UnknownFileCheck.STATIC_ERRORS); + } + } + public void testLicense_ajbrowser() { + checkLicense("ajbrowser"); + } + public void testLicense_ajde() { + checkLicense("ajde"); + } + public void testLicense_aspectj5rt() { + checkLicense("aspectj5rt"); + } + public void testLicense_asm() { + checkLicense("asm"); + } + + public void testLicense_bridge() { + checkLicense("bridge"); + } + public void testLicense_build() { + checkLicense("build"); + } + public void testLicense_org_aspectj_ajdt_core() { + checkLicense("org.aspectj.ajdt.core"); + } + public void testLicense_org_aspectj_lib() { + checkLicense("org.aspectj.lib"); + } + public void testLicense_org_eclipse_jdt_core() { + final String mod = "org.eclipse.jdt.core"; + final String pre = BASE_DIR + mod + File.separator; + for (int i = 0; i < JDT_SOURCE_DIRS.length; i++) { + checkSourceDirectory(new File(pre + JDT_SOURCE_DIRS[i]), mod); + } + } + + public void testLicense_runtime() { + checkLicense("runtime"); + } + public void testLicense_taskdefs() { + checkLicense("taskdefs"); + } + public void testLicense_testing() { + checkLicense("testing"); + } + public void testLicense_testing_client() { + checkLicense("testing-client"); + } + public void testLicense_testing_drivers() { + checkLicense("testing-drivers"); + } + public void testLicense_testing_util() { + checkLicense("testing-util"); + } + public void testLicense_util() { + checkLicense("util"); + } + public void testLicense_weaver() { + String module = "weaver"; + checkSourceDirectory(new File(Util.path(new String[] {"..", module, "src"})), module); + checkSourceDirectory(new File(Util.path(new String[] {"..", module, "testsrc", "org"})), module); + } + + void checkLicense(String module) { + File moduleDir = new File(Util.path("..", module)); + File[] srcDirs = findSourceRoots(moduleDir); + for (int i = 0; i < srcDirs.length; i++) { + checkSourceDirectory(srcDirs[i], module); + } + } + + void checkSourceDirectory(File srcDir, String module) { + final String label = "source dir " + srcDir + " (module " + module + ")"; + assertTrue(label, (srcDir.exists() && srcDir.isDirectory())); + String license = getLicense(module); +// if (replacing) { +// if (replacing && true) { +// throw new Error("replacing done - code left for other replaces"); +// } +// assertTrue("aborting - replace failed", !replaceFailed); +// // do the replace +// int fails = Checklics.runDirect(moduleDir.getPath(), "replace-headers"); +// replaceFailed = (0 != fails); +// assertTrue(!replaceFailed); +// license = Checklics.CPL_IBM_PARC_XEROX_TAG; +// } + int fails = Checklics.runDirect(srcDir.getPath(), license, true); + if (0 != fails) { + if (replacing) { + BuildModuleTests.replaceFailed = true; + } + assertTrue(label + " fails", !BuildModuleTests.replaceFailed); + } + + // separate check to verify all file types (suffixes) are known + if (!"testsrc".equals(srcDir.getName())) { + ArrayList unknownFiles = new ArrayList(); + UnknownFileCheck.SINGLETON.unknownFiles(srcDir, unknownFiles); + if (!unknownFiles.isEmpty()) { + String s = "unknown files (see readme-build-module.html to " + + "update Builder.properties resource patterns): "; + fail(s + unknownFiles); + } + } + } + /** + * Check tree for files not managed by the build system + * (either source files or managed as resources). + * This should pick up situations where new kinds of resources are added + * to the tree without updating the build script patterns to pick them + * up. + * @see Builder#BINARY_SOURCE_PATTERN + * @see Builder#RESOURCE_PATTERN + * @see org.aspectj.util.FileUtil#SOURCE_SUFFIXES + */ + static class UnknownFileCheck implements FileFilter { + private static final UnknownFileCheck SINGLETON = new UnknownFileCheck(); + private static final ArrayList STATIC_ERRORS = new ArrayList(); + // Builder.BINARY_SOURCE_PATTERN and Builder.RESOURCE_PATTERN + public static final List KNOWN_SUFFIXES; + + static { + List suffixes = new ArrayList(); + // sources from org.aspectj.util.FileUtil.SOURCE_SUFFIXES + suffixes.add(".aj"); + suffixes.add(".java"); + + // just because we know... + suffixes.add(".html"); + + // others from Builder + final String input = Builder.BINARY_SOURCE_PATTERN + + "," + Builder.RESOURCE_PATTERN; + StringTokenizer st = new StringTokenizer(input, ","); + while (st.hasMoreTokens()) { + String token = st.nextToken().trim(); + if (0 == token.length()) { + continue; + } + if (token.startsWith("**/*.")) { + token = token.substring(4); + } else if (token.startsWith("*.")) { + token = token.substring(1); + } else { + String s = input + " at \"" + token + "\""; + STATIC_ERRORS.add("unable to read pattern: " + s); + } + suffixes.add(token); + } + KNOWN_SUFFIXES = Collections.unmodifiableList(suffixes); + } + + private UnknownFileCheck() { + + } + /** + * Return true if input File file is a valid path to a directory + * or to a file + * which is not hidden (starts with .) + * and does not have a known suffix. + * Caller is responsible for pruning CVS directories + * @return true iff unknown or a directory + */ + public boolean accept(File file) { + if (null == file) { + return false; + } + if (file.isDirectory()) { + return file.canRead(); + } + + String name = file.getName(); + if ("CVS".equals(name) || name.startsWith(".")) { + return false; + } + // to do not accepting uppercase suffixes... + for (Iterator iter = KNOWN_SUFFIXES.iterator(); iter.hasNext();) { + String suffix = (String) iter.next(); + if (name.endsWith(suffix)) { + return false; + } + } + return true; + + } + void unknownFiles(File dir, ArrayList results) { + File[] files = dir.listFiles(this); + for (int j = 0; j < files.length; j++) { + File file = files[j]; + if (file.isDirectory()) { + String name = file.getName(); + if (!("CVS".equals(name))) { + unknownFiles(file, results); + } + } else { + results.add(file); + } + } + } + + } +} + diff --git a/loadtime/testsrc/LoadtimeModuleTests.java b/loadtime/testsrc/LoadtimeModuleTests.java deleted file mode 100644 index 342b16f24..000000000 --- a/loadtime/testsrc/LoadtimeModuleTests.java +++ /dev/null @@ -1,46 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2005 Contributors. - * 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://eclipse.org/legal/epl-v10.html - * - * Contributors: - * Alexandre Vasseur initial implementation - *******************************************************************************/ - -import junit.framework.TestCase; -import junit.framework.Test; -import junit.framework.TestSuite; -import junit.textui.TestRunner; - -import org.aspectj.weaver.loadtime.AjTest; -import org.aspectj.weaver.loadtime.ClassLoaderWeavingAdaptorTest; -import org.aspectj.weaver.loadtime.JRockitAgentTest; -import org.aspectj.weaver.loadtime.WeavingContextTest; -import org.aspectj.weaver.loadtime.WeavingURLClassLoaderTest; -import org.aspectj.weaver.loadtime.test.DocumentParserTest; - -/** - * @author Alexandre Vasseur - */ -public class LoadtimeModuleTests extends TestCase { - - public static Test suite() { - TestSuite suite = new TestSuite(LoadtimeModuleTests.class.getName()); - - suite.addTestSuite(DocumentParserTest.class); - suite.addTestSuite(AjTest.class); - suite.addTestSuite(ClassLoaderWeavingAdaptorTest.class); - suite.addTestSuite(JRockitAgentTest.class); - suite.addTestSuite(WeavingContextTest.class); - suite.addTestSuite(WeavingURLClassLoaderTest.class); - return suite; - } - - public static void main(String args[]) throws Throwable { - TestRunner.run(suite()); - } - -} diff --git a/loadtime/testsrc/org/aspectj/loadtime/LoadtimeModuleTests.java b/loadtime/testsrc/org/aspectj/loadtime/LoadtimeModuleTests.java new file mode 100644 index 000000000..da7509b6f --- /dev/null +++ b/loadtime/testsrc/org/aspectj/loadtime/LoadtimeModuleTests.java @@ -0,0 +1,47 @@ +package org.aspectj.loadtime; +/******************************************************************************* + * Copyright (c) 2005 Contributors. + * 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://eclipse.org/legal/epl-v10.html + * + * Contributors: + * Alexandre Vasseur initial implementation + *******************************************************************************/ + +import junit.framework.TestCase; +import junit.framework.Test; +import junit.framework.TestSuite; +import junit.textui.TestRunner; + +import org.aspectj.weaver.loadtime.AjTest; +import org.aspectj.weaver.loadtime.ClassLoaderWeavingAdaptorTest; +import org.aspectj.weaver.loadtime.JRockitAgentTest; +import org.aspectj.weaver.loadtime.WeavingContextTest; +import org.aspectj.weaver.loadtime.WeavingURLClassLoaderTest; +import org.aspectj.weaver.loadtime.test.DocumentParserTest; + +/** + * @author Alexandre Vasseur + */ +public class LoadtimeModuleTests extends TestCase { + + public static Test suite() { + TestSuite suite = new TestSuite(LoadtimeModuleTests.class.getName()); + + suite.addTestSuite(DocumentParserTest.class); + suite.addTestSuite(AjTest.class); + suite.addTestSuite(ClassLoaderWeavingAdaptorTest.class); + suite.addTestSuite(JRockitAgentTest.class); + suite.addTestSuite(WeavingContextTest.class); + suite.addTestSuite(WeavingURLClassLoaderTest.class); + return suite; + } + + public static void main(String args[]) throws Throwable { + TestRunner.run(suite()); + } + +} diff --git a/loadtime5/testsrc/Loadtime5ModuleTests.java b/loadtime5/testsrc/Loadtime5ModuleTests.java deleted file mode 100644 index 526750347..000000000 --- a/loadtime5/testsrc/Loadtime5ModuleTests.java +++ /dev/null @@ -1,36 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2005 Contributors. - * 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://eclipse.org/legal/epl-v10.html - * - * Contributors: (See CVS logs) - * - *******************************************************************************/ - -import org.aspectj.testing.util.TestUtil; - -import junit.framework.Test; -import junit.framework.TestCase; -import junit.framework.TestSuite; - -/** - */ -public class Loadtime5ModuleTests extends TestCase { - - public static Test suite() { - TestSuite suite = new TestSuite(Loadtime5ModuleTests.class.getName()); - if (TestUtil.is15VMOrGreater()) { - TestUtil.loadTestsReflectively(suite, "Loadtime515ModuleTests", true); - } else { - suite.addTest(TestUtil.testNamed("all tests require 1.5")); - } - return suite; - } - public static void main(String[] args) { - junit.textui.TestRunner.main(new String[] {Loadtime5ModuleTests.class.getName()}); - } - -} diff --git a/loadtime5/testsrc/org/aspectj/loadtime/Loadtime5ModuleTests.java b/loadtime5/testsrc/org/aspectj/loadtime/Loadtime5ModuleTests.java new file mode 100644 index 000000000..665aecdc6 --- /dev/null +++ b/loadtime5/testsrc/org/aspectj/loadtime/Loadtime5ModuleTests.java @@ -0,0 +1,37 @@ +package org.aspectj.loadtime; +/******************************************************************************* + * Copyright (c) 2005 Contributors. + * 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://eclipse.org/legal/epl-v10.html + * + * Contributors: (See CVS logs) + * + *******************************************************************************/ + +import org.aspectj.testing.util.TestUtil; + +import junit.framework.Test; +import junit.framework.TestCase; +import junit.framework.TestSuite; + +/** + */ +public class Loadtime5ModuleTests extends TestCase { + + public static Test suite() { + TestSuite suite = new TestSuite(Loadtime5ModuleTests.class.getName()); + if (TestUtil.is15VMOrGreater()) { + TestUtil.loadTestsReflectively(suite, "Loadtime515ModuleTests", true); + } else { + suite.addTest(TestUtil.testNamed("all tests require 1.5")); + } + return suite; + } + public static void main(String[] args) { + junit.textui.TestRunner.main(new String[] {Loadtime5ModuleTests.class.getName()}); + } + +} diff --git a/org.aspectj.ajdt.core/testsrc/EajcModuleTests.java b/org.aspectj.ajdt.core/testsrc/EajcModuleTests.java deleted file mode 100644 index 6dc0dd785..000000000 --- a/org.aspectj.ajdt.core/testsrc/EajcModuleTests.java +++ /dev/null @@ -1,34 +0,0 @@ -/* ******************************************************************* - * Copyright (c) 1999-2001 Xerox Corporation, - * 2002 Palo Alto Research Center, Incorporated (PARC). - * 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: - * PARC initial implementation - * ******************************************************************/ - - -// default package - - -import junit.framework.*; -import junit.framework.Test; - -public class EajcModuleTests extends TestCase { - - public static Test suite() { - TestSuite suite = new TestSuite(EajcModuleTests.class.getName()); - suite.addTest(org.aspectj.ajdt.ajc.AjdtAjcTests.suite()); - suite.addTest(org.aspectj.ajdt.internal.compiler.batch.AjdtBatchTests.suite()); - suite.addTest(org.aspectj.ajdt.internal.core.builder.AjdtBuilderTests.suite()); - suite.addTest(org.aspectj.tools.ajc.AjcTests.suite()); - return suite; - } - - public EajcModuleTests(String name) { super(name); } - -} diff --git a/org.aspectj.ajdt.core/testsrc/org/aspectj/ajdt/EajcModuleTests.java b/org.aspectj.ajdt.core/testsrc/org/aspectj/ajdt/EajcModuleTests.java new file mode 100644 index 000000000..58816162d --- /dev/null +++ b/org.aspectj.ajdt.core/testsrc/org/aspectj/ajdt/EajcModuleTests.java @@ -0,0 +1,35 @@ +package org.aspectj.ajdt; +/* ******************************************************************* + * Copyright (c) 1999-2001 Xerox Corporation, + * 2002 Palo Alto Research Center, Incorporated (PARC). + * 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: + * PARC initial implementation + * ******************************************************************/ + + +// default package + + +import junit.framework.*; +import junit.framework.Test; + +public class EajcModuleTests extends TestCase { + + public static Test suite() { + TestSuite suite = new TestSuite(EajcModuleTests.class.getName()); + suite.addTest(org.aspectj.ajdt.ajc.AjdtAjcTests.suite()); + suite.addTest(org.aspectj.ajdt.internal.compiler.batch.AjdtBatchTests.suite()); + suite.addTest(org.aspectj.ajdt.internal.core.builder.AjdtBuilderTests.suite()); + suite.addTest(org.aspectj.tools.ajc.AjcTests.suite()); + return suite; + } + + public EajcModuleTests(String name) { super(name); } + +} diff --git a/org.aspectj.lib/testsrc/LibModuleTests.java b/org.aspectj.lib/testsrc/LibModuleTests.java deleted file mode 100644 index 6a521ca97..000000000 --- a/org.aspectj.lib/testsrc/LibModuleTests.java +++ /dev/null @@ -1,28 +0,0 @@ -/* ******************************************************************* - * Copyright (c) 2005 Contributors. - * 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://eclipse.org/legal/epl-v10.html - * - * Contributors: - * Wes Isberg initial implementation - * ******************************************************************/ - -// default package - -import junit.framework.Test; -import junit.framework.TestCase; -import junit.framework.TestSuite; - -public class LibModuleTests extends TestCase { - - public static Test suite() { - TestSuite suite = new TestSuite(LibModuleTests.class.getName()); - suite.addTest(org.aspectj.lib.pointcuts.PointcutsTests.suite()); - suite.addTest(org.aspectj.lib.tracing.TracingTests.suite()); - return suite; - } - -} diff --git a/org.aspectj.lib/testsrc/org/aspectj/lib/LibModuleTests.java b/org.aspectj.lib/testsrc/org/aspectj/lib/LibModuleTests.java new file mode 100644 index 000000000..6a666b2c1 --- /dev/null +++ b/org.aspectj.lib/testsrc/org/aspectj/lib/LibModuleTests.java @@ -0,0 +1,29 @@ +package org.aspectj.lib; +/* ******************************************************************* + * Copyright (c) 2005 Contributors. + * 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://eclipse.org/legal/epl-v10.html + * + * Contributors: + * Wes Isberg initial implementation + * ******************************************************************/ + +// default package + +import junit.framework.Test; +import junit.framework.TestCase; +import junit.framework.TestSuite; + +public class LibModuleTests extends TestCase { + + public static Test suite() { + TestSuite suite = new TestSuite(LibModuleTests.class.getName()); + suite.addTest(org.aspectj.lib.pointcuts.PointcutsTests.suite()); + suite.addTest(org.aspectj.lib.tracing.TracingTests.suite()); + return suite; + } + +} diff --git a/run-all-junit-tests/testsrc/AllTests.java b/run-all-junit-tests/testsrc/AllTests.java index e354498d3..bac614eb2 100644 --- a/run-all-junit-tests/testsrc/AllTests.java +++ b/run-all-junit-tests/testsrc/AllTests.java @@ -12,7 +12,24 @@ // default package import org.aspectj.util.LangUtil; +import org.aspectj.util.UtilModuleTests; +import org.aspectj.weaver.BcweaverModuleTests; +import org.aspectj.weaver.BcweaverModuleTests15; +import org.aspectj.ajde.AjdeModuleTests; +import org.aspectj.ajdt.EajcModuleTests; +import org.aspectj.asm.AsmModuleTests; +import org.aspectj.bridge.BridgeModuleTests; +import org.aspectj.build.BuildModuleTests; +import org.aspectj.loadtime.LoadtimeModuleTests; +import org.aspectj.runtime.RuntimeModuleTests; +import org.aspectj.testing.TestingClientModuleTests; +import org.aspectj.testing.TestingDriversModuleTests; +import org.aspectj.testing.TestingModuleTests; import org.aspectj.testing.util.TestUtil; +import org.aspectj.testingutil.TestingUtilModuleTests; +import org.aspectj.tools.ajbrowser.AjbrowserModuleTests; +import org.aspectj.tools.ajdoc.AjdocModuleTests; +import org.aspectj.tools.ant.TaskdefsModuleTests; import junit.framework.TestCase; import junit.framework.TestSuite; @@ -45,11 +62,11 @@ public class AllTests extends TestCase { // these only require 1.3, but in Eclipse they are built // with 1.5, i.e., wrong class version to load under 1.3 // so the class name can only be used reflectively - TestUtil.loadTestsReflectively(suite, "Aspectj5rtModuleTests", false); - TestUtil.loadTestsReflectively(suite, "Loadtime5ModuleTests", false); + TestUtil.loadTestsReflectively(suite, "org.aspectj.runtime.Aspectj5rtModuleTests", false); + TestUtil.loadTestsReflectively(suite, "org.aspectj.loadtime.Loadtime5ModuleTests", false); // this next one is built normally, but needs 1.5 rt.jar to pass suite.addTest(BcweaverModuleTests15.suite()); - TestUtil.loadTestsReflectively(suite, "Weaver5ModuleTests",false); + TestUtil.loadTestsReflectively(suite, "org.aspectj.weaver.Weaver5ModuleTests",false); } else { suite.addTest(TestUtil.skipTest("for 1.5")); } diff --git a/run-all-junit-tests/testsrc/RunTheseBeforeYouCommitTests.java b/run-all-junit-tests/testsrc/RunTheseBeforeYouCommitTests.java index c835ef057..767bcb3ea 100644 --- a/run-all-junit-tests/testsrc/RunTheseBeforeYouCommitTests.java +++ b/run-all-junit-tests/testsrc/RunTheseBeforeYouCommitTests.java @@ -10,6 +10,8 @@ * * ******************************************************************/ +import org.aspectj.tests.TestsModuleTests; + import junit.framework.Test; import junit.framework.TestSuite; diff --git a/runtime/testsrc/RuntimeModuleTests.java b/runtime/testsrc/RuntimeModuleTests.java deleted file mode 100644 index 53ccf091d..000000000 --- a/runtime/testsrc/RuntimeModuleTests.java +++ /dev/null @@ -1,87 +0,0 @@ -/* ******************************************************************* - * Copyright (c) 1999-2001 Xerox Corporation, - * 2002 Palo Alto Research Center, Incorporated (PARC). - * 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: - * Xerox/PARC initial implementation - * ******************************************************************/ - -// default package - -import java.io.*; - -import org.aspectj.lang.*; -import org.aspectj.runtime.reflect.JoinPointImplTest; -import org.aspectj.runtime.reflect.RuntimePerformanceTest; -import org.aspectj.runtime.reflect.SignatureTest; - -import junit.framework.*; - -public class RuntimeModuleTests extends TestCase { - - public static TestSuite suite() { - TestSuite suite = new TestSuite(RuntimeModuleTests.class.getName()); - suite.addTestSuite(RuntimeModuleTests.class); // minimum 1 test (testNothing) - suite.addTestSuite(SignatureTest.class); - suite.addTestSuite(JoinPointImplTest.class); - suite.addTestSuite(RuntimePerformanceTest.class); - return suite; - } - - public RuntimeModuleTests(String name) { super(name); } - - public void testNoAspectBoundException() { - RuntimeException fun = new RuntimeException("fun"); - NoAspectBoundException nab = new NoAspectBoundException("Foo", fun); - assertEquals(fun,nab.getCause()); - } - - public void testSoftExceptionPrintStackTrace() { - // let's see -// Throwable t = new Error("xyz"); -// new SoftException(t).printStackTrace(); - - // save to specified PrintStream - ByteArrayOutputStream sink = new ByteArrayOutputStream(); - PrintStream out = new PrintStream(sink); - new SoftException(new Error("xyz")).printStackTrace(out); - String s = new String(sink.toByteArray()); - out.flush(); - checkSoftExceptionString(s); - - // save to specified PrintWriter - sink = new ByteArrayOutputStream(); - PrintWriter pout = new PrintWriter(sink); - new SoftException(new Error("xyz")).printStackTrace(pout); - pout.flush(); - s = new String(sink.toByteArray()); - checkSoftExceptionString(s); - - // check System.err redirect - PrintStream systemErr = System.err; - try { - sink = new ByteArrayOutputStream(); - out = new PrintStream(sink); - System.setErr(out); - new SoftException(new Error("xyz")).printStackTrace(); - out.flush(); - s = new String(sink.toByteArray()); - checkSoftExceptionString(s); - } finally { - System.setErr(systemErr); - } - } - - - static void checkSoftExceptionString(String s) { - assertTrue(-1 != s.indexOf("SoftException")); - assertTrue(-1 != s.indexOf("Caused by: java.lang.Error")); - assertTrue(-1 != s.indexOf("xyz")); - assertTrue(-1 != s.indexOf("testSoftExceptionPrintStackTrace")); - } -} diff --git a/runtime/testsrc/org/aspectj/runtime/RuntimeModuleTests.java b/runtime/testsrc/org/aspectj/runtime/RuntimeModuleTests.java new file mode 100644 index 000000000..c9bfe88b9 --- /dev/null +++ b/runtime/testsrc/org/aspectj/runtime/RuntimeModuleTests.java @@ -0,0 +1,86 @@ +package org.aspectj.runtime; +/* ******************************************************************* + * Copyright (c) 1999-2001 Xerox Corporation, + * 2002 Palo Alto Research Center, Incorporated (PARC). + * 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: + * Xerox/PARC initial implementation + * ******************************************************************/ + +import java.io.*; + +import org.aspectj.lang.*; +import org.aspectj.runtime.reflect.JoinPointImplTest; +import org.aspectj.runtime.reflect.RuntimePerformanceTest; +import org.aspectj.runtime.reflect.SignatureTest; + +import junit.framework.*; + +public class RuntimeModuleTests extends TestCase { + + public static TestSuite suite() { + TestSuite suite = new TestSuite(RuntimeModuleTests.class.getName()); + suite.addTestSuite(RuntimeModuleTests.class); // minimum 1 test (testNothing) + suite.addTestSuite(SignatureTest.class); + suite.addTestSuite(JoinPointImplTest.class); + suite.addTestSuite(RuntimePerformanceTest.class); + return suite; + } + + public RuntimeModuleTests(String name) { super(name); } + + public void testNoAspectBoundException() { + RuntimeException fun = new RuntimeException("fun"); + NoAspectBoundException nab = new NoAspectBoundException("Foo", fun); + assertEquals(fun,nab.getCause()); + } + + public void testSoftExceptionPrintStackTrace() { + // let's see +// Throwable t = new Error("xyz"); +// new SoftException(t).printStackTrace(); + + // save to specified PrintStream + ByteArrayOutputStream sink = new ByteArrayOutputStream(); + PrintStream out = new PrintStream(sink); + new SoftException(new Error("xyz")).printStackTrace(out); + String s = new String(sink.toByteArray()); + out.flush(); + checkSoftExceptionString(s); + + // save to specified PrintWriter + sink = new ByteArrayOutputStream(); + PrintWriter pout = new PrintWriter(sink); + new SoftException(new Error("xyz")).printStackTrace(pout); + pout.flush(); + s = new String(sink.toByteArray()); + checkSoftExceptionString(s); + + // check System.err redirect + PrintStream systemErr = System.err; + try { + sink = new ByteArrayOutputStream(); + out = new PrintStream(sink); + System.setErr(out); + new SoftException(new Error("xyz")).printStackTrace(); + out.flush(); + s = new String(sink.toByteArray()); + checkSoftExceptionString(s); + } finally { + System.setErr(systemErr); + } + } + + + static void checkSoftExceptionString(String s) { + assertTrue(-1 != s.indexOf("SoftException")); + assertTrue(-1 != s.indexOf("Caused by: java.lang.Error")); + assertTrue(-1 != s.indexOf("xyz")); + assertTrue(-1 != s.indexOf("testSoftExceptionPrintStackTrace")); + } +} diff --git a/taskdefs/testsrc/TaskdefsModuleTests.java b/taskdefs/testsrc/TaskdefsModuleTests.java deleted file mode 100644 index cdd5f2203..000000000 --- a/taskdefs/testsrc/TaskdefsModuleTests.java +++ /dev/null @@ -1,28 +0,0 @@ -/* ******************************************************************* - * Copyright (c) 1999-2001 Xerox Corporation, - * 2002 Palo Alto Research Center, Incorporated (PARC). - * 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: - * Xerox/PARC initial implementation - * ******************************************************************/ - - -// default package - -import junit.framework.*; - -public class TaskdefsModuleTests extends TestCase { - - public static TestSuite suite() { - TestSuite suite = new TestSuite(TaskdefsModuleTests.class.getName()); - suite.addTest(org.aspectj.tools.ant.taskdefs.TaskdefsTests.suite()); - return suite; - } - - public TaskdefsModuleTests(String name) { super(name); } -} diff --git a/taskdefs/testsrc/org/aspectj/tools/ant/TaskdefsModuleTests.java b/taskdefs/testsrc/org/aspectj/tools/ant/TaskdefsModuleTests.java new file mode 100644 index 000000000..b47577eeb --- /dev/null +++ b/taskdefs/testsrc/org/aspectj/tools/ant/TaskdefsModuleTests.java @@ -0,0 +1,29 @@ +package org.aspectj.tools.ant; +/* ******************************************************************* + * Copyright (c) 1999-2001 Xerox Corporation, + * 2002 Palo Alto Research Center, Incorporated (PARC). + * 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: + * Xerox/PARC initial implementation + * ******************************************************************/ + + +// default package + +import junit.framework.*; + +public class TaskdefsModuleTests extends TestCase { + + public static TestSuite suite() { + TestSuite suite = new TestSuite(TaskdefsModuleTests.class.getName()); + suite.addTest(org.aspectj.tools.ant.taskdefs.TaskdefsTests.suite()); + return suite; + } + + public TaskdefsModuleTests(String name) { super(name); } +} diff --git a/testing-client/testsrc/TestingClientModuleTests.java b/testing-client/testsrc/TestingClientModuleTests.java deleted file mode 100644 index bce2ceae3..000000000 --- a/testing-client/testsrc/TestingClientModuleTests.java +++ /dev/null @@ -1,31 +0,0 @@ -/* ******************************************************************* - * Copyright (c) 1999-2001 Xerox Corporation, - * 2002 Palo Alto Research Center, Incorporated (PARC). - * 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: - * Xerox/PARC initial implementation - * ******************************************************************/ - - -// default package - -import junit.framework.*; -import junit.framework.Test; -import org.aspectj.testing.TestingTests; - -public class TestingClientModuleTests extends TestCase { - - public static Test suite() { - TestSuite suite = new TestSuite(TestingClientModuleTests.class.getName()); - suite.addTest(TestingTests.suite()); - return suite; - } - - public TestingClientModuleTests(String name) { super(name); } - -} diff --git a/testing-client/testsrc/org/aspectj/testing/TestingClientModuleTests.java b/testing-client/testsrc/org/aspectj/testing/TestingClientModuleTests.java new file mode 100644 index 000000000..b5dfd039c --- /dev/null +++ b/testing-client/testsrc/org/aspectj/testing/TestingClientModuleTests.java @@ -0,0 +1,30 @@ +package org.aspectj.testing; +/* ******************************************************************* + * Copyright (c) 1999-2001 Xerox Corporation, + * 2002 Palo Alto Research Center, Incorporated (PARC). + * 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: + * Xerox/PARC initial implementation + * ******************************************************************/ + + +// default package + +import junit.framework.*; + +public class TestingClientModuleTests extends TestCase { + + public static Test suite() { + TestSuite suite = new TestSuite(TestingClientModuleTests.class.getName()); + suite.addTest(TestingTests.suite()); + return suite; + } + + public TestingClientModuleTests(String name) { super(name); } + +} diff --git a/testing-drivers/testsrc/TestingDriversModuleTests.java b/testing-drivers/testsrc/TestingDriversModuleTests.java deleted file mode 100644 index 17456fed1..000000000 --- a/testing-drivers/testsrc/TestingDriversModuleTests.java +++ /dev/null @@ -1,35 +0,0 @@ -/* ******************************************************************* - * Copyright (c) 1999-2001 Xerox Corporation, - * 2002 Palo Alto Research Center, Incorporated (PARC). - * 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: - * Xerox/PARC initial implementation - * ******************************************************************/ - - -// default package - -import org.aspectj.testing.drivers.DriversTests; - -import junit.framework.*; -import junit.framework.Test; - -/** - * TODO weaver dumping ajcore files when using this interface - */ -public class TestingDriversModuleTests extends TestCase { - - public static Test suite() { - TestSuite suite = new TestSuite(TestingDriversModuleTests.class.getName()); - suite.addTest(DriversTests.suite()); - return suite; - } - - public TestingDriversModuleTests(String name) { super(name); } - -} diff --git a/testing-drivers/testsrc/org/aspectj/testing/TestingDriversModuleTests.java b/testing-drivers/testsrc/org/aspectj/testing/TestingDriversModuleTests.java new file mode 100644 index 000000000..8cb8ddf30 --- /dev/null +++ b/testing-drivers/testsrc/org/aspectj/testing/TestingDriversModuleTests.java @@ -0,0 +1,36 @@ +package org.aspectj.testing; +/* ******************************************************************* + * Copyright (c) 1999-2001 Xerox Corporation, + * 2002 Palo Alto Research Center, Incorporated (PARC). + * 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: + * Xerox/PARC initial implementation + * ******************************************************************/ + + +// default package + +import org.aspectj.testing.drivers.DriversTests; + +import junit.framework.*; +import junit.framework.Test; + +/** + * TODO weaver dumping ajcore files when using this interface + */ +public class TestingDriversModuleTests extends TestCase { + + public static Test suite() { + TestSuite suite = new TestSuite(TestingDriversModuleTests.class.getName()); + suite.addTest(DriversTests.suite()); + return suite; + } + + public TestingDriversModuleTests(String name) { super(name); } + +} diff --git a/testing-util/testsrc/TestingUtilModuleTests.java b/testing-util/testsrc/TestingUtilModuleTests.java deleted file mode 100644 index 8d27711e0..000000000 --- a/testing-util/testsrc/TestingUtilModuleTests.java +++ /dev/null @@ -1,31 +0,0 @@ -/* ******************************************************************* - * Copyright (c) 1999-2001 Xerox Corporation, - * 2002 Palo Alto Research Center, Incorporated (PARC). - * 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: - * Xerox/PARC initial implementation - * ******************************************************************/ - - -// default package - -import junit.framework.Test; -import junit.framework.TestCase; -import junit.framework.TestSuite; -import org.aspectj.testingutil.UtilTests; - -public class TestingUtilModuleTests extends TestCase { - - public static Test suite() { - TestSuite suite = new TestSuite(TestingUtilModuleTests.class.getName()); - suite.addTest(UtilTests.suite()); - return suite; - } - - public TestingUtilModuleTests(String name) { super(name); } -} diff --git a/testing-util/testsrc/org/aspectj/testingutil/TestingUtilModuleTests.java b/testing-util/testsrc/org/aspectj/testingutil/TestingUtilModuleTests.java new file mode 100644 index 000000000..4c5f62ec0 --- /dev/null +++ b/testing-util/testsrc/org/aspectj/testingutil/TestingUtilModuleTests.java @@ -0,0 +1,31 @@ +package org.aspectj.testingutil; +/* ******************************************************************* + * Copyright (c) 1999-2001 Xerox Corporation, + * 2002 Palo Alto Research Center, Incorporated (PARC). + * 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: + * Xerox/PARC initial implementation + * ******************************************************************/ + + +// default package + +import junit.framework.Test; +import junit.framework.TestCase; +import junit.framework.TestSuite; + +public class TestingUtilModuleTests extends TestCase { + + public static Test suite() { + TestSuite suite = new TestSuite(TestingUtilModuleTests.class.getName()); + suite.addTest(UtilTests.suite()); + return suite; + } + + public TestingUtilModuleTests(String name) { super(name); } +} diff --git a/testing/testsrc/TestingModuleTests.java b/testing/testsrc/TestingModuleTests.java deleted file mode 100644 index bf34ecfd3..000000000 --- a/testing/testsrc/TestingModuleTests.java +++ /dev/null @@ -1,35 +0,0 @@ -/* ******************************************************************* - * Copyright (c) 1999-2001 Xerox Corporation, - * 2002 Palo Alto Research Center, Incorporated (PARC). - * 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: - * Xerox/PARC initial implementation - * ******************************************************************/ - - -// default package - -import junit.framework.Test; -import junit.framework.TestCase; -import junit.framework.TestSuite; - -public class TestingModuleTests extends TestCase { - - public static Test suite() { - TestSuite suite = new TestSuite(TestingModuleTests.class.getName()); - suite.addTest(org.aspectj.testing.harness.bridge.TestingBridgeTests.suite()); - suite.addTest(org.aspectj.testing.taskdefs.TaskdefTests.suite()); - suite.addTest(org.aspectj.testing.util.UtilTests.suite()); - suite.addTest(org.aspectj.testing.util.options.OptionsTests.suite()); - suite.addTest(org.aspectj.testing.xml.TestingXmlTests.suite()); - return suite; - } - - public TestingModuleTests(String name) { super(name); } - -} diff --git a/testing/testsrc/org/aspectj/testing/TestingModuleTests.java b/testing/testsrc/org/aspectj/testing/TestingModuleTests.java new file mode 100644 index 000000000..b6c20b215 --- /dev/null +++ b/testing/testsrc/org/aspectj/testing/TestingModuleTests.java @@ -0,0 +1,36 @@ +package org.aspectj.testing; +/* ******************************************************************* + * Copyright (c) 1999-2001 Xerox Corporation, + * 2002 Palo Alto Research Center, Incorporated (PARC). + * 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: + * Xerox/PARC initial implementation + * ******************************************************************/ + + +// default package + +import junit.framework.Test; +import junit.framework.TestCase; +import junit.framework.TestSuite; + +public class TestingModuleTests extends TestCase { + + public static Test suite() { + TestSuite suite = new TestSuite(TestingModuleTests.class.getName()); + suite.addTest(org.aspectj.testing.harness.bridge.TestingBridgeTests.suite()); + suite.addTest(org.aspectj.testing.taskdefs.TaskdefTests.suite()); + suite.addTest(org.aspectj.testing.util.UtilTests.suite()); + suite.addTest(org.aspectj.testing.util.options.OptionsTests.suite()); + suite.addTest(org.aspectj.testing.xml.TestingXmlTests.suite()); + return suite; + } + + public TestingModuleTests(String name) { super(name); } + +} diff --git a/tests/testsrc/TestsModuleTests.java b/tests/testsrc/TestsModuleTests.java deleted file mode 100644 index 8df16f222..000000000 --- a/tests/testsrc/TestsModuleTests.java +++ /dev/null @@ -1,41 +0,0 @@ -/* ******************************************************************* - * Copyright (c) 2005 Contributors. - * 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://eclipse.org/legal/epl-v10.html - * - * Contributors: - * Wes Isberg initial implementation - * ******************************************************************/ - -import junit.framework.TestCase; -import junit.framework.Test; -import junit.framework.TestSuite; - -import org.aspectj.systemtest.AllTests; -import org.aspectj.systemtest.AllTests14; -import org.aspectj.systemtest.AllTests15; -import org.aspectj.util.LangUtil; - -public class TestsModuleTests extends TestCase { - - public static Test suite() { - String name = TestsModuleTests.class.getName(); - TestSuite suite = new TestSuite(name); - // compiler tests, wrapped for JUnit - if (LangUtil.is15VMOrGreater()) { - suite.addTest(AllTests15.suite()); - } else if (LangUtil.is14VMOrGreater()) { - System.err.println("Skipping tests for 1.5"); - //suite.addTest(TestUtil.skipTest("for 1.5")); - suite.addTest(AllTests14.suite()); - } else { - System.err.println("Skipping tests for 1.4 and 1.5"); - //suite.addTest(TestUtil.skipTest("for 1.4 and 1.5")); - suite.addTest(AllTests.suite()); - } - return suite; - } -} diff --git a/tests/testsrc/org/aspectj/tests/TestsModuleTests.java b/tests/testsrc/org/aspectj/tests/TestsModuleTests.java new file mode 100644 index 000000000..ddb62dd3e --- /dev/null +++ b/tests/testsrc/org/aspectj/tests/TestsModuleTests.java @@ -0,0 +1,42 @@ +package org.aspectj.tests; +/* ******************************************************************* + * Copyright (c) 2005 Contributors. + * 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://eclipse.org/legal/epl-v10.html + * + * Contributors: + * Wes Isberg initial implementation + * ******************************************************************/ + +import junit.framework.TestCase; +import junit.framework.Test; +import junit.framework.TestSuite; + +import org.aspectj.systemtest.AllTests; +import org.aspectj.systemtest.AllTests14; +import org.aspectj.systemtest.AllTests15; +import org.aspectj.util.LangUtil; + +public class TestsModuleTests extends TestCase { + + public static Test suite() { + String name = TestsModuleTests.class.getName(); + TestSuite suite = new TestSuite(name); + // compiler tests, wrapped for JUnit + if (LangUtil.is15VMOrGreater()) { + suite.addTest(AllTests15.suite()); + } else if (LangUtil.is14VMOrGreater()) { + System.err.println("Skipping tests for 1.5"); + //suite.addTest(TestUtil.skipTest("for 1.5")); + suite.addTest(AllTests14.suite()); + } else { + System.err.println("Skipping tests for 1.4 and 1.5"); + //suite.addTest(TestUtil.skipTest("for 1.4 and 1.5")); + suite.addTest(AllTests.suite()); + } + return suite; + } +} diff --git a/util/testsrc/UtilModuleTests.java b/util/testsrc/UtilModuleTests.java deleted file mode 100644 index 66e3d0fc2..000000000 --- a/util/testsrc/UtilModuleTests.java +++ /dev/null @@ -1,30 +0,0 @@ -/* ******************************************************************* - * Copyright (c) 1999-2001 Xerox Corporation, - * 2002 Palo Alto Research Center, Incorporated (PARC). - * 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: - * Xerox/PARC initial implementation - * ******************************************************************/ - - -// default package - -import junit.framework.*; -import junit.framework.Test; - -public class UtilModuleTests extends TestCase { - - public static Test suite() { - TestSuite suite = new TestSuite(UtilModuleTests.class.getName()); - suite.addTest(org.aspectj.util.UtilTests.suite()); - return suite; - } - - public UtilModuleTests(String name) { super(name); } - -} diff --git a/util/testsrc/org/aspectj/util/UtilModuleTests.java b/util/testsrc/org/aspectj/util/UtilModuleTests.java new file mode 100644 index 000000000..463fdce2a --- /dev/null +++ b/util/testsrc/org/aspectj/util/UtilModuleTests.java @@ -0,0 +1,31 @@ +package org.aspectj.util; +/* ******************************************************************* + * Copyright (c) 1999-2001 Xerox Corporation, + * 2002 Palo Alto Research Center, Incorporated (PARC). + * 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: + * Xerox/PARC initial implementation + * ******************************************************************/ + + +// default package + +import junit.framework.*; +import junit.framework.Test; + +public class UtilModuleTests extends TestCase { + + public static Test suite() { + TestSuite suite = new TestSuite(UtilModuleTests.class.getName()); + suite.addTest(org.aspectj.util.UtilTests.suite()); + return suite; + } + + public UtilModuleTests(String name) { super(name); } + +} diff --git a/weaver/testsrc/BcweaverModuleTests.java b/weaver/testsrc/BcweaverModuleTests.java deleted file mode 100644 index 15d90170e..000000000 --- a/weaver/testsrc/BcweaverModuleTests.java +++ /dev/null @@ -1,36 +0,0 @@ -/* ******************************************************************* - * Copyright (c) 2002 Palo Alto Research Center, Incorporated (PARC). - * 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: - * PARC initial implementation - * ******************************************************************/ - -// default package - -import junit.framework.Test; -import junit.framework.TestCase; -import junit.framework.TestSuite; - -import org.aspectj.weaver.LocaleTest; -import org.aspectj.weaver.tools.ToolsTests; - -public class BcweaverModuleTests extends TestCase { - - public static Test suite() { - TestSuite suite = new TestSuite(BcweaverModuleTests.class.getName()); - suite.addTest(org.aspectj.weaver.bcel.BcelTests.suite()); - suite.addTest(org.aspectj.weaver.BcweaverTests.suite()); - suite.addTest(org.aspectj.weaver.patterns.PatternsTests.suite()); - suite.addTestSuite(LocaleTest.class); - suite.addTest(ToolsTests.suite()); - return suite; - } - - public BcweaverModuleTests(String name) { super(name); } - -} diff --git a/weaver/testsrc/BcweaverModuleTests15.java b/weaver/testsrc/BcweaverModuleTests15.java deleted file mode 100644 index 55f118d3c..000000000 --- a/weaver/testsrc/BcweaverModuleTests15.java +++ /dev/null @@ -1,44 +0,0 @@ -/* ******************************************************************* - * Copyright (c) 2005 Contributors. - * 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://eclipse.org/legal/epl-v10.html - * - * Contributors: - * Adrian Colyer Initial implementation - * ******************************************************************/ -import junit.framework.Test; -import junit.framework.TestCase; -import junit.framework.TestSuite; - -import org.aspectj.testing.util.TestUtil; -import org.aspectj.util.LangUtil; -import org.aspectj.weaver.BoundedReferenceTypeTestCase; -import org.aspectj.weaver.MemberTestCase15; -import org.aspectj.weaver.ReferenceTypeTestCase; -import org.aspectj.weaver.TypeVariableReferenceTypeTestCase; -import org.aspectj.weaver.TypeVariableTestCase; -import org.aspectj.weaver.bcel.BcelGenericSignatureToTypeXTestCase; -import org.aspectj.weaver.patterns.WildTypePatternResolutionTestCase; - -public class BcweaverModuleTests15 extends TestCase { - public static Test suite() { - TestSuite suite = new TestSuite(BcweaverModuleTests15.class.getName()); - suite.addTestSuite(TypeVariableTestCase.class); - suite.addTestSuite(ReferenceTypeTestCase.class); - suite.addTestSuite(BoundedReferenceTypeTestCase.class); - suite.addTestSuite(TypeVariableReferenceTypeTestCase.class); - suite.addTestSuite(MemberTestCase15.class); - suite.addTestSuite(BcelGenericSignatureToTypeXTestCase.class); - suite.addTestSuite(WildTypePatternResolutionTestCase.class); - if (LangUtil.is15VMOrGreater()) { - TestUtil.loadTestsReflectively(suite, "org.aspectj.weaver.tools.Java15PointcutExpressionTest", false); - TestUtil.loadTestsReflectively(suite, "org.aspectj.weaver.TestJava5ReflectionBasedReferenceTypeDelegate", false); - } - return suite; - } - - public BcweaverModuleTests15(String name) { super(name); } -} diff --git a/weaver/testsrc/org/aspectj/weaver/BcweaverModuleTests.java b/weaver/testsrc/org/aspectj/weaver/BcweaverModuleTests.java new file mode 100644 index 000000000..84853ac33 --- /dev/null +++ b/weaver/testsrc/org/aspectj/weaver/BcweaverModuleTests.java @@ -0,0 +1,36 @@ +package org.aspectj.weaver; +/* ******************************************************************* + * Copyright (c) 2002 Palo Alto Research Center, Incorporated (PARC). + * 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: + * PARC initial implementation + * ******************************************************************/ + +// default package + +import junit.framework.Test; +import junit.framework.TestCase; +import junit.framework.TestSuite; + +import org.aspectj.weaver.tools.ToolsTests; + +public class BcweaverModuleTests extends TestCase { + + public static Test suite() { + TestSuite suite = new TestSuite(BcweaverModuleTests.class.getName()); + suite.addTest(org.aspectj.weaver.bcel.BcelTests.suite()); + suite.addTest(org.aspectj.weaver.BcweaverTests.suite()); + suite.addTest(org.aspectj.weaver.patterns.PatternsTests.suite()); + suite.addTestSuite(LocaleTest.class); + suite.addTest(ToolsTests.suite()); + return suite; + } + + public BcweaverModuleTests(String name) { super(name); } + +} diff --git a/weaver/testsrc/org/aspectj/weaver/BcweaverModuleTests15.java b/weaver/testsrc/org/aspectj/weaver/BcweaverModuleTests15.java new file mode 100644 index 000000000..7220ea50a --- /dev/null +++ b/weaver/testsrc/org/aspectj/weaver/BcweaverModuleTests15.java @@ -0,0 +1,40 @@ +package org.aspectj.weaver; +/* ******************************************************************* + * Copyright (c) 2005 Contributors. + * 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://eclipse.org/legal/epl-v10.html + * + * Contributors: + * Adrian Colyer Initial implementation + * ******************************************************************/ +import junit.framework.Test; +import junit.framework.TestCase; +import junit.framework.TestSuite; + +import org.aspectj.testing.util.TestUtil; +import org.aspectj.util.LangUtil; +import org.aspectj.weaver.bcel.BcelGenericSignatureToTypeXTestCase; +import org.aspectj.weaver.patterns.WildTypePatternResolutionTestCase; + +public class BcweaverModuleTests15 extends TestCase { + public static Test suite() { + TestSuite suite = new TestSuite(BcweaverModuleTests15.class.getName()); + suite.addTestSuite(TypeVariableTestCase.class); + suite.addTestSuite(ReferenceTypeTestCase.class); + suite.addTestSuite(BoundedReferenceTypeTestCase.class); + suite.addTestSuite(TypeVariableReferenceTypeTestCase.class); + suite.addTestSuite(MemberTestCase15.class); + suite.addTestSuite(BcelGenericSignatureToTypeXTestCase.class); + suite.addTestSuite(WildTypePatternResolutionTestCase.class); + if (LangUtil.is15VMOrGreater()) { + TestUtil.loadTestsReflectively(suite, "org.aspectj.weaver.tools.Java15PointcutExpressionTest", false); + TestUtil.loadTestsReflectively(suite, "org.aspectj.weaver.TestJava5ReflectionBasedReferenceTypeDelegate", false); + } + return suite; + } + + public BcweaverModuleTests15(String name) { super(name); } +} diff --git a/weaver5/testsrc/Weaver5ModuleTests.java b/weaver5/testsrc/Weaver5ModuleTests.java deleted file mode 100644 index 8aa725b93..000000000 --- a/weaver5/testsrc/Weaver5ModuleTests.java +++ /dev/null @@ -1,39 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2005 Contributors. - * 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://eclipse.org/legal/epl-v10.html - * - * Contributors: (See CVS logs) - * - *******************************************************************************/ - -import junit.framework.Test; -import junit.framework.TestCase; -import junit.framework.TestSuite; - -import org.aspectj.testing.util.TestUtil; -import org.aspectj.weaver.tools.PointcutExpressionTest; - -/** - */ -public class Weaver5ModuleTests extends TestCase { - - public static Test suite() { - TestSuite suite = new TestSuite(Weaver5ModuleTests.class.getName()); - if (TestUtil.is15VMOrGreater()) { - TestUtil.loadTestsReflectively(suite, "org.aspectj.weaver.tools.Java15PointcutExpressionTest", false); - TestUtil.loadTestsReflectively(suite, "org.aspectj.weaver.AllTracing5Tests", false); - suite.addTestSuite(PointcutExpressionTest.class); - } else { - suite.addTest(TestUtil.testNamed("all tests require 1.5")); - } - return suite; - } - public static void main(String[] args) { - junit.textui.TestRunner.main(new String[] {Weaver5ModuleTests.class.getName()}); - } - -} diff --git a/weaver5/testsrc/org/aspectj/weaver/Weaver5ModuleTests.java b/weaver5/testsrc/org/aspectj/weaver/Weaver5ModuleTests.java new file mode 100644 index 000000000..a72e34356 --- /dev/null +++ b/weaver5/testsrc/org/aspectj/weaver/Weaver5ModuleTests.java @@ -0,0 +1,40 @@ +package org.aspectj.weaver; +/******************************************************************************* + * Copyright (c) 2005 Contributors. + * 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://eclipse.org/legal/epl-v10.html + * + * Contributors: (See CVS logs) + * + *******************************************************************************/ + +import junit.framework.Test; +import junit.framework.TestCase; +import junit.framework.TestSuite; + +import org.aspectj.testing.util.TestUtil; +import org.aspectj.weaver.tools.PointcutExpressionTest; + +/** + */ +public class Weaver5ModuleTests extends TestCase { + + public static Test suite() { + TestSuite suite = new TestSuite(Weaver5ModuleTests.class.getName()); + if (TestUtil.is15VMOrGreater()) { + TestUtil.loadTestsReflectively(suite, "org.aspectj.weaver.tools.Java15PointcutExpressionTest", false); + TestUtil.loadTestsReflectively(suite, "org.aspectj.weaver.AllTracing5Tests", false); + suite.addTestSuite(PointcutExpressionTest.class); + } else { + suite.addTest(TestUtil.testNamed("all tests require 1.5")); + } + return suite; + } + public static void main(String[] args) { + junit.textui.TestRunner.main(new String[] {Weaver5ModuleTests.class.getName()}); + } + +}