WmfOnlineStandardDumpFile extends WmfDumpFile { @Override public DumpContentType getDumpContentType() { return this.dumpContentType; } WmfOnlineStandardDumpFile(String dateStamp, String projectName,
			WebResourceFetcher webResourceFetcher,
			DirectoryManager dumpfileDirectoryManager,
			DumpContentType dumpContentType); @Override DumpContentType getDumpContentType(); @Override InputStream getDumpFileStream(); @Override void prepareDumpFile();  }
@Test public void validCurrentDumpPropertiesOldFormat() throws IOException { wrf.setWebResourceContentsFromResource( "https: "/wikidatawiki-20140210-index.html", this.getClass()); wrf.setWebResourceContents( "https: "Line1", CompressionType.BZ2); wrf.setWebResourceContentsFromResource( "https: "/wikidatawiki-20140210-md5sums.txt", this.getClass()); MwDumpFile dump = new WmfOnlineStandardDumpFile("20140210", "wikidatawiki", wrf, dm, DumpContentType.CURRENT); BufferedReader br = dump.getDumpFileReader(); assertEquals(br.readLine(), "Line1"); assertNull(br.readLine()); assertTrue(dump.isAvailable()); assertEquals("20140210", dump.getDateStamp()); assertEquals(DumpContentType.CURRENT, dump.getDumpContentType()); }
@Test public void validCurrentDumpPropertiesNewFormat() throws IOException { wrf.setWebResourceContentsFromResource( "https: "/wikidatawiki-20140508-index.html", this.getClass()); wrf.setWebResourceContents( "https: "Line1", CompressionType.BZ2); wrf.setWebResourceContentsFromResource( "https: "/wikidatawiki-20140210-md5sums.txt", this.getClass()); MwDumpFile dump = new WmfOnlineStandardDumpFile("20140210", "wikidatawiki", wrf, dm, DumpContentType.CURRENT); BufferedReader br = dump.getDumpFileReader(); assertEquals(br.readLine(), "Line1"); assertNull(br.readLine()); assertTrue(dump.isAvailable()); assertEquals("20140210", dump.getDateStamp()); assertEquals(DumpContentType.CURRENT, dump.getDumpContentType()); }
@Test public void emptyFullDumpIsDone() throws IOException { wrf.setWebResourceContentsFromResource( "http: "/wikidatawiki-20140210-index.html", this.getClass()); MwDumpFile dump = new WmfOnlineStandardDumpFile("20140210", "wikidatawiki", wrf, dm, DumpContentType.FULL); assertFalse(dump.isAvailable()); assertEquals("20140210", dump.getDateStamp()); assertEquals(DumpContentType.FULL, dump.getDumpContentType()); }