commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tcu...@apache.org
Subject svn commit: r327837 - in /jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow: RewritingTestCase.java SerializationTestCase.java flow/ClassAccessBugFlow.java flow/CounterFlow.java flow/NoReferenceBugFlow.java
Date Sun, 23 Oct 2005 18:58:09 GMT
Author: tcurdt
Date: Sun Oct 23 11:57:59 2005
New Revision: 327837

URL: http://svn.apache.org/viewcvs?rev=327837&view=rev
Log:
some more testcases


Added:
    jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/flow/ClassAccessBugFlow.java
  (with props)
    jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/flow/NoReferenceBugFlow.java
  (with props)
Modified:
    jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/RewritingTestCase.java
    jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/SerializationTestCase.java
    jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/flow/CounterFlow.java

Modified: jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/RewritingTestCase.java
URL: http://svn.apache.org/viewcvs/jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/RewritingTestCase.java?rev=327837&r1=327836&r2=327837&view=diff
==============================================================================
--- jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/RewritingTestCase.java
(original)
+++ jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/RewritingTestCase.java
Sun Oct 23 11:57:59 2005
@@ -1,8 +1,10 @@
 package org.apache.commons.javaflow;
 
 import org.apache.commons.javaflow.flow.BlackRedFlow;
+import org.apache.commons.javaflow.flow.ClassAccessBugFlow;
 import org.apache.commons.javaflow.flow.CounterFlow;
 import org.apache.commons.javaflow.flow.NewObjectFlow;
+import org.apache.commons.javaflow.flow.NoReferenceBugFlow;
 import org.apache.commons.javaflow.flow.StackBugFlow;
 
 
@@ -19,6 +21,18 @@
         final Continuation c = Continuation.startWith(r);
         assertTrue(c == null);
     }
+
+    public void testNoReferenceBug() throws Exception {
+        final Runnable r = new NoReferenceBugFlow();
+        final Continuation c = Continuation.startWith(r);
+        assertTrue(c != null);
+    }
+
+    public void testClassAccessBug() throws Exception {
+        final Runnable r = new ClassAccessBugFlow();
+        final Continuation c = Continuation.startWith(r);
+        assertTrue(c != null);
+    }
     
     public void testBlackRed() throws Exception {
         final Runnable r = new BlackRedFlow();
@@ -30,7 +44,7 @@
     
     public void testCounter() throws Exception {
         final int count = 5;
-        final Runnable r = new CounterFlow(new Integer(count));
+        final Runnable r = new CounterFlow(count);
         
         int i = 0;
         for(Continuation c = Continuation.startWith(r); c != null; c = Continuation.continueWith(c))
{

Modified: jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/SerializationTestCase.java
URL: http://svn.apache.org/viewcvs/jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/SerializationTestCase.java?rev=327837&r1=327836&r2=327837&view=diff
==============================================================================
--- jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/SerializationTestCase.java
(original)
+++ jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/SerializationTestCase.java
Sun Oct 23 11:57:59 2005
@@ -65,17 +65,21 @@
     }
     
     public void testSerializableCheck() throws Exception {
-        final Runnable r1 = new SimpleSerializableFlow();
+        final Runnable r1 = new SimpleFlow();
         Continuation c1 = Continuation.startWith(r1);
-        assertTrue(c1.isSerializable());
+        assertTrue(c1 != null);
+        assertTrue(!c1.isSerializable());
 
         final Runnable r2 = new SimpleSerializableFlow();
-        Continuation c2 = Continuation.startWith(new Invoker(r2));
+        Continuation c2 = Continuation.startWith(r2);
+        assertTrue(c2 != null);
         assertTrue(c2.isSerializable());
 
-        final Runnable r3 = new SimpleFlow();
-        Continuation c3 = Continuation.startWith(r3);
-        assertTrue(!c3.isSerializable());
+        final Runnable r3 = new SimpleSerializableFlow();
+        Continuation c3 = Continuation.startWith(new Invoker(r3));
+        assertTrue(c3 != null);
+        assertTrue(c3.isSerializable());
+
     }
 
 }

Added: jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/flow/ClassAccessBugFlow.java
URL: http://svn.apache.org/viewcvs/jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/flow/ClassAccessBugFlow.java?rev=327837&view=auto
==============================================================================
--- jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/flow/ClassAccessBugFlow.java
(added)
+++ jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/flow/ClassAccessBugFlow.java
Sun Oct 23 11:57:59 2005
@@ -0,0 +1,15 @@
+package org.apache.commons.javaflow.flow;
+
+import org.apache.commons.javaflow.Continuation;
+
+public final class ClassAccessBugFlow implements Runnable {
+
+    public void run() {
+
+        final Class clazz1 = ClassAccessBugFlow.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/flow/ClassAccessBugFlow.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/flow/ClassAccessBugFlow.java
------------------------------------------------------------------------------
    svn:keywords = Id

Modified: jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/flow/CounterFlow.java
URL: http://svn.apache.org/viewcvs/jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/flow/CounterFlow.java?rev=327837&r1=327836&r2=327837&view=diff
==============================================================================
--- jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/flow/CounterFlow.java
(original)
+++ jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/flow/CounterFlow.java
Sun Oct 23 11:57:59 2005
@@ -9,8 +9,8 @@
 
     final int up;
 
-    public CounterFlow(Integer up) {
-        this.up = up.intValue();
+    public CounterFlow(int pUp) {
+        this.up = pUp;
     }
 
     public void run() {

Added: jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/flow/NoReferenceBugFlow.java
URL: http://svn.apache.org/viewcvs/jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/flow/NoReferenceBugFlow.java?rev=327837&view=auto
==============================================================================
--- jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/flow/NoReferenceBugFlow.java
(added)
+++ jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/flow/NoReferenceBugFlow.java
Sun Oct 23 11:57:59 2005
@@ -0,0 +1,14 @@
+package org.apache.commons.javaflow.flow;
+
+import org.apache.commons.javaflow.Continuation;
+
+public final class NoReferenceBugFlow 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/flow/NoReferenceBugFlow.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/flow/NoReferenceBugFlow.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