Package org.pentaho.platform.api.engine

Examples of org.pentaho.platform.api.engine.IPentahoSession


public class StandaloneObjectFactoryTest extends TestCase {

  public void testNoCreator() {

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

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


  }

  public void testBadScope() throws Exception {

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

    factory.defineObject( Object1.class.getSimpleName(), Object1.class.getName(), null );

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

  }

  public void testImplementingClass() throws Exception {

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

    factory.defineObject( Object1.class.getSimpleName(), Object1.class.getName(), Scope.GLOBAL );
    factory.defineObject( "bogus2", "bogus", Scope.GLOBAL ); //$NON-NLS-1$ //$NON-NLS-2$
View Full Code Here

    }
  }

  public void testInit() throws Exception {

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

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

    assertTrue( "Object is not defined", factory.objectDefined( Object1.class.getSimpleName() ) ); //$NON-NLS-1$
View Full Code Here

    try {
      if ( session != null ) {
        String sessionId = event.getSession().getId();
        Object obj = session.getAttribute( PentahoSystem.PENTAHO_SESSION_KEY ); //$NON-NLS-1$
        if ( obj != null ) {
          IPentahoSession userSession = (IPentahoSession) obj;
          PentahoSystem.invokeLogoutListeners( userSession );
          userSession.destroy();
        } else {
          String[] info = PentahoHttpSessionListener.getSessionInfo( sessionId );
          if ( info != null ) {
            String instanceId = info[5];
            String userId = info[3];
View Full Code Here

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

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

    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.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

  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

TOP

Related Classes of org.pentaho.platform.api.engine.IPentahoSession

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.