@Test public void getAllJsonDumps() throws IOException { wrf.setWebResourceContentsFromResource( "https: "/other-wikidata-index.html", this.getClass()); setLocalDump("20141110", DumpContentType.JSON, true); setLocalDump("20150105", DumpContentType.CURRENT, true); setLocalDump("20141201", DumpContentType.JSON, true); setLocalDump("nodate", DumpContentType.JSON, true); WmfDumpFileManager dumpFileManager = new WmfDumpFileManager( "wikidatawiki", dm, wrf); List<? extends MwDumpFile> dumpFiles = dumpFileManager .findAllDumps(DumpContentType.JSON); String[] dumpDates = { "20150112", "20150105", "20141229", "20141222", "20141215", "20141210", "20141201", "20141124", "20141117", "20141110" }; boolean[] dumpIsLocal = { false, false, false, false, false, false, true, false, false, true }; assertEquals(dumpFiles.size(), dumpDates.length); for (int i = 0; i < dumpFiles.size(); i++) { assertEquals(dumpFiles.get(i).getDumpContentType(), DumpContentType.JSON); assertEquals(dumpFiles.get(i).getDateStamp(), dumpDates[i]); if (dumpIsLocal[i]) { assertTrue( "Dumpfile " + dumpFiles.get(i) + " should be local.", dumpFiles.get(i) instanceof WmfLocalDumpFile); } else { assertTrue("Dumpfile " + dumpFiles.get(i) + " should be online.", dumpFiles.get(i) instanceof JsonOnlineDumpFile); } } }
public List<MwDumpFile> findAllDumps(DumpContentType dumpContentType) { List<MwDumpFile> localDumps = findDumpsLocally(dumpContentType); if (this.webResourceFetcher != null) { List<MwDumpFile> onlineDumps = findDumpsOnline(dumpContentType); return mergeDumpLists(localDumps, onlineDumps); } else { return localDumps; } }
WmfDumpFileManager { public List<MwDumpFile> findAllDumps(DumpContentType dumpContentType) { List<MwDumpFile> localDumps = findDumpsLocally(dumpContentType); if (this.webResourceFetcher != null) { List<MwDumpFile> onlineDumps = findDumpsOnline(dumpContentType); return mergeDumpLists(localDumps, onlineDumps); } else { return localDumps; } } }
WmfDumpFileManager { public List<MwDumpFile> findAllDumps(DumpContentType dumpContentType) { List<MwDumpFile> localDumps = findDumpsLocally(dumpContentType); if (this.webResourceFetcher != null) { List<MwDumpFile> onlineDumps = findDumpsOnline(dumpContentType); return mergeDumpLists(localDumps, onlineDumps); } else { return localDumps; } } WmfDumpFileManager(String projectName,
			DirectoryManager downloadDirectoryManager,
			WebResourceFetcher webResourceFetcher); }
WmfDumpFileManager { public List<MwDumpFile> findAllDumps(DumpContentType dumpContentType) { List<MwDumpFile> localDumps = findDumpsLocally(dumpContentType); if (this.webResourceFetcher != null) { List<MwDumpFile> onlineDumps = findDumpsOnline(dumpContentType); return mergeDumpLists(localDumps, onlineDumps); } else { return localDumps; } } WmfDumpFileManager(String projectName,
			DirectoryManager downloadDirectoryManager,
			WebResourceFetcher webResourceFetcher); List<MwDumpFile> findAllRelevantRevisionDumps(boolean preferCurrent); MwDumpFile findMostRecentDump(DumpContentType dumpContentType); List<MwDumpFile> findAllDumps(DumpContentType dumpContentType); }
WmfDumpFileManager { public List<MwDumpFile> findAllDumps(DumpContentType dumpContentType) { List<MwDumpFile> localDumps = findDumpsLocally(dumpContentType); if (this.webResourceFetcher != null) { List<MwDumpFile> onlineDumps = findDumpsOnline(dumpContentType); return mergeDumpLists(localDumps, onlineDumps); } else { return localDumps; } } WmfDumpFileManager(String projectName,
			DirectoryManager downloadDirectoryManager,
			WebResourceFetcher webResourceFetcher); List<MwDumpFile> findAllRelevantRevisionDumps(boolean preferCurrent); MwDumpFile findMostRecentDump(DumpContentType dumpContentType); List<MwDumpFile> findAllDumps(DumpContentType dumpContentType); static final String DOWNLOAD_DIRECTORY_NAME; }