Package org.pentaho.platform.engine.core.system

Examples of org.pentaho.platform.engine.core.system.StandaloneApplicationContext


    when( securityConfig.getId() ).thenReturn( "security" );
    systemConfig.registerConfiguration( securityConfig );

    systemResource = new SystemResource( systemConfig );

    StandaloneApplicationContext applicationContext = new StandaloneApplicationContext( getSolutionPath(), "" ); //$NON-NLS-1$

    ApplicationContext springApplicationContext = getSpringApplicationContext();
    IPentahoObjectFactory pentahoObjectFactory = new StandaloneSpringPentahoObjectFactory();
    pentahoObjectFactory.init( null, springApplicationContext );
    PentahoSystem.registerObjectFactory( pentahoObjectFactory );
View Full Code Here


  public void testTempFileDeleter() throws Exception {
    StandaloneSession session = new StandaloneSession( "tempfiledeleter", UUIDUtil.getUUIDAsString() ); // get one with an id. //$NON-NLS-1$
    StandaloneTempFileDeleter deleter = new StandaloneTempFileDeleter();

    StandaloneApplicationContext appContext = new StandaloneApplicationContext( getSolutionRoot(), "" ); //$NON-NLS-1$ //$NON-NLS-2$
    File file1 = appContext.createTempFile( session, "testTempFileDeleter", "txt", true ); //$NON-NLS-1$ //$NON-NLS-2$
    assertNotNull( file1 ); // File object was returned
    assertTrue( file1.exists() ); // File exists
    assertFalse( deleter.hasTempFile( file1.getName() ) ); // Deleter wasn't bound to session, so no delete
    // Bind deleter to the session
    session.setAttribute( ITempFileDeleter.DELETER_SESSION_VARIABLE, deleter );
    File file2 = appContext.createTempFile( session, "testTempFileDeleter", "txt", true ); //$NON-NLS-1$ //$NON-NLS-2$
    assertNotNull( file2 ); // File object was returned
    assertTrue( file2.exists() ); // File exists
    assertTrue( deleter.hasTempFile( file2.getName() ) ); // Deleter is bound to session
    // File names should be unique
    assertFalse( file1.getName().equals( file2.getName() ) );
View Full Code Here

  }

  public boolean init() {
    PentahoSystem.setSystemSettingsService( new PathBasedSystemSettings() );
    File file = new File( SOLUTION_PATH + PENTAHO_XML_PATH );
    StandaloneApplicationContext applicationContext = null;
    if ( file.exists() ) {
      applicationContext = new StandaloneApplicationContext( SystemSettingsTest.SOLUTION_PATH, "" ); //$NON-NLS-1$
    } else {
      applicationContext = new StandaloneApplicationContext( SystemSettingsTest.ALT_SOLUTION_PATH, "" ); //$NON-NLS-1$
    }
    String inContainer = System.getProperty( "incontainer", "false" ); //$NON-NLS-1$ //$NON-NLS-2$
    if ( inContainer.equalsIgnoreCase( "false" ) ) { //$NON-NLS-1$
      // Setup simple-jndi for datasources
      System.setProperty( "java.naming.factory.initial", "org.osjava.sj.SimpleContextFactory" ); //$NON-NLS-1$ //$NON-NLS-2$
View Full Code Here

  public void test1() throws ObjectFactoryException {

    StandaloneSession session = new StandaloneSession( "test" );

    StandaloneApplicationContext appContext = new StandaloneApplicationContext( "test-res/solution", "" );

    StandaloneSpringPentahoObjectFactory factory = new StandaloneSpringPentahoObjectFactory();
    factory.init( "test-res/solution/system/pentahoObjects.GlobalListPublisherTest.spring.xml", null );

    PentahoSystem.init( appContext );
View Full Code Here

  @Test
  public void testSystemSettingsConfiguration() throws Exception {

    PentahoSystem.clearObjectFactory();
    PentahoSystem.setApplicationContext( new StandaloneApplicationContext( "test-res/SystemConfig", "" ) );
    SystemSettingsConfiguration settings = new SystemSettingsConfiguration( "system", new PathBasedSystemSettings() );
    Properties props = settings.getProperties();
    assertNotNull( props );
    assertEquals( "Hypersonic", props.get( "sampledata-datasource.type" ) );
  }
View Full Code Here

  }

  @Test
  public void testSystemSettingsFromSpring() throws Exception {
    PentahoSystem.clearObjectFactory();
    PentahoSystem.setApplicationContext( new StandaloneApplicationContext( "test-res/SystemConfig", "" ) );

    FileSystemXmlApplicationContext context =
        new FileSystemXmlApplicationContext(
            "test-res/SystemConfig/system/testPropertyPlaceholders-system-settings.spring.xml" );
    context.refresh();
View Full Code Here

* File Templates.
*/
public class OSGIBootTest {
  @Test
  public void testStartup() throws Exception {
    PentahoSystem.setApplicationContext( new StandaloneApplicationContext( "test-res/osgiSystem", "test-res/osgiSystem" ) );
    OSGIBoot boot = new OSGIBoot();
    boot.startup( new StandaloneSession() );
    assertEquals( org.osgi.framework.Bundle.ACTIVE, boot.framework.getState() );
  }
View Full Code Here

    }

    PentahoSystem.setSystemSettingsService( new PathBasedSystemSettings() );

    if ( PentahoSystem.getApplicationContext() == null ) {
      StandaloneApplicationContext applicationContext = new StandaloneApplicationContext( getSolutionPath(), "" ); //$NON-NLS-1$
      // set the base url assuming there is a running server on port 8080
      applicationContext.setFullyQualifiedServerURL( getFullyQualifiedServerURL() );
      String inContainer = System.getProperty( "incontainer", "false" ); //$NON-NLS-1$ //$NON-NLS-2$
      if ( inContainer.equalsIgnoreCase( "false" ) ) { //$NON-NLS-1$
        // Setup simple-jndi for datasources
        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$
View Full Code Here

  public String getSolutionPath() {
    return SOLUTION_PATH;
  }

  public void setUp() {
    StandaloneApplicationContext applicationContext = new StandaloneApplicationContext( getSolutionPath(), "" ); //$NON-NLS-1$
    PentahoSystem.init( applicationContext, getRequiredListeners() );
  }
View Full Code Here

    return SOLUTION_PATH;
  }

  public void setUp() {
    super.setUp();
    StandaloneApplicationContext applicationContext = new StandaloneApplicationContext( getSolutionPath(), "" ); //$NON-NLS-1$
    PentahoSystem.init( applicationContext, getRequiredListeners() );

  }
View Full Code Here

TOP

Related Classes of org.pentaho.platform.engine.core.system.StandaloneApplicationContext

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.