Update the big file test to use POIFSFileSystem.create(File), and tweak javadocs

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1782454 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Nick Burch 2017-02-10 11:43:01 +00:00
parent eeae830d19
commit 16a825ccf5
2 changed files with 6 additions and 16 deletions

View File

@ -27,9 +27,10 @@ import org.apache.poi.util.CloseIgnoringInputStream;
/** /**
* Transition class for the move from {@link POIFSFileSystem} to * Transition class for the move from {@link POIFSFileSystem} to
* {@link OPOIFSFileSystem}, and from {@link NPOIFSFileSystem} to * {@link OPOIFSFileSystem}, and from {@link NPOIFSFileSystem} to
* {@link POIFSFileSystem}. Currently, this is OPOIFS-powered * {@link POIFSFileSystem}.
* <p>This has been updated to be powered by the NIO-based NPOIFS
* {@link NPOIFSFileSystem}.
*/ */
public class POIFSFileSystem public class POIFSFileSystem
extends NPOIFSFileSystem // TODO Temporary workaround during #56791 extends NPOIFSFileSystem // TODO Temporary workaround during #56791
implements POIFSViewable implements POIFSViewable

View File

@ -1569,8 +1569,7 @@ public final class TestNPOIFSFileSystem {
* Note that to run this test, you will require 2.5+gb of free * Note that to run this test, you will require 2.5+gb of free
* space on your TMP/TEMP partition/disk * space on your TMP/TEMP partition/disk
* *
* TODO Fix this to work * TODO Fix this to work...
* TODO Update this to use a "create as new file" constructor too
*/ */
@Test @Test
@Ignore("Work in progress test for #60670") @Ignore("Work in progress test for #60670")
@ -1584,14 +1583,8 @@ public final class TestNPOIFSFileSystem {
int s512mb = 512*1024*1024; int s512mb = 512*1024*1024;
DocumentEntry entry; DocumentEntry entry;
// TODO Provide a create method that takes a file
// Create a just-sub 2gb file // Create a just-sub 2gb file
NPOIFSFileSystem fs = new NPOIFSFileSystem(); NPOIFSFileSystem fs = POIFSFileSystem.create(big);
fs.writeFilesystem(new FileOutputStream(big));
fs.close();
fs = new NPOIFSFileSystem(big, false);
for (int i=0; i<19; i++) { for (int i=0; i<19; i++) {
fs.createDocument(new DummyDataInputStream(s100mb), "Entry"+i); fs.createDocument(new DummyDataInputStream(s100mb), "Entry"+i);
} }
@ -1627,11 +1620,7 @@ public final class TestNPOIFSFileSystem {
// Create a >2gb file // Create a >2gb file
fs = new NPOIFSFileSystem(); fs = POIFSFileSystem.create(big);
fs.writeFilesystem(new FileOutputStream(big));
fs.close();
fs = new NPOIFSFileSystem(big, false);
for (int i=0; i<4; i++) { for (int i=0; i<4; i++) {
fs.createDocument(new DummyDataInputStream(s512mb), "Entry"+i); fs.createDocument(new DummyDataInputStream(s512mb), "Entry"+i);
} }