Examples of OutgoingSessionGranularitySessionData


Examples of org.jboss.as.clustering.web.OutgoingSessionGranularitySessionData

    @Test
    public void store() throws IOException {
        @SuppressWarnings("unchecked")
        Map<Object, Object> map = mock(Map.class);
        OutgoingSessionGranularitySessionData data = mock(OutgoingSessionGranularitySessionData.class);
        Map<String, Object> attributes = Collections.emptyMap();
        Object marshalledAttributes = new Object();

        when(data.getSessionAttributes()).thenReturn(attributes);
        when(this.marshaller.marshal(attributes)).thenReturn(marshalledAttributes);

        this.storage.store(map, data);

        verify(map).put(eq((byte) SessionMapEntry.ATTRIBUTES.ordinal()), same(marshalledAttributes));
View Full Code Here

Examples of org.jboss.as.clustering.web.OutgoingSessionGranularitySessionData

    @Test
    public void storeNull() throws IOException {
        @SuppressWarnings("unchecked")
        Map<Object, Object> map = mock(Map.class);
        OutgoingSessionGranularitySessionData data = mock(OutgoingSessionGranularitySessionData.class);

        when(data.getSessionAttributes()).thenReturn(null);

        this.storage.store(map, data);

        verifyZeroInteractions(map);
    }
View Full Code Here

Examples of org.jboss.web.tomcat.service.session.distributedcache.spi.OutgoingSessionGranularitySessionData

      md.setValid(true);
      md.setMaxInactiveInterval(30000);
      Long ts = Long.valueOf(md.getCreationTime() + 1);
      Map<String, Object> attrs = new HashMap<String, Object>();
      attrs.put("key", "value");
      OutgoingSessionGranularitySessionData sessionData = new MockOutgoingSessionData(id, 0, ts, md, attrs);
      testee.storeSessionData(sessionData);
     
      assertEquals(Integer.valueOf(0), testee.getSessionVersion(id));
     
      md = new DistributableSessionMetadata();
View Full Code Here

Examples of org.jboss.web.tomcat.service.session.distributedcache.spi.OutgoingSessionGranularitySessionData

      md.setValid(true);
      md.setMaxInactiveInterval(30000);
      Long ts = Long.valueOf(md.getCreationTime() + 1);
      Map<String, Object> attrs = new HashMap<String, Object>();
      attrs.put("key", "value");
      OutgoingSessionGranularitySessionData sessionData = new MockOutgoingSessionData(id, 0, ts, md, attrs);
      testee.storeSessionData(sessionData);
     
      md = new DistributableSessionMetadata();
      String id2 = nextId();
      md.setId(id2 + ".full");
View Full Code Here

Examples of org.jboss.web.tomcat.service.session.distributedcache.spi.OutgoingSessionGranularitySessionData

      md.setValid(true);
      md.setMaxInactiveInterval(30000);
      Long ts = Long.valueOf(md.getCreationTime() + 1);
      Map<String, Object> attrs = new HashMap<String, Object>();
      attrs.put("key", "value");
      OutgoingSessionGranularitySessionData sessionData = new MockOutgoingSessionData(id, 0, ts, md, attrs);
      testee.storeSessionData(sessionData);
     
      IncomingDistributableSessionData incoming = testee.getSessionData(id, true);
      assertEquals(0, incoming.getVersion());
      assertEquals(md.getCreationTime() + 1, incoming.getTimestamp());
View Full Code Here

Examples of org.jboss.web.tomcat.service.session.distributedcache.spi.OutgoingSessionGranularitySessionData

      md.setValid(true);
      md.setMaxInactiveInterval(30000);
      Long ts = Long.valueOf(md.getCreationTime() + 1);
      Map<String, Object> attrs = new HashMap<String, Object>();
      attrs.put("key", "value");
      OutgoingSessionGranularitySessionData sessionData = new MockOutgoingSessionData(id, 0, ts, md, attrs);
      testee.storeSessionData(sessionData);
     
      testee.remove(id);
     
      assertNull(testee.getSessionData(id, false));
View Full Code Here

Examples of org.jboss.web.tomcat.service.session.distributedcache.spi.OutgoingSessionGranularitySessionData

      md.setValid(true);
      md.setMaxInactiveInterval(30000);
      Long ts = Long.valueOf(md.getCreationTime() + 1);
      Map<String, Object> attrs = new HashMap<String, Object>();
      attrs.put("key", "value");
      OutgoingSessionGranularitySessionData sessionData = new MockOutgoingSessionData(id, 0, ts, md, attrs);
      testee.storeSessionData(sessionData);
     
      IncomingDistributableSessionData incoming = testee.getSessionData(id, true);
      assertEquals(0, incoming.getVersion());
      assertEquals(md.getCreationTime() + 1, incoming.getTimestamp());
View Full Code Here

Examples of org.jboss.web.tomcat.service.session.distributedcache.spi.OutgoingSessionGranularitySessionData

      md.setNew(true);
      md.setValid(true);
      md.setMaxInactiveInterval(30000);
      Long ts = Long.valueOf(md.getCreationTime() + 1);
      Map<String, Object> attrs = null;
      OutgoingSessionGranularitySessionData sessionData = new MockOutgoingSessionData(id, 0, ts, md, attrs);
      testee.storeSessionData(sessionData);
     
      IncomingDistributableSessionData incoming = testee.getSessionData(id, true);
      assertEquals(0, incoming.getVersion());
      assertEquals(md.getCreationTime() + 1, incoming.getTimestamp());
View Full Code Here

Examples of org.jboss.web.tomcat.service.session.distributedcache.spi.OutgoingSessionGranularitySessionData

      md.setValid(true);
      md.setMaxInactiveInterval(30000);
      Long ts = Long.valueOf(2);
      Map<String, Object> attrs = new HashMap<String, Object>();
      attrs.put("key", "value");
      OutgoingSessionGranularitySessionData sessionData = new MockOutgoingSessionData(id, 0, ts, md, attrs);
      testee.storeSessionData(sessionData);
     
      // Don't call md.setNew(false); !! Treat it as a new session
      DistributableSessionMetadata newmd = new DistributableSessionMetadata();
      newmd.setId(id + ".full");
View Full Code Here

Examples of org.jboss.web.tomcat.service.session.distributedcache.spi.OutgoingSessionGranularitySessionData

      md.setValid(true);
      md.setMaxInactiveInterval(30000);
      Long ts = Long.valueOf(md.getCreationTime() + 1);
      Map<String, Object> attrs = new HashMap<String, Object>();
      attrs.put("key", "value");
      OutgoingSessionGranularitySessionData sessionData = new MockOutgoingSessionData(id, 1, ts, md, attrs);
      testee.storeSessionData(sessionData);
     
      md.setNew(false);
      md.setMaxInactiveInterval(20000);
      attrs.put("key", "newvalue");
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.