commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rahul Akolkar <rahul.akol...@gmail.com>
Subject Re: [scxml] transition leaving a child state of parallel
Date Mon, 06 Jun 2011 23:02:40 GMT
On Mon, Jun 6, 2011 at 4:24 PM, Enrico Nardelli
<nardelli@mat.uniroma2.it> wrote:
>
> Rahul Akolkar wrote:
>>
>> I can't see why it should error out either. Please open a defect in
>> JIRA [1] with above SCXML document and I'll take a look.
>
> I opened it
>  https://issues.apache.org/jira/browse/SCXML-161
>
<snip/>

Thanks, I've checked in a fix, which you may verify by building [A]
from source. More on providing test cases below.


>
> Rahul Akolkar wrote:
>>
>> If you're so inclined, a patch with a (failing) JUnit test -- see
>> existing test suite [2] for inspiration -- would make it even easier.
>>
>> -Rahul
>>
>> [1] http://commons.apache.org/scxml/issue-tracking.html
>> [2]
>> http://svn.apache.org/repos/asf/commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml/
>>
>
> I would be glad to contribute more,
<snap/>

Excellent :-)


> but I am not sure whether I'll be able
> to do what you are suggesting. I know very little about JUnit...
>
> If I've undertstood well I should upload under the directory in reference
> [2], probably in subdirectory model, a file called e.g
> ParallelTest<something>.java and corresponding file parallel<something>.xml.
> The first file containing a JUnit test case having in input the second file
> and failing.
>
> Is that correct?
>
<snip/>

Yes, the outline is correct, though you'd attach a patch in JIRA
rather than upload anything. More on creating and submitting patches
here [B].

By way of example, you may look at r1132819 [C], in which I've checked
in a fix for this issue. To start, I took the test case you provided
(added as new file transitions-05.xml) and added a JUnit test (see
text changed for SCXMLExecutorTest.java -- I added the test to
existing file rather than creating a new one, but one could've created
ParallelTest<something>.java as you mention instead). The JUnit test
is actually quite easy to write since we have a number of test utility
functions to help. As you can see, it was basically 6-7 lines of
simple Java code based on your description. The test failed as you
indicated, then I made a fix to the source locally so it passed, and
checked in the fix as well (see change in SCXMLHelper.java). A good
failing test case illustrating the bug is usually halfway to fixing
it, so bug reporters can help with such patches (with or without
actual fixes themselves).

Please let me know if any of the above needs more clarification.

-Rahul

[A] http://commons.apache.org/scxml/building.html
[B] http://commons.apache.org/patches.html
[C] http://svn.apache.org/viewvc?view=revision&amp;revision=1132819


> - Enrico
>

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


Mime
View raw message