{
Response response;
ArchetypeCatalog catalog;
ArchetypeCatalogXpp3Reader acr = new ArchetypeCatalogXpp3Reader();
// path of catalog
String relativePath = "archetype-catalog.xml";
String url = getRepositoryUrl(getTestRepositoryId()) + relativePath;
// request the catalog
response = RequestFacade.sendMessage(new URL(url), Method.GET, null);
// read and check
catalog = acr.read(response.getEntity().getReader());
Assert.assertEquals(catalog.getArchetypes().size(), 1);
// deploy one new archetype
int httpResponseCode =
getDeployUtils().deployUsingPomWithRest(getTestRepositoryId(), getTestFile("simple-archetype2.jar"),
getTestFile("simple-archetype2.pom"), null, null);
Assert.assertTrue("Unable to deploy artifact " + httpResponseCode, Status.isSuccess(httpResponseCode));
// wait
getEventInspectorsUtil().waitForCalmPeriod();
// request the catalog
response = RequestFacade.sendMessage(new URL(url), Method.GET, null);
// read and check
catalog = acr.read(response.getEntity().getReader());
Assert.assertEquals(catalog.getArchetypes().size(), 2);
}