aboutsummaryrefslogtreecommitdiffstats
path: root/src/testcases
diff options
context:
space:
mode:
Diffstat (limited to 'src/testcases')
-rw-r--r--src/testcases/org/apache/poi/hssf/usermodel/TestCellStyle.java13
-rw-r--r--src/testcases/org/apache/poi/poifs/property/TestDirectoryProperty.java2
-rw-r--r--src/testcases/org/apache/poi/poifs/property/TestRootProperty.java4
-rw-r--r--src/testcases/org/apache/poi/poifs/storage/TestBlockAllocationTableReader.java4
-rw-r--r--src/testcases/org/apache/poi/poifs/storage/TestBlockAllocationTableWriter.java6
5 files changed, 20 insertions, 9 deletions
diff --git a/src/testcases/org/apache/poi/hssf/usermodel/TestCellStyle.java b/src/testcases/org/apache/poi/hssf/usermodel/TestCellStyle.java
index f7eb6a5162..04fa4c6584 100644
--- a/src/testcases/org/apache/poi/hssf/usermodel/TestCellStyle.java
+++ b/src/testcases/org/apache/poi/hssf/usermodel/TestCellStyle.java
@@ -135,7 +135,7 @@ public class TestCellStyle
}
/**
- * Tests that is creating a file with a date works correctly.
+ * Tests that is creating a file with a date or an calendar works correctly.
*/
public void testDataStyle()
throws Exception
@@ -147,10 +147,21 @@ public class TestCellStyle
HSSFSheet s = wb.createSheet();
HSSFCellStyle cs = wb.createCellStyle();
HSSFRow row = s.createRow((short)0);
+
+ // with Date:
HSSFCell cell = row.createCell((short)1);
cs.setDataFormat(HSSFDataFormat.getFormat("m/d/yy"));
cell.setCellStyle(cs);
cell.setCellValue(new Date());
+
+ // with Calendar:
+ cell = row.createCell((short)2);
+ cs.setDataFormat(HSSFDataFormat.getFormat("m/d/yy"));
+ cell.setCellStyle(cs);
+ Calendar cal = Calendar.getInstance();
+ cal.setTime(new Date());
+ cell.setCellValue(cal);
+
wb.write(out);
out.close();
diff --git a/src/testcases/org/apache/poi/poifs/property/TestDirectoryProperty.java b/src/testcases/org/apache/poi/poifs/property/TestDirectoryProperty.java
index 3ed55270e9..9eca02541b 100644
--- a/src/testcases/org/apache/poi/poifs/property/TestDirectoryProperty.java
+++ b/src/testcases/org/apache/poi/poifs/property/TestDirectoryProperty.java
@@ -61,7 +61,7 @@ import java.util.*;
import junit.framework.*;
-import org.apache.poi.poifs.common.PoiFSConstants;
+import org.apache.poi.poifs.common.POIFSConstants;
/**
* Class to test DirectoryProperty functionality
diff --git a/src/testcases/org/apache/poi/poifs/property/TestRootProperty.java b/src/testcases/org/apache/poi/poifs/property/TestRootProperty.java
index 8304647595..cec79393ee 100644
--- a/src/testcases/org/apache/poi/poifs/property/TestRootProperty.java
+++ b/src/testcases/org/apache/poi/poifs/property/TestRootProperty.java
@@ -61,7 +61,7 @@ import java.util.*;
import junit.framework.*;
-import org.apache.poi.poifs.common.PoiFSConstants;
+import org.apache.poi.poifs.common.POIFSConstants;
/**
* Class to test RootProperty functionality
@@ -124,7 +124,7 @@ public class TestRootProperty
{
_testblock[ index ] = ( byte ) 0;
}
- _testblock[ index++ ] = ( byte ) PoiFSConstants.END_OF_CHAIN;
+ _testblock[ index++ ] = ( byte ) POIFSConstants.END_OF_CHAIN;
for (; index < 0x78; index++)
{
_testblock[ index ] = ( byte ) 0xff;
diff --git a/src/testcases/org/apache/poi/poifs/storage/TestBlockAllocationTableReader.java b/src/testcases/org/apache/poi/poifs/storage/TestBlockAllocationTableReader.java
index cd0c116b71..566b363ee2 100644
--- a/src/testcases/org/apache/poi/poifs/storage/TestBlockAllocationTableReader.java
+++ b/src/testcases/org/apache/poi/poifs/storage/TestBlockAllocationTableReader.java
@@ -61,7 +61,7 @@ import java.util.*;
import junit.framework.*;
-import org.apache.poi.poifs.common.PoiFSConstants;
+import org.apache.poi.poifs.common.POIFSConstants;
import org.apache.poi.util.LittleEndian;
import org.apache.poi.util.LittleEndianConsts;
@@ -1254,7 +1254,7 @@ public class TestBlockAllocationTableReader
else if (i % 256 == 255)
{
assertEquals("Verify end of chain for block " + i,
- PoiFSConstants.END_OF_CHAIN,
+ POIFSConstants.END_OF_CHAIN,
table.getNextBlockIndex(i));
}
else
diff --git a/src/testcases/org/apache/poi/poifs/storage/TestBlockAllocationTableWriter.java b/src/testcases/org/apache/poi/poifs/storage/TestBlockAllocationTableWriter.java
index c751f038b2..f8e5747275 100644
--- a/src/testcases/org/apache/poi/poifs/storage/TestBlockAllocationTableWriter.java
+++ b/src/testcases/org/apache/poi/poifs/storage/TestBlockAllocationTableWriter.java
@@ -61,7 +61,7 @@ import java.util.*;
import junit.framework.*;
-import org.apache.poi.poifs.common.PoiFSConstants;
+import org.apache.poi.poifs.common.POIFSConstants;
import org.apache.poi.util.LittleEndian;
import org.apache.poi.util.LittleEndianConsts;
@@ -189,7 +189,7 @@ public class TestBlockAllocationTableWriter
offset += LittleEndianConsts.INT_SIZE;
}
LittleEndian.putInt(expected, offset,
- PoiFSConstants.END_OF_CHAIN);
+ POIFSConstants.END_OF_CHAIN);
offset += 4;
block_index++;
}
@@ -197,7 +197,7 @@ public class TestBlockAllocationTableWriter
// add BAT block indices
LittleEndian.putInt(expected, offset, block_index++);
offset += LittleEndianConsts.INT_SIZE;
- LittleEndian.putInt(expected, offset, PoiFSConstants.END_OF_CHAIN);
+ LittleEndian.putInt(expected, offset, POIFSConstants.END_OF_CHAIN);
for (int k = 0; k < expected.length; k++)
{
assertEquals("At offset " + k, expected[ k ], output[ k ]);