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;
}
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);
}
Aggregations