tests in error

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

tests in error

Erwan de FERRIERES-3
Hi all,

I run the tests task this morning, and this testsuite was in error :
testInvoiceWorkerGetInvoiceTotal

Error message is :
Assertion failed: [invoiceTotal=323.54] equals [amount=323.0]  as BigDecimal
and so on for the others.

Regards,

--
Erwan de FERRIERES
www.nereide.biz
Reply | Threaded
Open this post in threaded view
|

Re: tests in error

Scott Gray-2
Hi Erwan

The tests are passing on buildbot: http://ci.apache.org/waterfall?show=ofbiz-trunk

Regards
Scott

HotWax Media
http://www.hotwaxmedia.com

On 28/01/2010, at 1:02 AM, Erwan de FERRIERES wrote:

> Hi all,
>
> I run the tests task this morning, and this testsuite was in error :
> testInvoiceWorkerGetInvoiceTotal
>
> Error message is :
> Assertion failed: [invoiceTotal=323.54] equals [amount=323.0]  as BigDecimal
> and so on for the others.
>
> Regards,
>
> --
> Erwan de FERRIERES
> www.nereide.biz


smime.p7s (3K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: tests in error

Erwan de FERRIERES-3


Le 29/01/2010 00:13, Scott Gray a écrit :
> Hi Erwan
>
> The tests are passing on buildbot: http://ci.apache.org/waterfall?show=ofbiz-trunk
Strange... Maybe it's because the tests are in failure and not error ?
It just tried it once again, and I still got the tests not passing...

>
> Regards
> Scott
>

--
Erwan de FERRIERES
www.nereide.biz
Reply | Threaded
Open this post in threaded view
|

Re: tests in error

Jacopo Cappellato-4
Erwan,

could you please clean all your data and try again?
ant clean-all
ant run-tests

I know that there is an entity test that fails becaiuse of some records not being rolled back in previous test runs.

Jacopo

On Jan 29, 2010, at 11:28 AM, Erwan de FERRIERES wrote:

>
>
> Le 29/01/2010 00:13, Scott Gray a écrit :
>> Hi Erwan
>>
>> The tests are passing on buildbot: http://ci.apache.org/waterfall?show=ofbiz-trunk
> Strange... Maybe it's because the tests are in failure and not error ? It just tried it once again, and I still got the tests not passing...
>
>>
>> Regards
>> Scott
>>
>
> --
> Erwan de FERRIERES
> www.nereide.biz

Reply | Threaded
Open this post in threaded view
|

Re: tests in error

Erwan de FERRIERES-3
Hi Jaccopo,

Once again, the same test is in error. Have you succedeed in reproducing
it ?

Assertion failed: [invoiceTotal=323.54] equals [amount=323.0] as BigDecimal

junit.framework.AssertionFailedError: Assertion failed:
[invoiceTotal=323.54] equals [amount=323.0] as BigDecimal
at org.ofbiz.testtools.SimpleMethodTest.run(SimpleMethodTest.java:81)
at org.ofbiz.testtools.TestRunContainer.start(TestRunContainer.java:146)
at org.ofbiz.base.container.ContainerLoader.start(ContainerLoader.java:100)
at org.ofbiz.base.start.Start.startStartLoaders(Start.java:272)
at org.ofbiz.base.start.Start.startServer(Start.java:322)
at org.ofbiz.base.start.Start.start(Start.java:326)
at org.ofbiz.base.start.Start.main(Start.java:411)
Assertion failed: [invoiceTotal=36.43] equals [amount=36.0] as BigDecimal

junit.framework.AssertionFailedError: Assertion failed:
[invoiceTotal=36.43] equals [amount=36.0] as BigDecimal
at org.ofbiz.testtools.SimpleMethodTest.run(SimpleMethodTest.java:81)
at org.ofbiz.testtools.TestRunContainer.start(TestRunContainer.java:146)
at org.ofbiz.base.container.ContainerLoader.start(ContainerLoader.java:100)
at org.ofbiz.base.start.Start.startStartLoaders(Start.java:272)
at org.ofbiz.base.start.Start.startServer(Start.java:322)
at org.ofbiz.base.start.Start.start(Start.java:326)
at org.ofbiz.base.start.Start.main(Start.java:411)
Assertion failed: [invoiceTotal=56.99] equals [amount=56.0] as BigDecimal

junit.framework.AssertionFailedError: Assertion failed:
[invoiceTotal=56.99] equals [amount=56.0] as BigDecimal
at org.ofbiz.testtools.SimpleMethodTest.run(SimpleMethodTest.java:81)
at org.ofbiz.testtools.TestRunContainer.start(TestRunContainer.java:146)
at org.ofbiz.base.container.ContainerLoader.start(ContainerLoader.java:100)
at org.ofbiz.base.start.Start.startStartLoaders(Start.java:272)
at org.ofbiz.base.start.Start.startServer(Start.java:322)
at org.ofbiz.base.start.Start.start(Start.java:326)
at org.ofbiz.base.start.Start.main(Start.java:411)
Assertion failed: [invoiceTotal=543.23] equals [amount=543.0] as BigDecimal

Le 29/01/2010 11:37, Jacopo Cappellato a écrit :

> Erwan,
>
> could you please clean all your data and try again?
> ant clean-all
> ant run-tests
>
> I know that there is an entity test that fails becaiuse of some records not being rolled back in previous test runs.
>
> Jacopo
>
> On Jan 29, 2010, at 11:28 AM, Erwan de FERRIERES wrote:
>
>>
>>
>> Le 29/01/2010 00:13, Scott Gray a écrit :
>>> Hi Erwan
>>>
>>> The tests are passing on buildbot: http://ci.apache.org/waterfall?show=ofbiz-trunk
>> Strange... Maybe it's because the tests are in failure and not error ? It just tried it once again, and I still got the tests not passing...
>>
>>>
>>> Regards
>>> Scott
>>>
>>
>> --
>> Erwan de FERRIERES
>> www.nereide.biz
>
>

--
Erwan de FERRIERES
www.nereide.biz
Reply | Threaded
Open this post in threaded view
|

Re: tests in error

Jacopo Cappellato-4
I didn't try but I am going to try today and let you know.
Thank you for your further test and report.

Jacopo

On Jan 29, 2010, at 12:25 PM, Erwan de FERRIERES wrote:

> Hi Jaccopo,
>
> Once again, the same test is in error. Have you succedeed in reproducing it ?
>
> Assertion failed: [invoiceTotal=323.54] equals [amount=323.0] as BigDecimal
>
> junit.framework.AssertionFailedError: Assertion failed: [invoiceTotal=323.54] equals [amount=323.0] as BigDecimal
> at org.ofbiz.testtools.SimpleMethodTest.run(SimpleMethodTest.java:81)
> at org.ofbiz.testtools.TestRunContainer.start(TestRunContainer.java:146)
> at org.ofbiz.base.container.ContainerLoader.start(ContainerLoader.java:100)
> at org.ofbiz.base.start.Start.startStartLoaders(Start.java:272)
> at org.ofbiz.base.start.Start.startServer(Start.java:322)
> at org.ofbiz.base.start.Start.start(Start.java:326)
> at org.ofbiz.base.start.Start.main(Start.java:411)
> Assertion failed: [invoiceTotal=36.43] equals [amount=36.0] as BigDecimal
>
> junit.framework.AssertionFailedError: Assertion failed: [invoiceTotal=36.43] equals [amount=36.0] as BigDecimal
> at org.ofbiz.testtools.SimpleMethodTest.run(SimpleMethodTest.java:81)
> at org.ofbiz.testtools.TestRunContainer.start(TestRunContainer.java:146)
> at org.ofbiz.base.container.ContainerLoader.start(ContainerLoader.java:100)
> at org.ofbiz.base.start.Start.startStartLoaders(Start.java:272)
> at org.ofbiz.base.start.Start.startServer(Start.java:322)
> at org.ofbiz.base.start.Start.start(Start.java:326)
> at org.ofbiz.base.start.Start.main(Start.java:411)
> Assertion failed: [invoiceTotal=56.99] equals [amount=56.0] as BigDecimal
>
> junit.framework.AssertionFailedError: Assertion failed: [invoiceTotal=56.99] equals [amount=56.0] as BigDecimal
> at org.ofbiz.testtools.SimpleMethodTest.run(SimpleMethodTest.java:81)
> at org.ofbiz.testtools.TestRunContainer.start(TestRunContainer.java:146)
> at org.ofbiz.base.container.ContainerLoader.start(ContainerLoader.java:100)
> at org.ofbiz.base.start.Start.startStartLoaders(Start.java:272)
> at org.ofbiz.base.start.Start.startServer(Start.java:322)
> at org.ofbiz.base.start.Start.start(Start.java:326)
> at org.ofbiz.base.start.Start.main(Start.java:411)
> Assertion failed: [invoiceTotal=543.23] equals [amount=543.0] as BigDecimal
>
> Le 29/01/2010 11:37, Jacopo Cappellato a écrit :
>> Erwan,
>>
>> could you please clean all your data and try again?
>> ant clean-all
>> ant run-tests
>>
>> I know that there is an entity test that fails becaiuse of some records not being rolled back in previous test runs.
>>
>> Jacopo
>>
>> On Jan 29, 2010, at 11:28 AM, Erwan de FERRIERES wrote:
>>
>>>
>>>
>>> Le 29/01/2010 00:13, Scott Gray a écrit :
>>>> Hi Erwan
>>>>
>>>> The tests are passing on buildbot: http://ci.apache.org/waterfall?show=ofbiz-trunk
>>> Strange... Maybe it's because the tests are in failure and not error ? It just tried it once again, and I still got the tests not passing...
>>>
>>>>
>>>> Regards
>>>> Scott
>>>>
>>>
>>> --
>>> Erwan de FERRIERES
>>> www.nereide.biz
>>
>>
>
> --
> Erwan de FERRIERES
> www.nereide.biz

Reply | Threaded
Open this post in threaded view
|

Re: tests in error

Jacopo Cappellato-4
Erwan,

I have tested it and get a success on all tests. I don't know what is happening.

Jacopo

On Jan 29, 2010, at 2:35 PM, Jacopo Cappellato wrote:

> I didn't try but I am going to try today and let you know.
> Thank you for your further test and report.
>
> Jacopo
>
> On Jan 29, 2010, at 12:25 PM, Erwan de FERRIERES wrote:
>
>> Hi Jaccopo,
>>
>> Once again, the same test is in error. Have you succedeed in reproducing it ?
>>
>> Assertion failed: [invoiceTotal=323.54] equals [amount=323.0] as BigDecimal
>>
>> junit.framework.AssertionFailedError: Assertion failed: [invoiceTotal=323.54] equals [amount=323.0] as BigDecimal
>> at org.ofbiz.testtools.SimpleMethodTest.run(SimpleMethodTest.java:81)
>> at org.ofbiz.testtools.TestRunContainer.start(TestRunContainer.java:146)
>> at org.ofbiz.base.container.ContainerLoader.start(ContainerLoader.java:100)
>> at org.ofbiz.base.start.Start.startStartLoaders(Start.java:272)
>> at org.ofbiz.base.start.Start.startServer(Start.java:322)
>> at org.ofbiz.base.start.Start.start(Start.java:326)
>> at org.ofbiz.base.start.Start.main(Start.java:411)
>> Assertion failed: [invoiceTotal=36.43] equals [amount=36.0] as BigDecimal
>>
>> junit.framework.AssertionFailedError: Assertion failed: [invoiceTotal=36.43] equals [amount=36.0] as BigDecimal
>> at org.ofbiz.testtools.SimpleMethodTest.run(SimpleMethodTest.java:81)
>> at org.ofbiz.testtools.TestRunContainer.start(TestRunContainer.java:146)
>> at org.ofbiz.base.container.ContainerLoader.start(ContainerLoader.java:100)
>> at org.ofbiz.base.start.Start.startStartLoaders(Start.java:272)
>> at org.ofbiz.base.start.Start.startServer(Start.java:322)
>> at org.ofbiz.base.start.Start.start(Start.java:326)
>> at org.ofbiz.base.start.Start.main(Start.java:411)
>> Assertion failed: [invoiceTotal=56.99] equals [amount=56.0] as BigDecimal
>>
>> junit.framework.AssertionFailedError: Assertion failed: [invoiceTotal=56.99] equals [amount=56.0] as BigDecimal
>> at org.ofbiz.testtools.SimpleMethodTest.run(SimpleMethodTest.java:81)
>> at org.ofbiz.testtools.TestRunContainer.start(TestRunContainer.java:146)
>> at org.ofbiz.base.container.ContainerLoader.start(ContainerLoader.java:100)
>> at org.ofbiz.base.start.Start.startStartLoaders(Start.java:272)
>> at org.ofbiz.base.start.Start.startServer(Start.java:322)
>> at org.ofbiz.base.start.Start.start(Start.java:326)
>> at org.ofbiz.base.start.Start.main(Start.java:411)
>> Assertion failed: [invoiceTotal=543.23] equals [amount=543.0] as BigDecimal
>>
>> Le 29/01/2010 11:37, Jacopo Cappellato a écrit :
>>> Erwan,
>>>
>>> could you please clean all your data and try again?
>>> ant clean-all
>>> ant run-tests
>>>
>>> I know that there is an entity test that fails becaiuse of some records not being rolled back in previous test runs.
>>>
>>> Jacopo
>>>
>>> On Jan 29, 2010, at 11:28 AM, Erwan de FERRIERES wrote:
>>>
>>>>
>>>>
>>>> Le 29/01/2010 00:13, Scott Gray a écrit :
>>>>> Hi Erwan
>>>>>
>>>>> The tests are passing on buildbot: http://ci.apache.org/waterfall?show=ofbiz-trunk
>>>> Strange... Maybe it's because the tests are in failure and not error ? It just tried it once again, and I still got the tests not passing...
>>>>
>>>>>
>>>>> Regards
>>>>> Scott
>>>>>
>>>>
>>>> --
>>>> Erwan de FERRIERES
>>>> www.nereide.biz
>>>
>>>
>>
>> --
>> Erwan de FERRIERES
>> www.nereide.biz
>

Reply | Threaded
Open this post in threaded view
|

Re: tests in error

Erwan de FERRIERES-3
Ok, so it must be on my machine.
Thanks for having looking !

Le 29/01/2010 15:27, Jacopo Cappellato a écrit :

> Erwan,
>
> I have tested it and get a success on all tests. I don't know what is happening.
>
> Jacopo
>
> On Jan 29, 2010, at 2:35 PM, Jacopo Cappellato wrote:
>
>> I didn't try but I am going to try today and let you know.
>> Thank you for your further test and report.
>>
>> Jacopo
>>
>> On Jan 29, 2010, at 12:25 PM, Erwan de FERRIERES wrote:
>>
../..
--
Erwan de FERRIERES
www.nereide.biz
Reply | Threaded
Open this post in threaded view
|

Re: tests in error

Erwan de FERRIERES

> ../..
Errors are still present on my machine. So, when looking deeper, it
looks like the InvoiceWorker.getInvoiceTotal method doesn't use any
locale. When returning a result via the run-tests commande, its decimals
are removed, so the results is always xxx.00, and then the test is in error.

I've changed my machine's locale to en_US, and the results are fine.
When going back to fr_FR, then all the testInvoiceWorkerGetInvoiceTotal
is in error.

--
Erwan de FERRIERES
www.nereide.biz
Reply | Threaded
Open this post in threaded view
|

Re: tests in error

Jacopo Cappellato-4
This is interesting Erwan!
Could you please debug a bit more that method and find out where exactly is the problem?
My guess is that the issue is in getInvoiceCurrencyConversionRate

Jacopo

On Feb 17, 2010, at 12:31 PM, Erwan de FERRIERES wrote:

>
>> ../..
> Errors are still present on my machine. So, when looking deeper, it looks like the InvoiceWorker.getInvoiceTotal method doesn't use any locale. When returning a result via the run-tests commande, its decimals are removed, so the results is always xxx.00, and then the test is in error.
>
> I've changed my machine's locale to en_US, and the results are fine. When going back to fr_FR, then all the testInvoiceWorkerGetInvoiceTotal is in error.
>
> --
> Erwan de FERRIERES
> www.nereide.biz

Reply | Threaded
Open this post in threaded view
|

Re: tests in error

Jacopo Cappellato-4

On Feb 17, 2010, at 12:52 PM, Jacopo Cappellato wrote:

> My guess is that the issue is in getInvoiceCurrencyConversionRate

Hmmm.... maybe not.

Jacopo

Reply | Threaded
Open this post in threaded view
|

Re: tests in error

Erwan de FERRIERES
Le 17/02/2010 12:56, Jacopo Cappellato a écrit :

>
> On Feb 17, 2010, at 12:52 PM, Jacopo Cappellato wrote:
>
>> My guess is that the issue is in getInvoiceCurrencyConversionRate
>
> Hmmm.... maybe not.
>
> Jacopo
>
>
Jacopo,

Here are more information :

when using pure JUnit tests, it's working great
     public void testTotalInvoice1() throws Exception {
         GenericValue invoice = null;
         invoice = delegator.findByPrimaryKey("Invoice",
UtilMisc.toMap("invoiceId", 8010));
         BigDecimal total = InvoiceWorker.getInvoiceTotal(invoice);
         assertEquals(new BigDecimal("179.97"), total);
     }

when defining the locale with LC_ALL=C, it's working great.

So it seems that the
<set field="amount" value="323.54" type="BigDecimal"/>
in AutoInvoiceTests.xml is having some difficulties...


--
Erwan de FERRIERES
www.nereide.biz