Search in sources :

Example 1 with CubaClassPathXmlApplicationContext

use of com.haulmont.cuba.core.sys.CubaClassPathXmlApplicationContext in project cuba by cuba-platform.

the class TestContainer method initAppContext.

protected void initAppContext() {
    EclipseLinkCustomizer.initTransientCompatibleAnnotations();
    String configProperty = AppContext.getProperty(AbstractAppContextLoader.SPRING_CONTEXT_CONFIG);
    StringTokenizer tokenizer = new StringTokenizer(configProperty);
    List<String> locations = tokenizer.getTokenList();
    StringTokenizer configTokenizer = new StringTokenizer(getSpringConfig());
    locations.addAll(configTokenizer.getTokenList());
    springAppContext = new CubaClassPathXmlApplicationContext(locations.toArray(new String[0]));
    AppContext.Internals.setApplicationContext(springAppContext);
    Events events = springAppContext.getBean(Events.NAME, Events.class);
    events.publish(new AppContextInitializedEvent(springAppContext));
}
Also used : StringTokenizer(org.apache.commons.text.StringTokenizer) Events(com.haulmont.cuba.core.global.Events) AppContextInitializedEvent(com.haulmont.cuba.core.sys.events.AppContextInitializedEvent) CubaClassPathXmlApplicationContext(com.haulmont.cuba.core.sys.CubaClassPathXmlApplicationContext)

Aggregations

Events (com.haulmont.cuba.core.global.Events)1 CubaClassPathXmlApplicationContext (com.haulmont.cuba.core.sys.CubaClassPathXmlApplicationContext)1 AppContextInitializedEvent (com.haulmont.cuba.core.sys.events.AppContextInitializedEvent)1 StringTokenizer (org.apache.commons.text.StringTokenizer)1