Examples of StandaloneSession


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

    assertEquals( "Higher Priority MimeTypeListener", obj.name );
  }

  public void testSessionProperties() throws Exception {

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

    IContentInfo obj = factory.get( IContentInfo.class, session );
    assertEquals( "Test Session", obj.getTitle() );

    IContentInfo obj_again = factory.get( IContentInfo.class, session );
    assertSame( obj_again, obj );

    session = new StandaloneSession();
    IContentInfo obj_newer = factory.get( IContentInfo.class, session );
    assertNotSame( obj, obj_newer );
  }
View Full Code Here

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

    assertNotSame( obj, obj_newer );
  }

  public void testInitFromObject() throws Exception {

    StandaloneSession session = new StandaloneSession();

    StandaloneSpringPentahoObjectFactory factory = new StandaloneSpringPentahoObjectFactory();

    File f = new File( "test-res/solution/system/pentahoObjects.spring.xml" );
    FileSystemResource fsr = new FileSystemResource( f );
View Full Code Here

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

     * create SimpleOutputHandler (to handle outputs of type "response.content")
     */
    outputHandler = new SimpleOutputHandler( out, false );
    outputHandler.setOutputPreference( IOutputHandler.OUTPUT_TYPE_DEFAULT );

    IPentahoSession session = new StandaloneSession( "system" );
    ISolutionEngine solutionEngine = ServiceTestHelper.getSolutionEngine();
    outputHandler.setSession( session );

    String xactionStr = ServiceTestHelper.getXAction( "test-res/solution/test/ActionDelegateTest", actionSequenceFile );

View Full Code Here

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

  private static final String SolutionDeleterTopFolderName = "test-session-solution";

  public void testDefaultConstructor() {

    StandaloneSession session = new StandaloneSession();

    assertEquals( "session name is wrong", "unknown", session.getName() ); //$NON-NLS-1$ //$NON-NLS-2$
    assertEquals( "session id is wrong", "unknown", session.getId() ); //$NON-NLS-1$ //$NON-NLS-2$
    assertEquals( "session locale is wrong", Locale.getDefault(), session.getLocale() ); //$NON-NLS-1$

    // make sure this does not blow up
    session.destroy();

    assertEquals( "session object name is wrong", StandaloneSession.class.getName(), session.getObjectName() ); //$NON-NLS-1$
  }
View Full Code Here

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

    }
  }

  public void testNameConstructor() {

    StandaloneSession session = new StandaloneSession( "testname" ); //$NON-NLS-1$

    assertEquals( "session name is wrong", "testname", session.getName() ); //$NON-NLS-1$ //$NON-NLS-2$
    assertEquals( "session id is wrong", "testname", session.getId() ); //$NON-NLS-1$ //$NON-NLS-2$
    assertEquals( "session locale is wrong", Locale.getDefault(), session.getLocale() ); //$NON-NLS-1$
  }
View Full Code Here

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

    assertEquals( "session locale is wrong", Locale.getDefault(), session.getLocale() ); //$NON-NLS-1$
  }

  public void testIdConstructor() {

    StandaloneSession session = new StandaloneSession( "testname", "testid" ); //$NON-NLS-1$ //$NON-NLS-2$

    assertEquals( "session name is wrong", "testname", session.getName() ); //$NON-NLS-1$ //$NON-NLS-2$
    assertEquals( "session id is wrong", "testid", session.getId() ); //$NON-NLS-1$ //$NON-NLS-2$
    assertEquals( "session locale is wrong", Locale.getDefault(), session.getLocale() ); //$NON-NLS-1$
  }
View Full Code Here

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

    assertEquals( "session locale is wrong", Locale.getDefault(), session.getLocale() ); //$NON-NLS-1$
  }

  public void testConstructor() {

    StandaloneSession session = new StandaloneSession( "testname", "testid", Locale.CHINESE ); //$NON-NLS-1$ //$NON-NLS-2$

    assertEquals( "session name is wrong", "testname", session.getName() ); //$NON-NLS-1$ //$NON-NLS-2$
    assertEquals( "session id is wrong", "testid", session.getId() ); //$NON-NLS-1$ //$NON-NLS-2$
    assertEquals( "session locale is wrong", Locale.CHINESE, session.getLocale() ); //$NON-NLS-1$
  }
View Full Code Here

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

    assertEquals( "session locale is wrong", Locale.CHINESE, session.getLocale() ); //$NON-NLS-1$
  }

  public void testAttributes() {

    StandaloneSession session = new StandaloneSession();
    assertFalse( "Wrong attributes", session.getAttributeNames().hasNext() ); //$NON-NLS-1$

    session.setAttribute( "testattribute", this ); //$NON-NLS-1$
    assertTrue( "Wrong attributes", session.getAttributeNames().hasNext() ); //$NON-NLS-1$
    assertEquals( "Wrong attribute name", "testattribute", session.getAttributeNames().next() ); //$NON-NLS-1$ //$NON-NLS-2$
    assertEquals( "Wrong attribute value", this, session.getAttribute( "testattribute" ) ); //$NON-NLS-1$ //$NON-NLS-2$

    session.removeAttribute( "testattribute" ); //$NON-NLS-1$
    assertFalse( "Wrong attributes", session.getAttributeNames().hasNext() ); //$NON-NLS-1$
    assertNull( "Wrong attribute value", session.getAttribute( "testattribute" ) ); //$NON-NLS-1$ //$NON-NLS-2$

  }
View Full Code Here

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

  }

  public void testLogger() {

    StandaloneSession session = new StandaloneSession();
    assertNotNull( "Bad logger", session.getLogger() ); //$NON-NLS-1$   
  }
View Full Code Here

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

    assertNotNull( "Bad logger", session.getLogger() ); //$NON-NLS-1$   
  }

  public void testAuthenticated() {

    StandaloneSession session = new StandaloneSession( "testname" ); //$NON-NLS-1$
    assertFalse( "Wrong authenication", session.isAuthenticated() ); //$NON-NLS-1$

    session.setAuthenticated( null );
    assertFalse( "Wrong authenication", session.isAuthenticated() ); //$NON-NLS-1$

    session.setAuthenticated( "testname" ); //$NON-NLS-1$
    assertTrue( "Wrong authenication", session.isAuthenticated() ); //$NON-NLS-1$

    session.setNotAuthenticated();
    assertNull( "session name is wrong", session.getName() ); //$NON-NLS-1$
    assertFalse( "Wrong authenication", session.isAuthenticated() ); //$NON-NLS-1$

  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.