You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@poi.apache.org by ye...@apache.org on 2010/06/13 08:26:14 UTC
svn commit: r954172 - in /poi/trunk: build.xml
src/testcases/org/apache/poi/hssf/extractor/TestExcelExtractor.java
src/testcases/org/apache/poi/hssf/usermodel/TestHSSFDataFormatter.java
Author: yegor
Date: Sun Jun 13 06:26:14 2010
New Revision: 954172
URL: http://svn.apache.org/viewvc?rev=954172&view=rev
Log:
force ASCII encoding when compiling sources, fixed unmappable characters for encoding ASCII
Modified:
poi/trunk/build.xml
poi/trunk/src/testcases/org/apache/poi/hssf/extractor/TestExcelExtractor.java
poi/trunk/src/testcases/org/apache/poi/hssf/usermodel/TestHSSFDataFormatter.java
Modified: poi/trunk/build.xml
URL: http://svn.apache.org/viewvc/poi/trunk/build.xml?rev=954172&r1=954171&r2=954172&view=diff
==============================================================================
--- poi/trunk/build.xml (original)
+++ poi/trunk/build.xml Sun Jun 13 06:26:14 2010
@@ -66,6 +66,9 @@ under the License.
<property name="jdk.version.class" value="1.5" description="JDK version of generated class files"/>
<property name="compile.debug" value="true"/>
+ <!-- issue warnings if source code contains unmappable characters for encoding ASCII -->
+ <property name="java.source.encoding" value="ASCII"/>
+
<!--
JVM system properties for running tests,
user.language and user.country are required as we have locale-sensitive formatters
@@ -421,6 +424,7 @@ under the License.
destdir="${main.output.dir}"
srcdir="${main.src}"
debug="${compile.debug}"
+ encoding="${java.source.encoding}"
fork="yes">
<classpath refid="main.classpath"/>
</javac>
@@ -429,6 +433,7 @@ under the License.
destdir="${main.output.test.dir}"
srcdir="${main.src.test}"
debug="${compile.debug}"
+ encoding="${java.source.encoding}"
fork="yes">
<classpath>
<path refid="main.classpath"/>
@@ -446,6 +451,7 @@ under the License.
destdir="${scratchpad.output.dir}"
srcdir="${scratchpad.src}"
debug="${compile.debug}"
+ encoding="${java.source.encoding}"
fork="yes">
<classpath refid="scratchpad.classpath"/>
</javac>
@@ -454,6 +460,7 @@ under the License.
destdir="${scratchpad.output.test.dir}"
srcdir="${scratchpad.src.test}"
debug="${compile.debug}"
+ encoding="${java.source.encoding}"
fork="yes">
<classpath>
<path refid="scratchpad.classpath"/>
@@ -472,6 +479,7 @@ under the License.
destdir="${contrib.output.dir}"
srcdir="${contrib.src}"
debug="${compile.debug}"
+ encoding="${java.source.encoding}"
fork="yes">
<classpath refid="contrib.classpath"/>
</javac>
@@ -481,6 +489,7 @@ under the License.
destdir="${contrib.output.test.dir}"
srcdir="${contrib.src.test}"
debug="${compile.debug}"
+ encoding="${java.source.encoding}"
fork="yes">
<classpath>
<path refid="contrib.classpath"/>
@@ -495,6 +504,7 @@ under the License.
destdir="${examples.output.dir}"
srcdir="${examples.src}"
debug="${compile.debug}"
+ encoding="${java.source.encoding}"
fork="yes">
<classpath>
<path refid="ooxml.classpath"/>
@@ -513,6 +523,7 @@ under the License.
source="${jdk.version.source}"
destdir="${ooxml.output.dir}"
srcdir="${ooxml.src}"
+ encoding="${java.source.encoding}"
debug="${compile.debug}">
<classpath refid="ooxml.classpath"/>
</javac>
@@ -521,6 +532,7 @@ under the License.
destdir="${ooxml.output.test.dir}"
srcdir="${ooxml.src.test}"
debug="${compile.debug}"
+ encoding="${java.source.encoding}"
fork="yes">
<classpath>
<path refid="ooxml.classpath"/>
@@ -547,7 +559,9 @@ under the License.
<!-- Compile -->
<javac target="${jdk.version.class}" source="${jdk.version.source}"
failonerror="true" destdir="${main.output.dir}" debug="on" fork="yes"
- srcdir="${main.output.dir}"/>
+ srcdir="${main.output.dir}"
+ encoding="${java.source.encoding}">
+ </javac>
<!-- Tidy up -->
<delete file="${version.java}"/>
</target>
Modified: poi/trunk/src/testcases/org/apache/poi/hssf/extractor/TestExcelExtractor.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/testcases/org/apache/poi/hssf/extractor/TestExcelExtractor.java?rev=954172&r1=954171&r2=954172&view=diff
==============================================================================
--- poi/trunk/src/testcases/org/apache/poi/hssf/extractor/TestExcelExtractor.java (original)
+++ poi/trunk/src/testcases/org/apache/poi/hssf/extractor/TestExcelExtractor.java Sun Jun 13 06:26:14 2010
@@ -251,7 +251,7 @@ public final class TestExcelExtractor ex
);
assertTrue(
text.indexOf(
- "£nn.nn\t£10.52\n"
+ "\u00a3nn.nn\t\u00a310.52\n"
) > -1
);
}
Modified: poi/trunk/src/testcases/org/apache/poi/hssf/usermodel/TestHSSFDataFormatter.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/testcases/org/apache/poi/hssf/usermodel/TestHSSFDataFormatter.java?rev=954172&r1=954171&r2=954172&view=diff
==============================================================================
--- poi/trunk/src/testcases/org/apache/poi/hssf/usermodel/TestHSSFDataFormatter.java (original)
+++ poi/trunk/src/testcases/org/apache/poi/hssf/usermodel/TestHSSFDataFormatter.java Sun Jun 13 06:26:14 2010
@@ -405,9 +405,9 @@ public final class TestHSSFDataFormatter
assertEquals("10.5", f.formatCellValue(sheet.getRow(11).getCell(1)));
// text isn't quite the format rule...
- assertEquals("£nn.nn", sheet.getRow(12).getCell(0).getStringCellValue());
- assertEquals("\"£\"#,##0.00", sheet.getRow(12).getCell(1).getCellStyle().getDataFormatString());
- assertEquals("£10.52", f.formatCellValue(sheet.getRow(12).getCell(1)));
+ assertEquals("\u00a3nn.nn", sheet.getRow(12).getCell(0).getStringCellValue());
+ assertEquals("\"\u00a3\"#,##0.00", sheet.getRow(12).getCell(1).getCellStyle().getDataFormatString());
+ assertEquals("\u00a310.52", f.formatCellValue(sheet.getRow(12).getCell(1)));
}
private static void log(String msg) {
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@poi.apache.org
For additional commands, e-mail: commits-help@poi.apache.org