commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tcu...@apache.org
Subject svn commit: r367531 [2/2] - in /jakarta/commons/sandbox/javaflow/trunk: ./ src/test/org/apache/commons/javaflow/ src/test/org/apache/commons/javaflow/bytecode/transformation/ src/test/org/apache/commons/javaflow/bytecode/transformation/asm/ src/test/or...
Date Tue, 10 Jan 2006 09:16:34 GMT
Copied: jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/data/NewObject.java
(from r367530, jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/asm/data/NewObject.java)
URL: http://svn.apache.org/viewcvs/jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/data/NewObject.java?p2=jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/data/NewObject.java&p1=jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/asm/data/NewObject.java&r1=367530&r2=367531&rev=367531&view=diff
==============================================================================
--- jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/asm/data/NewObject.java
(original)
+++ jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/data/NewObject.java
Tue Jan 10 01:15:39 2006
@@ -1,4 +1,4 @@
-package org.apache.commons.javaflow.bytecode.transformation.asm.data;
+package org.apache.commons.javaflow.bytecode.transformation.data;
 
 import junit.framework.Assert;
 

Copied: jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/data/NoReference.java
(from r367530, jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/asm/data/NoReference.java)
URL: http://svn.apache.org/viewcvs/jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/data/NoReference.java?p2=jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/data/NoReference.java&p1=jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/asm/data/NoReference.java&r1=367530&r2=367531&rev=367531&view=diff
==============================================================================
--- jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/asm/data/NoReference.java
(original)
+++ jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/data/NoReference.java
Tue Jan 10 01:15:39 2006
@@ -1,4 +1,4 @@
-package org.apache.commons.javaflow.bytecode.transformation.asm.data;
+package org.apache.commons.javaflow.bytecode.transformation.data;
 
 import org.apache.commons.javaflow.Continuation;
 

Copied: jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/data/NullVariableMethodFlow.java
(from r366393, jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/flow/NullVariableMethodFlow.java)
URL: http://svn.apache.org/viewcvs/jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/data/NullVariableMethodFlow.java?p2=jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/data/NullVariableMethodFlow.java&p1=jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/flow/NullVariableMethodFlow.java&r1=366393&r2=367531&rev=367531&view=diff
==============================================================================
--- jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/flow/NullVariableMethodFlow.java
(original)
+++ jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/data/NullVariableMethodFlow.java
Tue Jan 10 01:15:39 2006
@@ -1,8 +1,6 @@
-package org.apache.commons.javaflow.flow;
+package org.apache.commons.javaflow.bytecode.transformation.data;
 
 import java.util.Properties;
-import java.util.NoSuchElementException;
-import java.util.Vector;
 
 /**
  * A regression test case for handling null in the local variables.

Copied: jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/data/Simple.java
(from r367530, jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/asm/data/Simple.java)
URL: http://svn.apache.org/viewcvs/jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/data/Simple.java?p2=jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/data/Simple.java&p1=jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/asm/data/Simple.java&r1=367530&r2=367531&rev=367531&view=diff
==============================================================================
--- jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/asm/data/Simple.java
(original)
+++ jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/data/Simple.java
Tue Jan 10 01:15:39 2006
@@ -1,4 +1,4 @@
-package org.apache.commons.javaflow.bytecode.transformation.asm.data;
+package org.apache.commons.javaflow.bytecode.transformation.data;
 
 import org.apache.commons.javaflow.Continuation;
 

Copied: jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/data/SimpleSerializable.java
(from r367530, jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/asm/data/SimpleSerializable.java)
URL: http://svn.apache.org/viewcvs/jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/data/SimpleSerializable.java?p2=jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/data/SimpleSerializable.java&p1=jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/asm/data/SimpleSerializable.java&r1=367530&r2=367531&rev=367531&view=diff
==============================================================================
--- jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/asm/data/SimpleSerializable.java
(original)
+++ jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/data/SimpleSerializable.java
Tue Jan 10 01:15:39 2006
@@ -1,4 +1,4 @@
-package org.apache.commons.javaflow.bytecode.transformation.asm.data;
+package org.apache.commons.javaflow.bytecode.transformation.data;
 
 import java.io.Serializable;
 import org.apache.commons.javaflow.Continuation;

Copied: jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/data/Stack.java
(from r367530, jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/asm/data/Stack.java)
URL: http://svn.apache.org/viewcvs/jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/data/Stack.java?p2=jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/data/Stack.java&p1=jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/asm/data/Stack.java&r1=367530&r2=367531&rev=367531&view=diff
==============================================================================
--- jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/asm/data/Stack.java
(original)
+++ jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/data/Stack.java
Tue Jan 10 01:15:39 2006
@@ -1,4 +1,4 @@
-package org.apache.commons.javaflow.bytecode.transformation.asm.data;
+package org.apache.commons.javaflow.bytecode.transformation.data;
 
 /**
  * Regression test case.

Added: jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/tests/AbstractBlackRedTestCase.java
URL: http://svn.apache.org/viewcvs/jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/tests/AbstractBlackRedTestCase.java?rev=367531&view=auto
==============================================================================
--- jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/tests/AbstractBlackRedTestCase.java
(added)
+++ jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/tests/AbstractBlackRedTestCase.java
Tue Jan 10 01:15:39 2006
@@ -0,0 +1,16 @@
+package org.apache.commons.javaflow.bytecode.transformation.tests;
+
+import org.apache.commons.javaflow.Continuation;
+import org.apache.commons.javaflow.bytecode.transformation.AbstractTransformerTestCase;
+import org.apache.commons.javaflow.bytecode.transformation.data.BlackRed;
+
+public abstract class AbstractBlackRedTestCase extends AbstractTransformerTestCase {
+
+    public void testBlackRed() {
+        final Runnable r = new BlackRed();
+        final Continuation c1 = Continuation.startWith(r);
+        assertTrue(c1 != null);
+        final Continuation c2 = Continuation.continueWith(c1);
+        assertTrue(c2 == null);
+    }
+}

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

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

Added: jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/tests/AbstractClassAccessTestCase.java
URL: http://svn.apache.org/viewcvs/jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/tests/AbstractClassAccessTestCase.java?rev=367531&view=auto
==============================================================================
--- jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/tests/AbstractClassAccessTestCase.java
(added)
+++ jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/tests/AbstractClassAccessTestCase.java
Tue Jan 10 01:15:39 2006
@@ -0,0 +1,21 @@
+package org.apache.commons.javaflow.bytecode.transformation.tests;
+
+import org.apache.commons.javaflow.Continuation;
+import org.apache.commons.javaflow.bytecode.transformation.AbstractTransformerTestCase;
+import org.apache.commons.javaflow.bytecode.transformation.data.ClassAccess1;
+import org.apache.commons.javaflow.bytecode.transformation.data.ClassAccess2;
+
+public abstract class AbstractClassAccessTestCase extends AbstractTransformerTestCase {
+
+    public void testClassAccess1() throws Exception {
+        final ClassAccess1 r = new ClassAccess1();
+        final Continuation c = Continuation.startWith(r);
+        assertTrue(c != null);
+    }
+    
+    public void testClassAccess2() throws Exception {
+        final ClassAccess2 r = new ClassAccess2();
+        final Continuation c = Continuation.startWith(r);
+        assertTrue(c != null);
+    }
+}

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

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

Added: jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/tests/AbstractCounterTestCase.java
URL: http://svn.apache.org/viewcvs/jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/tests/AbstractCounterTestCase.java?rev=367531&view=auto
==============================================================================
--- jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/tests/AbstractCounterTestCase.java
(added)
+++ jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/tests/AbstractCounterTestCase.java
Tue Jan 10 01:15:39 2006
@@ -0,0 +1,20 @@
+package org.apache.commons.javaflow.bytecode.transformation.tests;
+
+import org.apache.commons.javaflow.Continuation;
+import org.apache.commons.javaflow.bytecode.transformation.AbstractTransformerTestCase;
+import org.apache.commons.javaflow.bytecode.transformation.data.CounterFlow;
+
+public abstract class AbstractCounterTestCase extends AbstractTransformerTestCase {
+
+    public void testCounter() {
+        final int count = 5;
+        final Runnable r = new CounterFlow(count);
+        int i = 0;
+        Continuation c = Continuation.startWith(r);
+        while (c != null) {
+            c = Continuation.continueWith(c);
+            i++;
+        }
+        assertTrue(i == count);
+    }
+}

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

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

Added: jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/tests/AbstractDefaultConstructorTestCase.java
URL: http://svn.apache.org/viewcvs/jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/tests/AbstractDefaultConstructorTestCase.java?rev=367531&view=auto
==============================================================================
--- jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/tests/AbstractDefaultConstructorTestCase.java
(added)
+++ jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/tests/AbstractDefaultConstructorTestCase.java
Tue Jan 10 01:15:39 2006
@@ -0,0 +1,14 @@
+package org.apache.commons.javaflow.bytecode.transformation.tests;
+
+import junit.framework.TestCase;
+import org.apache.commons.javaflow.Continuation;
+import org.apache.commons.javaflow.bytecode.transformation.data.DefaultConstructor;
+
+public class AbstractDefaultConstructorTestCase extends TestCase {
+
+    public void testInvoker() {
+        Runnable o = new DefaultConstructor();
+        Continuation c = Continuation.startWith(o);
+        assertTrue(c == null);
+    }
+}

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

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

Added: jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/tests/AbstractInvokerTestCase.java
URL: http://svn.apache.org/viewcvs/jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/tests/AbstractInvokerTestCase.java?rev=367531&view=auto
==============================================================================
--- jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/tests/AbstractInvokerTestCase.java
(added)
+++ jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/tests/AbstractInvokerTestCase.java
Tue Jan 10 01:15:39 2006
@@ -0,0 +1,15 @@
+package org.apache.commons.javaflow.bytecode.transformation.tests;
+
+import org.apache.commons.javaflow.Continuation;
+import org.apache.commons.javaflow.bytecode.transformation.AbstractTransformerTestCase;
+import org.apache.commons.javaflow.bytecode.transformation.Invoker;
+
+public abstract class AbstractInvokerTestCase extends AbstractTransformerTestCase {
+
+    public void testInvoker() {
+        Runnable r = new Thread();
+        Runnable o = new Invoker(r);
+        Continuation c = Continuation.startWith(o);
+        assertTrue(c != null);
+    }
+}

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

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

Added: jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/tests/AbstractNewObjectTestCase.java
URL: http://svn.apache.org/viewcvs/jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/tests/AbstractNewObjectTestCase.java?rev=367531&view=auto
==============================================================================
--- jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/tests/AbstractNewObjectTestCase.java
(added)
+++ jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/tests/AbstractNewObjectTestCase.java
Tue Jan 10 01:15:39 2006
@@ -0,0 +1,14 @@
+package org.apache.commons.javaflow.bytecode.transformation.tests;
+
+import org.apache.commons.javaflow.Continuation;
+import org.apache.commons.javaflow.bytecode.transformation.AbstractTransformerTestCase;
+import org.apache.commons.javaflow.bytecode.transformation.data.NewObject;
+
+public abstract class AbstractNewObjectTestCase extends AbstractTransformerTestCase {
+
+    public void testNewObject() throws Exception {
+        final Runnable r = new NewObject();
+        final Continuation c = Continuation.startWith(r);
+        assertTrue(c == null);
+    }
+}

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

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

Added: jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/tests/AbstractNoReferenceTestCase.java
URL: http://svn.apache.org/viewcvs/jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/tests/AbstractNoReferenceTestCase.java?rev=367531&view=auto
==============================================================================
--- jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/tests/AbstractNoReferenceTestCase.java
(added)
+++ jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/tests/AbstractNoReferenceTestCase.java
Tue Jan 10 01:15:39 2006
@@ -0,0 +1,14 @@
+package org.apache.commons.javaflow.bytecode.transformation.tests;
+
+import org.apache.commons.javaflow.Continuation;
+import org.apache.commons.javaflow.bytecode.transformation.AbstractTransformerTestCase;
+import org.apache.commons.javaflow.bytecode.transformation.data.NoReference;
+
+public abstract class AbstractNoReferenceTestCase extends AbstractTransformerTestCase {
+
+    public void testNoReference() throws Exception {
+        final Runnable r = new NoReference();
+        final Continuation c = Continuation.startWith(r);
+        assertTrue(c != null);
+    }
+}

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

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

Added: jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/tests/AbstractResumeTestCase.java
URL: http://svn.apache.org/viewcvs/jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/tests/AbstractResumeTestCase.java?rev=367531&view=auto
==============================================================================
--- jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/tests/AbstractResumeTestCase.java
(added)
+++ jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/tests/AbstractResumeTestCase.java
Tue Jan 10 01:15:39 2006
@@ -0,0 +1,42 @@
+package org.apache.commons.javaflow.bytecode.transformation.tests;
+
+import org.apache.commons.javaflow.Continuation;
+import org.apache.commons.javaflow.bytecode.transformation.AbstractTransformerTestCase;
+import org.apache.commons.javaflow.bytecode.transformation.data.SimpleSerializable;
+
+public abstract class AbstractResumeTestCase extends AbstractTransformerTestCase {
+
+    public void testSimpleSuspendResume() throws Exception {
+        final SimpleSerializable r = new SimpleSerializable();
+        assertTrue(r.g == -1);
+        assertTrue(r.l == -1);
+        Continuation c1 = Continuation.startWith(r);
+        assertTrue(r.g == 0);
+        assertTrue(r.l == 0);
+        Continuation c2 = Continuation.continueWith(c1);
+        assertTrue(r.g == 1);
+        assertTrue(r.l == 1);
+        Continuation c3 = Continuation.continueWith(c2);
+        assertTrue(r.g == 2);
+        assertTrue(r.l == 2);
+    }
+
+
+    public void testContinuationBranching() throws Exception {
+        final SimpleSerializable r = new SimpleSerializable();
+        assertTrue(r.g == -1);
+        assertTrue(r.l == -1);
+        Continuation c1 = Continuation.startWith(r);
+        assertTrue(r.g == 0);
+        assertTrue(r.l == 0);
+        Continuation c2 = Continuation.continueWith(c1);
+        assertTrue(r.g == 1);
+        assertTrue(r.l == 1);
+        Continuation c31 = Continuation.continueWith(c2);
+        assertTrue(r.g == 2);
+        assertTrue(r.l == 2);
+        Continuation c32 = Continuation.continueWith(c2);
+        assertTrue(r.g == 3);
+        assertTrue(r.l == 2);
+    }
+}

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

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

Added: jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/tests/AbstractSerializationTestCase.java
URL: http://svn.apache.org/viewcvs/jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/tests/AbstractSerializationTestCase.java?rev=367531&view=auto
==============================================================================
--- jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/tests/AbstractSerializationTestCase.java
(added)
+++ jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/tests/AbstractSerializationTestCase.java
Tue Jan 10 01:15:39 2006
@@ -0,0 +1,72 @@
+package org.apache.commons.javaflow.bytecode.transformation.tests;
+
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.FileReader;
+import junitx.util.PrivateAccessor;
+import org.apache.commons.javaflow.Continuation;
+import org.apache.commons.javaflow.bytecode.transformation.AbstractTransformerTestCase;
+import org.apache.commons.javaflow.bytecode.transformation.Invoker;
+import org.apache.commons.javaflow.bytecode.transformation.data.Simple;
+import org.apache.commons.javaflow.bytecode.transformation.data.SimpleSerializable;
+import org.apache.tools.ant.util.FileUtils;
+import com.thoughtworks.xstream.XStream;
+import com.thoughtworks.xstream.io.xml.DomDriver;
+
+public abstract class AbstractSerializationTestCase extends AbstractTransformerTestCase {
+
+    private File output;
+
+
+    public void testSuspend() throws Exception {
+        final SimpleSerializable r = new SimpleSerializable();
+        assertTrue(r.g == -1);
+        assertTrue(r.l == -1);
+        Continuation c1 = Continuation.startWith(r);
+        assertTrue(r.g == 0);
+        assertTrue(r.l == 0);
+        final XStream xstream = new XStream(new DomDriver());
+        final String xml = xstream.toXML(c1);
+        output = File.createTempFile("continuation", "xml");
+        output.deleteOnExit();
+        final FileOutputStream fos = new FileOutputStream(output);
+        fos.write(xml.getBytes());
+    }
+
+
+    public void testResume() throws Exception {
+        testSuspend();
+        assertTrue("suspend must succeed to create the output first", output != null);
+        final String xml = FileUtils.readFully(new FileReader(output));
+        final XStream xstream = new XStream(new DomDriver());
+        final Object o = xstream.fromXML(xml);
+        assertTrue(o instanceof Continuation);
+        final Continuation c1 = (Continuation) o;
+        final SimpleSerializable r1 = (SimpleSerializable) PrivateAccessor.getField(PrivateAccessor
+                .getField(c1, "stackRecorder"), "runnable");
+        assertTrue(r1.g == 0);
+        assertTrue(r1.l == 0);
+        final Continuation c2 = Continuation.continueWith(c1);
+        final SimpleSerializable r2 = (SimpleSerializable) PrivateAccessor.getField(PrivateAccessor
+                .getField(c1, "stackRecorder"), "runnable");
+        assertTrue(r2.g == 1);
+        assertTrue(r2.l == 1);
+        assertTrue(r1 == r2);
+    }
+
+
+    public void testSerializableCheck() throws Exception {
+        final Runnable r1 = new Simple();
+        Continuation c1 = Continuation.startWith(r1);
+        assertTrue(c1 != null);
+        assertTrue(!c1.isSerializable());
+        final Runnable r2 = new SimpleSerializable();
+        Continuation c2 = Continuation.startWith(r2);
+        assertTrue(c2 != null);
+        assertTrue(c2.isSerializable());
+        final Runnable r3 = new SimpleSerializable();
+        Continuation c3 = Continuation.startWith(new Invoker(r3));
+        assertTrue(c3 != null);
+        assertTrue(c3.isSerializable());
+    }
+}

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

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

Added: jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/tests/AbstractSimpleTestCase.java
URL: http://svn.apache.org/viewcvs/jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/tests/AbstractSimpleTestCase.java?rev=367531&view=auto
==============================================================================
--- jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/tests/AbstractSimpleTestCase.java
(added)
+++ jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/tests/AbstractSimpleTestCase.java
Tue Jan 10 01:15:39 2006
@@ -0,0 +1,14 @@
+package org.apache.commons.javaflow.bytecode.transformation.tests;
+
+import org.apache.commons.javaflow.Continuation;
+import org.apache.commons.javaflow.bytecode.transformation.AbstractTransformerTestCase;
+import org.apache.commons.javaflow.bytecode.transformation.data.Simple;
+
+public abstract class AbstractSimpleTestCase extends AbstractTransformerTestCase {
+
+    public void testSimpleSuspend() throws Exception {
+        final Runnable r = new Simple();
+        final Continuation c = Continuation.startWith(r);
+        assertTrue(c != null);
+    }
+}

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

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

Added: jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/tests/AbstractStackTestCase.java
URL: http://svn.apache.org/viewcvs/jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/tests/AbstractStackTestCase.java?rev=367531&view=auto
==============================================================================
--- jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/tests/AbstractStackTestCase.java
(added)
+++ jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/tests/AbstractStackTestCase.java
Tue Jan 10 01:15:39 2006
@@ -0,0 +1,14 @@
+package org.apache.commons.javaflow.bytecode.transformation.tests;
+
+import org.apache.commons.javaflow.Continuation;
+import org.apache.commons.javaflow.bytecode.transformation.AbstractTransformerTestCase;
+import org.apache.commons.javaflow.bytecode.transformation.data.Stack;
+
+public abstract class AbstractStackTestCase extends AbstractTransformerTestCase {
+
+    public void testStack() throws Exception {
+        final Runnable r = new Stack();
+        final Continuation c = Continuation.startWith(r);
+        assertTrue(c == null);
+    }
+}

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

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

Added: jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/tests/RewritingTestCase.java
URL: http://svn.apache.org/viewcvs/jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/tests/RewritingTestCase.java?rev=367531&view=auto
==============================================================================
--- jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/tests/RewritingTestCase.java
(added)
+++ jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/tests/RewritingTestCase.java
Tue Jan 10 01:15:39 2006
@@ -0,0 +1,44 @@
+package org.apache.commons.javaflow.bytecode.transformation.tests;
+
+import org.apache.commons.javaflow.bytecode.transformation.AbstractTransformerTestCase;
+
+
+public final class RewritingTestCase extends AbstractTransformerTestCase {
+
+//    public void testBlackRed() throws Exception {
+//        assertSameTransformation("org.apache.commons.javaflow.bytecode.transformation.data.BlackRed");
+//    }
+//    public void testClassAccess1() throws Exception {
+//        assertSameTransformation("org.apache.commons.javaflow.bytecode.transformation.data.ClassAccess1");
+//    }
+//    public void testClassAccess2() throws Exception {
+//        assertSameTransformation("org.apache.commons.javaflow.bytecode.transformation.data.ClassAccess2");
+//    }
+//    public void testClassAccess3() throws Exception {
+//        assertSameTransformation("org.apache.commons.javaflow.bytecode.transformation.data.ClassAccess3");
+//    }
+//    public void testCounterFlow() throws Exception {
+//        assertSameTransformation("org.apache.commons.javaflow.bytecode.transformation.data.CounterFlow");
+//    }
+//    public void testDefaultConstructor() throws Exception {
+//        assertSameTransformation("org.apache.commons.javaflow.bytecode.transformation.data.DefaultConstructor");
+//    }
+//    public void testNewObject() throws Exception {
+//        assertSameTransformation("org.apache.commons.javaflow.bytecode.transformation.data.NewObject");
+//    }
+//    public void testNoReference() throws Exception {
+//        assertSameTransformation("org.apache.commons.javaflow.bytecode.transformation.data.NoReference");
+//    }
+//    public void testNullVariableMethodFlow() throws Exception {
+//        assertSameTransformation("org.apache.commons.javaflow.bytecode.transformation.data.NullVariableMethodFlow");
+//    }
+//    public void testSimple() throws Exception {
+//        assertSameTransformation("org.apache.commons.javaflow.bytecode.transformation.data.Simple");
+//    }
+//    public void testSimpleSerializable() throws Exception {
+//        assertSameTransformation("org.apache.commons.javaflow.bytecode.transformation.data.SimpleSerializable");
+//    }
+//    public void testStack() throws Exception {
+//        assertSameTransformation("org.apache.commons.javaflow.bytecode.transformation.data.Stack");
+//    }
+}

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

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

Added: jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/tests/UsageTestCase.java
URL: http://svn.apache.org/viewcvs/jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/tests/UsageTestCase.java?rev=367531&view=auto
==============================================================================
--- jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/tests/UsageTestCase.java
(added)
+++ jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/bytecode/transformation/tests/UsageTestCase.java
Tue Jan 10 01:15:39 2006
@@ -0,0 +1,20 @@
+package org.apache.commons.javaflow.bytecode.transformation.tests;
+
+import junit.framework.TestCase;
+import org.apache.commons.javaflow.bytecode.transformation.data.Simple;
+
+
+
+public final class UsageTestCase extends TestCase {
+    
+    public void testIncorrectUsageWithNormalClassLoader() throws Exception {
+        try {
+            final Runnable r = new Simple();
+            r.run();
+            fail();
+        } catch (final Exception e) {
+            assertTrue(e instanceof IllegalStateException);
+        }
+    }
+    
+}

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

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



---------------------------------------------------------------------
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