Adrian Crum wrote:
> --- On Sun, 1/31/10, Adam Heath <[email protected]> wrote:
>> Subject: Re: svn commit: r905114 - in /ofbiz/trunk/framework/base: build.xml
>> src/org/ofbiz/base/test/BaseUnitTests.java
>> To: [email protected]
>> Date: Sunday, January 31, 2010, 3:48 PM
>> Adrian Crum wrote:
>>> --- On Sun, 1/31/10, Adam Heath <[email protected]>
>> wrote:
>>>> Subject: Re: svn commit: r905114 - in
>> /ofbiz/trunk/framework/base: build.xml
>> src/org/ofbiz/base/test/BaseUnitTests.java
>>>> To: [email protected]
>>>> Date: Sunday, January 31, 2010, 1:05 PM
>>>> [email protected]
>>>> wrote:
>>>>> Author: adrianc
>>>>> Date: Sun Jan 31 20:25:46 2010
>>>>> New Revision: 905114
>>>>>
>>>>> URL: http://svn.apache.org/viewvc?rev=905114&view=rev
>>>>> Log:
>>>>> Added a unit test for StringUtil.java. I
>> commented out
>>>> the new webslinger tests which seem to fail every
>> time.
>>>> Bad commit, 2 things done that are unrelated.
>>>>
>>>> What do you mean the TTLObject tests fail?
>> Care to
>>>> show what fails?
>>>> Before I committed this code, I did extensive
>> testing to be
>>>> sure that
>>>> the tests always worked(before I added to ofbiz,
>> they were
>>>> a little
>>>> racy, and would sometimes fail).
>>>>
>>>> I just ran just my 2 new test suites in a loop of
>> 50, and
>>>> they didn't
>>>> fail. I'm using sun java 1.6(not openjdk),
>> and a
>>>> system installed ant.
>>> I think the difference is I'm running the tests from
>> within the component, not from the main build file. I have
>> my local copy set to run the base component tests every time
>> I compile. It would be helpful if we could keep it that way.
>> If not, then I'll uncomment it and keep my local copy
>> patched.
>>
>> Of course, that's what I do. You'll notice that I
>> purposefully didn't
>> add them to testdef, they are only runnable from
>> framework/base.
>> What exception do you get?
>
> [junit] Testsuite: org.ofbiz.base.concurrent.test.SyncTTLObjectTest
> [junit] Tests run: 3, Failures: 1, Errors: 0, Time elapsed: 7.281 sec
> [junit] Testcase: testRefresh took 0 sec
> [junit] Testcase: testGetTTL took 0 sec
> [junit] Testcase: testGet took 7.281 sec
> [junit] FAILED
> [junit] Auto-refresh: data expected:<2> but was:<1>
> [junit] junit.framework.ComparisonFailure: Auto-refresh: data
> expected:<2> but was:<1>
> [junit] at
> org.ofbiz.base.test.GenericTestCaseBase.assertEquals(GenericTestCaseBase.java:194)
> [junit] at
> org.ofbiz.base.concurrent.test.TTLObjectTest.assertGetObject(TTLObjectTest.java:80)
> [junit] at
> org.ofbiz.base.concurrent.test.SyncTTLObjectTest.testGet(SyncTTLObjectTest.java:125)
What is wrong with your machine?
[junit] Testsuite: org.ofbiz.base.concurrent.test.SyncTTLObjectTest
[junit] Tests run: 5, Failures: 0, Errors: 0, Time elapsed: 3.688 sec
[junit]
[junit] Testcase: testRefresh took 0.012 sec
[junit] Testcase: testGetTTL took 0.004 sec
[junit] Testcase: testGet took 2.114 sec
[junit] Testcase: testSetGetAbort took 0.336 sec
[junit] Testcase: testThrowException took 1.211 sec
[junit] Testsuite: org.ofbiz.base.concurrent.test.AsyncTTLObjectTest
[junit] Tests run: 4, Failures: 0, Errors: 0, Time elapsed: 7.193 sec
[junit]
[junit] Testcase: testGet took 4.266 sec
[junit] Testcase: testSetGetAbort took 0.304 sec
[junit] Testcase: testThrowException took 1.313 sec
[junit] Testcase: testSet took 1.302 sec
Note that there are 5 tests in SyncTTLObjectTest, whereas yours only
lists 4. Plus, a successful run is sync:testGet is supposed to be
under 3 seconds, but yours is more than 7.
>
> BUILD FAILED
> C:\ofbiz\common.xml:110: Tests failed
>
> Total time: 9 seconds
>
> Windows XP, Java EE SDK v 6, latest Eclipse.
>
> Also, I found a bad dependency. Run ant clean-all on the main build file,
> then try to run tests from framework/base. It fails. It seems the test target
> is expecting something to be compiled already? Something about crypto. I wish
> I could be more more help, but I'm just a grasshopper.
Um, yes, duh. Running the tests in any component requires all other
components that come before it to be built. This means
framework/start has to be built. This is obvious, as framework/base
compiles against things in start.
Then, when compiling framework/start, it complains about a missing
org.ofbiz.tools.ant.IfTask. You can get that by going to the top and
running ant ofbiz-init.