aboutsummaryrefslogtreecommitdiffstats
path: root/src/testcases/org/apache/poi/hpsf/basic/TestWriteWellKnown.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/testcases/org/apache/poi/hpsf/basic/TestWriteWellKnown.java')
-rw-r--r--src/testcases/org/apache/poi/hpsf/basic/TestWriteWellKnown.java44
1 files changed, 22 insertions, 22 deletions
diff --git a/src/testcases/org/apache/poi/hpsf/basic/TestWriteWellKnown.java b/src/testcases/org/apache/poi/hpsf/basic/TestWriteWellKnown.java
index 152e04cf88..3d3c962a82 100644
--- a/src/testcases/org/apache/poi/hpsf/basic/TestWriteWellKnown.java
+++ b/src/testcases/org/apache/poi/hpsf/basic/TestWriteWellKnown.java
@@ -17,11 +17,11 @@
package org.apache.poi.hpsf.basic;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertNull;
+import static org.junit.jupiter.api.Assertions.assertTrue;
import java.io.File;
import java.io.FileInputStream;
@@ -51,8 +51,8 @@ import org.apache.poi.poifs.filesystem.POIFSFileSystem;
import org.apache.poi.util.IOUtils;
import org.apache.poi.util.LocaleUtil;
import org.apache.poi.util.TempFile;
-import org.junit.BeforeClass;
-import org.junit.Test;
+import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.Test;
/**
* <p>Tests HPSF's high-level writing functionality for the well-known property
@@ -62,7 +62,7 @@ public class TestWriteWellKnown {
private static final String POI_FS = "TestWriteWellKnown.doc";
- @BeforeClass
+ @BeforeAll
public static void setUp() {
VariantSupport.setLogUnsupportedTypes(false);
}
@@ -125,7 +125,7 @@ public class TestWriteWellKnown {
cal.set(2002, 8, 8, 8, 8, 8);
P_LAST_SAVE_DATE_TIME = cal.getTime();
}
-
+
/**
* <p>This test method test the writing of properties in the well-known
* property set streams "SummaryInformation" and
@@ -172,7 +172,7 @@ public class TestWriteWellKnown {
@Test
public void testWriteWellKnown() throws Exception {
POIDataSamples _samples = POIDataSamples.getHPSFInstance();
-
+
final File doc1 = TempFile.createTempFile("POI_HPSF_Test1.", ".tmp");
final File doc2 = TempFile.createTempFile("POI_HPSF_Test2.", ".tmp");
final File doc3 = TempFile.createTempFile("POI_HPSF_Test3.", ".tmp");
@@ -182,14 +182,14 @@ public class TestWriteWellKnown {
IOUtils.copy(fis, fos);
fos.close();
fis.close();
-
+
CustomProperties cps1 = write1stFile(doc1, doc2);
CustomProperties cps2 = write2ndFile(doc2, doc3);
write3rdFile(doc3);
-
+
assertEquals(cps1, cps2);
}
-
+
/*
* Write all properties supported by HPSF to the summary information
* (e.g. author, edit date, application name) and to the document
@@ -268,17 +268,17 @@ public class TestWriteWellKnown {
cps.put("min_Long", MIN_LONG);
cps.put("max_Double", MAX_DOUBLE);
cps.put("min_Double", MIN_DOUBLE);
-
+
// Check the keys went in
assertTrue(cps.containsKey("Schl\u00fcssel \u00e4"));
assertTrue(cps.containsKey("Boolean"));
-
+
// Check the values went in
assertEquals("Wert \u00e4", cps.get("Schl\u00fcssel \u00e4"));
assertEquals(Boolean.TRUE, cps.get("Boolean"));
assertTrue(cps.containsValue(Boolean.TRUE));
assertTrue(cps.containsValue("Wert \u00e4"));
-
+
// Check that things that aren't in aren't in
assertFalse(cps.containsKey("False Boolean"));
assertFalse(cps.containsValue(Boolean.FALSE));
@@ -286,7 +286,7 @@ public class TestWriteWellKnown {
// Save as our custom properties
dsi.setCustomProperties(cps);
-
+
/* Write the summary information stream and the document summary
* information stream to the POI filesystem. */
si.write(poifs.getRoot(), SummaryInformation.DEFAULT_STREAM_NAME);
@@ -298,10 +298,10 @@ public class TestWriteWellKnown {
poifs.writeFilesystem(out);
out.close();
poifs.close();
-
+
return cps;
}
-
+
/*
* Open <em>doc2</em> for reading and check summary information and
* document summary information. All properties written before must be
@@ -419,10 +419,10 @@ public class TestWriteWellKnown {
poifs.writeFilesystem(out);
out.close();
poifs.close();
-
+
return cps;
}
-
+
/*
* Open {@code doc3} for reading and check summary information
* and document summary information. All properties removed before must not
@@ -491,7 +491,7 @@ public class TestWriteWellKnown {
dis.close();
return si;
}
-
+
static DocumentSummaryInformation getDocumentSummaryInformation(POIFSFileSystem poifs)
throws IOException, NoPropertySetStreamException, UnexpectedPropertySetTypeException {
if (!poifs.getRoot().hasEntry(DocumentSummaryInformation.DEFAULT_STREAM_NAME)) {