db-ojb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Armin Waibel <arm...@apache.org>
Subject Re: Unit test strangeness
Date Mon, 14 Jun 2004 19:51:27 GMT
Hi Tom,

I'm not sure, but it could depend on the used timestamp based tests in 
some cases.

 > junit.framework.AssertionFailedError: expected:<2> but was:<4>
 > at
 > 
org.apache.ojb.odmg.ManyToManyTest.testMtoNTogether(ManyToManyTest.java:203) 


This test use a timestamp value for an persistent object field. The test 
before use the same timestamp field. If now the test runs really fast, 
it seems that two tests can rely on the same timestamp. I tried to avoid 
this by sleep the thread for each test awhile. See class 
org.apache.ojb.junit.OJBTestCase#setUp()
method.
Seems it doesn't solve the problem.

regards,
Armin


Thomas Dudziak wrote:

> Just ran the unit tests against Hsqldb, and I get the following results:
> 
> * 1st run, clean OJB (fresh compile, no Hsqldb database)
> 
> junit-no-compile-no-prepare:
>     [junit] Running org.apache.ojb.broker.AllTests
>     [junit] Tests run: 402, Failures: 0, Errors: 0, Time elapsed: 33,922 
> sec
> 
> 
>     [junit] Running org.apache.ojb.odmg.AllTests
>     [junit] [BOOT] INFO: OJB.properties: 
> file:/E:/projects/ojb/db-ojb-dev/target
> /test/ojb/OJB.properties
>     [junit] [BOOT] INFO: No value for key 'InterceptorClass'
>     [junit] Tests run: 196, Failures: 2, Errors: 0, Time elapsed: 12,266 
> sec
> 
> 
>     [junit] TEST org.apache.ojb.odmg.AllTests FAILED
>     [junit] Running org.apache.ojb.soda.AllTests
>     [junit] Tests run: 3, Failures: 0, Errors: 0, Time elapsed: 6,328 sec
> 
> 
>     [junit] Running org.apache.ojb.otm.AllTests
>     [junit] Tests run: 79, Failures: 0, Errors: 0, Time elapsed: 16,5 sec
> 
> 
> In error were:
> 
> testComplexOQL2:
> junit.framework.AssertionFailedError: Should have found just one object, 
> instead found 0
> at 
> org.apache.ojb.odmg.ContractVersionEffectivenessOQLTest.testComplexOQL2(ContractVersionEffectivenessOQLTest.java:233)

> 
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at 
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) 
> 
> at 
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

> 
> 
> and
> 
> testMtoNTogether:
> junit.framework.AssertionFailedError: expected:<2> but was:<4>
> at 
> org.apache.ojb.odmg.ManyToManyTest.testMtoNTogether(ManyToManyTest.java:203) 
> 
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at 
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) 
> 
> at 
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

> 
> 
> 
> * 2nd run (over the previous run, no cleaning in between)
> 
> junit-no-compile-no-prepare:
>     [junit] Running org.apache.ojb.broker.AllTests
>     [junit] Tests run: 402, Failures: 1, Errors: 0, Time elapsed: 33,922 
> sec
> 
> 
>     [junit] TEST org.apache.ojb.broker.AllTests FAILED
>     [junit] Running org.apache.ojb.odmg.AllTests
>     [junit] [BOOT] INFO: OJB.properties: 
> file:/E:/projects/ojb/db-ojb-dev/target
> /test/ojb/OJB.properties
>     [junit] [BOOT] INFO: No value for key 'InterceptorClass'
>     [junit] Tests run: 196, Failures: 0, Errors: 0, Time elapsed: 12,25 sec
> 
> 
>     [junit] Running org.apache.ojb.soda.AllTests
>     [junit] Tests run: 3, Failures: 0, Errors: 0, Time elapsed: 6,328 sec
> 
> 
>     [junit] Running org.apache.ojb.otm.AllTests
>     [junit] Tests run: 79, Failures: 0, Errors: 0, Time elapsed: 16,5 sec
> 
> This time the error was in:
> 
> testStoreTTFT:
> junit.framework.AssertionFailedError: expected:<1> but was:<2>
> at org.apache.ojb.broker.M2NTest.doTestStoreTTXX(M2NTest.java:400)
> at org.apache.ojb.broker.M2NTest.testStoreTTFT(M2NTest.java:386)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at 
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) 
> 
> at 
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

> 
> 
> 
> Any ideas why this is happening ?
> 
> Tom
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
> For additional commands, e-mail: ojb-dev-help@db.apache.org
> 
> 
> 

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


Mime
View raw message