StroomZipNameSet { public void add(Collection<String> fileNameList) { for (String fileName : fileNameList) { add(fileName); } } StroomZipNameSet(boolean checkOrder); static StroomZipFileType getStroomZipFileType(final String fileName); void add(Collection<String> fileNameList); StroomZipEntry add(final String fileName); Set<String> getBaseNameSet(); List<String> getBaseNameList(); List<List<String>> getBaseNameGroupedList(String grouping); String getName(String baseName, StroomZipFileType stroomZipFileType); String getBaseName(String fileName);  }
@Test public void testBaseNameTest() { final StroomZipNameSet stroomZipNameSet = new StroomZipNameSet(true); final List<StroomZipEntry> testList = new ArrayList<StroomZipEntry>(); testList.add(stroomZipNameSet.add("1.hdr")); testList.add(stroomZipNameSet.add("1.ctx")); Assert.assertTrue(testList.get(testList.size() - 2).equalsBaseName(testList.get(testList.size() - 1))); testList.add(stroomZipNameSet.add("1.data")); Assert.assertTrue(testList.get(testList.size() - 2).equalsBaseName(testList.get(testList.size() - 1))); testList.add(stroomZipNameSet.add("2.data")); Assert.assertFalse(testList.get(testList.size() - 2).equalsBaseName(testList.get(testList.size() - 1))); testList.add(stroomZipNameSet.add("2.ctx")); Assert.assertTrue(testList.get(testList.size() - 2).equalsBaseName(testList.get(testList.size() - 1))); testList.add(stroomZipNameSet.add("2.hdr")); Assert.assertTrue(testList.get(testList.size() - 2).equalsBaseName(testList.get(testList.size() - 1))); testList.add(stroomZipNameSet.add("3.dat")); Assert.assertFalse(testList.get(testList.size() - 2).equalsBaseName(testList.get(testList.size() - 1))); testList.add(stroomZipNameSet.add("3.hdr")); Assert.assertTrue(testList.get(testList.size() - 2).equalsBaseName(testList.get(testList.size() - 1))); testList.add(stroomZipNameSet.add("4.dat")); Assert.assertFalse(testList.get(testList.size() - 2).equalsBaseName(testList.get(testList.size() - 1))); testList.add(stroomZipNameSet.add("4.hdr")); Assert.assertTrue(testList.get(testList.size() - 2).equalsBaseName(testList.get(testList.size() - 1))); testList.add(stroomZipNameSet.add("5.dat")); Assert.assertFalse(testList.get(testList.size() - 2).equalsBaseName(testList.get(testList.size() - 1))); testList.add(stroomZipNameSet.add("6.dat")); Assert.assertFalse(testList.get(testList.size() - 2).equalsBaseName(testList.get(testList.size() - 1))); }
@Test void testBaseNameTest() { final StroomZipNameSet stroomZipNameSet = new StroomZipNameSet(true); final List<StroomZipEntry> testList = new ArrayList<StroomZipEntry>(); testList.add(stroomZipNameSet.add("1.hdr")); testList.add(stroomZipNameSet.add("1.ctx")); assertThat(testList.get(testList.size() - 2).equalsBaseName(testList.get(testList.size() - 1))).isTrue(); testList.add(stroomZipNameSet.add("1.data")); assertThat(testList.get(testList.size() - 2).equalsBaseName(testList.get(testList.size() - 1))).isTrue(); testList.add(stroomZipNameSet.add("2.data")); assertThat(testList.get(testList.size() - 2).equalsBaseName(testList.get(testList.size() - 1))).isFalse(); testList.add(stroomZipNameSet.add("2.ctx")); assertThat(testList.get(testList.size() - 2).equalsBaseName(testList.get(testList.size() - 1))).isTrue(); testList.add(stroomZipNameSet.add("2.hdr")); assertThat(testList.get(testList.size() - 2).equalsBaseName(testList.get(testList.size() - 1))).isTrue(); testList.add(stroomZipNameSet.add("3.dat")); assertThat(testList.get(testList.size() - 2).equalsBaseName(testList.get(testList.size() - 1))).isFalse(); testList.add(stroomZipNameSet.add("3.hdr")); assertThat(testList.get(testList.size() - 2).equalsBaseName(testList.get(testList.size() - 1))).isTrue(); testList.add(stroomZipNameSet.add("4.dat")); assertThat(testList.get(testList.size() - 2).equalsBaseName(testList.get(testList.size() - 1))).isFalse(); testList.add(stroomZipNameSet.add("4.hdr")); assertThat(testList.get(testList.size() - 2).equalsBaseName(testList.get(testList.size() - 1))).isTrue(); testList.add(stroomZipNameSet.add("5.dat")); assertThat(testList.get(testList.size() - 2).equalsBaseName(testList.get(testList.size() - 1))).isFalse(); testList.add(stroomZipNameSet.add("6.dat")); assertThat(testList.get(testList.size() - 2).equalsBaseName(testList.get(testList.size() - 1))).isFalse(); }