Examples of MockOutgoingSessionData


Examples of org.jboss.test.cluster.web.persistent.MockOutgoingSessionData

      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();
      String id2 = nextId();
      md.setId(id2 + ".full");
      md.setCreationTime(System.currentTimeMillis());
      md.setNew(true);
      md.setValid(true);
      md.setMaxInactiveInterval(30000);
      ts = Long.valueOf(md.getCreationTime() + 1);
      attrs = new HashMap<String, Object>();
      attrs.put("key", "value");
      sessionData = new MockOutgoingSessionData(id2, 0, ts, md, attrs);
      testee.storeSessionData(sessionData);
     
      assertEquals(Integer.valueOf(0), testee.getSessionVersion(id2));
     
      assertEquals(2 + existing, testee.getSize());
View Full Code Here

Examples of org.jboss.test.cluster.web.persistent.MockOutgoingSessionData

      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");
      md.setCreationTime(System.currentTimeMillis());
      md.setNew(true);
      md.setValid(true);
      md.setMaxInactiveInterval(30000);
      ts = Long.valueOf(md.getCreationTime() + 1);
      attrs = new HashMap<String, Object>();
      attrs.put("key", "value");
      sessionData = new MockOutgoingSessionData(id2, 0, ts, md, attrs);
      testee.storeSessionData(sessionData);
     
      Set<String> ids = testee.getSessionIds();
      assertNotNull(ids);
      assertTrue(ids.contains(id));
View Full Code Here

Examples of org.jboss.test.cluster.web.persistent.MockOutgoingSessionData

      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.test.cluster.web.persistent.MockOutgoingSessionData

      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.test.cluster.web.persistent.MockOutgoingSessionData

      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.test.cluster.web.persistent.MockOutgoingSessionData

      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.test.cluster.web.persistent.MockOutgoingSessionData

      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");
      newmd.setCreationTime(3);
      newmd.setNew(true);
      newmd.setValid(true);
      newmd.setMaxInactiveInterval(30000);
      newmd.setMaxInactiveInterval(20000);
      attrs.clear();
      attrs.put("key", "newvalue");
      Long newts = Long.valueOf(4);
      sessionData = new MockOutgoingSessionData(id, 0, newts, newmd, attrs);
      testee.storeSessionData(sessionData);
     
      IncomingDistributableSessionData incoming = testee.getSessionData(id, true);
      assertEquals(0, incoming.getVersion());
      assertEquals(newts.longValue(), incoming.getTimestamp());
View Full Code Here

Examples of org.jboss.test.cluster.web.persistent.MockOutgoingSessionData

      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");
      ts = Long.valueOf(System.currentTimeMillis());
      sessionData = new MockOutgoingSessionData(id, 1, ts, md, attrs);
      testee.storeSessionData(sessionData);
     
      IncomingDistributableSessionData incoming = testee.getSessionData(id, true);
      assertEquals(1, incoming.getVersion());
      assertEquals(ts.longValue(), incoming.getTimestamp());
View Full Code Here

Examples of org.jboss.test.cluster.web.persistent.MockOutgoingSessionData

      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);
     
      attrs.put("key", "newvalue");
      ts = Long.valueOf(System.currentTimeMillis());
      sessionData = new MockOutgoingSessionData(id, 1, ts, null, attrs);
      testee.storeSessionData(sessionData);
     
      IncomingDistributableSessionData incoming = testee.getSessionData(id, true);
      assertEquals(1, incoming.getVersion());
      assertEquals(ts.longValue(), incoming.getTimestamp());
View Full Code Here

Examples of org.jboss.test.cluster.web.persistent.MockOutgoingSessionData

      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);
      ts = Long.valueOf(System.currentTimeMillis());
      sessionData = new MockOutgoingSessionData(id, 1, ts, md, null);
      testee.storeSessionData(sessionData);
     
      IncomingDistributableSessionData incoming = testee.getSessionData(id, true);
      assertEquals(1, incoming.getVersion());
      assertEquals(ts.longValue(), incoming.getTimestamp());
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.