klute 2004/08/15 06:40:23
Modified: src/testcases/org/apache/poi/hpsf/basic TestWrite.java
Log:
Restored the functionality to use ALL files beginning with "Test" in
src/testcases/org/apache/poi/hpsf/data as test data. Each of these files is read and
rewritten. The result is compared with the original and must be equal to it.
Revision Changes Path
1.17 +35 -30
jakarta-poi/src/testcases/org/apache/poi/hpsf/basic/TestWrite.java
Index: TestWrite.java
===================================================================
RCS file:
/home/cvs/jakarta-poi/src/testcases/org/apache/poi/hpsf/basic/TestWrite.java,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -r1.16 -r1.17
--- TestWrite.java 13 Aug 2004 22:38:52 -0000 1.16
+++ TestWrite.java 15 Aug 2004 13:40:22 -0000 1.17
@@ -396,22 +396,38 @@
check(Variant.VT_I2, new Integer(27), codepage);
check(Variant.VT_I4, new Long(28), codepage);
check(Variant.VT_FILETIME, new Date(), codepage);
- check(Variant.VT_LPSTR, "", codepage);
- check(Variant.VT_LPSTR, "\u00e4", codepage);
- check(Variant.VT_LPSTR, "\u00e4\u00f6", codepage);
- check(Variant.VT_LPSTR, "\u00e4\u00f6\u00fc", codepage);
- check(Variant.VT_LPSTR, "\u00e4\u00f6\u00fc\u00c4", codepage);
- check(Variant.VT_LPSTR, "\u00e4\u00f6\u00fc\u00c4\u00d6", codepage);
- check(Variant.VT_LPSTR, "\u00e4\u00f6\u00fc\u00c4\u00d6\u00dc",
codepage);
- check(Variant.VT_LPSTR, "\u00e4\u00f6\u00fc\u00c4\u00d6\u00dc\u00df",
codepage);
- check(Variant.VT_LPWSTR, "", codepage);
- check(Variant.VT_LPWSTR, "\u00e4", codepage);
- check(Variant.VT_LPWSTR, "\u00e4\u00f6", codepage);
- check(Variant.VT_LPWSTR, "\u00e4\u00f6\u00fc", codepage);
- check(Variant.VT_LPWSTR, "\u00e4\u00f6\u00fc\u00c4", codepage);
- check(Variant.VT_LPWSTR, "\u00e4\u00f6\u00fc\u00c4\u00d6", codepage);
- check(Variant.VT_LPWSTR, "\u00e4\u00f6\u00fc\u00c4\u00d6\u00dc",
codepage);
- check(Variant.VT_LPWSTR, "\u00e4\u00f6\u00fc\u00c4\u00d6\u00dc\u00df",
codepage);
+ check(Variant.VT_LPSTR,
+ "", codepage);
+ check(Variant.VT_LPSTR,
+ "\u00e4", codepage);
+ check(Variant.VT_LPSTR,
+ "\u00e4\u00f6", codepage);
+ check(Variant.VT_LPSTR,
+ "\u00e4\u00f6\u00fc", codepage);
+ check(Variant.VT_LPSTR,
+ "\u00e4\u00f6\u00fc\u00c4", codepage);
+ check(Variant.VT_LPSTR,
+ "\u00e4\u00f6\u00fc\u00c4\u00d6", codepage);
+ check(Variant.VT_LPSTR,
+ "\u00e4\u00f6\u00fc\u00c4\u00d6\u00dc", codepage);
+ check(Variant.VT_LPSTR,
+ "\u00e4\u00f6\u00fc\u00c4\u00d6\u00dc\u00df", codepage);
+ check(Variant.VT_LPWSTR,
+ "", codepage);
+ check(Variant.VT_LPWSTR,
+ "\u00e4", codepage);
+ check(Variant.VT_LPWSTR,
+ "\u00e4\u00f6", codepage);
+ check(Variant.VT_LPWSTR,
+ "\u00e4\u00f6\u00fc", codepage);
+ check(Variant.VT_LPWSTR,
+ "\u00e4\u00f6\u00fc\u00c4", codepage);
+ check(Variant.VT_LPWSTR,
+ "\u00e4\u00f6\u00fc\u00c4\u00d6", codepage);
+ check(Variant.VT_LPWSTR,
+ "\u00e4\u00f6\u00fc\u00c4\u00d6\u00dc", codepage);
+ check(Variant.VT_LPWSTR,
+ "\u00e4\u00f6\u00fc\u00c4\u00d6\u00dc\u00df", codepage);
}
catch (Exception ex)
{
@@ -637,23 +653,11 @@
{
final File dataDir =
new File(System.getProperty("HPSF.testdata.path"));
- String[] filesToTest = new String[]{
- "Test0313rur.adm",
- "TestChineseProperties.doc",
- "TestCorel.shw",
- "TestEditTime.doc",
- "TestGermanWord90.doc",
- "TestMickey.doc",
- "TestSectionDictionary.doc",
- "TestUnicode.xls"
-
- };
- final java.util.List listFilesToTest = Arrays.asList(filesToTest);
final File[] fileList = dataDir.listFiles(new FileFilter()
{
public boolean accept(final File f)
{
- return listFilesToTest.contains(f.getName());
+ return f.getName().startsWith("Test");
}
});
for (int i = 0; i < fileList.length; i++)
@@ -670,6 +674,7 @@
*/
private void testRecreate(final File f)
{
+ System.out.println("Recreating file \"" + f + "\"");
try
{
/* Read the POI filesystem's property set streams: */
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]