make sure tests can run in on dist code, and no_aop can still build.
git-svn-id: https://google-guice.googlecode.com/svn/trunk@1507 d779f126-a31b-0410-b53b-1d3aecad763e
diff --git a/common.xml b/common.xml
index e3cbb02..a318ab3 100644
--- a/common.xml
+++ b/common.xml
@@ -123,6 +123,10 @@
classpath="${common.basedir}/lib/build/jarjar-snapshot.jar"/>
<jarjar jarfile="${build.dir}/${ant.project.name}-${version}-tests.jar">
<fileset dir="${build.dir}/test"/>
+ <rule pattern="net.sf.cglib.*" result="com.google.inject.internal.cglib.$@1"/>
+ <rule pattern="net.sf.cglib.**.*" result="com.google.inject.internal.cglib.@1.$@2"/>
+ <rule pattern="org.objectweb.asm.*" result="com.google.inject.internal.asm.$@1"/>
+ <rule pattern="org.objectweb.asm.**.*" result="com.google.inject.internal.asm.@1.$@2"/>
<rule pattern="com.google.inject.internal.util.*" result="com.google.inject.internal.util.$@1"/>
<rule pattern="com.google.inject.internal.util.**.*" result="com.google.inject.internal.util.@1.$@2"/>
<keep pattern="com.google.inject.**"/>
diff --git a/core/test/com/google/inject/internal/util/LineNumbersTest.java b/core/test/com/google/inject/internal/util/LineNumbersTest.java
index 9ca5c38..78421cd 100644
--- a/core/test/com/google/inject/internal/util/LineNumbersTest.java
+++ b/core/test/com/google/inject/internal/util/LineNumbersTest.java
@@ -25,10 +25,6 @@
import com.google.inject.matcher.Matchers;
import java.lang.reflect.Modifier;
import junit.framework.TestCase;
-import org.objectweb.asm.ClassWriter;
-import org.objectweb.asm.MethodVisitor;
-import org.objectweb.asm.Opcodes;
-import org.objectweb.asm.Type;
/**
* @author jessewilson@google.com (Jesse Wilson)
@@ -51,6 +47,11 @@
}
}
+ static class A {
+ @Inject A(B b) {}
+ }
+ public interface B {}
+
/*if[AOP]*/
public void testCanHandleLineNumbersForGuiceGeneratedClasses() {
try {
@@ -74,12 +75,6 @@
"at " + LineNumbersTest.class.getName(), ".configure(LineNumbersTest.java:");
}
}
- /*end[AOP]*/
-
- static class A {
- @Inject A(B b) {}
- }
- public interface B {}
static class GeneratingClassLoader extends ClassLoader {
static String name = "__generated";
@@ -89,18 +84,22 @@
}
Class<?> generate() {
- ClassWriter cw = new ClassWriter(ClassWriter.COMPUTE_MAXS);
- cw.visit(Opcodes.V1_5, Modifier.PUBLIC, name, null, Type.getInternalName(Object.class), null);
+ org.objectweb.asm.ClassWriter cw =
+ new org.objectweb.asm.ClassWriter(org.objectweb.asm.ClassWriter.COMPUTE_MAXS);
+ cw.visit(org.objectweb.asm.Opcodes.V1_5,
+ Modifier.PUBLIC, name, null,
+ org.objectweb.asm.Type.getInternalName(Object.class), null);
- String sig = "("+Type.getDescriptor(B.class)+")V";
+ String sig = "("+org.objectweb.asm.Type.getDescriptor(B.class)+")V";
- MethodVisitor mv = cw.visitMethod(Modifier.PUBLIC, "<init>", sig, null, null);
+ org.objectweb.asm.MethodVisitor mv = cw.visitMethod(Modifier.PUBLIC, "<init>", sig, null, null);
- mv.visitAnnotation(Type.getDescriptor(Inject.class), true);
+ mv.visitAnnotation(org.objectweb.asm.Type.getDescriptor(Inject.class), true);
mv.visitCode();
- mv.visitVarInsn(Opcodes.ALOAD, 0);
- mv.visitMethodInsn( Opcodes.INVOKESPECIAL, Type.getInternalName(Object.class), "<init>", "()V" );
- mv.visitInsn(Opcodes.RETURN);
+ mv.visitVarInsn(org.objectweb.asm.Opcodes.ALOAD, 0);
+ mv.visitMethodInsn(org.objectweb.asm.Opcodes.INVOKESPECIAL,
+ org.objectweb.asm.Type.getInternalName(Object.class), "<init>", "()V" );
+ mv.visitInsn(org.objectweb.asm.Opcodes.RETURN);
mv.visitMaxs(0, 0);
mv.visitEnd();
cw.visitEnd();
@@ -138,4 +137,5 @@
Object instance = injector.getInstance(generated);
assertEquals(instance.getClass(), generated);
}
+ /*end[AOP]*/
}