* Test method for {@link org.jboss.web.tomcat.service.session.persistent.RDBMSStoreBase#storeSessionData(org.jboss.web.tomcat.service.session.distributedcache.spi.OutgoingSessionGranularitySessionData)}.
*/
public void testSimpleUpdateSessionData()
{
testee.start();
DistributableSessionMetadata md = new DistributableSessionMetadata();
String id = nextId();
md.setId(id + ".full");
md.setCreationTime(System.currentTimeMillis());
md.setNew(true);
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);
ts = Long.valueOf(System.currentTimeMillis());
sessionData = new MockOutgoingSessionData(id, 1, ts, null, null);
testee.storeSessionData(sessionData);
IncomingDistributableSessionData incoming = testee.getSessionData(id, true);
assertEquals(1, incoming.getVersion());
assertEquals(ts.longValue(), incoming.getTimestamp());
assertEquals(md.getId(), incoming.getMetadata().getId());
assertEquals(md.getCreationTime(), incoming.getMetadata().getCreationTime());
assertEquals(md.isNew(), incoming.getMetadata().isNew());
assertEquals(md.isValid(), incoming.getMetadata().isValid());
assertEquals(md.getMaxInactiveInterval(), incoming.getMetadata().getMaxInactiveInterval());
assertTrue(incoming.providesSessionAttributes());
assertEquals(attrs, incoming.getSessionAttributes());
}