aboutsummaryrefslogtreecommitdiffstats
path: root/poi
diff options
context:
space:
mode:
authorDominik Stadler <centic@apache.org>2023-10-03 06:17:01 +0000
committerDominik Stadler <centic@apache.org>2023-10-03 06:17:01 +0000
commite8e6f671ef055819b0627e0c38fef65e4c6b299d (patch)
tree692911370380d997b977f0d7e5d3ae38ffd81d18 /poi
parenta5b4a3504af71ba9c5068842bed1a1fc46fcde85 (diff)
downloadpoi-e8e6f671ef055819b0627e0c38fef65e4c6b299d.tar.gz
poi-e8e6f671ef055819b0627e0c38fef65e4c6b299d.zip
Assert that deleting test-files and entries works in tests
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1912709 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'poi')
-rw-r--r--poi/src/test/java/org/apache/poi/hssf/usermodel/TestPOIFSProperties.java3
-rw-r--r--poi/src/test/java/org/apache/poi/poifs/filesystem/TestPOIFSStream.java10
2 files changed, 7 insertions, 6 deletions
diff --git a/poi/src/test/java/org/apache/poi/hssf/usermodel/TestPOIFSProperties.java b/poi/src/test/java/org/apache/poi/hssf/usermodel/TestPOIFSProperties.java
index 4faf164731..e9a6fbf43e 100644
--- a/poi/src/test/java/org/apache/poi/hssf/usermodel/TestPOIFSProperties.java
+++ b/poi/src/test/java/org/apache/poi/hssf/usermodel/TestPOIFSProperties.java
@@ -19,6 +19,7 @@ package org.apache.poi.hssf.usermodel;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertTrue;
import java.io.ByteArrayInputStream;
import java.io.IOException;
@@ -89,7 +90,7 @@ class TestPOIFSProperties {
summary1.setTitle(title);
//write the modified property back to POIFS
- fs.getRoot().getEntryCaseInsensitive(SummaryInformation.DEFAULT_STREAM_NAME).delete();
+ assertTrue(fs.getRoot().getEntryCaseInsensitive(SummaryInformation.DEFAULT_STREAM_NAME).delete());
fs.createDocument(summary1.toInputStream(), SummaryInformation.DEFAULT_STREAM_NAME);
// check that the information was added successfully to the filesystem object
diff --git a/poi/src/test/java/org/apache/poi/poifs/filesystem/TestPOIFSStream.java b/poi/src/test/java/org/apache/poi/poifs/filesystem/TestPOIFSStream.java
index 7f25ca751d..0b97d8eb8c 100644
--- a/poi/src/test/java/org/apache/poi/poifs/filesystem/TestPOIFSStream.java
+++ b/poi/src/test/java/org/apache/poi/poifs/filesystem/TestPOIFSStream.java
@@ -1817,7 +1817,7 @@ final class TestPOIFSStream {
main4096[4095] = -11;
testDir.createDocument("Normal4096", new ByteArrayInputStream(main4096));
- root.getEntryCaseInsensitive("Tags").delete();
+ assertTrue(root.getEntryCaseInsensitive("Tags").delete());
// Write out, re-load
@@ -1848,7 +1848,7 @@ final class TestPOIFSStream {
// Delete a directory, and add one more
- testDir.getEntryCaseInsensitive("Testing 456").delete();
+ assertTrue(testDir.getEntryCaseInsensitive("Testing 456").delete());
testDir.createDirectory("Testing ABC");
@@ -1903,7 +1903,7 @@ final class TestPOIFSStream {
// Delete a mini stream, add one more
- testDir.getEntryCaseInsensitive("Mini").delete();
+ assertTrue(testDir.getEntryCaseInsensitive("Mini").delete());
byte[] mini3 = new byte[]{42, 0, 42, 0, 42, 0, 42};
testDir.createDocument("Mini3", new ByteArrayInputStream(mini3));
@@ -2179,8 +2179,8 @@ final class TestPOIFSStream {
// Delete a couple of streams
- miniDoc.delete();
- normDoc.delete();
+ assertTrue(miniDoc.delete());
+ assertTrue(normDoc.delete());
// Check - will have un-used sectors now