disabled a test failing under jdk 1.5: it assumes rounding mode half-up and jdk 1.6+
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1212401 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
e8208a7363
commit
49c8d803f1
@ -311,6 +311,12 @@ public class TestDataFormatter extends TestCase {
|
|||||||
assertEquals("120", dfUS.formatRawCellContents(120*second, -1, "[ss]"));
|
assertEquals("120", dfUS.formatRawCellContents(120*second, -1, "[ss]"));
|
||||||
assertEquals("121", dfUS.formatRawCellContents(121*second, -1, "[ss]"));
|
assertEquals("121", dfUS.formatRawCellContents(121*second, -1, "[ss]"));
|
||||||
|
|
||||||
|
boolean jdk_1_5 = System.getProperty("java.vm.version").startsWith("1.5");
|
||||||
|
if(!jdk_1_5) {
|
||||||
|
// YK: the tests below were written under JDK 1.6 and assume that
|
||||||
|
// the rounding mode in the underlying decimal formatters is HALF_UP
|
||||||
|
// It is not so JDK 1.5 where the default rounding mode is HALV_EVEN and cannot be changed.
|
||||||
|
|
||||||
assertEquals("27:18:08", dfUS.formatRawCellContents(1.1376, -1, "[h]:mm:ss"));
|
assertEquals("27:18:08", dfUS.formatRawCellContents(1.1376, -1, "[h]:mm:ss"));
|
||||||
assertEquals("28:48:00", dfUS.formatRawCellContents(1.2, -1, "[h]:mm:ss"));
|
assertEquals("28:48:00", dfUS.formatRawCellContents(1.2, -1, "[h]:mm:ss"));
|
||||||
assertEquals("29:31:12", dfUS.formatRawCellContents(1.23, -1, "[h]:mm:ss"));
|
assertEquals("29:31:12", dfUS.formatRawCellContents(1.23, -1, "[h]:mm:ss"));
|
||||||
@ -327,6 +333,7 @@ public class TestDataFormatter extends TestCase {
|
|||||||
assertEquals("57:41.760", dfUS.formatRawCellContents(.1234, -1, "mm:ss.000;@"));
|
assertEquals("57:41.760", dfUS.formatRawCellContents(.1234, -1, "mm:ss.000;@"));
|
||||||
assertEquals("24:00.0", dfUS.formatRawCellContents(123456.6, -1, "mm:ss.0"));
|
assertEquals("24:00.0", dfUS.formatRawCellContents(123456.6, -1, "mm:ss.0"));
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public void testDateWindowing() {
|
public void testDateWindowing() {
|
||||||
DataFormatter dfUS = new DataFormatter(Locale.US);
|
DataFormatter dfUS = new DataFormatter(Locale.US);
|
||||||
|
Loading…
Reference in New Issue
Block a user