Search in sources :

Example 1 with ApplicationResourcesManager

use of org.jaffa.loader.config.ApplicationResourcesManager in project jaffa-framework by jaffa-projects.

the class CoreLoaderConfig method applicationResourcesManager.

/**
 * @return Returns a ApplicationResourcesManager
 */
@Bean
public ApplicationResourcesManager applicationResourcesManager() {
    ApplicationResourcesManager applicationResourcesManager = new ApplicationResourcesManager();
    ApplicationResourceLoader.setApplicationResourcesManager(applicationResourcesManager);
    return applicationResourcesManager;
}
Also used : ApplicationResourcesManager(org.jaffa.loader.config.ApplicationResourcesManager) Bean(org.springframework.context.annotation.Bean)

Example 2 with ApplicationResourcesManager

use of org.jaffa.loader.config.ApplicationResourcesManager in project jaffa-framework by jaffa-projects.

the class ApplicationResourceLoaderTest method setup.

/**
 * setting the up objects/properties before a Test is run
 * @throws Exception
 */
@Before
public void setup() throws Exception {
    ApplicationResourcesManager applicationResourcesManager = resourceLoaderConfig.getBean(ApplicationResourcesManager.class);
    MockHttpServletRequest request = new MockHttpServletRequest();
    // creating user session
    UserSession us = UserSession.getUserSession(request);
    us.setUserId("USER");
    us.setVariation("NULL");
    // creating mock http session for the same use session
    MockHttpSession session = new MockHttpSession();
    session.setAttribute("org.jaffa.presentation.portlet.session.UserInfo", us);
    // setting the mock session into request
    request.setSession(session);
    ContextManagerFactory.instance().setThreadContext(request);
    String overrideFileDir = ClassLoader.getSystemResource("ApplicationResourcesOverride.properties").getFile();
    overrideFileDir = overrideFileDir.substring(1, overrideFileDir.lastIndexOf("/"));
    ContextManagerFactory.instance().setProperty("data.directory", overrideFileDir);
}
Also used : MockHttpServletRequest(org.springframework.mock.web.MockHttpServletRequest) UserSession(org.jaffa.presentation.portlet.session.UserSession) ApplicationResourcesManager(org.jaffa.loader.config.ApplicationResourcesManager) MockHttpSession(org.springframework.mock.web.MockHttpSession) Before(org.junit.Before)

Aggregations

ApplicationResourcesManager (org.jaffa.loader.config.ApplicationResourcesManager)2 UserSession (org.jaffa.presentation.portlet.session.UserSession)1 Before (org.junit.Before)1 Bean (org.springframework.context.annotation.Bean)1 MockHttpServletRequest (org.springframework.mock.web.MockHttpServletRequest)1 MockHttpSession (org.springframework.mock.web.MockHttpSession)1