@Test
public void testGetOrCreateCategory() throws SimalRepositoryException {
boolean exists = getRepository().containsResource(TEST_SIMAL_PROJECT_CATEGORY_TWO);
assertTrue("Test category does not exist", exists);
IDoapCategory gotCat = SimalRepositoryFactory.getCategoryService().get(TEST_SIMAL_PROJECT_CATEGORY_TWO);
IDoapCategory gotOrCreateCat = SimalRepositoryFactory.getCategoryService().getOrCreate(TEST_SIMAL_PROJECT_CATEGORY_TWO);
assertEquals("Retrieved categories are different depending on method of retrieval", gotCat.getURI(), gotOrCreateCat.getURI());
String uri = "http://test.com/category";
gotCat = SimalRepositoryFactory.getCategoryService().get(uri);
assertNull("Retrieved a category we should not have been able to get", gotCat);
gotOrCreateCat = SimalRepositoryFactory.getCategoryService().getOrCreate(uri);
assertNotNull("Failed to create a category using getOrCreateCategory", gotOrCreateCat);
gotCat = SimalRepositoryFactory.getCategoryService().get(uri);
assertNotNull("Failed to retrieve a recently created category", gotCat);
gotOrCreateCat.delete();
gotCat = SimalRepositoryFactory.getCategoryService().get(uri);
assertNull("Retrieved a category we should have deleted", gotCat);
}