JUnit test failures

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

JUnit test failures

Karl Beecher
Hi there,

We're looking to develop an OFBiz installation and would like to
regularly run the unit-tests. Unfortunately, when we run the test
suite, even from an out-of-the-box Ofbiz (we use11.04.02), there are
always a few failing tests. I'd like to know if this is a known issue,
or whether we're doing something wrong.

Here's what we're doing. With a fresh copy of OFBiz, our procedure is
simply to execute:

ant run-install
ant run-tests

In subsequent attempts, we run the same steps but with "ant
clean-all". Regardless, the result is always a small number of failing
tests.

We've attempted this in several environments, including Fedora, Mac
OSX and Ubuntu, but with no success. We have not amended the
entityengine.xml file, so these tests are always executed against a
local Derby database.

If it helps, here's a sample run with the 2 failed tests encountered
when testing a fresh, out-of-the-box OFBiz:

entitytests testFindDistinct Failure There should only be 1 result
found by findDistinct() expected:<1> but was:<0>

junit.framework.AssertionFailedError: There should only be 1 result
found by findDistinct() expected:<1> but was:<0>
at org.ofbiz.entity.test.EntityTestSuite.testFindDistinct(EntityTestSuite.java:234)
at org.ofbiz.testtools.TestRunContainer.start(TestRunContainer.java:146)
at org.ofbiz.base.container.ContainerLoader.start(ContainerLoader.java:231)
at org.ofbiz.base.start.Start.startStartLoaders(Start.java:247)
at org.ofbiz.base.start.Start.start(Start.java:226)
at org.ofbiz.base.start.Start.main(Start.java:70)
        0.006
entitytests testForeignKeyRemove Failure Foreign key referential
integrity is not observed for remove (DELETE)

junit.framework.AssertionFailedError: Foreign key referential
integrity is not observed for remove (DELETE)
at org.ofbiz.entity.test.EntityTestSuite.testForeignKeyRemove(EntityTestSuite.java:297)
at org.ofbiz.testtools.TestRunContainer.start(TestRunContainer.java:146)
at org.ofbiz.base.container.ContainerLoader.start(ContainerLoader.java:231)
at org.ofbiz.base.start.Start.startStartLoaders(Start.java:247)
at org.ofbiz.base.start.Start.start(Start.java:226)
at org.ofbiz.base.start.Start.main(Start.java:70)

Any help with this would be greatly appreciated.

Karl
Reply | Threaded
Open this post in threaded view
|

Re: JUnit test failures

Jacques Le Roux
Administrator
This is weird, we know there were issues in the past, but they are solved at the moment, as you can see at
http://ci.apache.org/projects/ofbiz/logs/
Sorry I have currently no time to look at it. This last branch 11 build might help
http://ci.apache.org/builders/ofbiz-branch11/builds/57
The step 3 is what you look for, run-install is done in the step 2

HTH

Jacques

From: "Karl Beecher" <[hidden email]>

> Hi there,
>
> We're looking to develop an OFBiz installation and would like to
> regularly run the unit-tests. Unfortunately, when we run the test
> suite, even from an out-of-the-box Ofbiz (we use11.04.02), there are
> always a few failing tests. I'd like to know if this is a known issue,
> or whether we're doing something wrong.
>
> Here's what we're doing. With a fresh copy of OFBiz, our procedure is
> simply to execute:
>
> ant run-install
> ant run-tests
>
> In subsequent attempts, we run the same steps but with "ant
> clean-all". Regardless, the result is always a small number of failing
> tests.
>
> We've attempted this in several environments, including Fedora, Mac
> OSX and Ubuntu, but with no success. We have not amended the
> entityengine.xml file, so these tests are always executed against a
> local Derby database.
>
> If it helps, here's a sample run with the 2 failed tests encountered
> when testing a fresh, out-of-the-box OFBiz:
>
> entitytests testFindDistinct Failure There should only be 1 result
> found by findDistinct() expected:<1> but was:<0>
>
> junit.framework.AssertionFailedError: There should only be 1 result
> found by findDistinct() expected:<1> but was:<0>
> at org.ofbiz.entity.test.EntityTestSuite.testFindDistinct(EntityTestSuite.java:234)
> at org.ofbiz.testtools.TestRunContainer.start(TestRunContainer.java:146)
> at org.ofbiz.base.container.ContainerLoader.start(ContainerLoader.java:231)
> at org.ofbiz.base.start.Start.startStartLoaders(Start.java:247)
> at org.ofbiz.base.start.Start.start(Start.java:226)
> at org.ofbiz.base.start.Start.main(Start.java:70)
> 0.006
> entitytests testForeignKeyRemove Failure Foreign key referential
> integrity is not observed for remove (DELETE)
>
> junit.framework.AssertionFailedError: Foreign key referential
> integrity is not observed for remove (DELETE)
> at org.ofbiz.entity.test.EntityTestSuite.testForeignKeyRemove(EntityTestSuite.java:297)
> at org.ofbiz.testtools.TestRunContainer.start(TestRunContainer.java:146)
> at org.ofbiz.base.container.ContainerLoader.start(ContainerLoader.java:231)
> at org.ofbiz.base.start.Start.startStartLoaders(Start.java:247)
> at org.ofbiz.base.start.Start.start(Start.java:226)
> at org.ofbiz.base.start.Start.main(Start.java:70)
>
> Any help with this would be greatly appreciated.
>
> Karl
Reply | Threaded
Open this post in threaded view
|

Re: JUnit test failures

Christian Geisert
In reply to this post by Karl Beecher
Am 07.03.2013 15:30, schrieb Karl Beecher:
> Hi there,
>
> We're looking to develop an OFBiz installation and would like to
> regularly run the unit-tests. Unfortunately, when we run the test
> suite, even from an out-of-the-box Ofbiz (we use11.04.02), there are
> always a few failing tests. I'd like to know if this is a known issue,
> or whether we're doing something wrong.

A few months ago "run-tests" did fail on my local machine too,
but now both trunk and the 12.04 branch (rev 1455408) run the tests
without failures.

./ant clean-all load-demo run-tests
OS: Ubuntu 12.10
java -version:
java version "1.6.0_38"
Java(TM) SE Runtime Environment (build 1.6.0_38-b05)
Java HotSpot(TM) 64-Bit Server VM (build 20.13-b02, mixed mode)

(I think last time I used OpenJDK - will have another try with this...)


For the 11.04 branch I get 2 failures (both in lucenetests).

Christian