Examples of SimpleSession


Examples of org.apache.shiro.session.mgt.SimpleSession

        dbSession.setTimeout(session.getTimeout());
        dbSession.setStartTimestamp(session.getStartTimestamp());
        dbSession.setLastAccessTime(session.getLastAccessTime());

        if (session instanceof SimpleSession) {
            final SimpleSession simpleSession = (SimpleSession) session;
            dbSession.setAttributes(simpleSession.getAttributes());
            dbSession.setExpired(simpleSession.isExpired());
        } else {
            throw new RuntimeException("Unsupported session type: " + session.getClass().getCanonicalName());
        }

        mongoDBSessionService.saveWithoutValidation(dbSession);
View Full Code Here

Examples of org.apache.shiro.session.mgt.SimpleSession

    public void testOnStart() {
        DefaultWebSessionManager mgr = new DefaultWebSessionManager();
        Cookie cookie = createMock(Cookie.class);
        mgr.setSessionIdCookie(cookie);

        SimpleSession session = new SimpleSession();
        session.setId("12345");

        WebSessionContext wsc = new DefaultWebSessionContext();
        wsc.setServletRequest(createMock(HttpServletRequest.class));
        wsc.setServletResponse(createMock(HttpServletResponse.class));
View Full Code Here

Examples of org.apache.shiro.session.mgt.SimpleSession

        mgr.setSessionIdCookie(cookie);
        mgr.setSessionIdCookieEnabled(false);

        //we should not have any reads from the cookie fields - if we do, this test case will fail.

        SimpleSession session = new SimpleSession();
        session.setId("12345");

        WebSessionContext wsc = new DefaultWebSessionContext();
        wsc.setServletRequest(createMock(HttpServletRequest.class));
        wsc.setServletResponse(createMock(HttpServletResponse.class));
View Full Code Here

Examples of org.apache.shiro.session.mgt.SimpleSession

    public void testOnStart() {
        DefaultWebSessionManager mgr = new DefaultWebSessionManager();
        Cookie cookie = createMock(Cookie.class);
        mgr.setSessionIdCookie(cookie);

        SimpleSession session = new SimpleSession();
        session.setId("12345");

        WebSessionContext wsc = new DefaultWebSessionContext();
        wsc.setServletRequest(createMock(HttpServletRequest.class));
        wsc.setServletResponse(createMock(HttpServletResponse.class));
View Full Code Here

Examples of org.apache.shiro.session.mgt.SimpleSession

        mgr.setSessionIdCookie(cookie);
        mgr.setSessionIdCookieEnabled(false);

        //we should not have any reads from the cookie fields - if we do, this test case will fail.

        SimpleSession session = new SimpleSession();
        session.setId("12345");

        WebSessionContext wsc = new DefaultWebSessionContext();
        wsc.setServletRequest(createMock(HttpServletRequest.class));
        wsc.setServletResponse(createMock(HttpServletResponse.class));
View Full Code Here

Examples of org.jboss.test.ejb3.basic.SimpleSession

      throws Exception
   {
      InitialContext ctx = getInitialContext();
      String jndiName = "ejb3/basic/SimpleSessionBean";
      Object ref = ctx.lookup(jndiName);
      SimpleSession test = (SimpleSession) ref;
      test.ping();
   }
View Full Code Here

Examples of org.jboss.test.ejb3.basic.SimpleSession

      throws Exception
   {
      InitialContext ctx = getInitialContext();
      String jndiName = "ejb3/basic/SimpleSessionBean";
      Object ref = ctx.lookup(jndiName);
      SimpleSession test = (SimpleSession) ref;
      test.ping();
   }
View Full Code Here

Examples of org.jboss.test.security.ejb3.SimpleSession

      // login with a user that has the RegularUser role.
      this.login("UserA", "PassA".toCharArray());

      // get a reference to the remote protected stateless session bean.
      Object obj = getInitialContext().lookup("SimpleStatelessSessionBean/remote");
      SimpleSession session = (SimpleSession) PortableRemoteObject.narrow(obj, SimpleSession.class);

      Principal principal = null;
      try
      {
         principal = session.invokeRegularMethod();
         if (!(principal instanceof EJB3CustomPrincipalImpl))
            fail("Custom principal is not the caller principal");
      }
      catch (EJBAccessException eae)
      {
View Full Code Here

Examples of org.jboss.test.security.ejb3.SimpleSession

      // login with a user that has the Administrator role.
      this.login("UserA", "PassA".toCharArray());

      // get a reference to the remote protected stateless session bean.
      Object obj = getInitialContext().lookup("SimpleStatelessSessionBean/remote");
      SimpleSession session = (SimpleSession) PortableRemoteObject.narrow(obj, SimpleSession.class);

      // an administrator should have access to all methods but invokeUnavailableMethod.
      this.assertMethodAccessResults(session, true, true);

      // repeat the tests, this time calling a stateful session bean.
View Full Code Here

Examples of org.jboss.test.security.ejb3.SimpleSession

      // login with a user that has the RegularUser role.
      this.login("UserB", "PassB".toCharArray());

      // get a reference to the remote protected stateless session bean.
      Object obj = getInitialContext().lookup("SimpleStatelessSessionBean/remote");
      SimpleSession session = (SimpleSession) PortableRemoteObject.narrow(obj, SimpleSession.class);

      // a regular user cannot access administrative methods.
      this.assertMethodAccessResults(session, true, false);

      // repeat the tests, this time calling a stateful session bean.
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.