commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tcu...@apache.org
Subject svn commit: r411779 [1/2] - in /jakarta/commons/sandbox/javaflow/trunk: ./ src/java/org/apache/commons/javaflow/bytecode/ src/java/org/apache/commons/javaflow/bytecode/transformation/asm/ src/test/org/apache/commons/javaflow/bytecode/transformation/ sr...
Date Mon, 05 Jun 2006 13:08:22 GMT
Author: tcurdt
Date: Mon Jun  5 06:08:19 2006
New Revision: 411779

URL: http://svn.apache.org/viewvc?rev=411779&view=rev
Log:
fixed the classloading for the testcase sharing

Added:
    jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/ClassTransformerClassLoader.java
      - copied, changed from r411526, jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/AbstractClassTransformerClassLoader.java
    jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/UsageTestCase.java   (contents, props changed)
      - copied, changed from r411526, jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/tests/UsageTestCase.java
    jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/rewrite/
    jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/rewrite/BlackRed.java   (with props)
    jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/rewrite/ClassAccess1.java   (with props)
    jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/rewrite/ClassAccess2.java   (with props)
    jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/rewrite/ClassAccess3.java   (with props)
    jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/rewrite/CounterFlow.java   (with props)
    jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/rewrite/DefaultConstructor.java   (with props)
    jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/rewrite/NewObject.java   (with props)
    jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/rewrite/NoReference.java   (with props)
    jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/rewrite/NullVariableMethodFlow.java   (with props)
    jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/rewrite/Simple.java   (with props)
    jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/rewrite/SimpleSerializable.java   (with props)
    jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/rewrite/Stack.java   (with props)
    jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/tests/AbstractBlackRedTestCase.java   (with props)
    jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/tests/AbstractClassAccessTestCase.java   (with props)
    jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/tests/AbstractCounterTestCase.java   (with props)
    jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/tests/AbstractDefaultConstructorTestCase.java   (with props)
    jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/tests/AbstractInvokerTestCase.java   (with props)
    jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/tests/AbstractNewObjectTestCase.java   (with props)
    jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/tests/AbstractNoReferenceTestCase.java   (with props)
    jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/tests/AbstractResumeTestCase.java   (with props)
    jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/tests/AbstractSerializationTestCase.java   (with props)
    jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/tests/AbstractSimpleTestCase.java   (with props)
    jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/tests/AbstractStackTestCase.java   (with props)
Removed:
    jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/AbstractClassTransformerClassLoader.java
    jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/asm/AsmClassTransformerClassLoader.java
    jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/bcel/BcelClassTransformerClassLoader.java
    jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/data/
    jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/tests/RewritingTestCase.java
    jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/tests/UsageTestCase.java
Modified:
    jakarta/commons/sandbox/javaflow/trunk/project.xml
    jakarta/commons/sandbox/javaflow/trunk/src/java/org/apache/commons/javaflow/bytecode/BytecodeClassLoader.java
    jakarta/commons/sandbox/javaflow/trunk/src/java/org/apache/commons/javaflow/bytecode/transformation/asm/AsmClassTransformer.java
    jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/AbstractTransformerTestCase.java
    jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/asm/BlackRedTestCase.java
    jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/asm/ClassAccessTestCase.java
    jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/asm/CounterTestCase.java
    jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/asm/DefaultConstructorTestCase.java
    jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/asm/InvokerTestCase.java
    jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/asm/NewObjectTestCase.java
    jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/asm/NoReferenceTestCase.java
    jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/asm/ResumeTestCase.java
    jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/asm/SerializationTestCase.java
    jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/asm/SimpleTestCase.java
    jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/asm/StackTestCase.java
    jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/bcel/BlackRedTestCase.java
    jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/bcel/ClassAccessTestCase.java
    jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/bcel/CounterTestCase.java
    jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/bcel/DefaultConstructorTestCase.java
    jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/bcel/InvokerTestCase.java
    jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/bcel/NewObjectTestCase.java
    jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/bcel/NoReferenceTestCase.java
    jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/bcel/ResumeTestCase.java
    jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/bcel/SerializationTestCase.java
    jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/bcel/SimpleTestCase.java
    jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/bcel/StackTestCase.java

Modified: jakarta/commons/sandbox/javaflow/trunk/project.xml
URL: http://svn.apache.org/viewvc/jakarta/commons/sandbox/javaflow/trunk/project.xml?rev=411779&r1=411778&r2=411779&view=diff
==============================================================================
--- jakarta/commons/sandbox/javaflow/trunk/project.xml (original)
+++ jakarta/commons/sandbox/javaflow/trunk/project.xml Mon Jun  5 06:08:19 2006
@@ -161,11 +161,6 @@
       <artifactId>junit-addons</artifactId>
       <version>1.4</version>
     </dependency>
-    <dependency>
-      <groupId>xstream</groupId>
-      <artifactId>xstream</artifactId>
-      <version>1.1</version>
-    </dependency>
   </dependencies>
 
   <build>

Modified: jakarta/commons/sandbox/javaflow/trunk/src/java/org/apache/commons/javaflow/bytecode/BytecodeClassLoader.java
URL: http://svn.apache.org/viewvc/jakarta/commons/sandbox/javaflow/trunk/src/java/org/apache/commons/javaflow/bytecode/BytecodeClassLoader.java?rev=411779&r1=411778&r2=411779&view=diff
==============================================================================
--- jakarta/commons/sandbox/javaflow/trunk/src/java/org/apache/commons/javaflow/bytecode/BytecodeClassLoader.java (original)
+++ jakarta/commons/sandbox/javaflow/trunk/src/java/org/apache/commons/javaflow/bytecode/BytecodeClassLoader.java Mon Jun  5 06:08:19 2006
@@ -5,7 +5,7 @@
 import org.objectweb.asm.commons.EmptyVisitor;
 
 
-public final class BytecodeClassLoader extends ClassLoader {
+public class BytecodeClassLoader extends ClassLoader {
 
     class NameClassAdapter extends ClassAdapter {
         private String className;

Modified: jakarta/commons/sandbox/javaflow/trunk/src/java/org/apache/commons/javaflow/bytecode/transformation/asm/AsmClassTransformer.java
URL: http://svn.apache.org/viewvc/jakarta/commons/sandbox/javaflow/trunk/src/java/org/apache/commons/javaflow/bytecode/transformation/asm/AsmClassTransformer.java?rev=411779&r1=411778&r2=411779&view=diff
==============================================================================
--- jakarta/commons/sandbox/javaflow/trunk/src/java/org/apache/commons/javaflow/bytecode/transformation/asm/AsmClassTransformer.java (original)
+++ jakarta/commons/sandbox/javaflow/trunk/src/java/org/apache/commons/javaflow/bytecode/transformation/asm/AsmClassTransformer.java Mon Jun  5 06:08:19 2006
@@ -19,9 +19,6 @@
 import java.io.InputStream;
 
 import org.apache.commons.javaflow.bytecode.transformation.ResourceTransformer;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
 import org.objectweb.asm.ClassReader;
 import org.objectweb.asm.ClassWriter;
 import org.objectweb.asm.util.CheckClassAdapter;
@@ -33,8 +30,6 @@
  * @author Eugene Kuleshov
  */
 public final class AsmClassTransformer implements ResourceTransformer {
-    private final static Log log = LogFactory.getLog(AsmClassTransformer.class);
-
 
     public byte[] transform(InputStream is) throws IOException {
         return transform(new ClassReader(is));

Modified: jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/AbstractTransformerTestCase.java
URL: http://svn.apache.org/viewvc/jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/AbstractTransformerTestCase.java?rev=411779&r1=411778&r2=411779&view=diff
==============================================================================
--- jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/AbstractTransformerTestCase.java (original)
+++ jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/AbstractTransformerTestCase.java Mon Jun  5 06:08:19 2006
@@ -1,49 +1,53 @@
 package org.apache.commons.javaflow.bytecode.transformation;
 
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.PrintWriter;
-import java.io.StringWriter;
 import junit.framework.TestCase;
-import org.apache.commons.javaflow.bytecode.transformation.asm.AsmClassTransformer;
-import org.apache.commons.javaflow.bytecode.transformation.bcel.BcelClassTransformer;
-import org.objectweb.asm.ClassReader;
-import org.objectweb.asm.util.CheckClassAdapter;
-import org.objectweb.asm.util.TraceClassVisitor;
 
 
 public abstract class AbstractTransformerTestCase extends TestCase {
 
-    protected void assertSameTransformation( final String pClazzName ) throws IOException {
-        final InputStream is = getStream(pClazzName);
-        final ClassReader cr = new ClassReader(is);
-        
-        final AsmClassTransformer t1 = new AsmClassTransformer();
-        final BcelClassTransformer t2 = new BcelClassTransformer();
-        
-        final byte[] bytecode = t1.transform(cr.b);
-        CheckClassAdapter.verify(new ClassReader(bytecode), true);
-
-        final StringWriter sw1 = new StringWriter();
-        new ClassReader(bytecode).accept(new TraceClassVisitor(new PrintWriter(sw1)), false);
-
-        final StringWriter sw2 = new StringWriter();
-        new ClassReader(t2.transform(cr.b)).accept(new TraceClassVisitor(new PrintWriter(sw2)), false);
-        
-        assertEquals(sw2.toString(), sw1.toString());
-    }
+	public static String getTestCaseClassName( final Class pClazz ) {
+		final String pkg = pClazz.getPackage().getName();
+		final String cls = pClazz.getName();
+		return pkg.substring(0, pkg.lastIndexOf('.'))
+			+ ".tests.Abstract"
+			+ cls.substring(cls.lastIndexOf('.') + 1); 
+	}
+
+	public static String getTestCaseName( final Class pClazz ) {
+		final String cls = pClazz.getName();
+		return cls.substring(cls.lastIndexOf('.') + 1); 
+	}
+	
+//    protected void assertSameTransformation( final String pClazzName ) throws IOException {
+//        final InputStream is = getStream(pClazzName);
+//        final ClassReader cr = new ClassReader(is);
+//        
+//        final AsmClassTransformer t1 = new AsmClassTransformer();
+//        final BcelClassTransformer t2 = new BcelClassTransformer();
+//        
+//        final byte[] bytecode = t1.transform(cr.b);
+//        CheckClassAdapter.verify(new ClassReader(bytecode), true);
+//
+//        final StringWriter sw1 = new StringWriter();
+//        new ClassReader(bytecode).accept(new TraceClassVisitor(new PrintWriter(sw1)), false);
+//
+//        final StringWriter sw2 = new StringWriter();
+//        new ClassReader(t2.transform(cr.b)).accept(new TraceClassVisitor(new PrintWriter(sw2)), false);
+//        
+//        assertEquals(sw2.toString(), sw1.toString());
+//    }
     
   protected void runTest() throws Throwable {
-    try {
-      super.runTest();
-      
-    } catch( Throwable e) {
-        throw e;
-    }
-  }
+	  try {
+		  super.runTest();
 
-  private InputStream getStream( String name) {
-    return getClass().getResourceAsStream("/" + name.replace( '.', '/') + ".class");
+	  } catch( Throwable e) {
+		  throw e;
+	  }
   }
+
+//  private InputStream getStream( String name) {
+//    return getClass().getResourceAsStream("/" + name.replace( '.', '/') + ".class");
+//  }
 
 }

Copied: jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/ClassTransformerClassLoader.java (from r411526, jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/AbstractClassTransformerClassLoader.java)
URL: http://svn.apache.org/viewvc/jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/ClassTransformerClassLoader.java?p2=jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/ClassTransformerClassLoader.java&p1=jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/AbstractClassTransformerClassLoader.java&r1=411526&r2=411779&rev=411779&view=diff
==============================================================================
--- jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/AbstractClassTransformerClassLoader.java (original)
+++ jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/ClassTransformerClassLoader.java Mon Jun  5 06:08:19 2006
@@ -2,35 +2,97 @@
 
 import java.io.IOException;
 import java.io.InputStream;
+
 import org.apache.commons.io.IOUtils;
+import org.apache.commons.javaflow.bytecode.BytecodeClassLoader;
 import org.objectweb.asm.ClassReader;
+import org.objectweb.asm.ClassWriter;
+import org.objectweb.asm.Label;
+import org.objectweb.asm.MethodVisitor;
+import org.objectweb.asm.Opcodes;
 
-public abstract class AbstractClassTransformerClassLoader extends ClassLoader {
+public class ClassTransformerClassLoader extends BytecodeClassLoader {
 
     private final ResourceTransformer transformer;
     private final String prefix;
-    private final ClassLoader classloader;
+//    private final ClassLoader classloader;
 
+    public ClassTransformerClassLoader(final ResourceTransformer pTransformer) {
+    	this("org.apache.commons.javaflow.bytecode.transformation.", pTransformer);
+    }
 
-    public AbstractClassTransformerClassLoader(final String pPrefix, final ResourceTransformer pTransformer) {
+    public ClassTransformerClassLoader(final String pPrefix, final ResourceTransformer pTransformer) {
         prefix = pPrefix;
         transformer = pTransformer;
-        classloader = getClass().getClassLoader();
+//        classloader = getClass().getClassLoader();
     }
 
     protected byte[] transform( final InputStream pClassStream ) throws IOException {
         return transformer.transform(IOUtils.toByteArray(pClassStream));
     }
 
+    
+    public Class loadLocalClass( final String name ) throws ClassNotFoundException {
+    	return loadClass( prefix + name);
+    }
+    
+
+    public Class createImplementationOf( final Class pAbstractClass ) {
+    	
+    	final String base = pAbstractClass.getName().replace('.', '/');
+    	final int slash = base.lastIndexOf('/');
+    	final String packageName = base.substring(0, slash);
+    	final String name = base.substring(packageName.length() + "Abstract".length() + 1);
+    	final String extended = packageName + "/" + name + "Impl";
+    	
+    	ClassWriter cw = new ClassWriter(true);
+    	MethodVisitor mv;
+
+    	cw.visit(Opcodes.V1_2, Opcodes.ACC_PUBLIC + Opcodes.ACC_FINAL + Opcodes.ACC_SUPER,
+    			extended, null,
+    			base, null);
+
+    	cw.visitSource(name + "Impl.java", null);
+
+    	mv = cw.visitMethod(Opcodes.ACC_PUBLIC, "<init>", "()V", null, null);
+    	mv.visitCode();
+    	Label l0 = new Label();
+    	mv.visitLabel(l0);
+    	mv.visitLineNumber(3, l0);
+    	mv.visitVarInsn(Opcodes.ALOAD, 0);
+    	mv.visitMethodInsn(Opcodes.INVOKESPECIAL,
+    			base,
+    			"<init>", "()V");
+    	mv.visitInsn(Opcodes.RETURN);
+    	Label l1 = new Label();
+    	mv.visitLabel(l1);
+    	mv.visitLocalVariable("this",
+    			"L" + extended + ";",
+    			null, l0, l1, 0);
+    	mv.visitMaxs(1, 1);
+    	mv.visitEnd();
+
+    	cw.visitEnd();
+
+    	return loadClass(cw.toByteArray());    	    	
+    }
+    
+    
     public Class loadClass( final String name ) throws ClassNotFoundException {
-        if (name.startsWith("org.apache.commons.javaflow.bytecode.transformation.")) {
-            //System.err.println("Loading: " + name);
+        if (name.startsWith(prefix)) {
+
+//        	Class clazz = super.findClass(name);
+//        	if (clazz != null) {
+//        		return clazz;
+//        	}
+        	
+//            System.err.println("Loading: " + name);
             try {
                 final InputStream is = getClass().getResourceAsStream(
                         "/" + name.replace('.', '/') + ".class");
                 byte[] bytecode;
-                if (name.startsWith("org.apache.commons.javaflow.bytecode.transformation.data.")) {
-                    //System.err.println("Instrumenting: " + name);
+                if (name.indexOf(".rewrite.") >= 0) {
+//                    System.err.println("Instrumenting: " + name);
                     // bytecode = DefaultConstructorDump.dump();
                     bytecode = transform(is);
                     /*
@@ -53,6 +115,8 @@
                 throw new ClassNotFoundException(name + " " + ex.getMessage(), ex);
             }
         }
-        return classloader.loadClass(name);
+//        System.err.println("Other classloader loading: " + name);
+        return super.loadClass(name);
+        //return classloader.loadClass(name);
     }
 }

Copied: jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/UsageTestCase.java (from r411526, jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/tests/UsageTestCase.java)
URL: http://svn.apache.org/viewvc/jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/UsageTestCase.java?p2=jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/UsageTestCase.java&p1=jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/tests/UsageTestCase.java&r1=411526&r2=411779&rev=411779&view=diff
==============================================================================
--- jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/tests/UsageTestCase.java (original)
+++ jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/UsageTestCase.java Mon Jun  5 06:08:19 2006
@@ -1,7 +1,8 @@
-package org.apache.commons.javaflow.bytecode.transformation.tests;
+package org.apache.commons.javaflow.bytecode.transformation;
 
 import junit.framework.TestCase;
-import org.apache.commons.javaflow.bytecode.transformation.data.Simple;
+
+import org.apache.commons.javaflow.bytecode.transformation.rewrite.Simple;
 
 
 

Propchange: jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/UsageTestCase.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/UsageTestCase.java
------------------------------------------------------------------------------
    svn:keywords = Id

Modified: jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/asm/BlackRedTestCase.java
URL: http://svn.apache.org/viewvc/jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/asm/BlackRedTestCase.java?rev=411779&r1=411778&r2=411779&view=diff
==============================================================================
--- jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/asm/BlackRedTestCase.java (original)
+++ jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/asm/BlackRedTestCase.java Mon Jun  5 06:08:19 2006
@@ -1,17 +1,27 @@
 package org.apache.commons.javaflow.bytecode.transformation.asm;
 
 import junit.framework.Test;
+import junit.framework.TestCase;
 import junit.framework.TestSuite;
-import org.apache.commons.javaflow.bytecode.transformation.tests.AbstractBlackRedTestCase;
 
-public final class BlackRedTestCase extends AbstractBlackRedTestCase {
+import org.apache.commons.javaflow.bytecode.transformation.AbstractTransformerTestCase;
+import org.apache.commons.javaflow.bytecode.transformation.ClassTransformerClassLoader;
+import org.apache.commons.javaflow.bytecode.transformation.bcel.BcelClassTransformer;
+
+public final class BlackRedTestCase extends TestCase {
 
     public static Test suite() throws Exception {
-        final Class test = BlackRedTestCase.class;
-        final AsmClassTransformerClassLoader classloader =
-            new AsmClassTransformerClassLoader(test.getPackage().getName());
-        final Class clazz = classloader.loadClass(test.getName());
-        return new TestSuite(clazz);
+
+    	final ClassTransformerClassLoader classloader =
+            new ClassTransformerClassLoader(new BcelClassTransformer());
+        
+        final Class clazz = classloader.loadClass(
+        		AbstractTransformerTestCase.getTestCaseClassName(
+        				BlackRedTestCase.class));
+
+        final TestSuite suite = new TestSuite(classloader.createImplementationOf(clazz));
+        suite.setName("ASM " + clazz.getName());
+        return suite;
     }
     
 }

Modified: jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/asm/ClassAccessTestCase.java
URL: http://svn.apache.org/viewvc/jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/asm/ClassAccessTestCase.java?rev=411779&r1=411778&r2=411779&view=diff
==============================================================================
--- jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/asm/ClassAccessTestCase.java (original)
+++ jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/asm/ClassAccessTestCase.java Mon Jun  5 06:08:19 2006
@@ -1,18 +1,28 @@
 package org.apache.commons.javaflow.bytecode.transformation.asm;
 
 import junit.framework.Test;
+import junit.framework.TestCase;
 import junit.framework.TestSuite;
-import org.apache.commons.javaflow.bytecode.transformation.tests.AbstractClassAccessTestCase;
 
+import org.apache.commons.javaflow.bytecode.transformation.AbstractTransformerTestCase;
+import org.apache.commons.javaflow.bytecode.transformation.ClassTransformerClassLoader;
+import org.apache.commons.javaflow.bytecode.transformation.bcel.BcelClassTransformer;
 
-public class ClassAccessTestCase extends AbstractClassAccessTestCase {
+
+public class ClassAccessTestCase extends TestCase {
 
     public static Test suite() throws Exception {
-        final Class test = ClassAccessTestCase.class;
-        final AsmClassTransformerClassLoader classloader =
-            new AsmClassTransformerClassLoader(test.getPackage().getName());
-        final Class clazz = classloader.loadClass(test.getName());
-        return new TestSuite(clazz);
+
+    	final ClassTransformerClassLoader classloader =
+            new ClassTransformerClassLoader(new BcelClassTransformer());
+        
+        final Class clazz = classloader.loadClass(
+        		AbstractTransformerTestCase.getTestCaseClassName(
+        				ClassAccessTestCase.class));
+
+        final TestSuite suite = new TestSuite(classloader.createImplementationOf(clazz));
+        suite.setName("ASM " + clazz.getName());
+        return suite;
     }
   
 }

Modified: jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/asm/CounterTestCase.java
URL: http://svn.apache.org/viewvc/jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/asm/CounterTestCase.java?rev=411779&r1=411778&r2=411779&view=diff
==============================================================================
--- jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/asm/CounterTestCase.java (original)
+++ jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/asm/CounterTestCase.java Mon Jun  5 06:08:19 2006
@@ -1,18 +1,28 @@
 package org.apache.commons.javaflow.bytecode.transformation.asm;
 
 import junit.framework.Test;
+import junit.framework.TestCase;
 import junit.framework.TestSuite;
-import org.apache.commons.javaflow.bytecode.transformation.tests.AbstractCounterTestCase;
 
+import org.apache.commons.javaflow.bytecode.transformation.AbstractTransformerTestCase;
+import org.apache.commons.javaflow.bytecode.transformation.ClassTransformerClassLoader;
+import org.apache.commons.javaflow.bytecode.transformation.bcel.BcelClassTransformer;
 
-public final class CounterTestCase extends AbstractCounterTestCase {
+
+public final class CounterTestCase extends TestCase {
 
     public static Test suite() throws Exception {
-        final Class test = CounterTestCase.class;
-        final AsmClassTransformerClassLoader classloader =
-            new AsmClassTransformerClassLoader(test.getPackage().getName());
-        final Class clazz = classloader.loadClass(test.getName());
-        return new TestSuite(clazz);
+
+    	final ClassTransformerClassLoader classloader =
+            new ClassTransformerClassLoader(new BcelClassTransformer());
+        
+        final Class clazz = classloader.loadClass(
+        		AbstractTransformerTestCase.getTestCaseClassName(
+        				CounterTestCase.class));
+
+        final TestSuite suite = new TestSuite(classloader.createImplementationOf(clazz));
+        suite.setName("ASM " + clazz.getName());
+        return suite;
     }
  
 }

Modified: jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/asm/DefaultConstructorTestCase.java
URL: http://svn.apache.org/viewvc/jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/asm/DefaultConstructorTestCase.java?rev=411779&r1=411778&r2=411779&view=diff
==============================================================================
--- jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/asm/DefaultConstructorTestCase.java (original)
+++ jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/asm/DefaultConstructorTestCase.java Mon Jun  5 06:08:19 2006
@@ -1,18 +1,28 @@
 package org.apache.commons.javaflow.bytecode.transformation.asm;
 
 import junit.framework.Test;
+import junit.framework.TestCase;
 import junit.framework.TestSuite;
-import org.apache.commons.javaflow.bytecode.transformation.tests.AbstractDefaultConstructorTestCase;
 
+import org.apache.commons.javaflow.bytecode.transformation.AbstractTransformerTestCase;
+import org.apache.commons.javaflow.bytecode.transformation.ClassTransformerClassLoader;
+import org.apache.commons.javaflow.bytecode.transformation.bcel.BcelClassTransformer;
 
-public final class DefaultConstructorTestCase extends AbstractDefaultConstructorTestCase {
+
+public final class DefaultConstructorTestCase extends TestCase {
 
     public static Test suite() throws Exception {
-        final Class test = DefaultConstructorTestCase.class;
-        final AsmClassTransformerClassLoader classloader =
-            new AsmClassTransformerClassLoader(test.getPackage().getName());
-        final Class clazz = classloader.loadClass(test.getName());
-        return new TestSuite(clazz);
+
+    	final ClassTransformerClassLoader classloader =
+            new ClassTransformerClassLoader(new BcelClassTransformer());
+        
+        final Class clazz = classloader.loadClass(
+        		AbstractTransformerTestCase.getTestCaseClassName(
+        				DefaultConstructorTestCase.class));
+
+        final TestSuite suite = new TestSuite(classloader.createImplementationOf(clazz));
+        suite.setName("ASM " + clazz.getName());
+        return suite;
     }
     
 }

Modified: jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/asm/InvokerTestCase.java
URL: http://svn.apache.org/viewvc/jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/asm/InvokerTestCase.java?rev=411779&r1=411778&r2=411779&view=diff
==============================================================================
--- jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/asm/InvokerTestCase.java (original)
+++ jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/asm/InvokerTestCase.java Mon Jun  5 06:08:19 2006
@@ -1,18 +1,28 @@
 package org.apache.commons.javaflow.bytecode.transformation.asm;
 
 import junit.framework.Test;
+import junit.framework.TestCase;
 import junit.framework.TestSuite;
-import org.apache.commons.javaflow.bytecode.transformation.tests.AbstractInvokerTestCase;
 
+import org.apache.commons.javaflow.bytecode.transformation.AbstractTransformerTestCase;
+import org.apache.commons.javaflow.bytecode.transformation.ClassTransformerClassLoader;
+import org.apache.commons.javaflow.bytecode.transformation.bcel.BcelClassTransformer;
 
-public final class InvokerTestCase extends AbstractInvokerTestCase {
+
+public final class InvokerTestCase extends TestCase {
 
     public static Test suite() throws Exception {
-        final Class test = InvokerTestCase.class;
-        final AsmClassTransformerClassLoader classloader =
-            new AsmClassTransformerClassLoader(test.getPackage().getName());
-        final Class clazz = classloader.loadClass(test.getName());
-        return new TestSuite(clazz);
+
+    	final ClassTransformerClassLoader classloader =
+            new ClassTransformerClassLoader(new BcelClassTransformer());
+        
+        final Class clazz = classloader.loadClass(
+        		AbstractTransformerTestCase.getTestCaseClassName(
+        				InvokerTestCase.class));
+
+        final TestSuite suite = new TestSuite(classloader.createImplementationOf(clazz));
+        suite.setName("ASM " + clazz.getName());
+        return suite;
     }
     
 }

Modified: jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/asm/NewObjectTestCase.java
URL: http://svn.apache.org/viewvc/jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/asm/NewObjectTestCase.java?rev=411779&r1=411778&r2=411779&view=diff
==============================================================================
--- jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/asm/NewObjectTestCase.java (original)
+++ jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/asm/NewObjectTestCase.java Mon Jun  5 06:08:19 2006
@@ -1,18 +1,28 @@
 package org.apache.commons.javaflow.bytecode.transformation.asm;
 
 import junit.framework.Test;
+import junit.framework.TestCase;
 import junit.framework.TestSuite;
-import org.apache.commons.javaflow.bytecode.transformation.tests.AbstractNewObjectTestCase;
 
+import org.apache.commons.javaflow.bytecode.transformation.AbstractTransformerTestCase;
+import org.apache.commons.javaflow.bytecode.transformation.ClassTransformerClassLoader;
+import org.apache.commons.javaflow.bytecode.transformation.bcel.BcelClassTransformer;
 
-public final class NewObjectTestCase extends AbstractNewObjectTestCase {
+
+public final class NewObjectTestCase extends TestCase {
 
     public static Test suite() throws Exception {
-        final Class test = NewObjectTestCase.class;
-        final AsmClassTransformerClassLoader classloader =
-            new AsmClassTransformerClassLoader(test.getPackage().getName());
-        final Class clazz = classloader.loadClass(test.getName());
-        return new TestSuite(clazz);
+
+    	final ClassTransformerClassLoader classloader =
+            new ClassTransformerClassLoader(new BcelClassTransformer());
+        
+        final Class clazz = classloader.loadClass(
+        		AbstractTransformerTestCase.getTestCaseClassName(
+        				NewObjectTestCase.class));
+
+        final TestSuite suite = new TestSuite(classloader.createImplementationOf(clazz));
+        suite.setName("ASM " + clazz.getName());
+        return suite;
     }
  
 }

Modified: jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/asm/NoReferenceTestCase.java
URL: http://svn.apache.org/viewvc/jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/asm/NoReferenceTestCase.java?rev=411779&r1=411778&r2=411779&view=diff
==============================================================================
--- jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/asm/NoReferenceTestCase.java (original)
+++ jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/asm/NoReferenceTestCase.java Mon Jun  5 06:08:19 2006
@@ -1,18 +1,28 @@
 package org.apache.commons.javaflow.bytecode.transformation.asm;
 
 import junit.framework.Test;
+import junit.framework.TestCase;
 import junit.framework.TestSuite;
-import org.apache.commons.javaflow.bytecode.transformation.tests.AbstractNoReferenceTestCase;
 
+import org.apache.commons.javaflow.bytecode.transformation.AbstractTransformerTestCase;
+import org.apache.commons.javaflow.bytecode.transformation.ClassTransformerClassLoader;
+import org.apache.commons.javaflow.bytecode.transformation.bcel.BcelClassTransformer;
 
-public final class NoReferenceTestCase extends AbstractNoReferenceTestCase {
+
+public final class NoReferenceTestCase extends TestCase {
 
     public static Test suite() throws Exception {
-        final Class test = NoReferenceTestCase.class;
-        final AsmClassTransformerClassLoader classloader =
-            new AsmClassTransformerClassLoader(test.getPackage().getName());
-        final Class clazz = classloader.loadClass(test.getName());
-        return new TestSuite(clazz);
+
+    	final ClassTransformerClassLoader classloader =
+            new ClassTransformerClassLoader(new BcelClassTransformer());
+        
+        final Class clazz = classloader.loadClass(
+        		AbstractTransformerTestCase.getTestCaseClassName(
+        				NoReferenceTestCase.class));
+
+        final TestSuite suite = new TestSuite(classloader.createImplementationOf(clazz));
+        suite.setName("ASM " + clazz.getName());
+        return suite;
     }
    
 }

Modified: jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/asm/ResumeTestCase.java
URL: http://svn.apache.org/viewvc/jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/asm/ResumeTestCase.java?rev=411779&r1=411778&r2=411779&view=diff
==============================================================================
--- jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/asm/ResumeTestCase.java (original)
+++ jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/asm/ResumeTestCase.java Mon Jun  5 06:08:19 2006
@@ -1,18 +1,28 @@
 package org.apache.commons.javaflow.bytecode.transformation.asm;
 
 import junit.framework.Test;
+import junit.framework.TestCase;
 import junit.framework.TestSuite;
-import org.apache.commons.javaflow.bytecode.transformation.tests.AbstractResumeTestCase;
 
+import org.apache.commons.javaflow.bytecode.transformation.AbstractTransformerTestCase;
+import org.apache.commons.javaflow.bytecode.transformation.ClassTransformerClassLoader;
+import org.apache.commons.javaflow.bytecode.transformation.bcel.BcelClassTransformer;
 
-public final class ResumeTestCase extends AbstractResumeTestCase {
+
+public final class ResumeTestCase extends TestCase {
 
     public static Test suite() throws Exception {
-        final Class test = ResumeTestCase.class;
-        final AsmClassTransformerClassLoader classloader =
-            new AsmClassTransformerClassLoader(test.getPackage().getName());
-        final Class clazz = classloader.loadClass(test.getName());
-        return new TestSuite(clazz);
+
+    	final ClassTransformerClassLoader classloader =
+            new ClassTransformerClassLoader(new BcelClassTransformer());
+        
+        final Class clazz = classloader.loadClass(
+        		AbstractTransformerTestCase.getTestCaseClassName(
+        				ResumeTestCase.class));
+
+        final TestSuite suite = new TestSuite(classloader.createImplementationOf(clazz));
+        suite.setName("ASM " + AbstractTransformerTestCase.getTestCaseName(ResumeTestCase.class));
+        return suite;
     }
  
 }

Modified: jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/asm/SerializationTestCase.java
URL: http://svn.apache.org/viewvc/jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/asm/SerializationTestCase.java?rev=411779&r1=411778&r2=411779&view=diff
==============================================================================
--- jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/asm/SerializationTestCase.java (original)
+++ jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/asm/SerializationTestCase.java Mon Jun  5 06:08:19 2006
@@ -1,18 +1,28 @@
 package org.apache.commons.javaflow.bytecode.transformation.asm;
 
 import junit.framework.Test;
+import junit.framework.TestCase;
 import junit.framework.TestSuite;
-import org.apache.commons.javaflow.bytecode.transformation.tests.AbstractSerializationTestCase;
 
+import org.apache.commons.javaflow.bytecode.transformation.AbstractTransformerTestCase;
+import org.apache.commons.javaflow.bytecode.transformation.ClassTransformerClassLoader;
+import org.apache.commons.javaflow.bytecode.transformation.bcel.BcelClassTransformer;
 
-public final class SerializationTestCase extends AbstractSerializationTestCase {
+
+public final class SerializationTestCase extends TestCase {
 
     public static Test suite() throws Exception {
-        final Class test = SerializationTestCase.class;
-        final AsmClassTransformerClassLoader classloader =
-            new AsmClassTransformerClassLoader(test.getPackage().getName());
-        final Class clazz = classloader.loadClass(test.getName());
-        return new TestSuite(clazz);
+
+    	final ClassTransformerClassLoader classloader =
+            new ClassTransformerClassLoader(new BcelClassTransformer());
+        
+        final Class clazz = classloader.loadClass(
+        		AbstractTransformerTestCase.getTestCaseClassName(
+        				SerializationTestCase.class));
+
+        final TestSuite suite = new TestSuite(classloader.createImplementationOf(clazz));
+        suite.setName("ASM " + AbstractTransformerTestCase.getTestCaseName(SerializationTestCase.class));
+        return suite;
     }
  
 }

Modified: jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/asm/SimpleTestCase.java
URL: http://svn.apache.org/viewvc/jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/asm/SimpleTestCase.java?rev=411779&r1=411778&r2=411779&view=diff
==============================================================================
--- jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/asm/SimpleTestCase.java (original)
+++ jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/asm/SimpleTestCase.java Mon Jun  5 06:08:19 2006
@@ -1,18 +1,28 @@
 package org.apache.commons.javaflow.bytecode.transformation.asm;
 
 import junit.framework.Test;
+import junit.framework.TestCase;
 import junit.framework.TestSuite;
-import org.apache.commons.javaflow.bytecode.transformation.tests.AbstractSimpleTestCase;
 
+import org.apache.commons.javaflow.bytecode.transformation.AbstractTransformerTestCase;
+import org.apache.commons.javaflow.bytecode.transformation.ClassTransformerClassLoader;
+import org.apache.commons.javaflow.bytecode.transformation.bcel.BcelClassTransformer;
 
-public final class SimpleTestCase extends AbstractSimpleTestCase {
+
+public final class SimpleTestCase extends TestCase {
 
     public static Test suite() throws Exception {
-        final Class test = SimpleTestCase.class;
-        final AsmClassTransformerClassLoader classloader =
-            new AsmClassTransformerClassLoader(test.getPackage().getName());
-        final Class clazz = classloader.loadClass(test.getName());
-        return new TestSuite(clazz);
+
+    	final ClassTransformerClassLoader classloader =
+            new ClassTransformerClassLoader(new BcelClassTransformer());
+        
+        final Class clazz = classloader.loadClass(
+        		AbstractTransformerTestCase.getTestCaseClassName(
+        				SimpleTestCase.class));
+
+        final TestSuite suite = new TestSuite(classloader.createImplementationOf(clazz));
+        suite.setName("ASM " + clazz.getName());
+        return suite;
     }
  
 }

Modified: jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/asm/StackTestCase.java
URL: http://svn.apache.org/viewvc/jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/asm/StackTestCase.java?rev=411779&r1=411778&r2=411779&view=diff
==============================================================================
--- jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/asm/StackTestCase.java (original)
+++ jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/asm/StackTestCase.java Mon Jun  5 06:08:19 2006
@@ -1,18 +1,28 @@
 package org.apache.commons.javaflow.bytecode.transformation.asm;
 
 import junit.framework.Test;
+import junit.framework.TestCase;
 import junit.framework.TestSuite;
-import org.apache.commons.javaflow.bytecode.transformation.tests.AbstractStackTestCase;
 
+import org.apache.commons.javaflow.bytecode.transformation.AbstractTransformerTestCase;
+import org.apache.commons.javaflow.bytecode.transformation.ClassTransformerClassLoader;
+import org.apache.commons.javaflow.bytecode.transformation.bcel.BcelClassTransformer;
 
-public final class StackTestCase extends AbstractStackTestCase {
+
+public final class StackTestCase extends TestCase {
  
     public static Test suite() throws Exception {
-        final Class test = StackTestCase.class;
-        final AsmClassTransformerClassLoader classloader =
-            new AsmClassTransformerClassLoader(test.getPackage().getName());
-        final Class clazz = classloader.loadClass(test.getName());
-        return new TestSuite(clazz);
+
+    	final ClassTransformerClassLoader classloader =
+            new ClassTransformerClassLoader(new BcelClassTransformer());
+        
+        final Class clazz = classloader.loadClass(
+        		AbstractTransformerTestCase.getTestCaseClassName(
+        				StackTestCase.class));
+
+        final TestSuite suite = new TestSuite(classloader.createImplementationOf(clazz));
+        suite.setName("ASM " + clazz.getName());
+        return suite;
     }
  
 }

Modified: jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/bcel/BlackRedTestCase.java
URL: http://svn.apache.org/viewvc/jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/bcel/BlackRedTestCase.java?rev=411779&r1=411778&r2=411779&view=diff
==============================================================================
--- jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/bcel/BlackRedTestCase.java (original)
+++ jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/bcel/BlackRedTestCase.java Mon Jun  5 06:08:19 2006
@@ -1,17 +1,26 @@
 package org.apache.commons.javaflow.bytecode.transformation.bcel;
 
 import junit.framework.Test;
+import junit.framework.TestCase;
 import junit.framework.TestSuite;
-import org.apache.commons.javaflow.bytecode.transformation.tests.AbstractBlackRedTestCase;
 
-public final class BlackRedTestCase extends AbstractBlackRedTestCase {
+import org.apache.commons.javaflow.bytecode.transformation.AbstractTransformerTestCase;
+import org.apache.commons.javaflow.bytecode.transformation.ClassTransformerClassLoader;
+
+public final class BlackRedTestCase extends TestCase {
 
     public static Test suite() throws Exception {
-        final Class test = BlackRedTestCase.class;
-        final BcelClassTransformerClassLoader classloader =
-            new BcelClassTransformerClassLoader(test.getPackage().getName());
-        final Class clazz = classloader.loadClass(test.getName());
-        return new TestSuite(clazz);
+
+    	final ClassTransformerClassLoader classloader =
+            new ClassTransformerClassLoader(new BcelClassTransformer());
+        
+        final Class clazz = classloader.loadClass(
+        		AbstractTransformerTestCase.getTestCaseClassName(
+        				BlackRedTestCase.class));
+
+        final TestSuite suite = new TestSuite(classloader.createImplementationOf(clazz));
+        suite.setName("BCEL " + clazz.getName());
+        return suite;
     }
     
 }

Modified: jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/bcel/ClassAccessTestCase.java
URL: http://svn.apache.org/viewvc/jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/bcel/ClassAccessTestCase.java?rev=411779&r1=411778&r2=411779&view=diff
==============================================================================
--- jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/bcel/ClassAccessTestCase.java (original)
+++ jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/bcel/ClassAccessTestCase.java Mon Jun  5 06:08:19 2006
@@ -1,18 +1,27 @@
 package org.apache.commons.javaflow.bytecode.transformation.bcel;
 
 import junit.framework.Test;
+import junit.framework.TestCase;
 import junit.framework.TestSuite;
-import org.apache.commons.javaflow.bytecode.transformation.tests.AbstractClassAccessTestCase;
 
+import org.apache.commons.javaflow.bytecode.transformation.AbstractTransformerTestCase;
+import org.apache.commons.javaflow.bytecode.transformation.ClassTransformerClassLoader;
 
-public class ClassAccessTestCase extends AbstractClassAccessTestCase {
+
+public class ClassAccessTestCase extends TestCase {
 
     public static Test suite() throws Exception {
-        final Class test = ClassAccessTestCase.class;
-        final BcelClassTransformerClassLoader classloader =
-            new BcelClassTransformerClassLoader(test.getPackage().getName());
-        final Class clazz = classloader.loadClass(test.getName());
-        return new TestSuite(clazz);
+
+    	final ClassTransformerClassLoader classloader =
+            new ClassTransformerClassLoader(new BcelClassTransformer());
+        
+        final Class clazz = classloader.loadClass(
+        		AbstractTransformerTestCase.getTestCaseClassName(
+        				ClassAccessTestCase.class));
+
+        final TestSuite suite = new TestSuite(classloader.createImplementationOf(clazz));
+        suite.setName("BCEL " + clazz.getName());
+        return suite;
     }
   
 }

Modified: jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/bcel/CounterTestCase.java
URL: http://svn.apache.org/viewvc/jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/bcel/CounterTestCase.java?rev=411779&r1=411778&r2=411779&view=diff
==============================================================================
--- jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/bcel/CounterTestCase.java (original)
+++ jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/bcel/CounterTestCase.java Mon Jun  5 06:08:19 2006
@@ -1,18 +1,27 @@
 package org.apache.commons.javaflow.bytecode.transformation.bcel;
 
 import junit.framework.Test;
+import junit.framework.TestCase;
 import junit.framework.TestSuite;
-import org.apache.commons.javaflow.bytecode.transformation.tests.AbstractCounterTestCase;
 
+import org.apache.commons.javaflow.bytecode.transformation.AbstractTransformerTestCase;
+import org.apache.commons.javaflow.bytecode.transformation.ClassTransformerClassLoader;
 
-public final class CounterTestCase extends AbstractCounterTestCase {
+
+public final class CounterTestCase extends TestCase {
 
     public static Test suite() throws Exception {
-        final Class test = CounterTestCase.class;
-        final BcelClassTransformerClassLoader classloader =
-            new BcelClassTransformerClassLoader(test.getPackage().getName());
-        final Class clazz = classloader.loadClass(test.getName());
-        return new TestSuite(clazz);
+
+    	final ClassTransformerClassLoader classloader =
+            new ClassTransformerClassLoader(new BcelClassTransformer());
+        
+        final Class clazz = classloader.loadClass(
+        		AbstractTransformerTestCase.getTestCaseClassName(
+        				CounterTestCase.class));
+
+        final TestSuite suite = new TestSuite(classloader.createImplementationOf(clazz));
+        suite.setName("BCEL " + clazz.getName());
+        return suite;
     }
  
 }

Modified: jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/bcel/DefaultConstructorTestCase.java
URL: http://svn.apache.org/viewvc/jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/bcel/DefaultConstructorTestCase.java?rev=411779&r1=411778&r2=411779&view=diff
==============================================================================
--- jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/bcel/DefaultConstructorTestCase.java (original)
+++ jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/bcel/DefaultConstructorTestCase.java Mon Jun  5 06:08:19 2006
@@ -1,18 +1,27 @@
 package org.apache.commons.javaflow.bytecode.transformation.bcel;
 
 import junit.framework.Test;
+import junit.framework.TestCase;
 import junit.framework.TestSuite;
-import org.apache.commons.javaflow.bytecode.transformation.tests.AbstractDefaultConstructorTestCase;
 
+import org.apache.commons.javaflow.bytecode.transformation.AbstractTransformerTestCase;
+import org.apache.commons.javaflow.bytecode.transformation.ClassTransformerClassLoader;
 
-public final class DefaultConstructorTestCase extends AbstractDefaultConstructorTestCase {
+
+public final class DefaultConstructorTestCase extends TestCase {
 
     public static Test suite() throws Exception {
-        final Class test = DefaultConstructorTestCase.class;
-        final BcelClassTransformerClassLoader classloader =
-            new BcelClassTransformerClassLoader(test.getPackage().getName());
-        final Class clazz = classloader.loadClass(test.getName());
-        return new TestSuite(clazz);
+
+    	final ClassTransformerClassLoader classloader =
+            new ClassTransformerClassLoader(new BcelClassTransformer());
+        
+        final Class clazz = classloader.loadClass(
+        		AbstractTransformerTestCase.getTestCaseClassName(
+        				DefaultConstructorTestCase.class));
+
+        final TestSuite suite = new TestSuite(classloader.createImplementationOf(clazz));
+        suite.setName("BCEL " + clazz.getName());
+        return suite;
     }
     
 }

Modified: jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/bcel/InvokerTestCase.java
URL: http://svn.apache.org/viewvc/jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/bcel/InvokerTestCase.java?rev=411779&r1=411778&r2=411779&view=diff
==============================================================================
--- jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/bcel/InvokerTestCase.java (original)
+++ jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/bcel/InvokerTestCase.java Mon Jun  5 06:08:19 2006
@@ -1,18 +1,27 @@
 package org.apache.commons.javaflow.bytecode.transformation.bcel;
 
 import junit.framework.Test;
+import junit.framework.TestCase;
 import junit.framework.TestSuite;
-import org.apache.commons.javaflow.bytecode.transformation.tests.AbstractInvokerTestCase;
 
+import org.apache.commons.javaflow.bytecode.transformation.AbstractTransformerTestCase;
+import org.apache.commons.javaflow.bytecode.transformation.ClassTransformerClassLoader;
 
-public final class InvokerTestCase extends AbstractInvokerTestCase {
+
+public final class InvokerTestCase extends TestCase {
 
     public static Test suite() throws Exception {
-        final Class test = InvokerTestCase.class;
-        final BcelClassTransformerClassLoader classloader =
-            new BcelClassTransformerClassLoader(test.getPackage().getName());
-        final Class clazz = classloader.loadClass(test.getName());
-        return new TestSuite(clazz);
+
+    	final ClassTransformerClassLoader classloader =
+            new ClassTransformerClassLoader(new BcelClassTransformer());
+        
+        final Class clazz = classloader.loadClass(
+        		AbstractTransformerTestCase.getTestCaseClassName(
+        				InvokerTestCase.class));
+
+        final TestSuite suite = new TestSuite(classloader.createImplementationOf(clazz));
+        suite.setName("BCEL " + clazz.getName());
+        return suite;
     }
     
 }

Modified: jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/bcel/NewObjectTestCase.java
URL: http://svn.apache.org/viewvc/jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/bcel/NewObjectTestCase.java?rev=411779&r1=411778&r2=411779&view=diff
==============================================================================
--- jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/bcel/NewObjectTestCase.java (original)
+++ jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/bcel/NewObjectTestCase.java Mon Jun  5 06:08:19 2006
@@ -1,18 +1,27 @@
 package org.apache.commons.javaflow.bytecode.transformation.bcel;
 
 import junit.framework.Test;
+import junit.framework.TestCase;
 import junit.framework.TestSuite;
-import org.apache.commons.javaflow.bytecode.transformation.tests.AbstractNewObjectTestCase;
 
+import org.apache.commons.javaflow.bytecode.transformation.AbstractTransformerTestCase;
+import org.apache.commons.javaflow.bytecode.transformation.ClassTransformerClassLoader;
 
-public final class NewObjectTestCase extends AbstractNewObjectTestCase {
+
+public final class NewObjectTestCase extends TestCase {
 
     public static Test suite() throws Exception {
-        final Class test = NewObjectTestCase.class;
-        final BcelClassTransformerClassLoader classloader =
-            new BcelClassTransformerClassLoader(test.getPackage().getName());
-        final Class clazz = classloader.loadClass(test.getName());
-        return new TestSuite(clazz);
+
+    	final ClassTransformerClassLoader classloader =
+            new ClassTransformerClassLoader(new BcelClassTransformer());
+        
+        final Class clazz = classloader.loadClass(
+        		AbstractTransformerTestCase.getTestCaseClassName(
+        				NewObjectTestCase.class));
+
+        final TestSuite suite = new TestSuite(classloader.createImplementationOf(clazz));
+        suite.setName("BCEL " + clazz.getName());
+        return suite;
     }
  
 }

Modified: jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/bcel/NoReferenceTestCase.java
URL: http://svn.apache.org/viewvc/jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/bcel/NoReferenceTestCase.java?rev=411779&r1=411778&r2=411779&view=diff
==============================================================================
--- jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/bcel/NoReferenceTestCase.java (original)
+++ jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/bcel/NoReferenceTestCase.java Mon Jun  5 06:08:19 2006
@@ -1,18 +1,27 @@
 package org.apache.commons.javaflow.bytecode.transformation.bcel;
 
 import junit.framework.Test;
+import junit.framework.TestCase;
 import junit.framework.TestSuite;
-import org.apache.commons.javaflow.bytecode.transformation.tests.AbstractNoReferenceTestCase;
 
+import org.apache.commons.javaflow.bytecode.transformation.AbstractTransformerTestCase;
+import org.apache.commons.javaflow.bytecode.transformation.ClassTransformerClassLoader;
 
-public final class NoReferenceTestCase extends AbstractNoReferenceTestCase {
+
+public final class NoReferenceTestCase extends TestCase {
 
     public static Test suite() throws Exception {
-        final Class test = NoReferenceTestCase.class;
-        final BcelClassTransformerClassLoader classloader =
-            new BcelClassTransformerClassLoader(test.getPackage().getName());
-        final Class clazz = classloader.loadClass(test.getName());
-        return new TestSuite(clazz);
+
+    	final ClassTransformerClassLoader classloader =
+            new ClassTransformerClassLoader(new BcelClassTransformer());
+        
+        final Class clazz = classloader.loadClass(
+        		AbstractTransformerTestCase.getTestCaseClassName(
+        				NoReferenceTestCase.class));
+
+        final TestSuite suite = new TestSuite(classloader.createImplementationOf(clazz));
+        suite.setName("BCEL " + clazz.getName());
+        return suite;
     }
    
 }

Modified: jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/bcel/ResumeTestCase.java
URL: http://svn.apache.org/viewvc/jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/bcel/ResumeTestCase.java?rev=411779&r1=411778&r2=411779&view=diff
==============================================================================
--- jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/bcel/ResumeTestCase.java (original)
+++ jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/bcel/ResumeTestCase.java Mon Jun  5 06:08:19 2006
@@ -1,18 +1,27 @@
 package org.apache.commons.javaflow.bytecode.transformation.bcel;
 
 import junit.framework.Test;
+import junit.framework.TestCase;
 import junit.framework.TestSuite;
-import org.apache.commons.javaflow.bytecode.transformation.tests.AbstractResumeTestCase;
 
+import org.apache.commons.javaflow.bytecode.transformation.AbstractTransformerTestCase;
+import org.apache.commons.javaflow.bytecode.transformation.ClassTransformerClassLoader;
 
-public final class ResumeTestCase extends AbstractResumeTestCase {
+
+public final class ResumeTestCase extends TestCase {
 
     public static Test suite() throws Exception {
-        final Class test = ResumeTestCase.class;
-        final BcelClassTransformerClassLoader classloader =
-            new BcelClassTransformerClassLoader(test.getPackage().getName());
-        final Class clazz = classloader.loadClass(test.getName());
-        return new TestSuite(clazz);
+
+    	final ClassTransformerClassLoader classloader =
+            new ClassTransformerClassLoader(new BcelClassTransformer());
+        
+        final Class clazz = classloader.loadClass(
+        		AbstractTransformerTestCase.getTestCaseClassName(
+        				ResumeTestCase.class));
+
+        final TestSuite suite = new TestSuite(classloader.createImplementationOf(clazz));
+        suite.setName("BCEL " + clazz.getName());
+        return suite;
     }
  
 }

Modified: jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/bcel/SerializationTestCase.java
URL: http://svn.apache.org/viewvc/jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/bcel/SerializationTestCase.java?rev=411779&r1=411778&r2=411779&view=diff
==============================================================================
--- jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/bcel/SerializationTestCase.java (original)
+++ jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/bcel/SerializationTestCase.java Mon Jun  5 06:08:19 2006
@@ -1,18 +1,27 @@
 package org.apache.commons.javaflow.bytecode.transformation.bcel;
 
 import junit.framework.Test;
+import junit.framework.TestCase;
 import junit.framework.TestSuite;
-import org.apache.commons.javaflow.bytecode.transformation.tests.AbstractSerializationTestCase;
 
+import org.apache.commons.javaflow.bytecode.transformation.AbstractTransformerTestCase;
+import org.apache.commons.javaflow.bytecode.transformation.ClassTransformerClassLoader;
 
-public final class SerializationTestCase extends AbstractSerializationTestCase {
+
+public final class SerializationTestCase extends TestCase {
 
     public static Test suite() throws Exception {
-        final Class test = SerializationTestCase.class;
-        final BcelClassTransformerClassLoader classloader =
-            new BcelClassTransformerClassLoader(test.getPackage().getName());
-        final Class clazz = classloader.loadClass(test.getName());
-        return new TestSuite(clazz);
+
+    	final ClassTransformerClassLoader classloader =
+            new ClassTransformerClassLoader(new BcelClassTransformer());
+        
+        final Class clazz = classloader.loadClass(
+        		AbstractTransformerTestCase.getTestCaseClassName(
+        				SerializationTestCase.class));
+
+        final TestSuite suite = new TestSuite(classloader.createImplementationOf(clazz));
+        suite.setName("BCEL " + clazz.getName());
+        return suite;
     }
  
 }

Modified: jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/bcel/SimpleTestCase.java
URL: http://svn.apache.org/viewvc/jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/bcel/SimpleTestCase.java?rev=411779&r1=411778&r2=411779&view=diff
==============================================================================
--- jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/bcel/SimpleTestCase.java (original)
+++ jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/bcel/SimpleTestCase.java Mon Jun  5 06:08:19 2006
@@ -1,19 +1,28 @@
 package org.apache.commons.javaflow.bytecode.transformation.bcel;
 
 import junit.framework.Test;
+import junit.framework.TestCase;
 import junit.framework.TestSuite;
-import org.apache.commons.javaflow.bytecode.transformation.tests.AbstractSimpleTestCase;
 
+import org.apache.commons.javaflow.bytecode.transformation.AbstractTransformerTestCase;
+import org.apache.commons.javaflow.bytecode.transformation.ClassTransformerClassLoader;
 
-public final class SimpleTestCase extends AbstractSimpleTestCase {
+
+public final class SimpleTestCase extends TestCase {
 
     public static Test suite() throws Exception {
-        final Class test = SimpleTestCase.class;
-        final BcelClassTransformerClassLoader classloader =
-            new BcelClassTransformerClassLoader(test.getPackage().getName());
-        final Class clazz = classloader.loadClass(test.getName());
-        return new TestSuite(clazz);
+
+    	final ClassTransformerClassLoader classloader =
+            new ClassTransformerClassLoader(new BcelClassTransformer());
+        
+        final Class clazz = classloader.loadClass(
+        		AbstractTransformerTestCase.getTestCaseClassName(
+        				SimpleTestCase.class));
+
+        final TestSuite suite = new TestSuite(classloader.createImplementationOf(clazz));
+        suite.setName("BCEL " + clazz.getName());
+        return suite;
     }
- 
+
 }
 

Modified: jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/bcel/StackTestCase.java
URL: http://svn.apache.org/viewvc/jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/bcel/StackTestCase.java?rev=411779&r1=411778&r2=411779&view=diff
==============================================================================
--- jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/bcel/StackTestCase.java (original)
+++ jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/bcel/StackTestCase.java Mon Jun  5 06:08:19 2006
@@ -1,18 +1,27 @@
 package org.apache.commons.javaflow.bytecode.transformation.bcel;
 
 import junit.framework.Test;
+import junit.framework.TestCase;
 import junit.framework.TestSuite;
-import org.apache.commons.javaflow.bytecode.transformation.tests.AbstractStackTestCase;
 
+import org.apache.commons.javaflow.bytecode.transformation.AbstractTransformerTestCase;
+import org.apache.commons.javaflow.bytecode.transformation.ClassTransformerClassLoader;
 
-public final class StackTestCase extends AbstractStackTestCase {
+
+public final class StackTestCase extends TestCase {
  
     public static Test suite() throws Exception {
-        final Class test = StackTestCase.class;
-        final BcelClassTransformerClassLoader classloader =
-            new BcelClassTransformerClassLoader(test.getPackage().getName());
-        final Class clazz = classloader.loadClass(test.getName());
-        return new TestSuite(clazz);
+
+    	final ClassTransformerClassLoader classloader =
+            new ClassTransformerClassLoader(new BcelClassTransformer());
+        
+        final Class clazz = classloader.loadClass(
+        		AbstractTransformerTestCase.getTestCaseClassName(
+        				StackTestCase.class));
+
+        final TestSuite suite = new TestSuite(classloader.createImplementationOf(clazz));
+        suite.setName("BCEL " + clazz.getName());
+        return suite;
     }
  
 }

Added: jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/rewrite/BlackRed.java
URL: http://svn.apache.org/viewvc/jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/rewrite/BlackRed.java?rev=411779&view=auto
==============================================================================
--- jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/rewrite/BlackRed.java (added)
+++ jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/rewrite/BlackRed.java Mon Jun  5 06:08:19 2006
@@ -0,0 +1,57 @@
+package org.apache.commons.javaflow.bytecode.transformation.rewrite;
+
+import org.apache.commons.javaflow.Continuation;
+
+import java.io.Serializable;
+
+
+/**
+ * Test for making sure that rstack works correctly. For this test we need to
+ * have a stack frame that goes through multiple objects of different types.
+ * 
+ * @author Kohsuke Kawaguchi
+ */
+public final class BlackRed implements Runnable, Serializable {
+
+  public void run() {
+    // new Black( new Red( new Black( new Suspend()))).run();
+    new Black( new Suspend()).run();
+  }
+
+  
+  class Black implements Runnable {
+    final Runnable r;
+
+    public Black( Runnable r) {
+      this.r = r;
+    }
+
+    public void run() {
+      String s = "foo"; // have some random variable
+      r.run();
+    }
+  }
+
+  
+  class Red implements Runnable {
+    final Runnable r;
+
+    public Red( Runnable r) {
+      this.r = r;
+    }
+
+    public void run() {
+      int i = 5; // have some random variable
+      r.run();
+    }
+  }
+
+  
+  class Suspend implements Runnable {
+    public void run() {
+      Continuation.suspend();
+    }
+  }
+
+}
+

Propchange: jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/rewrite/BlackRed.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/rewrite/BlackRed.java
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"

Added: jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/rewrite/ClassAccess1.java
URL: http://svn.apache.org/viewvc/jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/rewrite/ClassAccess1.java?rev=411779&view=auto
==============================================================================
--- jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/rewrite/ClassAccess1.java (added)
+++ jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/rewrite/ClassAccess1.java Mon Jun  5 06:08:19 2006
@@ -0,0 +1,14 @@
+package org.apache.commons.javaflow.bytecode.transformation.rewrite;
+
+import org.apache.commons.javaflow.Continuation;
+
+public final class ClassAccess1 implements Runnable {
+
+    public void run() {
+        final Class clazz1 = ClassAccess1.class;
+        final Class clazz2 = this.getClass();
+        
+        Continuation.suspend();
+    }
+
+}
\ No newline at end of file

Propchange: jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/rewrite/ClassAccess1.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/rewrite/ClassAccess1.java
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"

Added: jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/rewrite/ClassAccess2.java
URL: http://svn.apache.org/viewvc/jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/rewrite/ClassAccess2.java?rev=411779&view=auto
==============================================================================
--- jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/rewrite/ClassAccess2.java (added)
+++ jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/rewrite/ClassAccess2.java Mon Jun  5 06:08:19 2006
@@ -0,0 +1,10 @@
+package org.apache.commons.javaflow.bytecode.transformation.rewrite;
+
+
+public final class ClassAccess2 implements Runnable {
+
+    public void run() {
+        Object o = ClassAccess2.class;
+    }
+    
+}

Propchange: jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/rewrite/ClassAccess2.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/rewrite/ClassAccess2.java
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"

Added: jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/rewrite/ClassAccess3.java
URL: http://svn.apache.org/viewvc/jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/rewrite/ClassAccess3.java?rev=411779&view=auto
==============================================================================
--- jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/rewrite/ClassAccess3.java (added)
+++ jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/rewrite/ClassAccess3.java Mon Jun  5 06:08:19 2006
@@ -0,0 +1,58 @@
+package org.apache.commons.javaflow.bytecode.transformation.rewrite;
+
+import org.apache.commons.javaflow.Continuation;
+
+public final class ClassAccess3 implements Runnable {
+
+    /*
+       L0 (0)
+        GETSTATIC ClassAccess2.class$0 : Class
+        DUP
+        IFNONNULL L1
+        POP
+       
+       L2 (5)
+        LDC "asm.data.ClassAccess2"
+        INVOKESTATIC Class.forName(String) : Class
+       
+       L3 (8)
+        DUP
+        PUTSTATIC ClassAccess2.class$0 : Class
+        GOTO L1
+       
+       L4 (12)
+        NEW NoClassDefFoundError
+        DUP_X1
+        SWAP
+        INVOKEVIRTUAL Throwable.getMessage() : String
+        INVOKESPECIAL NoClassDefFoundError.<init>(String) : void
+        ATHROW
+       
+       L1 (19)
+        ASTORE 1: clazz1
+       L5 (21)
+        INVOKESTATIC Continuation.suspend() : void
+       L6 (23)
+        RETURN
+
+       L7 (25)
+        TRYCATCHBLOCK L2 L3 L4 ClassNotFoundException
+     */
+  
+    static Class class$0;
+  
+    public void run() {
+        // final Class clazz1 = ClassAccess2.class;
+        // final Class clazz2 = this.getClass();
+        // if(class$0==null) {
+          try {
+            class$0 = Class.forName("asm.data.ClassAccess2");
+          } catch(ClassNotFoundException ex) {
+            throw new NoClassDefFoundError(ex.getMessage());
+          }
+        // }
+        
+        Continuation.suspend();
+    }
+
+}
\ No newline at end of file

Propchange: jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/rewrite/ClassAccess3.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/rewrite/ClassAccess3.java
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"

Added: jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/rewrite/CounterFlow.java
URL: http://svn.apache.org/viewvc/jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/rewrite/CounterFlow.java?rev=411779&view=auto
==============================================================================
--- jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/rewrite/CounterFlow.java (added)
+++ jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/rewrite/CounterFlow.java Mon Jun  5 06:08:19 2006
@@ -0,0 +1,24 @@
+package org.apache.commons.javaflow.bytecode.transformation.rewrite;
+
+import org.apache.commons.javaflow.Continuation;
+
+
+/**
+ * @author Kohsuke Kawaguchi
+ */
+public final class CounterFlow implements Runnable {
+
+  final int up;
+
+  public CounterFlow( int up) {
+    this.up = up;
+  }
+
+  public void run() {
+    for( int i = 0; i < up; i++) {
+      System.err.println(i);
+      Continuation.suspend();
+    }
+  }
+}
+

Propchange: jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/rewrite/CounterFlow.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/rewrite/CounterFlow.java
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"

Added: jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/rewrite/DefaultConstructor.java
URL: http://svn.apache.org/viewvc/jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/rewrite/DefaultConstructor.java?rev=411779&view=auto
==============================================================================
--- jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/rewrite/DefaultConstructor.java (added)
+++ jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/rewrite/DefaultConstructor.java Mon Jun  5 06:08:19 2006
@@ -0,0 +1,12 @@
+package org.apache.commons.javaflow.bytecode.transformation.rewrite;
+
+
+public final class DefaultConstructor implements Runnable {
+
+    public DefaultConstructor() {
+    }
+    
+    public void run() {
+    }
+    
+}

Propchange: jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/rewrite/DefaultConstructor.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/rewrite/DefaultConstructor.java
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"

Added: jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/rewrite/NewObject.java
URL: http://svn.apache.org/viewvc/jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/rewrite/NewObject.java?rev=411779&view=auto
==============================================================================
--- jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/rewrite/NewObject.java (added)
+++ jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/rewrite/NewObject.java Mon Jun  5 06:08:19 2006
@@ -0,0 +1,25 @@
+package org.apache.commons.javaflow.bytecode.transformation.rewrite;
+
+import junit.framework.Assert;
+
+
+/**
+ * Test that allocates a lot of new objects. Javaflow performs some tricky
+ * instrumentation on new object allocations, especially when it has arguments.
+ * Nesting object allocations makes it even more interesting.
+ * 
+ * @author Kohsuke Kawaguchi
+ */
+public final class NewObject implements Runnable {
+  static char[] ch = { 'a', 'b', 'c'};
+  
+  public void run() {
+
+    String s = new String( new String( new String( ch, 0, ch.length).toCharArray(), 0, ch.length));
+    // String s = new String( new String( ch).toCharArray());
+
+    Assert.assertEquals( s, "abc");
+  }
+
+}
+

Propchange: jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/rewrite/NewObject.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/rewrite/NewObject.java
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"

Added: jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/rewrite/NoReference.java
URL: http://svn.apache.org/viewvc/jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/rewrite/NoReference.java?rev=411779&view=auto
==============================================================================
--- jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/rewrite/NoReference.java (added)
+++ jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/rewrite/NoReference.java Mon Jun  5 06:08:19 2006
@@ -0,0 +1,13 @@
+package org.apache.commons.javaflow.bytecode.transformation.rewrite;
+
+import org.apache.commons.javaflow.Continuation;
+
+
+public final class NoReference implements Runnable {
+
+  public void run() {
+    new Object();
+    Continuation.suspend();
+  }
+
+}
\ No newline at end of file

Propchange: jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/rewrite/NoReference.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/rewrite/NoReference.java
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"

Added: jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/rewrite/NullVariableMethodFlow.java
URL: http://svn.apache.org/viewvc/jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/rewrite/NullVariableMethodFlow.java?rev=411779&view=auto
==============================================================================
--- jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/rewrite/NullVariableMethodFlow.java (added)
+++ jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/rewrite/NullVariableMethodFlow.java Mon Jun  5 06:08:19 2006
@@ -0,0 +1,33 @@
+package org.apache.commons.javaflow.bytecode.transformation.rewrite;
+
+import java.util.Properties;
+
+/**
+ * A regression test case for handling null in the local variables.
+ *
+ * @author Kohsuke Kawaguchi
+ */
+public class NullVariableMethodFlow implements Runnable {
+
+    public void run() {
+        getLocalAddress(System.getProperties());
+    }
+
+    public static String getLocalAddress(Properties session) {
+        String x = null, y;
+
+        // when javaflow generates the store/load code around this invocation,
+        // x is of the type 'null'. we have to restore the local variable
+        // in the correct type (in particular not java/lang/Object, but "null")
+        // or otherwise VerifyError occurs.
+        y = session.getProperty("a");
+        if (y == null) {
+            x = session.getProperty("b");
+        }
+
+        if (y == null)
+            y = x;
+
+        return y;
+    }
+}

Propchange: jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/rewrite/NullVariableMethodFlow.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/rewrite/NullVariableMethodFlow.java
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"

Added: jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/rewrite/Simple.java
URL: http://svn.apache.org/viewvc/jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/rewrite/Simple.java?rev=411779&view=auto
==============================================================================
--- jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/rewrite/Simple.java (added)
+++ jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/rewrite/Simple.java Mon Jun  5 06:08:19 2006
@@ -0,0 +1,22 @@
+package org.apache.commons.javaflow.bytecode.transformation.rewrite;
+
+import org.apache.commons.javaflow.Continuation;
+
+public final class Simple implements Runnable {
+
+    public int g = -1; // global count throughout all continuations
+    public int l = -1; // local count mapped to a global variable so
+                       // we can access is
+    
+    public void run() {
+        int local = -1;
+        ++g; l=++local;
+        Continuation.suspend();
+        ++g; l=++local;
+        Continuation.suspend();
+        ++g; l=++local;
+        Continuation.suspend();
+        ++g; l=++local;
+    }
+
+}
\ No newline at end of file

Propchange: jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/rewrite/Simple.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/rewrite/Simple.java
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"



---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message