public void testNormal() throws Exception{
Object context = getContext();
final ICatalog catalog = CatalogPlugin.getDefault().getLocalCatalog();
List members = catalog.members(new DummyMonitor());
if (!members.isEmpty()) {
//clear the catalog
for (Iterator itr = members.iterator(); itr.hasNext();) {
IService service = (IService)itr.next();
catalog.remove(service);
}
}
members = catalog.members(new DummyMonitor());
assertTrue(members.isEmpty());
catalogImport.getDialog().getWorkflowWizard().getWorkflow()
.setContext(context);
catalogImport.run(new DummyMonitor(),context);
//sleep for 10 seconds, if dialog still active by then kill it
UDIGTestUtil.inDisplayThreadWait(2000000, new WaitCondition(){
public boolean isTrue() {
try {
return !catalog.members(new DummyMonitor()).isEmpty();
} catch (IOException e) {
return false;
}
}
}, true);
members = catalog.members(new DummyMonitor());
assertTrue(!members.isEmpty());
for (Iterator itr = members.iterator(); itr.hasNext();) {
assertServiceType((IService)itr.next());
}
}