Return-Path: Delivered-To: apmail-commons-commits-archive@minotaur.apache.org Received: (qmail 48705 invoked from network); 5 Jan 2010 23:16:36 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 5 Jan 2010 23:16:36 -0000 Received: (qmail 4849 invoked by uid 500); 5 Jan 2010 23:16:36 -0000 Delivered-To: apmail-commons-commits-archive@commons.apache.org Received: (qmail 4760 invoked by uid 500); 5 Jan 2010 23:16:35 -0000 Mailing-List: contact commits-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@commons.apache.org Delivered-To: mailing list commits@commons.apache.org Received: (qmail 4751 invoked by uid 99); 5 Jan 2010 23:16:35 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 05 Jan 2010 23:16:35 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 05 Jan 2010 23:16:34 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 9F89E23889F7; Tue, 5 Jan 2010 23:16:14 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r896264 - in /commons/sandbox/javaflow/trunk: ./ src/test/java/org/apache/commons/javaflow/ src/test/java/org/apache/commons/javaflow/rewrite/ src/test/java/org/apache/commons/javaflow/suite/ Date: Tue, 05 Jan 2010 23:16:04 -0000 To: commits@commons.apache.org From: tcurdt@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20100105231614.9F89E23889F7@eris.apache.org> Author: tcurdt Date: Tue Jan 5 23:15:46 2010 New Revision: 896264 URL: http://svn.apache.org/viewvc?rev=896264&view=rev Log: Fixed some testcases. All ASM test are green now. Only a few BCEL ones still broken (but BCEL is depracted anyway), Activated the tests in the POM but maven still refuses to run the test suites properly. Updated the TODO, Modified: commons/sandbox/javaflow/trunk/.project commons/sandbox/javaflow/trunk/TODO.txt commons/sandbox/javaflow/trunk/pom.xml commons/sandbox/javaflow/trunk/src/test/java/org/apache/commons/javaflow/AsmTestSuite.java commons/sandbox/javaflow/trunk/src/test/java/org/apache/commons/javaflow/BcelTestSuite.java commons/sandbox/javaflow/trunk/src/test/java/org/apache/commons/javaflow/rewrite/RewriteBugs.java commons/sandbox/javaflow/trunk/src/test/java/org/apache/commons/javaflow/suite/SerializationTestCase.java commons/sandbox/javaflow/trunk/src/test/java/org/apache/commons/javaflow/suite/VerificationTestCase.java Modified: commons/sandbox/javaflow/trunk/.project URL: http://svn.apache.org/viewvc/commons/sandbox/javaflow/trunk/.project?rev=896264&r1=896263&r2=896264&view=diff ============================================================================== --- commons/sandbox/javaflow/trunk/.project (original) +++ commons/sandbox/javaflow/trunk/.project Tue Jan 5 23:15:46 2010 @@ -19,10 +19,15 @@ + + org.maven.ide.eclipse.maven2Builder + + + - org.eclipse.jdt.core.javanature org.maven.ide.eclipse.maven2Nature + org.eclipse.jdt.core.javanature org.devzuz.q.maven.jdt.core.mavenNature Modified: commons/sandbox/javaflow/trunk/TODO.txt URL: http://svn.apache.org/viewvc/commons/sandbox/javaflow/trunk/TODO.txt?rev=896264&r1=896263&r2=896264&view=diff ============================================================================== --- commons/sandbox/javaflow/trunk/TODO.txt (original) +++ commons/sandbox/javaflow/trunk/TODO.txt Tue Jan 5 23:15:46 2010 @@ -1,33 +1,11 @@ -In no particular order: - -o integrate just4log into the build system +Must: o testcases!!!! o documentation of the rewriting process -o fix rewriting bugs/limitations: - o fix unintialized objects for method/constructor calls - o inner classes - o try/catch/finally - o synchronized(obj) - o accessing .class - o new Object() without assignment -o only wrap the function calls - that may lead to a suspend (control - flow analysis) requires 2-pass - analysing/rewriting -o maybe: evaluate making the Stack class use a hierarchical - approach to support differential continuations -o maybe: asm implementation instead of BCEL - -o BCEL - o commit bug fixes in BCEL - - http://issues.apache.org/bugzilla/show_bug.cgi?id=27646 - http://issues.apache.org/bugzilla/show_bug.cgi?id=27854 - http://issues.apache.org/bugzilla/show_bug.cgi?id=27855 - - o get rid of the static repository approach - http://issues.apache.org/bugzilla/show_bug.cgi?id=38057 +o fix the maven build so the test suites run properly (some classloader issues) +Maybe: +o integrate just4log into the build system +o only wrap the function calls that may lead to a suspend (control flow analysis) requires 2-pass analysing/rewriting +o evaluate making the Stack class use a hierarchical approach to support differential continuations o talk to the RIFE guys about joining forces -o talk to the aspectwerkz and aspectj folks - about working together +o talk to the aspectwerkz and aspectj folks about working together Modified: commons/sandbox/javaflow/trunk/pom.xml URL: http://svn.apache.org/viewvc/commons/sandbox/javaflow/trunk/pom.xml?rev=896264&r1=896263&r2=896264&view=diff ============================================================================== --- commons/sandbox/javaflow/trunk/pom.xml (original) +++ commons/sandbox/javaflow/trunk/pom.xml Tue Jan 5 23:15:46 2010 @@ -104,12 +104,12 @@ org.apache.ant ant - 1.7.0 + 1.7.1 junit junit - 3.8.1 + 3.8.2 test @@ -127,33 +127,20 @@ - maven-surefire-plugin never - **/*TestCase.java + **/*TestSuite.java **/Abstract* true - - - - Modified: commons/sandbox/javaflow/trunk/src/test/java/org/apache/commons/javaflow/AsmTestSuite.java URL: http://svn.apache.org/viewvc/commons/sandbox/javaflow/trunk/src/test/java/org/apache/commons/javaflow/AsmTestSuite.java?rev=896264&r1=896263&r2=896264&view=diff ============================================================================== --- commons/sandbox/javaflow/trunk/src/test/java/org/apache/commons/javaflow/AsmTestSuite.java (original) +++ commons/sandbox/javaflow/trunk/src/test/java/org/apache/commons/javaflow/AsmTestSuite.java Tue Jan 5 23:15:46 2010 @@ -10,7 +10,6 @@ import org.apache.commons.javaflow.rewrite.ClassAccess2; import org.apache.commons.javaflow.rewrite.CounterFlow; import org.apache.commons.javaflow.rewrite.DefaultConstructor; -import org.apache.commons.javaflow.rewrite.Invoker; import org.apache.commons.javaflow.rewrite.NewObject; import org.apache.commons.javaflow.rewrite.NoReference; import org.apache.commons.javaflow.rewrite.RewriteBugs; @@ -24,7 +23,7 @@ import org.apache.commons.logging.LogFactory; import org.apache.commons.logging.impl.SimpleLog; -public class AsmTestSuite { +public class AsmTestSuite extends TestSuite { public static Test suite() throws Exception { @@ -41,7 +40,6 @@ CounterFlow.class, DefaultConstructor.class, Simple.class, - Invoker.class, NewObject.class, NoReference.class, SimpleSerializable.class, Modified: commons/sandbox/javaflow/trunk/src/test/java/org/apache/commons/javaflow/BcelTestSuite.java URL: http://svn.apache.org/viewvc/commons/sandbox/javaflow/trunk/src/test/java/org/apache/commons/javaflow/BcelTestSuite.java?rev=896264&r1=896263&r2=896264&view=diff ============================================================================== --- commons/sandbox/javaflow/trunk/src/test/java/org/apache/commons/javaflow/BcelTestSuite.java (original) +++ commons/sandbox/javaflow/trunk/src/test/java/org/apache/commons/javaflow/BcelTestSuite.java Tue Jan 5 23:15:46 2010 @@ -10,7 +10,6 @@ import org.apache.commons.javaflow.rewrite.ClassAccess2; import org.apache.commons.javaflow.rewrite.CounterFlow; import org.apache.commons.javaflow.rewrite.DefaultConstructor; -import org.apache.commons.javaflow.rewrite.Invoker; import org.apache.commons.javaflow.rewrite.NewObject; import org.apache.commons.javaflow.rewrite.NoReference; import org.apache.commons.javaflow.rewrite.RewriteBugs; @@ -22,7 +21,7 @@ import org.apache.commons.javaflow.suite.SerializationTestCase; import org.apache.commons.javaflow.suite.VerificationTestCase; -public class BcelTestSuite { +public class BcelTestSuite extends TestSuite { public static Test suite() throws Exception { @@ -36,7 +35,6 @@ CounterFlow.class, DefaultConstructor.class, Simple.class, - Invoker.class, NewObject.class, NoReference.class, SimpleSerializable.class, Modified: commons/sandbox/javaflow/trunk/src/test/java/org/apache/commons/javaflow/rewrite/RewriteBugs.java URL: http://svn.apache.org/viewvc/commons/sandbox/javaflow/trunk/src/test/java/org/apache/commons/javaflow/rewrite/RewriteBugs.java?rev=896264&r1=896263&r2=896264&view=diff ============================================================================== --- commons/sandbox/javaflow/trunk/src/test/java/org/apache/commons/javaflow/rewrite/RewriteBugs.java (original) +++ commons/sandbox/javaflow/trunk/src/test/java/org/apache/commons/javaflow/rewrite/RewriteBugs.java Tue Jan 5 23:15:46 2010 @@ -10,8 +10,11 @@ import java.util.List; import java.util.Map; -public class RewriteBugs -{ +public final class RewriteBugs implements Runnable { + + public void run() { + RewriteBugs.calculateCartesianProduct(new String[]{"a","b"}, new Object[]{"1","2"}); + } /** * Modified: commons/sandbox/javaflow/trunk/src/test/java/org/apache/commons/javaflow/suite/SerializationTestCase.java URL: http://svn.apache.org/viewvc/commons/sandbox/javaflow/trunk/src/test/java/org/apache/commons/javaflow/suite/SerializationTestCase.java?rev=896264&r1=896263&r2=896264&view=diff ============================================================================== --- commons/sandbox/javaflow/trunk/src/test/java/org/apache/commons/javaflow/suite/SerializationTestCase.java (original) +++ commons/sandbox/javaflow/trunk/src/test/java/org/apache/commons/javaflow/suite/SerializationTestCase.java Tue Jan 5 23:15:46 2010 @@ -124,5 +124,8 @@ Continuation c3 = Continuation.startWith(new Invoker(r3)); assertTrue(c3 != null); assertTrue(c3.isSerializable()); + // the invoker should not appear on the stack as it should not be instrumented + // and by that not hinder serialization (in cocoon the continuation is always called + // through such an invoker) } } Modified: commons/sandbox/javaflow/trunk/src/test/java/org/apache/commons/javaflow/suite/VerificationTestCase.java URL: http://svn.apache.org/viewvc/commons/sandbox/javaflow/trunk/src/test/java/org/apache/commons/javaflow/suite/VerificationTestCase.java?rev=896264&r1=896263&r2=896264&view=diff ============================================================================== --- commons/sandbox/javaflow/trunk/src/test/java/org/apache/commons/javaflow/suite/VerificationTestCase.java (original) +++ commons/sandbox/javaflow/trunk/src/test/java/org/apache/commons/javaflow/suite/VerificationTestCase.java Tue Jan 5 23:15:46 2010 @@ -11,7 +11,6 @@ import org.apache.commons.javaflow.rewrite.Invoker; import org.apache.commons.javaflow.rewrite.NewObject; import org.apache.commons.javaflow.rewrite.NoReference; -import org.apache.commons.javaflow.rewrite.RewriteBugs; import org.apache.commons.javaflow.rewrite.Simple; import org.apache.commons.javaflow.rewrite.SimpleSerializable; import org.apache.commons.javaflow.rewrite.SimpleSynchronized; @@ -117,10 +116,6 @@ assertTrue(r.l == 2); } - public void testASMRewriteBug() throws Exception { - //final RewriteBugs r = new RewriteBugs(); - RewriteBugs.calculateCartesianProduct(new String[]{"a","b"}, new Object[]{"1","2"}); - } public void testSimpleSuspend() throws Exception { final Simple r = new Simple(); final Continuation c = Continuation.startWith(r); @@ -131,8 +126,8 @@ final SimpleTryCatch r = new SimpleTryCatch(false); Continuation c; - c = Continuation.startWith(r); - assertTrue(c != null); + c = Continuation.startWith(r); // suspend within the try/catch + assertTrue(c != null); assertTrue(r.a); assertFalse(r.b); assertFalse(r.c); @@ -140,8 +135,8 @@ assertFalse(r.e); assertFalse(r.f); - c = Continuation.continueWith(c); - assertTrue(c == null); + c = Continuation.continueWith(c); // continue without exception and end in finally + assertTrue(c != null); assertTrue(r.a); assertTrue(r.b); assertFalse(r.c); @@ -149,31 +144,22 @@ assertTrue(r.e); assertFalse(r.f); - c = Continuation.continueWith(c); - assertTrue(c != null); - assertTrue(r.a); - assertFalse(r.b); - assertTrue(r.c); - assertTrue(r.d); - assertTrue(r.e); - assertFalse(r.f); - - - c = Continuation.continueWith(c); + c = Continuation.continueWith(c); // continue within the finally and end in return assertTrue(c == null); assertTrue(r.a); - assertFalse(r.b); - assertTrue(r.c); - assertTrue(r.d); + assertTrue(r.b); + assertFalse(r.c); + assertFalse(r.d); assertTrue(r.e); assertTrue(r.f); + } public void testSimpleTryCatchWithException() throws Exception { final SimpleTryCatch r = new SimpleTryCatch(true); Continuation c; - c = Continuation.startWith(r); + c = Continuation.startWith(r); // suspend in the try/catch assertTrue(c != null); assertTrue(r.a); assertFalse(r.b); @@ -182,7 +168,7 @@ assertFalse(r.e); assertFalse(r.f); - c = Continuation.continueWith(c); + c = Continuation.continueWith(c); // exception jumps into exception block and suspends assertTrue(c != null); assertTrue(r.a); assertFalse(r.b); @@ -191,12 +177,21 @@ assertFalse(r.e); assertFalse(r.f); - c = Continuation.continueWith(c); + c = Continuation.continueWith(c); // continue in the exception block and then suspends in finally assertTrue(c != null); assertTrue(r.a); - assertTrue(r.b); - assertFalse(r.c); - assertFalse(r.d); + assertFalse(r.b); + assertTrue(r.c); + assertTrue(r.d); + assertTrue(r.e); + assertFalse(r.f); + + c = Continuation.continueWith(c); // continue in finally + assertTrue(c == null); + assertTrue(r.a); + assertFalse(r.b); + assertTrue(r.c); + assertTrue(r.d); assertTrue(r.e); assertTrue(r.f); } @@ -205,7 +200,7 @@ final SimpleSynchronized r = new SimpleSynchronized(); Continuation c; - c = Continuation.startWith(r); + c = Continuation.startWith(r); // suspend right away assertTrue(c != null); assertTrue(r.a); assertFalse(r.b); @@ -214,8 +209,8 @@ assertFalse(r.e); assertFalse(r.f); - c = Continuation.continueWith(c); - assertTrue(c == null); + c = Continuation.continueWith(c); // resume and run into synchronized block where we suspend again + assertTrue(c != null); assertTrue(r.a); assertTrue(r.b); assertTrue(r.c); @@ -223,7 +218,7 @@ assertFalse(r.e); assertFalse(r.f); - c = Continuation.continueWith(c); + c = Continuation.continueWith(c); // continue inside the synchronized block and suspend after assertTrue(c != null); assertTrue(r.a); assertTrue(r.b); @@ -232,8 +227,8 @@ assertTrue(r.e); assertFalse(r.f); - c = Continuation.continueWith(c); - assertTrue(c != null); + c = Continuation.continueWith(c); // resume and then return + assertTrue(c == null); assertTrue(r.a); assertTrue(r.b); assertTrue(r.c); @@ -245,7 +240,7 @@ public void testStack() throws Exception { final Runnable r = new Stack(); final Continuation c = Continuation.startWith(r); - assertNotNull(c); + assertNull(c); // does not have a suspend } }