Package com.mockrunner.mock.web

Examples of com.mockrunner.mock.web.MockHttpSession


    private RequestContext initRequestContext()
    {
        MockHttpServletRequest request = new MockHttpServletRequest();
        MockHttpServletResponse response = new MockHttpServletResponse();
        MockHttpSession session = new MockHttpSession();

//        Principal p = new UserPrincipalImpl("anotherFaker");
        Principal p = new UserPrincipalImpl(USERNAME);

        request.setUserPrincipal(p);
View Full Code Here


                this.domain = new DataDomain("test");
            }
           
            @Override
            protected HttpSession getSession(boolean create) {
                return new MockHttpSession();
            }
        };

        handler.init(config);
        assertEquals(MockEventBridgeFactory.class.getName(), handler
View Full Code Here

  public void testPentahoHttpSession() {
    startTest();
    // @TOTO Not sure how to test PentahoHttpSession. In a request object to be present
    MockHttpServletRequest request = new MockHttpServletRequest();
    MockHttpSession session = new MockHttpSession();
    request.setSession( session );
    request.setupAddParameter( "solution", "samples" ); //$NON-NLS-1$//$NON-NLS-2$
    request.setupAddParameter( "path", "steel-wheels/reports" ); //$NON-NLS-1$ //$NON-NLS-2$
    request.setupAddParameter( "action", "Inventory List.xaction" ); //$NON-NLS-1$ //$NON-NLS-2$
    request.setupAddParameter( "details", "all" ); //$NON-NLS-1$ //$NON-NLS-2$
View Full Code Here

    finishTest();
  }

  public void testPentahoHttpSessionListener() {
    startTest();
    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(), Long.parseLong( "100000" ) ); //$NON-NLS-1$ //$NON-NLS-2$
    PentahoHttpSessionListener.deregisterHttpSession( session.getId() );
    httpSessionListener.sessionDestroyed( event );

    finishTest();
  }
View Full Code Here

    finishTest();
  }

  public void testPentahoHttpSessionListener2() {
    startTest();
    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", "Admin", "4674564564", Long.parseLong( "100000" ) ); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$
    PentahoHttpSessionListener.deregisterHttpSession( session.getId() );
    session.setAttribute( PentahoSystem.PENTAHO_SESSION_KEY, null ); //$NON-NLS-1$
    httpSessionListener.sessionDestroyed( event );

    finishTest();
  }
View Full Code Here

    return listeners;
  }

  public void testService() throws ServletException, IOException {
    MockHttpServletRequest request = new MockHttpServletRequest();
    MockHttpSession session = new MockHttpSession();
    request.setSession( session );
    request.setupAddParameter( "ProxyURL", "http://www.pentaho.org" ); //$NON-NLS-1$//$NON-NLS-2$

    MockHttpServletResponse response = new MockHttpServletResponse();
    ProxyServlet servlet = new ProxyServlet();
View Full Code Here

    return listeners;
  }

  public void testGetResouce() throws ServletException, IOException {
    MockHttpServletRequest request = new MockHttpServletRequest();
    MockHttpSession session = new MockHttpSession();
    request.setSession( session );
    request.setupAddParameter( "resource", "adhoc/picklist.xsl" ); //$NON-NLS-1$ //$NON-NLS-2$
    MockHttpServletResponse response = new MockHttpServletResponse();
    MockServletContext context = new MockServletContext();
    context.setServletContextName( "pentaho" );
View Full Code Here

    return listeners;
  }

  public void testDoGet() throws ServletException, IOException {
    MockHttpServletRequest request = new MockHttpServletRequest();
    MockHttpSession session = new MockHttpSession();
    request.setSession( session );
    request.setupAddParameter( "solution", "samples" ); //$NON-NLS-1$//$NON-NLS-2$
    request.setupAddParameter( "path", "steel-wheels/reports" ); //$NON-NLS-1$ //$NON-NLS-2$
    request.setupAddParameter( "action", "Inventory List.xaction" ); //$NON-NLS-1$ //$NON-NLS-2$
    request.setupAddParameter( "details", "all" ); //$NON-NLS-1$ //$NON-NLS-2$
View Full Code Here

    return listeners;
  }

  public void testDoGet() throws ServletException, IOException {
    MockHttpServletRequest request = new MockHttpServletRequest();
    MockHttpSession session = new MockHttpSession();
    request.setSession( session );
    request.setupAddParameter( "action", "securitydetails" ); //$NON-NLS-1$//$NON-NLS-2$
    request.setupAddParameter( "details", "all" ); //$NON-NLS-1$ //$NON-NLS-2$
    MockHttpServletResponse response = new MockHttpServletResponse();
    HttpWebService servlet = new HttpWebService();
View Full Code Here

    return listeners;
  }

  public void testDoGet() throws ServletException, IOException {
    MockHttpServletRequest request = new MockHttpServletRequest();
    MockHttpSession session = new MockHttpSession();
    request.setSession( session );
    request.setupAddParameter( "solution", "samples" ); //$NON-NLS-1$//$NON-NLS-2$
    request.setupAddParameter( "path", "steel-wheels/reports" ); //$NON-NLS-1$ //$NON-NLS-2$
    request.setupAddParameter( "action", "Inventory List.xaction" ); //$NON-NLS-1$ //$NON-NLS-2$
    request.setupAddParameter( "details", "all" ); //$NON-NLS-1$ //$NON-NLS-2$
View Full Code Here

TOP

Related Classes of com.mockrunner.mock.web.MockHttpSession

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.