Example usage for javax.servlet.http HttpSessionEvent HttpSessionEvent

List of usage examples for javax.servlet.http HttpSessionEvent HttpSessionEvent

Introduction

In this page you can find the example usage for javax.servlet.http HttpSessionEvent HttpSessionEvent.

Prototype

public HttpSessionEvent(HttpSession source) 

Source Link

Document

Construct a session event from the given source.

Usage

From source file:org.pentaho.test.platform.web.SessionIT.java

public void testPentahoHttpSessionListener() {
    startTest();/*from ww  w.  j  a v a 2 s  . com*/
    MockHttpSession session = new MockHttpSession();
    HttpSession httpSession = session;
    HttpSessionEvent event = new HttpSessionEvent(httpSession);

    PentahoHttpSessionListener httpSessionListener = new PentahoHttpSessionListener();
    httpSessionListener.sessionCreated(event);
    PentahoHttpSessionListener.registerHttpSession(session.getId(), null, null, null, "Admin", session.getId(), //$NON-NLS-1$
            Long.parseLong("100000")); //$NON-NLS-1$
    PentahoHttpSessionListener.deregisterHttpSession(session.getId());
    httpSessionListener.sessionDestroyed(event);

    finishTest();
}

From source file:org.pentaho.test.platform.web.SessionIT.java

public void testPentahoHttpSessionListener2() {
    startTest();/*  ww w  .jav a  2 s  . c  o  m*/
    MockHttpSession session = new MockHttpSession();
    HttpSession httpSession = session;
    HttpSessionEvent event = new HttpSessionEvent(httpSession);

    PentahoHttpSessionListener httpSessionListener = new PentahoHttpSessionListener();
    httpSessionListener.sessionCreated(event);
    PentahoHttpSessionListener.registerHttpSession(session.getId(), "3543453453", "34534535345", "533453535345", //$NON-NLS-1$//$NON-NLS-2$//$NON-NLS-3$
            "Admin", "4674564564", Long.parseLong("100000")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
    PentahoHttpSessionListener.deregisterHttpSession(session.getId());
    session.setAttribute(PentahoSystem.PENTAHO_SESSION_KEY, null); //$NON-NLS-1$
    httpSessionListener.sessionDestroyed(event);

    finishTest();
}