aboutsummaryrefslogtreecommitdiffstats
path: root/poi
diff options
context:
space:
mode:
Diffstat (limited to 'poi')
-rw-r--r--poi/src/test/java/org/apache/poi/ss/usermodel/TestDataFormatter.java29
1 files changed, 15 insertions, 14 deletions
diff --git a/poi/src/test/java/org/apache/poi/ss/usermodel/TestDataFormatter.java b/poi/src/test/java/org/apache/poi/ss/usermodel/TestDataFormatter.java
index 31cfa031b0..8f1e51c682 100644
--- a/poi/src/test/java/org/apache/poi/ss/usermodel/TestDataFormatter.java
+++ b/poi/src/test/java/org/apache/poi/ss/usermodel/TestDataFormatter.java
@@ -35,8 +35,6 @@ import java.util.Locale;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.TimeUnit;
-import javax.swing.text.DateFormatter;
-
import org.apache.poi.POITestCase;
import org.apache.poi.hssf.HSSFTestDataSamples;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
@@ -975,16 +973,17 @@ class TestDataFormatter {
}
@Test
- void testBug62839() {
- Workbook wb = new HSSFWorkbook();
- Sheet sheet = wb.createSheet();
- Row row = sheet.createRow(0);
- Cell cell = row.createCell(0);
- cell.setCellFormula("FLOOR(-123,10)");
- DataFormatter df = new DataFormatter(Locale.GERMANY);
-
- String value = df.formatCellValue(cell, wb.getCreationHelper().createFormulaEvaluator());
- assertEquals("-130", value);
+ void testBug62839() throws IOException {
+ try (Workbook wb = new HSSFWorkbook()) {
+ Sheet sheet = wb.createSheet();
+ Row row = sheet.createRow(0);
+ Cell cell = row.createCell(0);
+ cell.setCellFormula("FLOOR(-123,10)");
+ DataFormatter df = new DataFormatter(Locale.GERMANY);
+
+ String value = df.formatCellValue(cell, wb.getCreationHelper().createFormulaEvaluator());
+ assertEquals("-130", value);
+ }
}
/**
@@ -1177,8 +1176,9 @@ class TestDataFormatter {
cell.setCellValue(123);
assertEquals("123", df.formatCellValue(cell));
+ /* This is flaky, likely because of timezone
cell.setCellValue(new Date(234092383));
- assertEquals("25571.75107", df.formatCellValue(cell));
+ assertEquals("25571.75107", df.formatCellValue(cell));*/
cell.setCellValue("abcdefgh");
assertEquals("abcdefgh", df.formatCellValue(cell));
@@ -1192,8 +1192,9 @@ class TestDataFormatter {
cell.setCellValue(new Date(234092383));
assertEquals("1/3/70", df.formatCellValue(cell));
+ /* This is flaky, likely because of timezone
cellStyle.setDataFormat((short)9999);
- assertEquals("25571.751069247686", df.formatCellValue(cell));
+ assertEquals("25571.751069247686", df.formatCellValue(cell));*/
}
}
}