@Test
public void testCategories() throws IOException, EntityProviderException {
AtomServiceDocumentConsumer svcDocumentParser = new AtomServiceDocumentConsumer();
ServiceDocument svcDocument = svcDocumentParser.readServiceDokument(createStreamReader("/svcAtomExample.xml"));
assertNotNull(svcDocument);
AtomInfo atomInfo = svcDocument.getAtomInfo();
assertNotNull(atomInfo);
assertEquals(2, atomInfo.getWorkspaces().size());
Workspace workspace = atomInfo.getWorkspaces().get(0);
assertEquals(2, workspace.getCollections().size());
for (Collection collection : workspace.getCollections()) {
for (Categories categories : collection.getCategories()) {
assertEquals("http://example.com/cats/forMain.cats", categories.getHref());
}
}
workspace = atomInfo.getWorkspaces().get(1);
for (Collection collection : workspace.getCollections()) {
for (Categories categories : collection.getCategories()) {
assertEquals(Fixed.YES, categories.getFixed());
for (Category category : categories.getCategoryList()) {
assertEquals("http://example.org/extra-cats/", category.getScheme());