diff options
author | Andreas Beeker <kiwiwings@apache.org> | 2017-01-23 00:31:27 +0000 |
---|---|---|
committer | Andreas Beeker <kiwiwings@apache.org> | 2017-01-23 00:31:27 +0000 |
commit | 80e397389f858945701011ebae3c782188e1fb61 (patch) | |
tree | 5fc986bbb7742992b3eea77b06c956b3955519d4 /src/testcases/org/apache/poi/poifs/crypt | |
parent | c0eb123f9152206666e7504ebc003720a04187eb (diff) | |
download | poi-80e397389f858945701011ebae3c782188e1fb61.tar.gz poi-80e397389f858945701011ebae3c782188e1fb61.zip |
fix eclipse warnings - close resources
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1779869 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/testcases/org/apache/poi/poifs/crypt')
-rw-r--r-- | src/testcases/org/apache/poi/poifs/crypt/TestXorEncryption.java | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/testcases/org/apache/poi/poifs/crypt/TestXorEncryption.java b/src/testcases/org/apache/poi/poifs/crypt/TestXorEncryption.java index cae6426f61..7b35fef8cb 100644 --- a/src/testcases/org/apache/poi/poifs/crypt/TestXorEncryption.java +++ b/src/testcases/org/apache/poi/poifs/crypt/TestXorEncryption.java @@ -21,11 +21,12 @@ import static org.hamcrest.core.IsEqual.equalTo; import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertThat;
+import java.io.IOException;
+
import org.apache.poi.hssf.HSSFTestDataSamples;
import org.apache.poi.hssf.record.crypto.Biff8EncryptionKey;
import org.apache.poi.hssf.usermodel.HSSFSheet;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
-import org.apache.poi.poifs.crypt.CryptoFunctions;
import org.apache.poi.poifs.filesystem.NPOIFSFileSystem;
import org.apache.poi.util.HexRead;
import org.junit.After;
@@ -33,7 +34,7 @@ import org.junit.Test; public class TestXorEncryption {
- private static HSSFTestDataSamples samples = new HSSFTestDataSamples();
+ private static final HSSFTestDataSamples samples = new HSSFTestDataSamples();
// to not affect other tests running in the same JVM
@After
@@ -42,7 +43,7 @@ public class TestXorEncryption { }
@Test
- public void testXorEncryption() throws Exception {
+ public void testXorEncryption() throws IOException {
// Xor-Password: abc
// 2.5.343 XORObfuscation
// key = 20810
@@ -59,7 +60,7 @@ public class TestXorEncryption { @SuppressWarnings("static-access")
@Test
- public void testUserFile() throws Exception {
+ public void testUserFile() throws IOException {
Biff8EncryptionKey.setCurrentUserPassword("abc");
NPOIFSFileSystem fs = new NPOIFSFileSystem(samples.getSampleFile("xor-encryption-abc.xls"), true);
HSSFWorkbook hwb = new HSSFWorkbook(fs.getRoot(), true);
@@ -68,7 +69,7 @@ public class TestXorEncryption { assertEquals(1.0, sh.getRow(0).getCell(0).getNumericCellValue(), 0.0);
assertEquals(2.0, sh.getRow(1).getCell(0).getNumericCellValue(), 0.0);
assertEquals(3.0, sh.getRow(2).getCell(0).getNumericCellValue(), 0.0);
-
+ hwb.close();
fs.close();
}
}
|