CLOUDSTACK-8656: use catch block for validation

This commit is contained in:
Daan Hoogland 2015-08-14 17:25:04 +02:00
parent 384a2e9cee
commit adcd0c0c0d

View File

@ -103,16 +103,19 @@ public class ModuleBasedContextFactoryTest {
assertEquals(parent, parentBean);
}
int notfound = 0;
for (String notThere : notTheres) {
try {
context.getBean(notThere, String.class);
fail();
} catch (NoSuchBeanDefinitionException e) {
notfound++;
}
}
int count = context.getBean("count", InstantiationCounter.class).getCount();
assertEquals(notTheres.length, notfound);
assertEquals(order, count);
}