You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by ko...@apache.org on 2005/10/03 07:34:56 UTC

svn commit: r293257 - in /jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow: ContinuationTestCase.java ContinuationTests.java testcode/StackBug.java

Author: kohsuke
Date: Sun Oct  2 22:34:51 2005
New Revision: 293257

URL: http://svn.apache.org/viewcvs?rev=293257&view=rev
Log:
added a regression test. I guess ideally I should have filed an issue and put the issue number in this test

Added:
    jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/testcode/StackBug.java
Modified:
    jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/ContinuationTestCase.java
    jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/ContinuationTests.java

Modified: jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/ContinuationTestCase.java
URL: http://svn.apache.org/viewcvs/jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/ContinuationTestCase.java?rev=293257&r1=293256&r2=293257&view=diff
==============================================================================
--- jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/ContinuationTestCase.java (original)
+++ jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/ContinuationTestCase.java Sun Oct  2 22:34:51 2005
@@ -39,9 +39,11 @@
         call("testCounter");
     }
 
-    /*
     public void testNewObject() throws Exception {
         call("testNewObject");
     }
-    */
+
+    public void testStackBug() throws Exception {
+        call("testStackBug");
+    }
 }

Modified: jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/ContinuationTests.java
URL: http://svn.apache.org/viewcvs/jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/ContinuationTests.java?rev=293257&r1=293256&r2=293257&view=diff
==============================================================================
--- jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/ContinuationTests.java (original)
+++ jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/ContinuationTests.java Sun Oct  2 22:34:51 2005
@@ -19,6 +19,7 @@
 import org.apache.commons.javaflow.testcode.Calculator;
 import org.apache.commons.javaflow.testcode.Counter;
 import org.apache.commons.javaflow.testcode.NewObject;
+import org.apache.commons.javaflow.testcode.StackBug;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 
@@ -89,6 +90,11 @@
 
     public void testNewObject() throws Exception {
         Continuation c = Continuation.startWith(new NewObject());
+        assertNull(c);
+    }
+
+    public void testStackBug() throws Exception {
+        Continuation c = Continuation.startWith(new StackBug());
         assertNull(c);
     }
 }

Added: jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/testcode/StackBug.java
URL: http://svn.apache.org/viewcvs/jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/testcode/StackBug.java?rev=293257&view=auto
==============================================================================
--- jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/testcode/StackBug.java (added)
+++ jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/testcode/StackBug.java Sun Oct  2 22:34:51 2005
@@ -0,0 +1,35 @@
+package org.apache.commons.javaflow.testcode;
+
+/**
+ * Regression test case.
+ *
+ * <p>
+ * When the stack size reaches the maximum in a constructor method invocation,
+ * there was a bug where we failed to expand the stack size appropriately.
+ *
+ * This is a regression test for that case.
+ *
+ *
+ * @author Kohsuke Kawaguchi
+ */
+public class StackBug implements Runnable {
+    public void run() {
+        System.out.println(foo("abc","def"));
+    }
+
+    private Object foo(String a, String b) {
+        return new StrStr(a,b);
+    }
+
+    private static final class StrStr {
+        private final String value;
+
+        public StrStr(String a, String b) {
+            value = a+b;
+        }
+
+        public String toString() {
+            return value;
+        }
+    }
+}



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