Assert.assertNotNull(resources);
Assert.assertEquals(12, resources.getAll().size());
List<String> allHrefs = new ArrayList<String>(resources.getAllHrefs());
Collections.sort(allHrefs);
Resource resource;
byte[] expectedData;
// container
resource = resources.getByHref(allHrefs.get(0));
Assert.assertEquals("container", resource.getId());
Assert.assertEquals("META-INF/container.xml", resource.getHref());
Assert.assertNull(resource.getMediaType());
Assert.assertEquals(230, resource.getData().length);
// book1.css
resource = resources.getByHref(allHrefs.get(1));
Assert.assertEquals("book1", resource.getId());
Assert.assertEquals("OEBPS/book1.css", resource.getHref());
Assert.assertEquals(MediatypeService.CSS, resource.getMediaType());
Assert.assertEquals(65, resource.getData().length);
expectedData = IOUtil.toByteArray(this.getClass().getResourceAsStream("/book1/book1.css"));
Assert.assertTrue(Arrays.equals(expectedData, resource.getData()));
// chapter1
resource = resources.getByHref(allHrefs.get(2));
Assert.assertEquals("chapter1", resource.getId());
Assert.assertEquals("OEBPS/chapter1.html", resource.getHref());
Assert.assertEquals(MediatypeService.XHTML, resource.getMediaType());
Assert.assertEquals(247, resource.getData().length);
expectedData = IOUtil.toByteArray(this.getClass().getResourceAsStream("/book1/chapter1.html"));
Assert.assertTrue(Arrays.equals(expectedData, resource.getData()));
}