use of org.pentaho.platform.engine.core.system.PathBasedSystemSettings in project pdi-platform-plugin by pentaho.
the class PdiActionTest method init.
@Before
public void init() throws SchedulerException, PlatformInitializationException {
// $NON-NLS-1$ //$NON-NLS-2$
System.setProperty("java.naming.factory.initial", "org.osjava.sj.SimpleContextFactory");
// $NON-NLS-1$ //$NON-NLS-2$
System.setProperty("org.osjava.sj.root", SOLUTION_REPOSITORY);
// $NON-NLS-1$ //$NON-NLS-2$
System.setProperty("org.osjava.sj.delimiter", "/");
// $NON-NLS-2$
System.setProperty("PENTAHO_SYS_CFG_PATH", new File(SOLUTION_REPOSITORY + "/pentaho.xml").getAbsolutePath());
IPentahoSession session = new StandaloneSession();
PentahoSessionHolder.setSession(session);
scheduler = new QuartzScheduler();
scheduler.start();
mp.define(IUserRoleListService.class, StubUserRoleListService.class);
mp.define(UserDetailsService.class, StubUserDetailService.class);
mp.defineInstance(IAuthorizationPolicy.class, new TestAuthorizationPolicy());
mp.setSettingsProvider(new PathBasedSystemSettings());
mp.defineInstance(IScheduler.class, scheduler);
mp.define(ISolutionEngine.class, SolutionEngine.class);
FileSystemBackedUnifiedRepository repo = new FileSystemBackedUnifiedRepository(SOLUTION_REPOSITORY);
mp.defineInstance(IUnifiedRepository.class, repo);
mp.start();
SecurityHelper.getInstance().becomeUser(TEST_USER);
}
use of org.pentaho.platform.engine.core.system.PathBasedSystemSettings in project pdi-platform-plugin by pentaho.
the class UserParametersTest method init.
@Before
public void init() throws PlatformInitializationException {
System.setProperty("java.naming.factory.initial", "org.osjava.sj.SimpleContextFactory");
System.setProperty("org.osjava.sj.root", "test-src/simple-jndi");
System.setProperty("org.osjava.sj.delimiter", "/");
System.setProperty("PENTAHO_SYS_CFG_PATH", new File(SOLUTION_REPOSITORY + "/pentaho.xml").getAbsolutePath());
IPentahoSession session = new StandaloneSession();
PentahoSessionHolder.setSession(session);
mp.define(IUserRoleListService.class, StubUserRoleListService.class);
mp.define(UserDetailsService.class, StubUserDetailService.class);
mp.defineInstance(IAuthorizationPolicy.class, new TestAuthorizationPolicy());
mp.setSettingsProvider(new PathBasedSystemSettings());
mp.define(ISolutionEngine.class, SolutionEngine.class);
FileSystemBackedUnifiedRepository repo = new FileSystemBackedUnifiedRepository(SOLUTION_REPOSITORY);
mp.defineInstance(IUnifiedRepository.class, repo);
mp.start();
SecurityHelper.getInstance().becomeUser(TEST_USER);
}
use of org.pentaho.platform.engine.core.system.PathBasedSystemSettings in project data-access by pentaho.
the class DataSourcePublishIT method setUpClass.
@BeforeClass
public static void setUpClass() throws Exception {
// folder cannot be deleted at teardown shutdown hooks have not yet necessarily completed
// parent folder must match jcrRepository.homeDir bean property in repository-test-override.spring.xml
FileUtils.deleteDirectory(new File("/tmp/repository-future/jackrabbit-test-TRUNK"));
PentahoSessionHolder.setStrategyName(PentahoSessionHolder.MODE_GLOBAL);
// register repository spring context for correct work of <pen:list>
final StandaloneSpringPentahoObjectFactory pentahoObjectFactory = new StandaloneSpringPentahoObjectFactory();
GenericApplicationContext appCtx = new GenericApplicationContext();
XmlBeanDefinitionReader xmlReader = new XmlBeanDefinitionReader(appCtx);
xmlReader.loadBeanDefinitions("classpath:/repository.spring.xml");
xmlReader.loadBeanDefinitions("classpath:/solutionACL/system/repository-test-override.spring.xml");
xmlReader.loadBeanDefinitions("classpath:/solutionACL/system/importExport.xml");
xmlReader.loadBeanDefinitions("classpath:/solutionACL/system/pentahoObjects.spring.xml");
xmlReader.loadBeanDefinitions("classpath:/jackrabbit-test-repo.xml");
pentahoObjectFactory.init(null, appCtx);
PentahoSystem.registerObjectFactory(pentahoObjectFactory);
PentahoSystem.setSystemSettingsService(new PathBasedSystemSettings());
FileUtils.deleteDirectory(new File("/tmp/data-access/jackrabbit-test-TRUNK"));
}
use of org.pentaho.platform.engine.core.system.PathBasedSystemSettings in project pentaho-platform by pentaho.
the class BaseTestCase method init.
protected void init(String solnPath) {
PentahoSystem.setSystemSettingsService(new PathBasedSystemSettings());
// $NON-NLS-1$
applicationContext = new StandaloneApplicationContext(solnPath, "");
applicationContext.setFullyQualifiedServerURL(getFullyQualifiedServerURL());
// $NON-NLS-1$ //$NON-NLS-2$
String inContainer = System.getProperty("incontainer", "false");
if (inContainer.equalsIgnoreCase("false")) {
// $NON-NLS-1$
// Setup simple-jndi for datasources
// $NON-NLS-1$ //$NON-NLS-2$
System.setProperty("java.naming.factory.initial", "org.osjava.sj.SimpleContextFactory");
// $NON-NLS-1$ //$NON-NLS-2$
System.setProperty("org.osjava.sj.root", getSolutionPath() + "/system/simple-jndi");
// $NON-NLS-1$ //$NON-NLS-2$
System.setProperty("org.osjava.sj.delimiter", "/");
}
// $NON-NLS-1$
String objectFactoryCreatorCfgFile = getSolutionPath() + SYSTEM_FOLDER + "/" + DEFAULT_SPRING_CONFIG_FILE_NAME;
IPentahoObjectFactory pentahoObjectFactory = new StandaloneSpringPentahoObjectFactory();
pentahoObjectFactory.init(objectFactoryCreatorCfgFile, null);
PentahoSystem.registerObjectFactory(pentahoObjectFactory);
PentahoSystem.init(applicationContext);
// $NON-NLS-1$
session = new StandaloneSession("system");
}
use of org.pentaho.platform.engine.core.system.PathBasedSystemSettings in project pentaho-platform by pentaho.
the class MicroPlatform method start.
@Override
public boolean start() throws PlatformInitializationException {
PentahoSystem.setSystemSettingsService(new PathBasedSystemSettings());
// initialize log4j to write to the console
BasicConfigurator.configure();
boolean ret = super.start();
// and other errors, not to mention it's inefficient
try {
Object o = PentahoSystem.get(ISolutionEngine.class);
if (o != null && o instanceof ILogger) {
((ILogger) o).setLoggingLevel(ILogger.DEBUG);
}
} catch (Throwable e) {
logger.error("Failed to set DEBUG log level due to ISolutionEngine not being available in MicroPlatform");
}
return ret;
}
Aggregations