commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kohs...@apache.org
Subject svn commit: r291070 - in /jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow: ContinuationTests.java testcode/NewObject.java
Date Fri, 23 Sep 2005 04:00:13 GMT
Author: kohsuke
Date: Thu Sep 22 21:00:08 2005
New Revision: 291070

URL: http://svn.apache.org/viewcvs?rev=291070&view=rev
Log:
added a file that was missing, and resurrected the test case

Added:
    jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/testcode/NewObject.java
Modified:
    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/ContinuationTests.java
URL: http://svn.apache.org/viewcvs/jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/ContinuationTests.java?rev=291070&r1=291069&r2=291070&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
Thu Sep 22 21:00:08 2005
@@ -18,6 +18,7 @@
 import junit.framework.Assert;
 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.logging.Log;
 import org.apache.commons.logging.LogFactory;
 
@@ -86,10 +87,8 @@
             System.out.println("resuming");
     }
 
-/*
     public void testNewObject() throws Exception {
         Continuation c = Continuation.startWith(new NewObject());
         assertNull(c);
     }
-*/
 }

Added: jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/testcode/NewObject.java
URL: http://svn.apache.org/viewcvs/jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/testcode/NewObject.java?rev=291070&view=auto
==============================================================================
--- jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/testcode/NewObject.java
(added)
+++ jakarta/commons/sandbox/javaflow/trunk/src/test/org/apache/commons/javaflow/testcode/NewObject.java
Thu Sep 22 21:00:08 2005
@@ -0,0 +1,25 @@
+package org.apache.commons.javaflow.testcode;
+
+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 class NewObject implements Runnable {
+    public void run() {
+        char[] ch = {'a','b','c'};
+
+        String s = new String(new String(
+                new String(ch,0,ch.length).toCharArray(), 0, ch.length ));
+
+        Assert.assertEquals(s,"abc");
+    }
+
+}



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