Bug 49344 - NumberFormatTests.xlsx fail on my machine
Summary: NumberFormatTests.xlsx fail on my machine
Status: RESOLVED INVALID
Alias: None
Product: POI
Classification: Unclassified
Component: XSSF (show other bugs)
Version: 3.7-dev
Hardware: PC Windows XP
: P2 normal (vote)
Target Milestone: ---
Assignee: POI Developers List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-05-26 08:33 UTC by Antoni Mylka
Modified: 2010-05-26 13:24 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Antoni Mylka 2010-05-26 08:33:19 UTC
With the current trunk (rev948199) I get two build failures. Both of them are related to the patch applied in rev942809 as described in issue 49066. I work on a Polish Locale. I had other problems with this, but this time it's weird. build.xml seems to set the locale to en_US via junit.properties (which is a good idea) but I still can't build POI.

The NumberFormatTests.xlsx seems to fail on row 333. The value of the cell A333 in the "Tests" sheet is unreadable in an English version of Excel 2010beta. This is the only cell in the A column that produces a #VALUE!. All other values in the A column are visible correctly in Excel and pass in java code.

The NumberFormatApproxTests.xlsx is much worse. When I open it in Excel, almost all values in the A column of the "Tests" sheet show a #VALUE! error. Only cells which show an actual value are: A40, A41, A96, A97, A136, A137, A176, A177, A216, A217. I get a failure in row 7: expected 120000.0 but was 100000.0. 

How should I approach debugging this?

     [java] 1) testNumberFormat(org.apache.poi.ss.format.TestCellFormatPart)junit.framework.ComparisonFailure: format "org.apache.poi.ss.format.CellFormatPart@511e0a" expected:<....14...> but was:<...,,14,159.3,...>
     [java] 	at org.apache.poi.ss.format.CellFormatTestBase$CellValue.equivalent(CellFormatTestBase.java:74)
     [java] 	at org.apache.poi.ss.format.CellFormatTestBase.tryColor(CellFormatTestBase.java:228)
     [java] 	at org.apache.poi.ss.format.CellFormatTestBase.tryFormat(CellFormatTestBase.java:201)
     [java] 	at org.apache.poi.ss.format.CellFormatTestBase.runFormatTests(CellFormatTestBase.java:109)
     [java] 	at org.apache.poi.ss.format.TestCellFormatPart.testNumberFormat(TestCellFormatPart.java:50)
     [java] 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
     [java] 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
     [java] 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
     [java] 	at org.apache.poi.util.OOXMLLite.build(OOXMLLite.java:103)
     [java] 	at org.apache.poi.util.OOXMLLite.main(OOXMLLite.java:78)
     [java] 2) testNumberApproxFormat(org.apache.poi.ss.format.TestCellFormatPart)junit.framework.AssertionFailedError: format "org.apache.poi.ss.format.CellFormatPart@8be9ef",|1.2|e|5| ~= |1,2.1|e|5| expected:<120000.0> but was:<100000.0>
     [java] 	at org.apache.poi.ss.format.TestCellFormatPart$3.equivalent(TestCellFormatPart.java:70)
     [java] 	at org.apache.poi.ss.format.CellFormatTestBase.tryColor(CellFormatTestBase.java:228)
     [java] 	at org.apache.poi.ss.format.CellFormatTestBase.tryFormat(CellFormatTestBase.java:201)
     [java] 	at org.apache.poi.ss.format.CellFormatTestBase.runFormatTests(CellFormatTestBase.java:109)
     [java] 	at org.apache.poi.ss.format.TestCellFormatPart.testNumberApproxFormat(TestCellFormatPart.java:58)
     [java] 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
     [java] 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
     [java] 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
     [java] 	at org.apache.poi.util.OOXMLLite.build(OOXMLLite.java:103)
     [java] 	at org.apache.poi.util.OOXMLLite.main(OOXMLLite.java:78)
Comment 1 Yegor Kozlov 2010-05-26 09:48:09 UTC
Can you run Ant in the debug mode:

"ant -debug ..."

Are there warnings or errors? 

Try to replace the reference to syspropertyset with explicit definition, that is,

replace
            <syspropertyset refid="junit.properties"/>

with

            <sysproperty name="user.language" value="en"/>
            <sysproperty name="user.country" value="US"/>
            <sysproperty name="POI.testdata.path" value="test-data"/>
            <sysproperty name="java.awt.headless" value="true"/>

What version of Ant are you running?  I'm on Ant 1.7.1 and tests against English and Russian locales pass OK to me.

Yegor
Comment 2 Antoni Mylka 2010-05-26 13:24:02 UTC
I reran the build with -debug and found the following lines in the output.

Override ignored for property "user.language"
Override ignored for property "user.country"

I have no idea who or what sets those properties.

ant -Duser.language=en -Duser.country=US dist

works for me now.

Thanks.

As far as I'm concerned this issue may be closed. It may be a quirk of my environment. I can live with the workaround.

I take the liberty of marking this as invalid. 

Sorry for the hassle.