DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUGĀ·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=40567>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED ANDĀ·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=40567

           Summary: Java RNG doesnt reseed itself properly under antunit
           Product: Ant
           Version: 1.7Alpha (nightly)
          Platform: Other
        OS/Version: other
            Status: NEW
          Severity: normal
          Priority: P2
         Component: AntUnit
        AssignedTo: dev@ant.apache.org
        ReportedBy: [EMAIL PROTECTED]


I have a resource that generates random numbers: 
http://antbook.cvs.sourceforge.net/antbook/examples/sections/extending/ch18_extras/resources/src/org/antbook/resources/RandomResource.java?view=markup

and a build file that compiles and tests it in one go:

http://antbook.cvs.sourceforge.net/antbook/examples/sections/extending/ch18_extras/resources/build.xml?view=markup

One attribute is to set the generator's seed, so that it regenerates the same
random stream as before, which is something I test for 

 <target name="testSeed"
   xmlns:res="antlib:org.antbook.resources"
   depends="define">
   <loadresource property="set1">
     <res:random size="10" seed="1"/>
   </loadresource>
   <loadresource property="set2">
     <res:random size="10" seed="1"/>
   </loadresource>
   <au:assertPropertySet name="set1"/>
   <au:assertPropertyEquals name="set1" value="${set2}"/>
 </target>

This test works on the command line, but under antunit it fails

[au:antunit] Target: testSeed  FAILED
[au:antunit]    at line 137, column 59
[au:antunit]    Message: Expected property 'set1' to have value
'keqegnwrkf' but was 'pkvryxjfnf'
[au:antunit]    took 0.008 sec

I dont know what is going on here, because the unexpected value is consistent on
every run. It isnt random either, just either off a different seed, or the
generator isnt resetting itself properly between runs, even though I create a
new one every time.

Maybe I could add some more logging to determine internal state.

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to