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

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



  @Test
  public void testRePublishAttributes() throws Exception {

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

    PentahoSystem.registerObjectFactory( factory );
View Full Code Here


  }

  @Test
  public void testGetById() throws Exception {

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

    AggregateObjectFactory aggFactory = new AggregateObjectFactory();
    aggFactory.registerObjectFactory( factory );
View Full Code Here

   * @throws Exception
   */
  @Test
  public void testRegistration() throws Exception {

    StandaloneSession session = new StandaloneSession();
    StandaloneSpringPentahoObjectFactory factory = new StandaloneSpringPentahoObjectFactory();

    ConfigurableApplicationContext context =
      new FileSystemXmlApplicationContext( "test-res/solution/system/pentahoObjects.spring.xml" );

View Full Code Here

   * @throws Exception
   */
  @Test
  public void testRegisteredButNotPublishingAnythingApplicationContext() throws Exception {

    StandaloneSession session = new StandaloneSession();
    StandaloneSpringPentahoObjectFactory factory = new StandaloneSpringPentahoObjectFactory();

    ConfigurableApplicationContext context =
      new FileSystemXmlApplicationContext( "test-res/solution/system/registeredButNotPublishing.spring.xml" );

View Full Code Here

  public void testGlobalObjectFail2() throws Exception {

    StandaloneObjectFactory factory = new StandaloneObjectFactory();

    factory.defineObject( Object2.class.getSimpleName(), Object2.class.getName(), Scope.GLOBAL, null );
    IPentahoSession session1 = new StandaloneSession( "test user 1" ); //$NON-NLS-1$
    try {
      factory.get( Object2.class, session1 );
      assertTrue( "Exception expected", false ); //$NON-NLS-1$
    } catch ( NullPointerException e ) {
      assertFalse( "Exception expected", false ); //$NON-NLS-1$
View Full Code Here

    SimpleParameterProvider parameterProvider = new SimpleParameterProvider();
    parameterProvider.setParameter( "type", "html" ); //$NON-NLS-1$ //$NON-NLS-2$
    OutputStream outputStream = getOutputStream( "TemplateTest.testTemplate3", ".svg" ); //$NON-NLS-1$ //$NON-NLS-2$
    SimpleOutputHandler outputHandler = new SimpleOutputHandler( outputStream, true );
    StandaloneSession session =
        new StandaloneSession( Messages.getInstance().getString( "BaseTest.DEBUG_JUNIT_SESSION" ) ); //$NON-NLS-1$
    IRuntimeContext context =
        run( "/test/template/europemap.xaction", null, false, parameterProvider, outputHandler, session ); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
    assertEquals(
        Messages.getInstance().getString( "BaseTest.USER_RUNNING_ACTION_SEQUENCE" ), IRuntimeContext.RUNTIME_STATUS_SUCCESS, context.getStatus() ); //$NON-NLS-1$
View Full Code Here

    StandaloneObjectFactory factory = new StandaloneObjectFactory();

    factory.defineObject( Object1.class.getSimpleName(), Object1.class.getName(), Scope.SESSION );

    IPentahoSession session1 = new StandaloneSession( "test user 1" ); //$NON-NLS-1$
    IPentahoSession session2 = new StandaloneSession( "test user 2" ); //$NON-NLS-1$

    Object1 obj1 = factory.get( Object1.class, session1 );
    assertNotNull( "Object is null", obj1 ); //$NON-NLS-1$

    Object1 obj2 = factory.get( Object1.class, session2 );
View Full Code Here

    StandaloneObjectFactory factory = new StandaloneObjectFactory();

    factory.defineObject( Object2.class.getSimpleName(), Object2.class.getName(), Scope.SESSION );

    IPentahoSession session1 = new StandaloneSession( "test user 1" ); //$NON-NLS-1$
    IPentahoSession session2 = new StandaloneSession( "test user 2" ); //$NON-NLS-1$

    Object2 obj1 = factory.get( Object2.class, session1 );
    assertNotNull( "Object is null", obj1 ); //$NON-NLS-1$

    Object2 obj2 = factory.get( Object2.class, session2 );
View Full Code Here

    StandaloneObjectFactory factory = new StandaloneObjectFactory();

    factory.defineObject( Object1.class.getSimpleName(), "bogus", Scope.SESSION ); //$NON-NLS-1$ 

    IPentahoSession session1 = new StandaloneSession( "test user 1" ); //$NON-NLS-1$

    try {
      factory.get( Object1.class, session1 );
      assertFalse( "exception expected", true ); //$NON-NLS-1$
    } catch ( ObjectFactoryException e ) {
View Full Code Here

    StandaloneObjectFactory factory = new StandaloneObjectFactory();

    factory.defineObject( Object1.class.getSimpleName(), Object1.class.getName(), Scope.LOCAL );

    IPentahoSession session1 = new StandaloneSession( "test user 1" ); //$NON-NLS-1$

    Object1 obj1 = factory.get( Object1.class, session1 );
    assertNotNull( "Object is null", obj1 ); //$NON-NLS-1$

    Object1 obj2 = factory.get( Object1.class, session1 );
View Full Code Here

TOP

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

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.