]> source.dussan.org Git - poi.git/commitdiff
ensure english locale for POI build
authorYegor Kozlov <yegor@apache.org>
Sun, 30 May 2010 12:39:42 +0000 (12:39 +0000)
committerYegor Kozlov <yegor@apache.org>
Sun, 30 May 2010 12:39:42 +0000 (12:39 +0000)
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@949511 13f79535-47bb-0310-9956-ffa450edef68

build.xml
src/testcases/org/apache/poi/ss/format/CellFormatTestBase.java

index 9ffdaf88e5c24479e52cd679f328fc5d0995ecc3..883db323fa027e3446ad9e4a59e79e7a901d522d 100644 (file)
--- a/build.xml
+++ b/build.xml
@@ -70,8 +70,7 @@ under the License.
       JVM system properties for running tests,
       user.language and user.country are required as we have locale-sensitive formatters
     -->
-    <property name="user.language" value="en"/>
-    <property name="user.country" value="US"/>
+    <property name="poi.test.locale" value="-Duser.language=en -Duser.country=US"/>
     <property name="POI.testdata.path" value="test-data"/>
     <property name="java.awt.headless" value="true"/>
     
@@ -159,8 +158,6 @@ under the License.
     <property name="halt.on.test.failure" value="true"/>
 
     <propertyset id="junit.properties">
-        <propertyref name="user.language"/>
-        <propertyref name="user.country"/>
         <propertyref name="POI.testdata.path"/>
         <propertyref name="java.awt.headless"/>
     </propertyset>
@@ -572,6 +569,7 @@ under the License.
                failureproperty="main.test.failed" showoutput="true">
             <classpath refid="test.classpath"/>
             <syspropertyset refid="junit.properties"/>
+            <jvmarg value="${poi.test.locale}"/>
             <formatter type="plain"/>
             <batchtest todir="${main.reports.test}">
                 <fileset dir="${main.src.test}">
@@ -608,6 +606,7 @@ under the License.
                failureproperty="scratchpad.test.failed">
             <classpath refid="test.scratchpad.classpath"/>
             <syspropertyset refid="junit.properties"/>
+            <jvmarg value="${poi.test.locale}"/>
             <formatter type="plain"/>
             <batchtest todir="${scratchpad.reports.test}">
                 <fileset dir="${scratchpad.src.test}">
@@ -642,6 +641,7 @@ under the License.
                 <pathelement location="${contrib.output.test.dir}"/>
             </classpath>
             <syspropertyset refid="junit.properties"/>
+            <jvmarg value="${poi.test.locale}"/>
             <formatter type="plain"/>
             <batchtest todir="${contrib.reports.test}">
                 <fileset dir="${contrib.src.test}">
@@ -672,6 +672,7 @@ under the License.
                  failureproperty="ooxml.test.failed">
               <classpath refid="@{classpath}"/>
               <syspropertyset refid="junit.properties"/>
+              <jvmarg value="${poi.test.locale}"/>
               <formatter type="plain"/>
               <batchtest todir="${ooxml.reports.test}">
                   <fileset dir="${ooxml.src.test}">
@@ -697,6 +698,7 @@ under the License.
         <java classname="org.apache.poi.util.OOXMLLite" fork="yes">
             <classpath refid="test.ooxml.classpath"/>
             <syspropertyset refid="junit.properties"/>
+            <jvmarg value="${poi.test.locale}"/>
             <arg line="-ooxml ${ooxml.xsds.jar} -test ${ooxml.output.test.dir} -dest ${ooxml.lite.output.dir}"/>
         </java>
     </target>
index b8d69251204601ff3ec6df09c4797fa81ca93cd6..28e9cfe46b8f5a69552cc8bf86b9f9d5c6d21c91 100644 (file)
@@ -43,6 +43,8 @@ import org.apache.poi.ss.usermodel.Cell;
 import org.apache.poi.ss.usermodel.Row;
 import org.apache.poi.ss.usermodel.Sheet;
 import org.apache.poi.ss.usermodel.Workbook;
+import org.apache.poi.util.POILogger;
+import org.apache.poi.util.POILogFactory;
 
 /**
  * This class is a base class for spreadsheet-based tests, such as are used for
@@ -58,6 +60,8 @@ import org.apache.poi.ss.usermodel.Workbook;
 @SuppressWarnings(
         {"JUnitTestCaseWithNoTests", "JUnitTestClassNamingConvention"})
 public class CellFormatTestBase extends TestCase {
+    private static final POILogger logger = POILogFactory.getLogger(CellFormatTestBase.class);
+
     private final ITestDataProvider _testDataProvider;
 
     protected Workbook workbook;
@@ -212,13 +216,11 @@ public class CellFormatTestBase extends TestCase {
         label.setForeground(testColor);
         label.setText("xyzzy");
 
-        System.out.printf("Row %d: \"%s\" -> \"%s\": expected \"%s\"", row + 1,
-                String.valueOf(value), desc, expectedText);
-        System.out.flush();
+        logger.log(POILogger.INFO, String.format("Row %d: \"%s\" -> \"%s\": expected \"%s\"", row + 1,
+                String.valueOf(value), desc, expectedText));
         String actualText = tryColor(desc, null, getter, value, expectedText,
                 testColor);
-        System.out.printf(", actual \"%s\")%n", actualText);
-        System.out.flush();
+        logger.log(POILogger.INFO, String.format(", actual \"%s\")%n", actualText));
 
         if (tryAllColors && testColor != TEST_COLOR) {
             for (int i = 0; i < COLOR_NAMES.length; i++) {