diff options
author | aclement <aclement> | 2006-10-26 10:17:19 +0000 |
---|---|---|
committer | aclement <aclement> | 2006-10-26 10:17:19 +0000 |
commit | 3294a35d1bfb49772a188d71777f109819faa8bf (patch) | |
tree | 3e0e5e3ca64a81794c4e7e5aef47ed4564c27db2 /weaver5 | |
parent | 2d20069013a05c140f3ce605c2f1588535db19cc (diff) | |
download | aspectj-3294a35d1bfb49772a188d71777f109819faa8bf.tar.gz aspectj-3294a35d1bfb49772a188d71777f109819faa8bf.zip |
removing asm for the moment
Diffstat (limited to 'weaver5')
-rw-r--r-- | weaver5/java5-testsrc/org/aspectj/weaver/AllWeaver5Tests.java | 2 | ||||
-rw-r--r-- | weaver5/java5-testsrc/org/aspectj/weaver/bcel/AsmDelegateTests5.java | 147 |
2 files changed, 0 insertions, 149 deletions
diff --git a/weaver5/java5-testsrc/org/aspectj/weaver/AllWeaver5Tests.java b/weaver5/java5-testsrc/org/aspectj/weaver/AllWeaver5Tests.java index b46d84011..886aeb112 100644 --- a/weaver5/java5-testsrc/org/aspectj/weaver/AllWeaver5Tests.java +++ b/weaver5/java5-testsrc/org/aspectj/weaver/AllWeaver5Tests.java @@ -15,7 +15,6 @@ package org.aspectj.weaver; import junit.framework.Test; import junit.framework.TestSuite; -import org.aspectj.weaver.bcel.AsmDelegateTests5; import org.aspectj.weaver.reflect.ReflectionWorldTest; import org.aspectj.weaver.tools.PointcutExpressionTest; @@ -25,7 +24,6 @@ public class AllWeaver5Tests { TestSuite suite = new TestSuite(AllWeaver5Tests.class.getName()); //$JUnit-BEGIN$ suite.addTest(AllTracing5Tests.suite()); - suite.addTest(AsmDelegateTests5.suite()); suite.addTest(BcweaverModuleTests15.suite()); suite.addTestSuite(PointcutExpressionTest.class); suite.addTestSuite(ReflectionWorldTest.class); diff --git a/weaver5/java5-testsrc/org/aspectj/weaver/bcel/AsmDelegateTests5.java b/weaver5/java5-testsrc/org/aspectj/weaver/bcel/AsmDelegateTests5.java deleted file mode 100644 index f88b2c336..000000000 --- a/weaver5/java5-testsrc/org/aspectj/weaver/bcel/AsmDelegateTests5.java +++ /dev/null @@ -1,147 +0,0 @@ -/* ******************************************************************* - * Copyright (c) 2006 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: - * Andy Clement initial implementation - * Matthew Webster move Java 5 tests - * ******************************************************************/ - - -package org.aspectj.weaver.bcel; - -import junit.framework.Test; -import junit.framework.TestSuite; - -import org.aspectj.weaver.AbstractWorldTestCase; -import org.aspectj.weaver.BcweaverTests; -import org.aspectj.weaver.ResolvedMember; -import org.aspectj.weaver.ResolvedType; -import org.aspectj.weaver.TypeVariable; -import org.aspectj.weaver.UnresolvedType; -import org.aspectj.weaver.World; - - -/** - * This is a test case for the nameType parts of worlds. - */ -public class AsmDelegateTests5 extends AbstractWorldTestCase { - - public static Test suite() { - TestSuite suite = new TestSuite(AsmDelegateTests5.class.getName()); - suite.addTestSuite(AsmDelegateTests5.class); - return suite; - } - - private final BcelWorld world = new BcelWorld(BcweaverTests.TESTDATA_PATH+"/forAsmDelegateTesting/stuff.jar"); - - public AsmDelegateTests5(String name) { - super(name); - } - - protected World getWorld() { - return world; - } - - // --- testcode - - /** - * Methods are transformed according to generic signatures - this checks - * that some of the generic methods in java.lang.Class appear the same - * whether viewed through an ASM or a BCEL delegate. - */ - public void testCompareGenericMethods() { - BcelWorld slowWorld = new BcelWorld(); - slowWorld.setFastDelegateSupport(false); - slowWorld.setBehaveInJava5Way(true); - - BcelWorld fastWorld = new BcelWorld(); - fastWorld.setBehaveInJava5Way(true); - - ResolvedType bcelJavaLangClass = slowWorld.resolve(UnresolvedType.forName("java.lang.Class")); - ResolvedType asmJavaLangClass = fastWorld.resolve(UnresolvedType.forName("java.lang.Class")); - - bcelJavaLangClass = bcelJavaLangClass.getGenericType(); - asmJavaLangClass = asmJavaLangClass.getGenericType(); - - ResolvedMember[] bcelMethods = bcelJavaLangClass.getDeclaredMethods(); - ResolvedMember[] asmMethods = asmJavaLangClass.getDeclaredMethods(); - - for (int i = 0; i < bcelMethods.length; i++) { - bcelMethods[i].setParameterNames(null); // forget them, asm delegates dont currently know them - String one = bcelMethods[i].toDebugString(); - String two = asmMethods[i].toDebugString(); - if (!one.equals(two)) { - fail("These methods look different when viewed through ASM or BCEL\nBCEL='"+bcelMethods[i].toDebugString()+ - "'\n ASM='"+asmMethods[i].toDebugString()+"'"); - } - // If one is parameterized, check the other is... - if (bcelMethods[i].canBeParameterized()) { - assertTrue("ASM method '"+asmMethods[i].toDebugString()+"' can't be parameterized whereas its' BCEL variant could", - asmMethods[i].canBeParameterized()); - } - - } - - // Let's take a special look at: - // public <U> Class<? extends U> asSubclass(Class<U> clazz) - ResolvedMember bcelSubclassMethod = null; - for (int i = 0; i < bcelMethods.length; i++) { - if (bcelMethods[i].getName().equals("asSubclass")) { bcelSubclassMethod = bcelMethods[i]; break; } - } - ResolvedMember asmSubclassMethod = null; - for (int i = 0; i < asmMethods.length; i++) { - if (asmMethods[i].getName().equals("asSubclass")) { asmSubclassMethod = asmMethods[i];break; } - } - - TypeVariable[] tvs = bcelSubclassMethod.getTypeVariables(); - assertTrue("should have one type variable on the bcel version but found: "+format(tvs),tvs!=null && tvs.length==1); - tvs = asmSubclassMethod.getTypeVariables(); - assertTrue("should have one type variable on the asm version but found: "+format(tvs),tvs!=null && tvs.length==1); - - } - - private String format(TypeVariable[] tvs) { - if (tvs==null) return "null"; - StringBuffer s = new StringBuffer(); - s.append("["); - for (int i = 0; i < tvs.length; i++) { - s.append(tvs[i]); - if ((i+1)<tvs.length) s.append(","); - } - s.append("]"); - return s.toString(); - } - - public void testCompareGenericFields() { - BcelWorld slowWorld = new BcelWorld(); - slowWorld.setFastDelegateSupport(false); - slowWorld.setBehaveInJava5Way(true); - - BcelWorld fastWorld = new BcelWorld(); - fastWorld.setBehaveInJava5Way(true); - - ResolvedType bcelJavaLangClass = slowWorld.resolve(UnresolvedType.forName("java.lang.Class")); - ResolvedType asmJavaLangClass = fastWorld.resolve(UnresolvedType.forName("java.lang.Class")); - - bcelJavaLangClass = bcelJavaLangClass.getGenericType(); - asmJavaLangClass = asmJavaLangClass.getGenericType(); - - ResolvedMember[] bcelFields = bcelJavaLangClass.getDeclaredFields(); - ResolvedMember[] asmFields = asmJavaLangClass.getDeclaredFields(); - - for (int i = 0; i < bcelFields.length; i++) { - UnresolvedType bcelFieldType = bcelFields[i].getGenericReturnType(); - UnresolvedType asmFieldType = asmFields[i].getGenericReturnType(); - if (!bcelFields[i].getGenericReturnType().toDebugString().equals(asmFields[i].getGenericReturnType().toDebugString())) { - fail("These fields look different when viewed through ASM or BCEL\nBCEL='"+bcelFieldType.toDebugString()+ - "'\n ASM='"+asmFieldType.toDebugString()+"'"); - } - } - } - -} |