You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ofbiz.apache.org by Erwan de FERRIERES <er...@nereide.fr> on 2010/02/17 12:31:51 UTC
Re: tests in error
> ../..
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
Re: tests in error
Posted by Erwan de FERRIERES <er...@nereide.fr>.
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
Re: tests in error
Posted by Jacopo Cappellato <ja...@hotwaxmedia.com>.
On Feb 17, 2010, at 12:52 PM, Jacopo Cappellato wrote:
> My guess is that the issue is in getInvoiceCurrencyConversionRate
Hmmm.... maybe not.
Jacopo
Re: tests in error
Posted by Jacopo Cappellato <ja...@hotwaxmedia.com>.
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