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

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


    assertEquals( "test data+test data2", new String( out.toByteArray() ) );

  }

  public void test2() throws Exception {
    StandaloneSession session = new StandaloneSession();

    OutputStream out = new MockExceptionOutputStream();
    IContentItem content = new SimpleContentItem( out );

    SimpleOutputHandler handler = new SimpleOutputHandler( content, true );
View Full Code Here


  }

  public void test3() throws Exception {

    StandaloneSession session = new StandaloneSession();

    OutputStream out = new MockExceptionOutputStream();

    SimpleOutputHandler handler = new SimpleOutputHandler( out, false );
View Full Code Here

  }

  public void test4() throws Exception {

    StandaloneSession session = new StandaloneSession();

    OutputStream out = new ByteArrayOutputStream();

    SimpleOutputHandler handler = new SimpleOutputHandler( out, true );
View Full Code Here

  @Test
  public void testStandaloneSessionLifecycle() {
    PentahoSessionHolder.removeSession();
    assertNull( "session should be null at first", PentahoSessionHolder.getSession() );

    StandaloneSession session = new StandaloneSession();
    PentahoSessionHolder.setSession( session );
    assertSame( "StandaloneSession was not set as the thread-bound session", session,
      PentahoSessionHolder.getSession() );

    PentahoSessionHolder.removeSession();
View Full Code Here

@SuppressWarnings( { "all" } )
public class GlobalListPublisherTest extends TestCase {

  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 );
View Full Code Here

            return UUID.randomUUID();
          }
        }
      ).build();

    IPentahoSession s1 = new StandaloneSession( "joe" );
    IPentahoSession s2 = new StandaloneSession( "admin" );

    PentahoSessionHolder.setSession( s1 );
    UUID s1Uuid = sessionRef.getObject();

    PentahoSessionHolder.setSession( s2 );
View Full Code Here

            return UUID.randomUUID();
          }
        }
      ).build();

    IPentahoSession s1 = new StandaloneSession( "joe" );
    IPentahoSession s2 = new StandaloneSession( "admin" );

    PentahoSessionHolder.setSession( s1 );
    UUID s1Uuid = sessionRef.getObject();

    PentahoSessionHolder.setSession( s2 );
View Full Code Here

@SuppressWarnings( { "all" } )
public class SessionParameterProviderTest extends TestCase {

  public void test1() {

    StandaloneSession session = new StandaloneSession( "test name" );

    PentahoSessionParameterProvider params = new PentahoSessionParameterProvider( session );

    session.setAttribute( "param1", "value1" );

    assertEquals( "Wrong param value", "test name", params.getParameter( "name" ) );
    assertEquals( "Wrong param value", "value1", params.getParameter( "param1" ) );
    assertEquals( "Wrong param value", "value1", params.getStringParameter( "param1", null ) );
    assertEquals( "Wrong param value", null, params.getStringParameter( "bogus", null ) );
View Full Code Here

    startTest();

    OutputStream outputStream = getOutputStream( "testAudit", ".html" ); //$NON-NLS-1$ //$NON-NLS-2$
    SimpleOutputHandler outputHandler = new SimpleOutputHandler( outputStream, true );
    outputHandler.setOutputPreference( IOutputHandler.OUTPUT_TYPE_PARAMETERS );
    StandaloneSession session =
        new StandaloneSession( Messages.getInstance().getString( "BaseTest.DEBUG_JUNIT_SESSION" ) ); //$NON-NLS-1$

    AuditHelper.audit( null, session, "Type", "This is a message", "Values", 34, this ); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
    assertTrue( true );
    finishTest();
  }
View Full Code Here

public class OSGIObjectFactoryTest {

  @Test
  public void testGet() throws Exception {

    StandaloneSession session = new StandaloneSession();
    BundleContext mockContext = Mockito.mock( BundleContext.class );
    ServiceReference<String> ref = Mockito.mock( ServiceReference.class );

    when( mockContext.getServiceReferences( String.class, null ) ).thenReturn( Collections.singletonList( ref ) );
    when( mockContext.getService( ref ) ).thenReturn( "SomeString" );
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.