diff options
author | Nick Burch <nick@apache.org> | 2015-05-11 18:15:03 +0000 |
---|---|---|
committer | Nick Burch <nick@apache.org> | 2015-05-11 18:15:03 +0000 |
commit | 1c4d0baeca3b7cf0ef6ac0c09ee97981e91eefd4 (patch) | |
tree | aadabc79d86b8cd0b13d63e261fd883bcae26ba6 /src/testcases/org/apache/poi/poifs | |
parent | 32579cda68087cce7ccaab56240d6bfa7e59ec4d (diff) | |
download | poi-1c4d0baeca3b7cf0ef6ac0c09ee97981e91eefd4.tar.gz poi-1c4d0baeca3b7cf0ef6ac0c09ee97981e91eefd4.zip |
#56791 More updates from OPOIFS to NPOIFS
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1678787 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/testcases/org/apache/poi/poifs')
4 files changed, 31 insertions, 33 deletions
diff --git a/src/testcases/org/apache/poi/poifs/filesystem/TestDocument.java b/src/testcases/org/apache/poi/poifs/filesystem/TestDocument.java index e216ed9a88..21494b39ba 100644 --- a/src/testcases/org/apache/poi/poifs/filesystem/TestDocument.java +++ b/src/testcases/org/apache/poi/poifs/filesystem/TestDocument.java @@ -28,27 +28,25 @@ import org.apache.poi.poifs.storage.RawDataBlock; import org.apache.poi.poifs.storage.SmallDocumentBlock; /** - * Class to test POIFSDocument functionality - * - * @author Marc Johnson + * Class to test OPOIFSDocument functionality */ public final class TestDocument extends TestCase { /** * Integration test -- really about all we can do */ - public void testPOIFSDocument() throws IOException { + public void testOPOIFSDocument() throws IOException { // verify correct number of blocks get created for document // that is exact multituple of block size - POIFSDocument document; + OPOIFSDocument document; byte[] array = new byte[ 4096 ]; for (int j = 0; j < array.length; j++) { array[ j ] = ( byte ) j; } - document = new POIFSDocument("foo", new SlowInputStream(new ByteArrayInputStream(array))); + document = new OPOIFSDocument("foo", new SlowInputStream(new ByteArrayInputStream(array))); checkDocument(document, array); // verify correct number of blocks get created for document @@ -58,7 +56,7 @@ public final class TestDocument extends TestCase { { array[ j ] = ( byte ) j; } - document = new POIFSDocument("bar", new ByteArrayInputStream(array)); + document = new OPOIFSDocument("bar", new ByteArrayInputStream(array)); checkDocument(document, array); // verify correct number of blocks get created for document @@ -68,7 +66,7 @@ public final class TestDocument extends TestCase { { array[ j ] = ( byte ) j; } - document = new POIFSDocument("_bar", new ByteArrayInputStream(array)); + document = new OPOIFSDocument("_bar", new ByteArrayInputStream(array)); checkDocument(document, array); // verify correct number of blocks get created for document @@ -78,7 +76,7 @@ public final class TestDocument extends TestCase { { array[ j ] = ( byte ) j; } - document = new POIFSDocument("_bar2", + document = new OPOIFSDocument("_bar2", new ByteArrayInputStream(array)); checkDocument(document, array); @@ -88,7 +86,7 @@ public final class TestDocument extends TestCase { { array[ j ] = ( byte ) j; } - document = new POIFSDocument("foobar", + document = new OPOIFSDocument("foobar", new ByteArrayInputStream(array)); checkDocument(document, array); document.setStartBlock(0x12345678); // what a big file!! @@ -135,9 +133,9 @@ public final class TestDocument extends TestCase { } } - private static POIFSDocument makeCopy(POIFSDocument document, byte[] input, byte[] data) + private static OPOIFSDocument makeCopy(OPOIFSDocument document, byte[] input, byte[] data) throws IOException { - POIFSDocument copy = null; + OPOIFSDocument copy = null; if (input.length >= 4096) { @@ -156,12 +154,12 @@ public final class TestDocument extends TestCase { } blocks[ index++ ] = block; } - copy = new POIFSDocument("test" + input.length, blocks, + copy = new OPOIFSDocument("test" + input.length, blocks, input.length); } else { - copy = new POIFSDocument( + copy = new OPOIFSDocument( "test" + input.length, ( SmallDocumentBlock [] ) document.getSmallBlocks(), input.length); @@ -169,7 +167,7 @@ public final class TestDocument extends TestCase { return copy; } - private static void checkDocument(final POIFSDocument document, final byte[] input) + private static void checkDocument(final OPOIFSDocument document, final byte[] input) throws IOException { int big_blocks = 0; int small_blocks = 0; @@ -195,7 +193,7 @@ public final class TestDocument extends TestCase { } private static byte[] checkValues(int big_blocks, int small_blocks, int total_output, - POIFSDocument document, byte[] input) throws IOException { + OPOIFSDocument document, byte[] input) throws IOException { assertEquals(document, document.getDocumentProperty().getDocument()); int increment = ( int ) Math.sqrt(input.length); diff --git a/src/testcases/org/apache/poi/poifs/filesystem/TestDocumentInputStream.java b/src/testcases/org/apache/poi/poifs/filesystem/TestDocumentInputStream.java index 6ba10f99c6..98b2b7a7d7 100644 --- a/src/testcases/org/apache/poi/poifs/filesystem/TestDocumentInputStream.java +++ b/src/testcases/org/apache/poi/poifs/filesystem/TestDocumentInputStream.java @@ -64,8 +64,8 @@ public final class TestDocumentInputStream extends TestCase { { rawBlocks[ j ] = new RawDataBlock(stream); } - POIFSDocument document = new POIFSDocument("Workbook", rawBlocks, - _workbook_size); + OPOIFSDocument document = new OPOIFSDocument("Workbook", rawBlocks, + _workbook_size); _workbook_o = new DocumentNode( document.getDocumentProperty(), diff --git a/src/testcases/org/apache/poi/poifs/filesystem/TestDocumentNode.java b/src/testcases/org/apache/poi/poifs/filesystem/TestDocumentNode.java index 6101494a07..69d167793a 100644 --- a/src/testcases/org/apache/poi/poifs/filesystem/TestDocumentNode.java +++ b/src/testcases/org/apache/poi/poifs/filesystem/TestDocumentNode.java @@ -46,7 +46,7 @@ public final class TestDocumentNode extends TestCase { { rawBlocks[ j ] = new RawDataBlock(stream); } - POIFSDocument document = new POIFSDocument("document", rawBlocks, + OPOIFSDocument document = new OPOIFSDocument("document", rawBlocks, 2000); DocumentProperty property2 = document.getDocumentProperty(); DirectoryNode parent = new DirectoryNode(property1, (POIFSFileSystem)null, null); diff --git a/src/testcases/org/apache/poi/poifs/storage/TestSmallBlockTableWriter.java b/src/testcases/org/apache/poi/poifs/storage/TestSmallBlockTableWriter.java index f10576a4aa..9bb4f6a166 100644 --- a/src/testcases/org/apache/poi/poifs/storage/TestSmallBlockTableWriter.java +++ b/src/testcases/org/apache/poi/poifs/storage/TestSmallBlockTableWriter.java @@ -25,7 +25,7 @@ import java.util.List; import junit.framework.TestCase; import org.apache.poi.poifs.common.POIFSConstants; -import org.apache.poi.poifs.filesystem.POIFSDocument; +import org.apache.poi.poifs.filesystem.OPOIFSDocument; import org.apache.poi.poifs.property.PropertyTable; import org.apache.poi.poifs.property.RootProperty; @@ -37,43 +37,43 @@ import org.apache.poi.poifs.property.RootProperty; public final class TestSmallBlockTableWriter extends TestCase { public void testWritingConstructor() throws IOException { - List<POIFSDocument> documents = new ArrayList<POIFSDocument>(); + List<OPOIFSDocument> documents = new ArrayList<OPOIFSDocument>(); documents.add( - new POIFSDocument( + new OPOIFSDocument( "doc340", new ByteArrayInputStream(new byte[ 340 ]))); documents.add( - new POIFSDocument( + new OPOIFSDocument( "doc5000", new ByteArrayInputStream(new byte[ 5000 ]))); documents - .add(new POIFSDocument("doc0", + .add(new OPOIFSDocument("doc0", new ByteArrayInputStream(new byte[ 0 ]))); documents - .add(new POIFSDocument("doc1", + .add(new OPOIFSDocument("doc1", new ByteArrayInputStream(new byte[ 1 ]))); documents - .add(new POIFSDocument("doc2", + .add(new OPOIFSDocument("doc2", new ByteArrayInputStream(new byte[ 2 ]))); documents - .add(new POIFSDocument("doc3", + .add(new OPOIFSDocument("doc3", new ByteArrayInputStream(new byte[ 3 ]))); documents - .add(new POIFSDocument("doc4", + .add(new OPOIFSDocument("doc4", new ByteArrayInputStream(new byte[ 4 ]))); documents - .add(new POIFSDocument("doc5", + .add(new OPOIFSDocument("doc5", new ByteArrayInputStream(new byte[ 5 ]))); documents - .add(new POIFSDocument("doc6", + .add(new OPOIFSDocument("doc6", new ByteArrayInputStream(new byte[ 6 ]))); documents - .add(new POIFSDocument("doc7", + .add(new OPOIFSDocument("doc7", new ByteArrayInputStream(new byte[ 7 ]))); documents - .add(new POIFSDocument("doc8", + .add(new OPOIFSDocument("doc8", new ByteArrayInputStream(new byte[ 8 ]))); documents - .add(new POIFSDocument("doc9", + .add(new OPOIFSDocument("doc9", new ByteArrayInputStream(new byte[ 9 ]))); HeaderBlock header = new HeaderBlock(POIFSConstants.SMALLER_BIG_BLOCK_SIZE_DETAILS); |