mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
CLOUDSTACK-8656: use catch block for validation
This commit is contained in:
parent
384a2e9cee
commit
adcd0c0c0d
@ -103,16 +103,19 @@ public class ModuleBasedContextFactoryTest {
|
|||||||
assertEquals(parent, parentBean);
|
assertEquals(parent, parentBean);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int notfound = 0;
|
||||||
for (String notThere : notTheres) {
|
for (String notThere : notTheres) {
|
||||||
try {
|
try {
|
||||||
context.getBean(notThere, String.class);
|
context.getBean(notThere, String.class);
|
||||||
fail();
|
fail();
|
||||||
} catch (NoSuchBeanDefinitionException e) {
|
} catch (NoSuchBeanDefinitionException e) {
|
||||||
|
notfound++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int count = context.getBean("count", InstantiationCounter.class).getCount();
|
int count = context.getBean("count", InstantiationCounter.class).getCount();
|
||||||
|
|
||||||
|
assertEquals(notTheres.length, notfound);
|
||||||
assertEquals(order, count);
|
assertEquals(order, count);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user