[gatein-commits] gatein SVN: r1596 - components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/consumer.

do-not-reply at jboss.org do-not-reply at jboss.org
Tue Feb 9 17:37:06 EST 2010


Author: chris.laprun at jboss.com
Date: 2010-02-09 17:37:06 -0500 (Tue, 09 Feb 2010)
New Revision: 1596

Modified:
   components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/consumer/ProducerSessionInformationTestCase.java
Log:
- Increased thread sleep time slightly as it could happen that it'd be too short to properly simulate session expiration.

Modified: components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/consumer/ProducerSessionInformationTestCase.java
===================================================================
--- components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/consumer/ProducerSessionInformationTestCase.java	2010-02-09 22:28:15 UTC (rev 1595)
+++ components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/consumer/ProducerSessionInformationTestCase.java	2010-02-09 22:37:06 UTC (rev 1596)
@@ -1,25 +1,25 @@
-/******************************************************************************
- * JBoss, a division of Red Hat                                               *
- * Copyright 2006, Red Hat Middleware, LLC, and individual                    *
- * contributors as indicated by the @authors tag. See the                     *
- * copyright.txt in the distribution for a full listing of                    *
- * individual contributors.                                                   *
- *                                                                            *
- * This is free software; you can redistribute it and/or modify it            *
- * under the terms of the GNU Lesser General Public License as                *
- * published by the Free Software Foundation; either version 2.1 of           *
- * the License, or (at your option) any later version.                        *
- *                                                                            *
- * This software is distributed in the hope that it will be useful,           *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of             *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU           *
- * Lesser General Public License for more details.                            *
- *                                                                            *
- * You should have received a copy of the GNU Lesser General Public           *
- * License along with this software; if not, write to the Free                *
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA         *
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.                   *
- ******************************************************************************/
+/*
+ * JBoss, a division of Red Hat
+ * Copyright 2010, Red Hat Middleware, LLC, and individual
+ * contributors as indicated by the @authors tag. See the
+ * copyright.txt in the distribution for a full listing of
+ * individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
 
 package org.gatein.wsrp.consumer;
 
@@ -37,6 +37,7 @@
 public class ProducerSessionInformationTestCase extends TestCase
 {
    ProducerSessionInformation info;
+   private static final int SLEEP_TIME = 1500;
 
    protected void setUp() throws Exception
    {
@@ -53,14 +54,14 @@
       assertEquals("name=value", info.getUserCookie());
 
       // wait for cookie expiration
-      Thread.sleep(1000);
+      Thread.sleep(SLEEP_TIME);
       assertNull(info.getUserCookie()); // we shouldn't have a cookie now
 
       cookies = new Cookie[]{createCookie("name1", "value1", 1), createCookie("name2", "value2", 3)};
       info.setUserCookie(cookies);
       assertEquals("name1=value1,name2=value2", info.getUserCookie());
 
-      Thread.sleep(1000);
+      Thread.sleep(SLEEP_TIME);
       assertEquals("name2=value2", info.getUserCookie());
 
       try
@@ -94,7 +95,7 @@
 
       assertEquals("name1=value1,name2=value2", info.getGroupCookieFor(groupId));
 
-      Thread.sleep(1000);
+      Thread.sleep(SLEEP_TIME);
       assertEquals("name2=value2", info.getGroupCookieFor(groupId));
 
       info.clearGroupCookies();
@@ -119,7 +120,7 @@
       assertEquals(sid, info.getSessionIdForPortlet(handle));
       assertEquals(2, info.getNumberOfSessions());
 
-      Thread.sleep(1000);
+      Thread.sleep(SLEEP_TIME);
       assertNull(info.getSessionIdForPortlet(handle));
       assertEquals(sid2, info.getSessionIdForPortlet(handle2));
       assertEquals(1, info.getNumberOfSessions());
@@ -144,7 +145,7 @@
       info.replaceUserCookiesWith(other);
       assertEquals("name2=value2", info.getUserCookie());
 
-      Thread.sleep(1000);
+      Thread.sleep(SLEEP_TIME);
       info.replaceUserCookiesWith(other);
       assertNull(info.getUserCookie());
    }



More information about the gatein-commits mailing list