@Test public void testCountSubdomains_EmptyList() { MemoryDocumentStorage docStorage = new MemoryDocumentStorage(); ArrayList<Frequency> expected = new ArrayList<Frequency>(); urlStats.runStats(docStorage); List<Frequency> actual = urlStats.getSubdomainFrequencies(); TestUtils.compareFrequencyLists(expected, actual); }
@Test public void testCountSubdomains_Tricky() { MemoryDocumentStorage docStorage = new MemoryDocumentStorage(); docStorage.storeDocument("http://vision.ics.uci.edu", ""); docStorage.storeDocument("http://vision.ics.uci.edu/", ""); docStorage.storeDocument("http://vision.ics.uci.edu/page.php", ""); docStorage.storeDocument("http://vision.ics.uci.edu/page.php?query", ""); ArrayList<Frequency> expected = new ArrayList<Frequency>(); expected.add(new Frequency("http://vision.ics.uci.edu", 3)); urlStats.runStats(docStorage); List<Frequency> actual = urlStats.getSubdomainFrequencies(); TestUtils.compareFrequencyLists(expected, actual); }