ZipXmlThemeResourceProvider: add method to just scan zip for xml themes (#807)

This commit is contained in:
Emux
2021-02-22 14:06:03 +02:00
committed by GitHub
parent 22ed9653ec
commit ddf94ae2ca
3 changed files with 75 additions and 15 deletions

View File

@@ -83,4 +83,18 @@ public class ZipXmlThemeResourceProviderTest {
public void openEmpty() throws IOException {
Assert.assertTrue(new ZipXmlThemeResourceProvider(null).getXmlThemes().isEmpty());
}
@Test
public void scanZipForXmlThemes() throws IOException {
ZipInputStream zis = new ZipInputStream(new BufferedInputStream(ZipXmlThemeResourceProviderTest.class.getResourceAsStream("/xmlthemetest.zip")));
Assert.assertNotNull(zis);
List<String> xmlThemes = ZipXmlThemeResourceProvider.scanXmlThemes(zis);
Assert.assertEquals(4, xmlThemes.size());
Assert.assertTrue(xmlThemes.contains("one.xml"));
Assert.assertTrue(xmlThemes.contains("two.xml"));
Assert.assertTrue(xmlThemes.contains("res/three.xml"));
Assert.assertTrue(xmlThemes.contains("res/sub/four.xml"));
}
}