use of org.pentaho.test.platform.engine.core.MicroPlatform in project pentaho-platform by pentaho.
the class EmailResourceTest method setUp.
@Override
protected void setUp() throws Exception {
// Setup the temp email config file
mp = new MicroPlatform();
mp.defineInstance(IAuthorizationPolicy.class, new TestAuthorizationPolicy());
mp.start();
defaultConfigFile = File.createTempFile("email_config_", ".xml");
this.emailResource = new EmailResource(new EmailService(defaultConfigFile));
}
use of org.pentaho.test.platform.engine.core.MicroPlatform in project pentaho-platform by pentaho.
the class RepositoryCleanerSystemListenerTest method prepareMp.
private void prepareMp() throws Exception {
mp = new MicroPlatform();
mp.defineInstance(IScheduler.class, scheduler);
mp.start();
}
use of org.pentaho.test.platform.engine.core.MicroPlatform in project pentaho-platform by pentaho.
the class AgileBITests method init.
/**
* Creates the files system that mimicks a BI Server solution. Also creates a LocaleTestUtility that is used to create
* the files needed for the tests.
* <p/>
* A MicroPlatform is also created as it is needed for filtering the property files that may exist in the metadata
* folder.
*
* @throws Exception
*/
@Before
public void init() throws Exception {
// create the solution folder
SOLUTION_PATH = System.getProperty("java.io.tmpdir") + "/" + SOLUTION_FOLDER_NAME;
METADATA_PATH = RESOURCE_FOLDER_NAME + "/" + METADATA_FOLDER_NAME;
File solutionFolder = new File(SOLUTION_PATH);
if (!solutionFolder.exists()) {
if (!solutionFolder.mkdir()) {
throw new Exception("Unable to create " + SOLUTION_PATH);
}
}
// Create the resource folder
String resourcePath = SOLUTION_PATH + "/" + RESOURCE_FOLDER_NAME;
File resourceFolder = new File(resourcePath);
if (!resourceFolder.exists()) {
if (!resourceFolder.mkdir()) {
throw new Exception("Unable to create " + resourcePath);
}
}
// Create the resource metadata folder
String metadataPath = SOLUTION_PATH + "/" + RESOURCE_FOLDER_NAME + "/" + METADATA_FOLDER_NAME;
File metadataFolder = new File(metadataPath);
if (!metadataFolder.exists()) {
if (!metadataFolder.mkdir()) {
throw new Exception("Unable to create " + metadataPath);
}
}
localeTestUtil = new LocaleTestUtil();
MicroPlatform mp = new MicroPlatform(SOLUTION_PATH);
try {
mp.start();
} catch (PlatformInitializationException pie) {
pie.printStackTrace();
}
}
use of org.pentaho.test.platform.engine.core.MicroPlatform in project pentaho-platform by pentaho.
the class UserDetailsRoleListWebServiceBase method init0.
@Before
public void init0() {
microPlatform = new MicroPlatform(getSolutionPath());
microPlatform.define(IUserRoleListService.class, MockUserRoleListService.class);
microPlatform.defineInstance("useMultiByteEncoding", new Boolean(false));
}
use of org.pentaho.test.platform.engine.core.MicroPlatform in project pentaho-platform by pentaho.
the class UserRoleWebServiceBase method init0.
@Before
public void init0() {
microPlatform = new MicroPlatform(getSolutionPath());
microPlatform.define(USER_ROLE_DAO_TXN, UserRoleDaoMock.class);
mockPolicy = mock(IAuthorizationPolicy.class);
mockUserAsAdmin(false);
microPlatform.define(IAuthorizationPolicy.class.getSimpleName(), mockPolicy);
microPlatform.define("passwordEncoder", PasswordEncoderMock.class);
UserRoleDaoMock userRoleDao = PentahoSystem.get(UserRoleDaoMock.class, USER_ROLE_DAO_TXN, null);
users.clear();
roles.clear();
userRoleDao.createUser(null, "test1", "test", "test", null);
userRoleDao.createUser(null, "test2", "test", "test", null);
userRoleDao.createRole(null, "testRole1", "test role", new String[] { "test1" });
userRoleDao.createRole(null, "testRole2", "test role", new String[] { "test2" });
}
Aggregations