]> source.dussan.org Git - aspectj.git/commitdiff
mavenized org.aspectj.matcher - finished
authorAndy Clement <aclement@pivotal.io>
Thu, 24 Jan 2019 03:29:58 +0000 (19:29 -0800)
committerAndy Clement <aclement@pivotal.io>
Thu, 24 Jan 2019 03:29:58 +0000 (19:29 -0800)
org.aspectj.matcher/pom.xml
org.aspectj.matcher/src/test/java/org/aspectj/matcher/tools/ReflectionWorldPointcutExpressionTest.java [new file with mode: 0644]
org.aspectj.matcher/src/test/java/org/aspectj/matcher/tools/ReflectionWorldPointcutExpressionTests.java [deleted file]
org.aspectj.matcher/src/test/java/org/aspectj/weaver/MatcherModuleTests.java [deleted file]
org.aspectj.matcher/src/test/java/org/aspectj/weaver/TypeFactoryTest.java [new file with mode: 0644]
org.aspectj.matcher/src/test/java/org/aspectj/weaver/TypeFactoryTests.java [deleted file]
org.aspectj.matcher/src/test/java/org/aspectj/weaver/patterns/PatternsTests.java [deleted file]
org.aspectj.matcher/src/test/java/org/aspectj/weaver/patterns/SimpleScopeTest.java [new file with mode: 0644]
org.aspectj.matcher/src/test/java/org/aspectj/weaver/patterns/SimpleScopeTests.java [deleted file]

index d2b02f44a2fb16f78baa369e702471786eadd293..4e67ef7f9d1c886cd5282053b9e22de7a2be33de 100644 (file)
@@ -1,6 +1,6 @@
 <project xmlns="http://maven.apache.org/POM/4.0.0"
          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
   <modelVersion>4.0.0</modelVersion>
 
   <parent>
diff --git a/org.aspectj.matcher/src/test/java/org/aspectj/matcher/tools/ReflectionWorldPointcutExpressionTest.java b/org.aspectj.matcher/src/test/java/org/aspectj/matcher/tools/ReflectionWorldPointcutExpressionTest.java
new file mode 100644 (file)
index 0000000..b057b4a
--- /dev/null
@@ -0,0 +1,17 @@
+package org.aspectj.matcher.tools;
+
+import org.aspectj.weaver.World;
+import org.aspectj.weaver.reflect.ReflectionWorld;
+
+/**
+ * Run all the pointcut parsing/matching tests against a ReflectionWorld.
+ * 
+ * @author Andy Clement
+ */
+public class ReflectionWorldPointcutExpressionTest extends CommonPointcutExpressionTests {
+
+       protected World getWorld() {
+               return new ReflectionWorld(true, getClass().getClassLoader());
+       }
+
+}
diff --git a/org.aspectj.matcher/src/test/java/org/aspectj/matcher/tools/ReflectionWorldPointcutExpressionTests.java b/org.aspectj.matcher/src/test/java/org/aspectj/matcher/tools/ReflectionWorldPointcutExpressionTests.java
deleted file mode 100644 (file)
index 1a5f9be..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-package org.aspectj.matcher.tools;
-
-import org.aspectj.weaver.World;
-import org.aspectj.weaver.reflect.ReflectionWorld;
-
-/**
- * Run all the pointcut parsing/matching tests against a ReflectionWorld.
- * 
- * @author Andy Clement
- */
-public class ReflectionWorldPointcutExpressionTests extends CommonPointcutExpressionTests {
-
-       protected World getWorld() {
-               return new ReflectionWorld(true, getClass().getClassLoader());
-       }
-
-}
diff --git a/org.aspectj.matcher/src/test/java/org/aspectj/weaver/MatcherModuleTests.java b/org.aspectj.matcher/src/test/java/org/aspectj/weaver/MatcherModuleTests.java
deleted file mode 100644 (file)
index 234e387..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-/* *******************************************************************
- * Copyright (c) 2002-2008 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: 
- *     PARC     initial implementation 
- * ******************************************************************/
-
-// default package
-package org.aspectj.weaver;
-
-import junit.framework.Test;
-import junit.framework.TestCase;
-import junit.framework.TestSuite;
-
-import org.aspectj.matcher.tools.ReflectionWorldPointcutExpressionTests;
-import org.aspectj.weaver.patterns.PatternsTests;
-import org.aspectj.weaver.reflect.ReflectionWorldBasicTest;
-import org.aspectj.weaver.reflect.ReflectionWorldSpecificTest;
-
-public class MatcherModuleTests extends TestCase {
-
-       public MatcherModuleTests(String name) {
-               super(name);
-       }
-
-       public static Test suite() {
-               TestSuite suite = new TestSuite(MatcherModuleTests.class.getName());
-               suite.addTestSuite(ReflectionWorldSpecificTest.class);
-               suite.addTestSuite(ReflectionWorldBasicTest.class);
-               suite.addTestSuite(ReflectionWorldPointcutExpressionTests.class);
-               suite.addTestSuite(TypeFactoryTests.class);
-               suite.addTest(PatternsTests.suite());
-               return suite;
-       }
-}
diff --git a/org.aspectj.matcher/src/test/java/org/aspectj/weaver/TypeFactoryTest.java b/org.aspectj.matcher/src/test/java/org/aspectj/weaver/TypeFactoryTest.java
new file mode 100644 (file)
index 0000000..8452723
--- /dev/null
@@ -0,0 +1,76 @@
+/* *******************************************************************
+ * Copyright (c) 2010 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 
+ * ******************************************************************/
+package org.aspectj.weaver;
+
+import junit.framework.TestCase;
+
+/**
+ * Check signature to type mapping.
+ * 
+ * @author Andy Clement
+ */
+public class TypeFactoryTest extends TestCase {
+
+       public void testParameterizedSig() {
+               UnresolvedType t = null;
+               t = UnresolvedType.forSignature("Pjava/util/List<Ljava/lang/String;>;");
+               assertEquals("Ljava/util/List;", t.getErasureSignature());
+               assertEquals("Ljava/lang/String;", t.getTypeParameters()[0].signature);
+               assertEquals("Ljava/lang/String;", t.getTypeParameters()[0].signatureErasure);
+               assertEquals("Pjava/util/List<Ljava/lang/String;>;", t.getSignature());
+
+               t = TypeFactory.createTypeFromSignature("Ljava/util/List<Ljava/lang/String;>;");
+               assertEquals("Ljava/util/List;", t.getErasureSignature());
+               assertEquals("Ljava/lang/String;", t.getTypeParameters()[0].signature);
+               assertEquals("Ljava/lang/String;", t.getTypeParameters()[0].signatureErasure);
+               assertEquals("Pjava/util/List<Ljava/lang/String;>;", t.getSignature());
+
+               t = UnresolvedType.forName("java.util.List<java.lang.String>");
+               assertEquals("Ljava/util/List;", t.getErasureSignature());
+               assertEquals("Ljava/lang/String;", t.getTypeParameters()[0].signature);
+               assertEquals("Ljava/lang/String;", t.getTypeParameters()[0].signatureErasure);
+               assertEquals("Pjava/util/List<Ljava/lang/String;>;", t.getSignature());
+
+               t = UnresolvedType.forSignature("Pjava/util/Map<TS;Pjava/util/List<Ljava/lang/String;>;>;");
+               assertEquals("Ljava/util/Map;", t.getErasureSignature());
+               assertEquals("TS;", t.getTypeParameters()[0].signature);
+               assertEquals("Ljava/lang/Object;", t.getTypeParameters()[0].signatureErasure);
+               assertEquals("S", ((UnresolvedTypeVariableReferenceType) t.getTypeParameters()[0]).getTypeVariable().getName());
+               assertEquals("Pjava/util/Map<TS;Pjava/util/List<Ljava/lang/String;>;>;", t.getSignature());
+               assertEquals("Pjava/util/List<Ljava/lang/String;>;", t.getTypeParameters()[1].signature);
+               assertEquals("Ljava/util/List;", t.getTypeParameters()[1].signatureErasure);
+
+               t = UnresolvedType.forSignature("Pjava/util/List<+Pnl/ZoekFoo<TS;Pnl/ZoekCopy<TS;>;>;>;");
+               assertEquals("Ljava/util/List;", t.getErasureSignature());
+               WildcardedUnresolvedType wut = (WildcardedUnresolvedType) t.getTypeParameters()[0];
+               assertEquals("+Pnl/ZoekFoo<TS;Pnl/ZoekCopy<TS;>;>;", wut.signature);
+               assertEquals("Lnl/ZoekFoo;", wut.signatureErasure);
+               assertTrue(wut.isExtends());
+               assertEquals("Pnl/ZoekFoo<TS;Pnl/ZoekCopy<TS;>;>;", wut.getUpperBound().signature);
+               assertEquals("Lnl/ZoekFoo;", wut.getUpperBound().signatureErasure);
+               UnresolvedTypeVariableReferenceType tvar = (UnresolvedTypeVariableReferenceType) wut.getUpperBound().getTypeParameters()[0];
+               assertEquals("Pnl/ZoekFoo<TS;Pnl/ZoekCopy<TS;>;>;", wut.getUpperBound().signature);
+               assertEquals("Lnl/ZoekFoo;", wut.getUpperBound().signatureErasure);
+               assertEquals("S", tvar.getTypeVariable().getName());
+               UnresolvedType t2 = wut.getUpperBound().getTypeParameters()[1];
+               assertEquals("Pnl/ZoekCopy<TS;>;", t2.getSignature());
+               assertEquals("Lnl/ZoekCopy;", t2.getErasureSignature());
+
+               //              //              t = UnresolvedType.forSignature("Ljava/util/List<+Lnl/ZoekFoo<TS;Lnl/ZoekCopy<TS;>;>;>;");
+               //              t = TypeFactory.createTypeFromSignature("Ljava/util/List<+Lnl/ZoekFoo<TS;Lnl/ZoekCopy<TS;>;>;>;");
+               //              System.out.println(t.getSignature());
+               //
+               //              t = TypeFactory.createTypeFromSignature("Ljava/util/List<Lnl/ZoekFoo<Ljava/lang/String;>;>;");
+               //              System.out.println(t.getSignature()); // Pjava/util/List<Lnl/ZoekFoo<Ljava/lang/String;>;>;
+
+               // TODO should be able to cope with nested parameterizations
+               // Foo<String>.Bar<List<Map<String,Integer>>>
+               // both components Foo and Bar of that are parameterized
+       }
+}
diff --git a/org.aspectj.matcher/src/test/java/org/aspectj/weaver/TypeFactoryTests.java b/org.aspectj.matcher/src/test/java/org/aspectj/weaver/TypeFactoryTests.java
deleted file mode 100644 (file)
index 40fed41..0000000
+++ /dev/null
@@ -1,76 +0,0 @@
-/* *******************************************************************
- * Copyright (c) 2010 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 
- * ******************************************************************/
-package org.aspectj.weaver;
-
-import junit.framework.TestCase;
-
-/**
- * Check signature to type mapping.
- * 
- * @author Andy Clement
- */
-public class TypeFactoryTests extends TestCase {
-
-       public void testParameterizedSig() {
-               UnresolvedType t = null;
-               t = UnresolvedType.forSignature("Pjava/util/List<Ljava/lang/String;>;");
-               assertEquals("Ljava/util/List;", t.getErasureSignature());
-               assertEquals("Ljava/lang/String;", t.getTypeParameters()[0].signature);
-               assertEquals("Ljava/lang/String;", t.getTypeParameters()[0].signatureErasure);
-               assertEquals("Pjava/util/List<Ljava/lang/String;>;", t.getSignature());
-
-               t = TypeFactory.createTypeFromSignature("Ljava/util/List<Ljava/lang/String;>;");
-               assertEquals("Ljava/util/List;", t.getErasureSignature());
-               assertEquals("Ljava/lang/String;", t.getTypeParameters()[0].signature);
-               assertEquals("Ljava/lang/String;", t.getTypeParameters()[0].signatureErasure);
-               assertEquals("Pjava/util/List<Ljava/lang/String;>;", t.getSignature());
-
-               t = UnresolvedType.forName("java.util.List<java.lang.String>");
-               assertEquals("Ljava/util/List;", t.getErasureSignature());
-               assertEquals("Ljava/lang/String;", t.getTypeParameters()[0].signature);
-               assertEquals("Ljava/lang/String;", t.getTypeParameters()[0].signatureErasure);
-               assertEquals("Pjava/util/List<Ljava/lang/String;>;", t.getSignature());
-
-               t = UnresolvedType.forSignature("Pjava/util/Map<TS;Pjava/util/List<Ljava/lang/String;>;>;");
-               assertEquals("Ljava/util/Map;", t.getErasureSignature());
-               assertEquals("TS;", t.getTypeParameters()[0].signature);
-               assertEquals("Ljava/lang/Object;", t.getTypeParameters()[0].signatureErasure);
-               assertEquals("S", ((UnresolvedTypeVariableReferenceType) t.getTypeParameters()[0]).getTypeVariable().getName());
-               assertEquals("Pjava/util/Map<TS;Pjava/util/List<Ljava/lang/String;>;>;", t.getSignature());
-               assertEquals("Pjava/util/List<Ljava/lang/String;>;", t.getTypeParameters()[1].signature);
-               assertEquals("Ljava/util/List;", t.getTypeParameters()[1].signatureErasure);
-
-               t = UnresolvedType.forSignature("Pjava/util/List<+Pnl/ZoekFoo<TS;Pnl/ZoekCopy<TS;>;>;>;");
-               assertEquals("Ljava/util/List;", t.getErasureSignature());
-               WildcardedUnresolvedType wut = (WildcardedUnresolvedType) t.getTypeParameters()[0];
-               assertEquals("+Pnl/ZoekFoo<TS;Pnl/ZoekCopy<TS;>;>;", wut.signature);
-               assertEquals("Lnl/ZoekFoo;", wut.signatureErasure);
-               assertTrue(wut.isExtends());
-               assertEquals("Pnl/ZoekFoo<TS;Pnl/ZoekCopy<TS;>;>;", wut.getUpperBound().signature);
-               assertEquals("Lnl/ZoekFoo;", wut.getUpperBound().signatureErasure);
-               UnresolvedTypeVariableReferenceType tvar = (UnresolvedTypeVariableReferenceType) wut.getUpperBound().getTypeParameters()[0];
-               assertEquals("Pnl/ZoekFoo<TS;Pnl/ZoekCopy<TS;>;>;", wut.getUpperBound().signature);
-               assertEquals("Lnl/ZoekFoo;", wut.getUpperBound().signatureErasure);
-               assertEquals("S", tvar.getTypeVariable().getName());
-               UnresolvedType t2 = wut.getUpperBound().getTypeParameters()[1];
-               assertEquals("Pnl/ZoekCopy<TS;>;", t2.getSignature());
-               assertEquals("Lnl/ZoekCopy;", t2.getErasureSignature());
-
-               //              //              t = UnresolvedType.forSignature("Ljava/util/List<+Lnl/ZoekFoo<TS;Lnl/ZoekCopy<TS;>;>;>;");
-               //              t = TypeFactory.createTypeFromSignature("Ljava/util/List<+Lnl/ZoekFoo<TS;Lnl/ZoekCopy<TS;>;>;>;");
-               //              System.out.println(t.getSignature());
-               //
-               //              t = TypeFactory.createTypeFromSignature("Ljava/util/List<Lnl/ZoekFoo<Ljava/lang/String;>;>;");
-               //              System.out.println(t.getSignature()); // Pjava/util/List<Lnl/ZoekFoo<Ljava/lang/String;>;>;
-
-               // TODO should be able to cope with nested parameterizations
-               // Foo<String>.Bar<List<Map<String,Integer>>>
-               // both components Foo and Bar of that are parameterized
-       }
-}
diff --git a/org.aspectj.matcher/src/test/java/org/aspectj/weaver/patterns/PatternsTests.java b/org.aspectj.matcher/src/test/java/org/aspectj/weaver/patterns/PatternsTests.java
deleted file mode 100644 (file)
index afd75ea..0000000
+++ /dev/null
@@ -1,50 +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 
- * ******************************************************************/
-
-package org.aspectj.weaver.patterns;
-
-import junit.framework.Test;
-import junit.framework.TestCase;
-import junit.framework.TestSuite;
-
-public class PatternsTests extends TestCase {
-
-       public static Test suite() {
-               TestSuite suite = new TestSuite(PatternsTests.class.getName());
-               // $JUnit-BEGIN$
-               suite.addTestSuite(AndOrNotTestCase.class);
-               suite.addTestSuite(BindingTestCase.class);
-               suite.addTestSuite(DeclareErrorOrWarningTestCase.class);
-               suite.addTestSuite(ModifiersPatternTestCase.class);
-               suite.addTestSuite(NamePatternParserTestCase.class);
-               suite.addTestSuite(NamePatternTestCase.class);
-               suite.addTestSuite(ParserTestCase.class);
-               suite.addTestSuite(SignaturePatternTestCase.class);
-               suite.addTestSuite(ThisOrTargetTestCase.class);
-               suite.addTestSuite(TypePatternListTestCase.class);
-               suite.addTestSuite(TypePatternTestCase.class);
-               suite.addTestSuite(SimpleScopeTests.class);
-               suite.addTestSuite(WithinTestCase.class);
-               suite.addTestSuite(ArgsTestCase.class);
-               // suite.addTestSuite(AnnotationPatternTestCase.class);
-               // suite.addTestSuite(AnnotationPatternMatchingTestCase.class);
-               suite.addTestSuite(PointcutRewriterTest.class);
-               suite.addTestSuite(VisitorTestCase.class);
-               // $JUnit-END$
-               return suite;
-       }
-
-       public PatternsTests(String name) {
-               super(name);
-       }
-
-}
diff --git a/org.aspectj.matcher/src/test/java/org/aspectj/weaver/patterns/SimpleScopeTest.java b/org.aspectj.matcher/src/test/java/org/aspectj/weaver/patterns/SimpleScopeTest.java
new file mode 100644 (file)
index 0000000..f4ae843
--- /dev/null
@@ -0,0 +1,278 @@
+/* *******************************************************************
+ * 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 
+ * ******************************************************************/
+
+package org.aspectj.weaver.patterns;
+
+import org.aspectj.weaver.UnresolvedType;
+import org.aspectj.weaver.World;
+import org.aspectj.weaver.reflect.ReflectionWorld;
+
+public class SimpleScopeTest extends PatternsTestCase {
+
+       public World getWorld() {
+               return new ReflectionWorld(true, this.getClass().getClassLoader());
+       }
+
+       public void testTestScope() {
+               SimpleScope scope = makeTestScope();
+
+               FormalBinding formalBinding = scope.lookupFormal("i");
+               assertEquals("i", formalBinding.getName());
+               assertEquals("I", formalBinding.getType().getSignature());
+
+               formalBinding = scope.lookupFormal("string");
+               assertEquals("string", formalBinding.getName());
+               assertEquals("Ljava/lang/String;", formalBinding.getType().getSignature());
+       }
+
+       public void test1() {
+               SimpleScope scope = makeTestScope();
+               UnresolvedType unresolvedType = scope.lookupType("void", null);
+               System.out.println(unresolvedType);
+       }
+
+       public static final String[] ZERO_STRINGS = new String[0];
+
+       private TestScope makeTestScope() {
+               // i = int
+               // string = String
+               return new TestScope(new String[] { "int", "java.lang.String" }, new String[] { "i", "string" }, world);
+       }
+       //
+       // public void testStaticMatch() {
+       // checkMatch("java.lang.Object", "java.lang.Object", true);
+       // checkMatch("java.lang.Object+", "java.lang.Object", true);
+       // checkMatch("java.lang.Object+", "java.lang.String", true);
+       // checkMatch("java.lang.String+", "java.lang.Object", false);
+       // checkMatch("java.lang.Integer", "java.lang.String", false);
+       //
+       // checkMatch("java.lang.Integer", "int", false);
+       //
+       // checkMatch("java.lang.Number+", "java.lang.Integer", true);
+       //
+       // checkMatch("java..*", "java.lang.Integer", true);
+       // checkMatch("java..*", "java.lang.reflect.Modifier", true);
+       // checkMatch("java..*", "int", false);
+       // checkMatch("java..*", "javax.swing.Action", false);
+       // checkMatch("java..*+", "javax.swing.Action", true);
+       //
+       // checkMatch("*.*.Object", "java.lang.Object", true);
+       // checkMatch("*.Object", "java.lang.Object", false);
+       // checkMatch("*..*", "java.lang.Object", true);
+       // checkMatch("*..*", "int", false);
+       // checkMatch("java..Modifier", "java.lang.reflect.Modifier", true);
+       // checkMatch("java.lang.reflect.Mod..ifier", "java.lang.reflect.Modifier", false);
+       //
+       // checkMatch("java..reflect..Modifier", "java.lang.reflect.Modifier", true);
+       // checkMatch("java..lang..Modifier", "java.lang.reflect.Modifier", true);
+       // checkMatch("java..*..Modifier", "java.lang.reflect.Modifier", true);
+       // checkMatch("java..*..*..Modifier", "java.lang.reflect.Modifier", true);
+       // checkMatch("java..*..*..*..Modifier", "java.lang.reflect.Modifier", false);
+       // // checkMatch("java..reflect..Modifier", "java.lang.reflect.Modxifier", false);
+       // checkMatch("ja*va..Modifier", "java.lang.reflect.Modifier", true);
+       // checkMatch("java..*..Mod*ifier", "java.lang.reflect.Modifier", true);
+       //
+       // }
+       //
+       // // three levels:
+       // // 0. defined in current compilation unit, or imported by name
+       // // 1. defined in current package/type/whatever
+       // // 2. defined in package imported by *
+       // /**
+       // * We've decided not to test this here, but rather in any compilers
+       // */
+       // public void testImportResolve() {
+       // // checkIllegalImportResolution("List", new String[] { "java.util", "java.awt", },
+       // // ZERO_STRINGS);
+       //
+       // }
+       //
+       // // Assumption for bcweaver: Already resolved type patterns with no *s or ..'s into exact type
+       // // patterns. Exact type patterns don't have import lists. non-exact-type pattens don't
+       // // care about precedence, so the current package can be included with all the other packages,
+       // // and we don't care about compilation units, and we don't care about ordering.
+       //
+       // // only giving this wild-type patterns
+       // public void testImportMatch() {
+       //
+       // checkImportMatch("*List", new String[] { "java.awt.", }, ZERO_STRINGS, "java.awt.List", true);
+       // checkImportMatch("*List", new String[] { "java.awt.", }, ZERO_STRINGS, "java.awt.List", true);
+       // checkImportMatch("*List", new String[] { "java.awt.", }, ZERO_STRINGS, "java.util.List", false);
+       // checkImportMatch("*List", new String[] { "java.util.", }, ZERO_STRINGS, "java.awt.List", false);
+       // checkImportMatch("*List", new String[] { "java.util.", }, ZERO_STRINGS, "java.util.List", true);
+       //
+       // checkImportMatch("*List", ZERO_STRINGS, new String[] { "java.awt.List", }, "java.awt.List", true);
+       //
+       // checkImportMatch("awt.*List", ZERO_STRINGS, new String[] { "java.awt.List", }, "java.awt.List", false);
+       // checkImportMatch("*Foo", ZERO_STRINGS, new String[] { "java.awt.List", }, "java.awt.List", false);
+       //
+       // checkImportMatch("*List", new String[] { "java.util.", "java.awt.", }, ZERO_STRINGS, "java.util.List", true);
+       // checkImportMatch("*List", new String[] { "java.util.", "java.awt.", }, ZERO_STRINGS, "java.awt.List", true);
+       //
+       // checkImportMatch("*..List", new String[] { "java.util." }, ZERO_STRINGS, "java.util.List", true);
+       // checkImportMatch("*..List", new String[] { "java.util." }, ZERO_STRINGS, "java.awt.List", true);
+       //
+       // }
+       //
+       // public void testImportMatchWithInners() {
+       // // checkImportMatch("*Entry", new String[] { "java.util.", "java.util.Map$" }, ZERO_STRINGS, "java.util.Map$Entry", true);
+       // //
+       // // checkImportMatch("java.util.Map.*Entry", ZERO_STRINGS, ZERO_STRINGS, "java.util.Map$Entry", true);
+       // //
+       // // checkImportMatch("*Entry", new String[] { "java.util.", }, ZERO_STRINGS, "java.util.Map$Entry", false);
+       // //
+       // // checkImportMatch("*.Entry", new String[] { "java.util.", }, ZERO_STRINGS, "java.util.Map$Entry", true);
+       // //
+       // // checkImportMatch("Map.*", new String[] { "java.util.", }, ZERO_STRINGS, "java.util.Map$Entry", true);
+       //
+       // checkImportMatch("Map.*", ZERO_STRINGS, new String[] { "java.util.Map" }, "java.util.Map$Entry", true);
+       // }
+       //
+       // private void checkImportMatch(String wildPattern, String[] importedPackages, String[] importedNames, String matchName,
+       // boolean shouldMatch) {
+       // WildTypePattern p = makeResolvedWildTypePattern(wildPattern, importedPackages, importedNames);
+       // checkPatternMatch(p, matchName, shouldMatch);
+       // }
+       //
+       // private WildTypePattern makeResolvedWildTypePattern(String wildPattern, String[] importedPackages, String[] importedNames) {
+       // WildTypePattern unresolved = (WildTypePattern) new PatternParser(wildPattern).parseTypePattern();
+       //
+       // WildTypePattern resolved = resolve(unresolved, importedPackages, importedNames);
+       // return resolved;
+       //
+       // }
+       //
+       // private WildTypePattern resolve(WildTypePattern unresolved, String[] importedPrefixes, String[] importedNames) {
+       //
+       // TestScope scope = makeTestScope();
+       // scope.setImportedPrefixes(importedPrefixes);
+       // scope.setImportedNames(importedNames);
+       // return (WildTypePattern) unresolved.resolveBindings(scope, Bindings.NONE, false, false);
+       // }
+       //
+
+       //
+       // public void testInstanceofMatch() {
+       //
+       // checkInstanceofMatch("java.lang.Object", "java.lang.Object", FuzzyBoolean.YES);
+       //
+       // checkIllegalInstanceofMatch("java.lang.Object+", "java.lang.Object");
+       // checkIllegalInstanceofMatch("java.lang.Object+", "java.lang.String");
+       // checkIllegalInstanceofMatch("java.lang.String+", "java.lang.Object");
+       // checkIllegalInstanceofMatch("java.lang.*", "java.lang.Object");
+       // checkInstanceofMatch("java.lang.Integer", "java.lang.String", FuzzyBoolean.NO);
+       //
+       // checkInstanceofMatch("java.lang.Number", "java.lang.Integer", FuzzyBoolean.YES);
+       // checkInstanceofMatch("java.lang.Integer", "java.lang.Number", FuzzyBoolean.MAYBE);
+       //
+       // checkIllegalInstanceofMatch("java..Integer", "java.lang.Integer");
+       //
+       // checkInstanceofMatch("*", "java.lang.Integer", FuzzyBoolean.YES);
+       //
+       // }
+       //
+       // public void testArrayMatch() {
+       // checkMatch("*[][]", "java.lang.Object", false);
+       // checkMatch("*[]", "java.lang.Object[]", true);
+       // checkMatch("*[][]", "java.lang.Object[][]", true);
+       // checkMatch("java.lang.Object+", "java.lang.Object[]", true);
+       // checkMatch("java.lang.Object[]", "java.lang.Object", false);
+       // checkMatch("java.lang.Object[]", "java.lang.Object[]", true);
+       // checkMatch("java.lang.Object[][]", "java.lang.Object[][]", true);
+       // checkMatch("java.lang.String[]", "java.lang.Object", false);
+       // checkMatch("java.lang.String[]", "java.lang.Object[]", false);
+       // checkMatch("java.lang.String[][]", "java.lang.Object[][]", false);
+       // checkMatch("java.lang.Object+[]", "java.lang.String[][]", true);
+       // checkMatch("java.lang.Object+[]", "java.lang.String[]", true);
+       // checkMatch("java.lang.Object+[]", "int[][]", true);
+       // checkMatch("java.lang.Object+[]", "int[]", false);
+       // }
+       //
+       // private void checkIllegalInstanceofMatch(String pattern, String name) {
+       // try {
+       // TypePattern p = makeTypePattern(pattern);
+       // ResolvedType type = world.resolve(name);
+       // p.matchesInstanceof(type);
+       // } catch (Throwable e) {
+       // return;
+       // }
+       // assertTrue("matching " + pattern + " with " + name + " should fail", false);
+       // }
+       //
+       // private void checkInstanceofMatch(String pattern, String name, FuzzyBoolean shouldMatch) {
+       // TypePattern p = makeTypePattern(pattern);
+       // ResolvedType type = world.resolve(name);
+       //
+       // p = p.resolveBindings(makeTestScope(), null, false, false);
+       //
+       // // System.out.println("type: " + p);
+       // FuzzyBoolean result = p.matchesInstanceof(type);
+       // String msg = "matches " + pattern + " to " + type;
+       // assertEquals(msg, shouldMatch, result);
+       // }
+       //
+       //
+       // private TypePattern makeTypePattern(String pattern) {
+       // PatternParser pp = new PatternParser(pattern);
+       // TypePattern tp = pp.parseSingleTypePattern();
+       // pp.checkEof();
+       // return tp;
+       // }
+       //
+       // private void checkMatch(String pattern, String name, boolean shouldMatch) {
+       // TypePattern p = makeTypePattern(pattern);
+       // p = p.resolveBindings(makeTestScope(), null, false, false);
+       // checkPatternMatch(p, name, shouldMatch);
+       // }
+       //
+       // private void checkPatternMatch(TypePattern p, String name, boolean shouldMatch) {
+       // ResolvedType type = world.resolve(name);
+       // // System.out.println("type: " + type);
+       // boolean result = p.matchesStatically(type);
+       // String msg = "matches " + p + " to " + type + " expected ";
+       // if (shouldMatch) {
+       // assertTrue(msg + shouldMatch, result);
+       // } else {
+       // assertTrue(msg + shouldMatch, !result);
+       // }
+       // }
+       //
+       // public void testSerialization() throws IOException {
+       // String[] patterns = new String[] { "java.lang.Object", "java.lang.Object+", "java.lang.Integer", "int", "java..*",
+       // "java..util..*", "*.*.Object", "*", };
+       //
+       // for (int i = 0, len = patterns.length; i < len; i++) {
+       // checkSerialization(patterns[i]);
+       // }
+       // }
+       //
+       // /**
+       // * Method checkSerialization.
+       // *
+       // * @param string
+       // */
+       // private void checkSerialization(String string) throws IOException {
+       // TypePattern p = makeTypePattern(string);
+       // ByteArrayOutputStream bo = new ByteArrayOutputStream();
+       // ConstantPoolSimulator cps = new ConstantPoolSimulator();
+       // CompressingDataOutputStream out = new CompressingDataOutputStream(bo, cps);
+       // p.write(out);
+       // out.close();
+       //
+       // ByteArrayInputStream bi = new ByteArrayInputStream(bo.toByteArray());
+       // VersionedDataInputStream in = new VersionedDataInputStream(bi, cps);
+       // TypePattern newP = TypePattern.read(in, null);
+       //
+       // assertEquals("write/read", p, newP);
+       // }
+
+}
diff --git a/org.aspectj.matcher/src/test/java/org/aspectj/weaver/patterns/SimpleScopeTests.java b/org.aspectj.matcher/src/test/java/org/aspectj/weaver/patterns/SimpleScopeTests.java
deleted file mode 100644 (file)
index 8df97e2..0000000
+++ /dev/null
@@ -1,278 +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 
- * ******************************************************************/
-
-package org.aspectj.weaver.patterns;
-
-import org.aspectj.weaver.UnresolvedType;
-import org.aspectj.weaver.World;
-import org.aspectj.weaver.reflect.ReflectionWorld;
-
-public class SimpleScopeTests extends PatternsTestCase {
-
-       public World getWorld() {
-               return new ReflectionWorld(true, this.getClass().getClassLoader());
-       }
-
-       public void testTestScope() {
-               SimpleScope scope = makeTestScope();
-
-               FormalBinding formalBinding = scope.lookupFormal("i");
-               assertEquals("i", formalBinding.getName());
-               assertEquals("I", formalBinding.getType().getSignature());
-
-               formalBinding = scope.lookupFormal("string");
-               assertEquals("string", formalBinding.getName());
-               assertEquals("Ljava/lang/String;", formalBinding.getType().getSignature());
-       }
-
-       public void test1() {
-               SimpleScope scope = makeTestScope();
-               UnresolvedType unresolvedType = scope.lookupType("void", null);
-               System.out.println(unresolvedType);
-       }
-
-       public static final String[] ZERO_STRINGS = new String[0];
-
-       private TestScope makeTestScope() {
-               // i = int
-               // string = String
-               return new TestScope(new String[] { "int", "java.lang.String" }, new String[] { "i", "string" }, world);
-       }
-       //
-       // public void testStaticMatch() {
-       // checkMatch("java.lang.Object", "java.lang.Object", true);
-       // checkMatch("java.lang.Object+", "java.lang.Object", true);
-       // checkMatch("java.lang.Object+", "java.lang.String", true);
-       // checkMatch("java.lang.String+", "java.lang.Object", false);
-       // checkMatch("java.lang.Integer", "java.lang.String", false);
-       //
-       // checkMatch("java.lang.Integer", "int", false);
-       //
-       // checkMatch("java.lang.Number+", "java.lang.Integer", true);
-       //
-       // checkMatch("java..*", "java.lang.Integer", true);
-       // checkMatch("java..*", "java.lang.reflect.Modifier", true);
-       // checkMatch("java..*", "int", false);
-       // checkMatch("java..*", "javax.swing.Action", false);
-       // checkMatch("java..*+", "javax.swing.Action", true);
-       //
-       // checkMatch("*.*.Object", "java.lang.Object", true);
-       // checkMatch("*.Object", "java.lang.Object", false);
-       // checkMatch("*..*", "java.lang.Object", true);
-       // checkMatch("*..*", "int", false);
-       // checkMatch("java..Modifier", "java.lang.reflect.Modifier", true);
-       // checkMatch("java.lang.reflect.Mod..ifier", "java.lang.reflect.Modifier", false);
-       //
-       // checkMatch("java..reflect..Modifier", "java.lang.reflect.Modifier", true);
-       // checkMatch("java..lang..Modifier", "java.lang.reflect.Modifier", true);
-       // checkMatch("java..*..Modifier", "java.lang.reflect.Modifier", true);
-       // checkMatch("java..*..*..Modifier", "java.lang.reflect.Modifier", true);
-       // checkMatch("java..*..*..*..Modifier", "java.lang.reflect.Modifier", false);
-       // // checkMatch("java..reflect..Modifier", "java.lang.reflect.Modxifier", false);
-       // checkMatch("ja*va..Modifier", "java.lang.reflect.Modifier", true);
-       // checkMatch("java..*..Mod*ifier", "java.lang.reflect.Modifier", true);
-       //
-       // }
-       //
-       // // three levels:
-       // // 0. defined in current compilation unit, or imported by name
-       // // 1. defined in current package/type/whatever
-       // // 2. defined in package imported by *
-       // /**
-       // * We've decided not to test this here, but rather in any compilers
-       // */
-       // public void testImportResolve() {
-       // // checkIllegalImportResolution("List", new String[] { "java.util", "java.awt", },
-       // // ZERO_STRINGS);
-       //
-       // }
-       //
-       // // Assumption for bcweaver: Already resolved type patterns with no *s or ..'s into exact type
-       // // patterns. Exact type patterns don't have import lists. non-exact-type pattens don't
-       // // care about precedence, so the current package can be included with all the other packages,
-       // // and we don't care about compilation units, and we don't care about ordering.
-       //
-       // // only giving this wild-type patterns
-       // public void testImportMatch() {
-       //
-       // checkImportMatch("*List", new String[] { "java.awt.", }, ZERO_STRINGS, "java.awt.List", true);
-       // checkImportMatch("*List", new String[] { "java.awt.", }, ZERO_STRINGS, "java.awt.List", true);
-       // checkImportMatch("*List", new String[] { "java.awt.", }, ZERO_STRINGS, "java.util.List", false);
-       // checkImportMatch("*List", new String[] { "java.util.", }, ZERO_STRINGS, "java.awt.List", false);
-       // checkImportMatch("*List", new String[] { "java.util.", }, ZERO_STRINGS, "java.util.List", true);
-       //
-       // checkImportMatch("*List", ZERO_STRINGS, new String[] { "java.awt.List", }, "java.awt.List", true);
-       //
-       // checkImportMatch("awt.*List", ZERO_STRINGS, new String[] { "java.awt.List", }, "java.awt.List", false);
-       // checkImportMatch("*Foo", ZERO_STRINGS, new String[] { "java.awt.List", }, "java.awt.List", false);
-       //
-       // checkImportMatch("*List", new String[] { "java.util.", "java.awt.", }, ZERO_STRINGS, "java.util.List", true);
-       // checkImportMatch("*List", new String[] { "java.util.", "java.awt.", }, ZERO_STRINGS, "java.awt.List", true);
-       //
-       // checkImportMatch("*..List", new String[] { "java.util." }, ZERO_STRINGS, "java.util.List", true);
-       // checkImportMatch("*..List", new String[] { "java.util." }, ZERO_STRINGS, "java.awt.List", true);
-       //
-       // }
-       //
-       // public void testImportMatchWithInners() {
-       // // checkImportMatch("*Entry", new String[] { "java.util.", "java.util.Map$" }, ZERO_STRINGS, "java.util.Map$Entry", true);
-       // //
-       // // checkImportMatch("java.util.Map.*Entry", ZERO_STRINGS, ZERO_STRINGS, "java.util.Map$Entry", true);
-       // //
-       // // checkImportMatch("*Entry", new String[] { "java.util.", }, ZERO_STRINGS, "java.util.Map$Entry", false);
-       // //
-       // // checkImportMatch("*.Entry", new String[] { "java.util.", }, ZERO_STRINGS, "java.util.Map$Entry", true);
-       // //
-       // // checkImportMatch("Map.*", new String[] { "java.util.", }, ZERO_STRINGS, "java.util.Map$Entry", true);
-       //
-       // checkImportMatch("Map.*", ZERO_STRINGS, new String[] { "java.util.Map" }, "java.util.Map$Entry", true);
-       // }
-       //
-       // private void checkImportMatch(String wildPattern, String[] importedPackages, String[] importedNames, String matchName,
-       // boolean shouldMatch) {
-       // WildTypePattern p = makeResolvedWildTypePattern(wildPattern, importedPackages, importedNames);
-       // checkPatternMatch(p, matchName, shouldMatch);
-       // }
-       //
-       // private WildTypePattern makeResolvedWildTypePattern(String wildPattern, String[] importedPackages, String[] importedNames) {
-       // WildTypePattern unresolved = (WildTypePattern) new PatternParser(wildPattern).parseTypePattern();
-       //
-       // WildTypePattern resolved = resolve(unresolved, importedPackages, importedNames);
-       // return resolved;
-       //
-       // }
-       //
-       // private WildTypePattern resolve(WildTypePattern unresolved, String[] importedPrefixes, String[] importedNames) {
-       //
-       // TestScope scope = makeTestScope();
-       // scope.setImportedPrefixes(importedPrefixes);
-       // scope.setImportedNames(importedNames);
-       // return (WildTypePattern) unresolved.resolveBindings(scope, Bindings.NONE, false, false);
-       // }
-       //
-
-       //
-       // public void testInstanceofMatch() {
-       //
-       // checkInstanceofMatch("java.lang.Object", "java.lang.Object", FuzzyBoolean.YES);
-       //
-       // checkIllegalInstanceofMatch("java.lang.Object+", "java.lang.Object");
-       // checkIllegalInstanceofMatch("java.lang.Object+", "java.lang.String");
-       // checkIllegalInstanceofMatch("java.lang.String+", "java.lang.Object");
-       // checkIllegalInstanceofMatch("java.lang.*", "java.lang.Object");
-       // checkInstanceofMatch("java.lang.Integer", "java.lang.String", FuzzyBoolean.NO);
-       //
-       // checkInstanceofMatch("java.lang.Number", "java.lang.Integer", FuzzyBoolean.YES);
-       // checkInstanceofMatch("java.lang.Integer", "java.lang.Number", FuzzyBoolean.MAYBE);
-       //
-       // checkIllegalInstanceofMatch("java..Integer", "java.lang.Integer");
-       //
-       // checkInstanceofMatch("*", "java.lang.Integer", FuzzyBoolean.YES);
-       //
-       // }
-       //
-       // public void testArrayMatch() {
-       // checkMatch("*[][]", "java.lang.Object", false);
-       // checkMatch("*[]", "java.lang.Object[]", true);
-       // checkMatch("*[][]", "java.lang.Object[][]", true);
-       // checkMatch("java.lang.Object+", "java.lang.Object[]", true);
-       // checkMatch("java.lang.Object[]", "java.lang.Object", false);
-       // checkMatch("java.lang.Object[]", "java.lang.Object[]", true);
-       // checkMatch("java.lang.Object[][]", "java.lang.Object[][]", true);
-       // checkMatch("java.lang.String[]", "java.lang.Object", false);
-       // checkMatch("java.lang.String[]", "java.lang.Object[]", false);
-       // checkMatch("java.lang.String[][]", "java.lang.Object[][]", false);
-       // checkMatch("java.lang.Object+[]", "java.lang.String[][]", true);
-       // checkMatch("java.lang.Object+[]", "java.lang.String[]", true);
-       // checkMatch("java.lang.Object+[]", "int[][]", true);
-       // checkMatch("java.lang.Object+[]", "int[]", false);
-       // }
-       //
-       // private void checkIllegalInstanceofMatch(String pattern, String name) {
-       // try {
-       // TypePattern p = makeTypePattern(pattern);
-       // ResolvedType type = world.resolve(name);
-       // p.matchesInstanceof(type);
-       // } catch (Throwable e) {
-       // return;
-       // }
-       // assertTrue("matching " + pattern + " with " + name + " should fail", false);
-       // }
-       //
-       // private void checkInstanceofMatch(String pattern, String name, FuzzyBoolean shouldMatch) {
-       // TypePattern p = makeTypePattern(pattern);
-       // ResolvedType type = world.resolve(name);
-       //
-       // p = p.resolveBindings(makeTestScope(), null, false, false);
-       //
-       // // System.out.println("type: " + p);
-       // FuzzyBoolean result = p.matchesInstanceof(type);
-       // String msg = "matches " + pattern + " to " + type;
-       // assertEquals(msg, shouldMatch, result);
-       // }
-       //
-       //
-       // private TypePattern makeTypePattern(String pattern) {
-       // PatternParser pp = new PatternParser(pattern);
-       // TypePattern tp = pp.parseSingleTypePattern();
-       // pp.checkEof();
-       // return tp;
-       // }
-       //
-       // private void checkMatch(String pattern, String name, boolean shouldMatch) {
-       // TypePattern p = makeTypePattern(pattern);
-       // p = p.resolveBindings(makeTestScope(), null, false, false);
-       // checkPatternMatch(p, name, shouldMatch);
-       // }
-       //
-       // private void checkPatternMatch(TypePattern p, String name, boolean shouldMatch) {
-       // ResolvedType type = world.resolve(name);
-       // // System.out.println("type: " + type);
-       // boolean result = p.matchesStatically(type);
-       // String msg = "matches " + p + " to " + type + " expected ";
-       // if (shouldMatch) {
-       // assertTrue(msg + shouldMatch, result);
-       // } else {
-       // assertTrue(msg + shouldMatch, !result);
-       // }
-       // }
-       //
-       // public void testSerialization() throws IOException {
-       // String[] patterns = new String[] { "java.lang.Object", "java.lang.Object+", "java.lang.Integer", "int", "java..*",
-       // "java..util..*", "*.*.Object", "*", };
-       //
-       // for (int i = 0, len = patterns.length; i < len; i++) {
-       // checkSerialization(patterns[i]);
-       // }
-       // }
-       //
-       // /**
-       // * Method checkSerialization.
-       // *
-       // * @param string
-       // */
-       // private void checkSerialization(String string) throws IOException {
-       // TypePattern p = makeTypePattern(string);
-       // ByteArrayOutputStream bo = new ByteArrayOutputStream();
-       // ConstantPoolSimulator cps = new ConstantPoolSimulator();
-       // CompressingDataOutputStream out = new CompressingDataOutputStream(bo, cps);
-       // p.write(out);
-       // out.close();
-       //
-       // ByteArrayInputStream bi = new ByteArrayInputStream(bo.toByteArray());
-       // VersionedDataInputStream in = new VersionedDataInputStream(bi, cps);
-       // TypePattern newP = TypePattern.read(in, null);
-       //
-       // assertEquals("write/read", p, newP);
-       // }
-
-}