Package org.pentaho.platform.web.http

Examples of org.pentaho.platform.web.http.PreAuthenticatedSessionHolder


*/
public class PreAuthenticatedSessionTest {

  @Test
  public void testSessionStore() {
    PreAuthenticatedSessionHolder holder = new PreAuthenticatedSessionHolder();

    IPentahoSession session = new StandaloneSession();
    PentahoSessionHolder.setSession( session );

    String key = holder.captureSession();

    assertNotNull( key );

    PentahoSessionHolder.setSession( session );

    assertTrue( holder.restoreSession( key ) );
    IPentahoSession outSession = PentahoSessionHolder.getSession();
    assertEquals( outSession, session );
    holder.close();
  }
View Full Code Here


    holder.close();
  }

  @Test
  public void testSessionNotFound() {
    PreAuthenticatedSessionHolder holder = new PreAuthenticatedSessionHolder();

    assertFalse( holder.restoreSession( "not real" ) );
  }
View Full Code Here

  public void testExpiration() {

    IPentahoSession session = new StandaloneSession();
    PentahoSessionHolder.setSession( session );

    PreAuthenticatedSessionHolder holder = new PreAuthenticatedSessionHolder( 1, 1 );

    String key = holder.captureSession();
    assertTrue( holder.restoreSession( key ) );
    try {
      Thread.sleep( 3000 );
    } catch ( InterruptedException e ) {
      //ignored
    }
    assertFalse( holder.restoreSession( key ) );

  }
View Full Code Here

TOP

Related Classes of org.pentaho.platform.web.http.PreAuthenticatedSessionHolder

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.