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

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


    StandaloneObjectFactory factory = new StandaloneObjectFactory();

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

    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( Object2.class.getSimpleName(), Object2.class.getName(), Scope.GLOBAL, getClass()
        .getClassLoader() );

    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.GLOBAL ); //$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

  @Test
  public void testEmptyActionSequence() throws IOException {
    List<Object> messages = new ArrayList<Object>();
    String instanceId = null;
    IPentahoSession session = new StandaloneSession( "system" );
    ISolutionEngine solutionEngine = PentahoSystem.get( ISolutionEngine.class, session );
    solutionEngine.setLoggingLevel( ILogger.ERROR );
    solutionEngine.init( session );
    Map<Object, Object> parameterProviderMap = new HashMap<Object, Object>();
    IPentahoUrlFactory urlFactory = new SimpleUrlFactory( "" );
View Full Code Here

    finishTest();
  }

  public void testCustomParameter() {
    startTest();
    IPentahoSession session = new StandaloneSession( "admin" );
    CustomSettingsParameterProvider provider = new CustomSettingsParameterProvider();
    provider.setSession( session );

    assertEquals( "Output is not correct", "value1", provider.getStringParameter(
        "settings-{$user}.xml{personal-settings/setting1}", null ) );
View Full Code Here

    }
    return xactionStr;
  }

  public static ISolutionEngine getSolutionEngine() {
    IPentahoSession session = new StandaloneSession( "system" );
    return getSolutionEngine( session );

  }
View Full Code Here

  }

  @Test
  public void testGetObjectReference() throws Exception {
    IPentahoSession session = new StandaloneSession( "joe" );
    RuntimeObjectFactory factory = new RuntimeObjectFactory();
    final SingletonPentahoObjectReference<String>
      something = new SingletonPentahoObjectReference<String>( String.class, "Something" );
    factory.registerReference( something );
    assertSame( something, factory.getObjectReference( String.class, session ) );
View Full Code Here

  }

  @Test
  public void testGetObjectReferences() throws Exception {

    IPentahoSession session = new StandaloneSession( "joe" );
    RuntimeObjectFactory factory = new RuntimeObjectFactory();
    final SingletonPentahoObjectReference<String> something1 =
      new SingletonPentahoObjectReference<String>( String.class, "Something1", Collections.<String, Object>emptyMap(),
        0 );
    final SingletonPentahoObjectReference<String> something2 =
View Full Code Here

    ByteArrayOutputStream out = new ByteArrayOutputStream();
    SimpleOutputHandler outputHandler = new SimpleOutputHandler( out, false );
    outputHandler.setOutputPreference( IOutputHandler.OUTPUT_TYPE_DEFAULT );

    startTest();
    IPentahoSession session = new StandaloneSession( "system" );
    ISolutionEngine solutionEngine = ServiceTestHelper.getSolutionEngine();
    if ( outputHandler != null ) {
      outputHandler.setSession( session );
    }
    try {
View Full Code Here

    TestOutputHandler.contentItem = new SimpleContentItem();
    factory.defineObject( "testoutut", TestOutputHandler.class.getName(), StandaloneObjectFactory.Scope.LOCAL );
    PentahoSystem.registerObjectFactory( factory );

    StandaloneSession session = new StandaloneSession();

    ByteArrayOutputStream out = new ByteArrayOutputStream();

    SimpleOutputHandler handler = new SimpleOutputHandler( out, false );
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.