shiro-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lhazlew...@apache.org
Subject svn commit: r997594 - /incubator/shiro/trunk/core/src/test/java/org/apache/shiro/session/mgt/SimpleSessionTest.java
Date Thu, 16 Sep 2010 06:17:30 GMT
Author: lhazlewood
Date: Thu Sep 16 06:17:29 2010
New Revision: 997594

URL: http://svn.apache.org/viewvc?rev=997594&view=rev
Log:
added additional serialization test method

Modified:
    incubator/shiro/trunk/core/src/test/java/org/apache/shiro/session/mgt/SimpleSessionTest.java

Modified: incubator/shiro/trunk/core/src/test/java/org/apache/shiro/session/mgt/SimpleSessionTest.java
URL: http://svn.apache.org/viewvc/incubator/shiro/trunk/core/src/test/java/org/apache/shiro/session/mgt/SimpleSessionTest.java?rev=997594&r1=997593&r2=997594&view=diff
==============================================================================
--- incubator/shiro/trunk/core/src/test/java/org/apache/shiro/session/mgt/SimpleSessionTest.java
(original)
+++ incubator/shiro/trunk/core/src/test/java/org/apache/shiro/session/mgt/SimpleSessionTest.java
Thu Sep 16 06:17:29 2010
@@ -21,11 +21,28 @@ package org.apache.shiro.session.mgt;
 import org.junit.Test;
 
 import java.io.*;
+import java.util.Date;
 
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertTrue;
 
 public class SimpleSessionTest {
+
+    @Test
+    public void testDefaultSerialization() throws Exception {
+        SimpleSession session = new SimpleSession();
+
+        long timeout = session.getTimeout();
+        Date start = session.getStartTimestamp();
+        Date lastAccess = session.getLastAccessTime();
+
+        SimpleSession deserialized = serializeAndDeserialize(session);
+
+        assertEquals(timeout, deserialized.getTimeout());
+        assertEquals(start, deserialized.getStartTimestamp());
+        assertEquals(lastAccess, deserialized.getLastAccessTime());
+    }
+
     @Test
     public void serializeHost() throws IOException, ClassNotFoundException {
         SimpleSession session = new SimpleSession("localhost");



Mime
View raw message