You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by ra...@apache.org on 2009/01/07 00:39:20 UTC

svn commit: r732174 - /commons/proper/scxml/branches/J6/src/test/java/org/apache/commons/scxml/env/javascript/JSBindingsTest.java

Author: rahul
Date: Tue Jan  6 15:39:20 2009
New Revision: 732174

URL: http://svn.apache.org/viewvc?rev=732174&view=rev
Log:
Changes to test case that should have been part of r728828 (Add support for the SCXML Script Module).

The m2 build is not running the javascript package tests (though the pom does include org/apache/commons/scxml/env/javascript/EnvJavaScriptTestSuite.java in the surefire configuration). It'd be great if someone else can try to spot the hang up.

Modified:
    commons/proper/scxml/branches/J6/src/test/java/org/apache/commons/scxml/env/javascript/JSBindingsTest.java

Modified: commons/proper/scxml/branches/J6/src/test/java/org/apache/commons/scxml/env/javascript/JSBindingsTest.java
URL: http://svn.apache.org/viewvc/commons/proper/scxml/branches/J6/src/test/java/org/apache/commons/scxml/env/javascript/JSBindingsTest.java?rev=732174&r1=732173&r2=732174&view=diff
==============================================================================
--- commons/proper/scxml/branches/J6/src/test/java/org/apache/commons/scxml/env/javascript/JSBindingsTest.java (original)
+++ commons/proper/scxml/branches/J6/src/test/java/org/apache/commons/scxml/env/javascript/JSBindingsTest.java Tue Jan  6 15:39:20 2009
@@ -508,9 +508,10 @@
         assertNull("Invalid JSbindings",         jsx.get     ("bear"));
 
         jsx.put       ("bear","koala");
-        assertNull    ("Invalid SCXML context",        context.get ("bear"));
-        assertNotNull ("Invalid Javascript bindings",  bindings.get("bear"));
-        assertEquals  ("Invalid Javascript","koala",   bindings.get("bear"));
+        assertNotNull ("Invalid SCXML context",        context.get ("bear"));
+        assertEquals  ("Invalid SCXML context","koala",context.get("bear"));
+        assertNotNull ("Invalid JSbindings",           jsx.get ("bear"));
+        assertNull    ("Invalid Javascript bindings",  bindings.get("bear"));
     }
 
     /**



Re: svn commit: r732174 - /commons/proper/scxml/branches/J6/src/test/java/org/apache/commons/scxml/env/javascript/JSBindingsTest.java

Posted by Rahul Akolkar <ra...@gmail.com>.
On Wed, Jan 7, 2009 at 12:36 AM, Rahul Akolkar <ra...@gmail.com> wrote:
> On Tue, Jan 6, 2009 at 9:46 PM, sebb <se...@gmail.com> wrote:
<snip/>
>>
>> By the way, the Exception handling changes have revealed a possible
>> bug - a class cast was being swallowed:
>>
>> testExample01Sample(org.apache.commons.scxml.env.javascript.JSExampleTest)
>>  Time elapsed: 0.281 sec  <<< ERROR!
>> java.lang.ClassCastException: java.lang.Double cannot be cast to
>> org.w3c.dom.Node
>>        at org.apache.commons.scxml.env.javascript.JSEvaluator.evalLocation(JSEvaluator.java:195)
>>
>> This was previously being converted to a SCXMLExpressionException.
>>
> <snap/>
>
> I'll take a look now -- thats the package I'm least familiar with so
> it'll be good to go through it anyway.
>
<snap/>

Turned out to be an error in the test document, should be fixed.

-Rahul

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


Re: svn commit: r732174 - /commons/proper/scxml/branches/J6/src/test/java/org/apache/commons/scxml/env/javascript/JSBindingsTest.java

Posted by Rahul Akolkar <ra...@gmail.com>.
On Tue, Jan 6, 2009 at 9:46 PM, sebb <se...@gmail.com> wrote:
> On 06/01/2009, rahul@apache.org <ra...@apache.org> wrote:
>> Author: rahul
>>  Date: Tue Jan  6 15:39:20 2009
>>  New Revision: 732174
>>
>>  URL: http://svn.apache.org/viewvc?rev=732174&view=rev
>>  Log:
>>  Changes to test case that should have been part of r728828 (Add support for the SCXML Script Module).
>>
>>  The m2 build is not running the javascript package tests (though the pom does include org/apache/commons/scxml/env/javascript/EnvJavaScriptTestSuite.java in the surefire configuration). It'd be great if someone else can try to spot the hang up.
>
> Appears to be a very silly bug in Surefire.
>
> Using **/EnvJavaScriptTestSuite.java works, as does
>
> org/apache/commons/scxml/env/jav*/EnvJavaScriptTestSuite.java
> but
> org/apache/commons/scxml/env/java*/EnvJavaScriptTestSuite.java
> does not work.
>
> Looks like Surefire is looking for "java" (or maybe the RE /.java/)
> and stopping when it finds the first part of the directory name. Yuk.
>
<snip/>

Interesting, I eyeballed it for a few minutes and had to run, but it
sure looked like some oddity :-)


> I'll commit a temporary fix.
>
<snap/>

Thanks for the fix and filing the bug report as well.


> ==
>
> I think it would be better to ignore the test suites in the pom, and just use
>
> **/*Test.java
>
> That avoids the problem where a Test case has been omitted from a suite.
>
<snip/>

IIRC, the donated pom had includes and it just grew organically from
there. I think by default it'll pick up **/*Test.java which means we
can probably get rid of the includes altogether.


> ==
>
> By the way, the Exception handling changes have revealed a possible
> bug - a class cast was being swallowed:
>
> testExample01Sample(org.apache.commons.scxml.env.javascript.JSExampleTest)
>  Time elapsed: 0.281 sec  <<< ERROR!
> java.lang.ClassCastException: java.lang.Double cannot be cast to
> org.w3c.dom.Node
>        at org.apache.commons.scxml.env.javascript.JSEvaluator.evalLocation(JSEvaluator.java:195)
>
> This was previously being converted to a SCXMLExpressionException.
>
<snap/>

I'll take a look now -- thats the package I'm least familiar with so
it'll be good to go through it anyway.

-Rahul

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


Re: svn commit: r732174 - /commons/proper/scxml/branches/J6/src/test/java/org/apache/commons/scxml/env/javascript/JSBindingsTest.java

Posted by sebb <se...@gmail.com>.
On 06/01/2009, rahul@apache.org <ra...@apache.org> wrote:
> Author: rahul
>  Date: Tue Jan  6 15:39:20 2009
>  New Revision: 732174
>
>  URL: http://svn.apache.org/viewvc?rev=732174&view=rev
>  Log:
>  Changes to test case that should have been part of r728828 (Add support for the SCXML Script Module).
>
>  The m2 build is not running the javascript package tests (though the pom does include org/apache/commons/scxml/env/javascript/EnvJavaScriptTestSuite.java in the surefire configuration). It'd be great if someone else can try to spot the hang up.

Appears to be a very silly bug in Surefire.

Using **/EnvJavaScriptTestSuite.java works, as does

org/apache/commons/scxml/env/jav*/EnvJavaScriptTestSuite.java
but
org/apache/commons/scxml/env/java*/EnvJavaScriptTestSuite.java
does not work.

Looks like Surefire is looking for "java" (or maybe the RE /.java/)
and stopping when it finds the first part of the directory name. Yuk.

I'll commit a temporary fix.

==

I think it would be better to ignore the test suites in the pom, and just use

**/*Test.java

That avoids the problem where a Test case has been omitted from a suite.

==

By the way, the Exception handling changes have revealed a possible
bug - a class cast was being swallowed:

testExample01Sample(org.apache.commons.scxml.env.javascript.JSExampleTest)
 Time elapsed: 0.281 sec  <<< ERROR!
java.lang.ClassCastException: java.lang.Double cannot be cast to
org.w3c.dom.Node
	at org.apache.commons.scxml.env.javascript.JSEvaluator.evalLocation(JSEvaluator.java:195)

This was previously being converted to a SCXMLExpressionException.

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