/**
* Loads the basic Citrus application context with all necessary parent context files.
*/
public ApplicationContext loadApplicationContext() {
if (applicationContext == null) {
TestContextManager testContextManager = new TestContextManager(AbstractTestNGCitrusTest.class) {
@Override
public void prepareTestInstance(Object testInstance) throws Exception {
applicationContext = getTestContext().getApplicationContext();
// add special admin webapp test listeners
applicationContext.getBean(TestListeners.class).addTestListener(webSocketTestEventListener);
applicationContext.getBean(TestActionListeners.class).addTestActionListener(webSocketTestEventListener);
applicationContext.getBean(MessageListeners.class).addMessageListener(webSocketTestEventListener);
}
};
try {
testContextManager.prepareTestInstance(null);
} catch (Exception e) {
log.error("Failed to load application context", e);
}
}