Author: nick
Date: Mon May 3 17:18:35 2010
New Revision: 940519
URL: http://svn.apache.org/viewvc?rev=940519&view=rev
Log:
Enable the tests for bug #49139, now that we have a sample test file to go with
it
Added:
poi/trunk/test-data/poifs/BlockSize4096.zvi (with props)
poi/trunk/test-data/poifs/BlockSize512.zvi (with props)
Modified:
poi/trunk/src/testcases/org/apache/poi/poifs/filesystem/TestPOIFSFileSystem.java
Modified:
poi/trunk/src/testcases/org/apache/poi/poifs/filesystem/TestPOIFSFileSystem.java
URL:
http://svn.apache.org/viewvc/poi/trunk/src/testcases/org/apache/poi/poifs/filesystem/TestPOIFSFileSystem.java?rev=940519&r1=940518&r2=940519&view=diff
==============================================================================
---
poi/trunk/src/testcases/org/apache/poi/poifs/filesystem/TestPOIFSFileSystem.java
(original)
+++
poi/trunk/src/testcases/org/apache/poi/poifs/filesystem/TestPOIFSFileSystem.java
Mon May 3 17:18:35 2010
@@ -179,8 +179,9 @@ public final class TestPOIFSFileSystem e
* use 4k blocks. Check that we can open these.
* DISABLED until we get a sample 4k block file that's under 22mb...
*/
- public void DISABLEDtest4KBlocks() throws Exception {
- InputStream inp = new FileInputStream(new
File("/home/nick/Downloads/IP-ConvertImage-01.zvi"));
+ public void test4KBlocks() throws Exception {
+ POIDataSamples _samples = POIDataSamples.getPOIFSInstance();
+ InputStream inp = _samples.openResourceAsStream("BlockSize4096.zvi");
// First up, check that we can process the header properly
HeaderBlockReader header_block_reader = new HeaderBlockReader(inp);
@@ -189,7 +190,7 @@ public final class TestPOIFSFileSystem e
// Check the fat info looks sane
assertEquals(109, header_block_reader.getBATArray().length);
- assertTrue(header_block_reader.getBATCount() > 5);
+ assertTrue(header_block_reader.getBATCount() > 0);
assertEquals(0, header_block_reader.getXBATCount());
// Now check we can get the basic fat
@@ -198,8 +199,15 @@ public final class TestPOIFSFileSystem e
// Now try and open properly
POIFSFileSystem fs = new POIFSFileSystem(
- new FileInputStream(new
File("/home/nick/Downloads/IP-ConvertImage-01.zvi"))
+ _samples.openResourceAsStream("BlockSize4096.zvi")
);
+ assertTrue(fs.getRoot().getEntryCount() > 3);
+
+ // Finally, check we can do a similar 512byte one too
+ fs = new POIFSFileSystem(
+ _samples.openResourceAsStream("BlockSize512.zvi")
+ );
+ assertTrue(fs.getRoot().getEntryCount() > 3);
}
private static InputStream openSampleStream(String sampleFileName) {
Added: poi/trunk/test-data/poifs/BlockSize4096.zvi
URL:
http://svn.apache.org/viewvc/poi/trunk/test-data/poifs/BlockSize4096.zvi?rev=940519&view=auto
==============================================================================
Binary file - no diff available.
Propchange: poi/trunk/test-data/poifs/BlockSize4096.zvi
------------------------------------------------------------------------------
svn:executable = *
Propchange: poi/trunk/test-data/poifs/BlockSize4096.zvi
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: poi/trunk/test-data/poifs/BlockSize512.zvi
URL:
http://svn.apache.org/viewvc/poi/trunk/test-data/poifs/BlockSize512.zvi?rev=940519&view=auto
==============================================================================
Binary file - no diff available.
Propchange: poi/trunk/test-data/poifs/BlockSize512.zvi
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]