use of org.pentaho.platform.engine.core.system.StandaloneApplicationContext in project pentaho-platform by pentaho.
the class PentahoSystemBoot method createApplicationContext.
/**
* Override this method if you want to change the type and state of the application context used to initialize
* the system.
*
* @return an application context for system initialization
*/
protected IApplicationContext createApplicationContext() {
// $NON-NLS-1$
StandaloneApplicationContext appCtxt = new StandaloneApplicationContext(getFilePath(), "");
appCtxt.setFullyQualifiedServerURL(fullyQualifiedServerUrl);
return appCtxt;
}
use of org.pentaho.platform.engine.core.system.StandaloneApplicationContext in project pentaho-platform by pentaho.
the class HttpMimeTypeListenerIT method setUp.
public void setUp() {
// $NON-NLS-1$
StandaloneApplicationContext applicationContext = new StandaloneApplicationContext(getSolutionPath(), "");
PentahoSystem.init(applicationContext, getRequiredListeners());
}
use of org.pentaho.platform.engine.core.system.StandaloneApplicationContext in project pentaho-platform by pentaho.
the class ProxyServletIT method setUp.
public void setUp() {
// $NON-NLS-1$
StandaloneApplicationContext applicationContext = new StandaloneApplicationContext(getSolutionPath(), "");
PentahoSystem.init(applicationContext, getRequiredListeners());
}
use of org.pentaho.platform.engine.core.system.StandaloneApplicationContext in project pentaho-platform by pentaho.
the class UIServletIT method setUp.
public void setUp() {
// $NON-NLS-1$
StandaloneApplicationContext applicationContext = new StandaloneApplicationContext(getSolutionPath(), "");
PentahoSystem.init(applicationContext, getRequiredListeners());
IMessageFormatter msgFormatter = new MessageFormatter();
PentahoSystem.registerObject(msgFormatter);
}
use of org.pentaho.platform.engine.core.system.StandaloneApplicationContext in project pentaho-platform by pentaho.
the class StandaloneSessionTest method testTempFileDeleter.
public void testTempFileDeleter() throws Exception {
// get one with an id. //$NON-NLS-1$
StandaloneSession session = new StandaloneSession("tempfiledeleter", UUIDUtil.getUUIDAsString());
StandaloneTempFileDeleter deleter = new StandaloneTempFileDeleter();
// $NON-NLS-1$ //$NON-NLS-2$
StandaloneApplicationContext appContext = new StandaloneApplicationContext(getSolutionRoot(), "");
// $NON-NLS-1$ //$NON-NLS-2$
File file1 = appContext.createTempFile(session, "testTempFileDeleter", "txt", true);
// File object was returned
assertNotNull(file1);
// File exists
assertTrue(file1.exists());
// Deleter wasn't bound to session, so no delete
assertFalse(deleter.hasTempFile(file1.getName()));
// Bind deleter to the session
session.setAttribute(ITempFileDeleter.DELETER_SESSION_VARIABLE, deleter);
// $NON-NLS-1$ //$NON-NLS-2$
File file2 = appContext.createTempFile(session, "testTempFileDeleter", "txt", true);
// File object was returned
assertNotNull(file2);
// File exists
assertTrue(file2.exists());
// Deleter is bound to session
assertTrue(deleter.hasTempFile(file2.getName()));
// File names should be unique
assertFalse(file1.getName().equals(file2.getName()));
deleter.doTempFileCleanup();
// This file will be left over
assertTrue(file1.exists());
// The deleter should have removed this
assertFalse(file2.exists());
// After doTempFileCleanup() the list should be empty
assertFalse(deleter.hasTempFile(file2.getName()));
// The tearDown should blow away everything else...
// Add known deleted file to the deleter
deleter.trackTempFile(file2);
// Validates cleanup doesn't choke on missing files
deleter.doTempFileCleanup();
// Test that IllegalArgumentException if passed a null
try {
deleter.trackTempFile(null);
fail();
} catch (IllegalArgumentException expected) {
// ignored
}
}
Aggregations