aboutsummaryrefslogtreecommitdiffstats
path: root/src/testcases/org
diff options
context:
space:
mode:
authorDominik Stadler <centic@apache.org>2015-12-30 20:31:13 +0000
committerDominik Stadler <centic@apache.org>2015-12-30 20:31:13 +0000
commita40f3668d6c784e5245076b9d3a64911a5fbe1cc (patch)
tree4c428c35964b3347c7140bc848f91706f6e72010 /src/testcases/org
parent581aba159709e313fa7e9ede880a661107740f7d (diff)
downloadpoi-a40f3668d6c784e5245076b9d3a64911a5fbe1cc.tar.gz
poi-a40f3668d6c784e5245076b9d3a64911a5fbe1cc.zip
Eclipse warnings
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1722406 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/testcases/org')
-rw-r--r--src/testcases/org/apache/poi/TestPOIDocumentMain.java12
-rw-r--r--src/testcases/org/apache/poi/ss/util/NumberRenderingSpreadsheetGenerator.java2
-rw-r--r--src/testcases/org/apache/poi/ss/util/TestCellRangeAddress.java9
-rw-r--r--src/testcases/org/apache/poi/util/TestHexDump.java2
-rw-r--r--src/testcases/org/apache/poi/util/TestLittleEndianStreams.java5
5 files changed, 21 insertions, 9 deletions
diff --git a/src/testcases/org/apache/poi/TestPOIDocumentMain.java b/src/testcases/org/apache/poi/TestPOIDocumentMain.java
index bac0c125c4..7483d59960 100644
--- a/src/testcases/org/apache/poi/TestPOIDocumentMain.java
+++ b/src/testcases/org/apache/poi/TestPOIDocumentMain.java
@@ -131,10 +131,14 @@ public final class TestPOIDocumentMain {
doc.write(baos);
ByteArrayInputStream bais = new ByteArrayInputStream(baos.toByteArray());
+ ((HSSFWorkbook)doc).close();
+
doc = new HSSFWorkbook(bais);
assertNotNull(doc.getSummaryInformation());
assertNotNull(doc.getDocumentSummaryInformation());
+
+ ((HSSFWorkbook)doc).close();
}
@Test
@@ -148,6 +152,9 @@ public final class TestPOIDocumentMain {
// Write out and back in again, no change
ByteArrayOutputStream baos = new ByteArrayOutputStream();
doc.write(baos);
+
+ ((HSSFWorkbook)doc).close();
+
ByteArrayInputStream bais = new ByteArrayInputStream(baos.toByteArray());
doc = new HSSFWorkbook(bais);
@@ -162,6 +169,9 @@ public final class TestPOIDocumentMain {
// Save and re-load
baos = new ByteArrayOutputStream();
doc.write(baos);
+
+ ((HSSFWorkbook)doc).close();
+
bais = new ByteArrayInputStream(baos.toByteArray());
doc = new HSSFWorkbook(bais);
@@ -177,5 +187,7 @@ public final class TestPOIDocumentMain {
assertNotNull(doc.getDocumentSummaryInformation());
assertEquals("POI Testing", doc.getSummaryInformation().getAuthor());
assertEquals("ASF", doc.getDocumentSummaryInformation().getCompany());
+
+ ((HSSFWorkbook)doc).close();
}
}
diff --git a/src/testcases/org/apache/poi/ss/util/NumberRenderingSpreadsheetGenerator.java b/src/testcases/org/apache/poi/ss/util/NumberRenderingSpreadsheetGenerator.java
index c9146ab784..7eda472792 100644
--- a/src/testcases/org/apache/poi/ss/util/NumberRenderingSpreadsheetGenerator.java
+++ b/src/testcases/org/apache/poi/ss/util/NumberRenderingSpreadsheetGenerator.java
@@ -206,7 +206,7 @@ public class NumberRenderingSpreadsheetGenerator {
}
private static void writeLong(byte[] bb, int i, long val) {
- String oldVal = interpretLong(bb, i);
+ /*String oldVal =*/ interpretLong(bb, i);
bb[i+7] = (byte) (val >> 56);
bb[i+6] = (byte) (val >> 48);
bb[i+5] = (byte) (val >> 40);
diff --git a/src/testcases/org/apache/poi/ss/util/TestCellRangeAddress.java b/src/testcases/org/apache/poi/ss/util/TestCellRangeAddress.java
index cf9e6019e7..431c80c781 100644
--- a/src/testcases/org/apache/poi/ss/util/TestCellRangeAddress.java
+++ b/src/testcases/org/apache/poi/ss/util/TestCellRangeAddress.java
@@ -17,18 +17,17 @@ limitations under the License.
package org.apache.poi.ss.util;
-import static org.junit.Assert.fail;
+import static org.junit.Assert.assertNotEquals;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
-//TODO: replace junit3 with junit4 code
-import junit.framework.TestCase; //junit3
-import static org.junit.Assert.assertNotEquals; //junit4
-
import org.apache.poi.hssf.record.TestcaseRecordInputStream;
import org.apache.poi.util.LittleEndianOutputStream;
+//TODO: replace junit3 with junit4 code
+import junit.framework.TestCase; //junit3
+
public final class TestCellRangeAddress extends TestCase {
byte[] data = new byte[] { (byte) 0x02, (byte) 0x00, (byte) 0x04,
(byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x03, (byte) 0x00, };
diff --git a/src/testcases/org/apache/poi/util/TestHexDump.java b/src/testcases/org/apache/poi/util/TestHexDump.java
index 30cd8256a4..a4bba37257 100644
--- a/src/testcases/org/apache/poi/util/TestHexDump.java
+++ b/src/testcases/org/apache/poi/util/TestHexDump.java
@@ -19,7 +19,6 @@ package org.apache.poi.util;
import static org.junit.Assert.assertArrayEquals;
import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
@@ -29,7 +28,6 @@ import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.PrintStream;
-import java.lang.reflect.Constructor;
import org.junit.Test;
diff --git a/src/testcases/org/apache/poi/util/TestLittleEndianStreams.java b/src/testcases/org/apache/poi/util/TestLittleEndianStreams.java
index 6e7b30f741..c05e365a92 100644
--- a/src/testcases/org/apache/poi/util/TestLittleEndianStreams.java
+++ b/src/testcases/org/apache/poi/util/TestLittleEndianStreams.java
@@ -21,6 +21,7 @@ import static org.junit.Assert.assertArrayEquals;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
+import java.io.IOException;
import junit.framework.AssertionFailedError;
import junit.framework.TestCase;
@@ -32,7 +33,7 @@ import junit.framework.TestCase;
*/
public final class TestLittleEndianStreams extends TestCase {
- public void testRead() {
+ public void testRead() throws IOException {
ByteArrayOutputStream baos = new ByteArrayOutputStream();
LittleEndianOutput leo = new LittleEndianOutputStream(baos);
leo.writeInt(12345678);
@@ -42,6 +43,7 @@ public final class TestLittleEndianStreams extends TestCase {
leo.writeByte(200);
leo.writeLong(1234567890123456789L);
leo.writeDouble(123.456);
+ ((LittleEndianOutputStream)leo).close();
LittleEndianInput lei = new LittleEndianInputStream(new ByteArrayInputStream(baos.toByteArray()));
@@ -52,6 +54,7 @@ public final class TestLittleEndianStreams extends TestCase {
assertEquals(200, lei.readUByte());
assertEquals(1234567890123456789L, lei.readLong());
assertEquals(123.456, lei.readDouble(), 0.0);
+ ((LittleEndianInputStream)lei).close();
}
/**