[jboss-cvs] JBossAS SVN: r63849 - trunk/testsuite/src/main/org/jboss/test/cluster/test.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Thu Jul 5 18:37:06 EDT 2007


Author: bstansberry at jboss.com
Date: 2007-07-05 18:37:06 -0400 (Thu, 05 Jul 2007)
New Revision: 63849

Modified:
   trunk/testsuite/src/main/org/jboss/test/cluster/test/ScopedTestCase.java
Log:
Deploy CacheHelper as a SAR rather than via a ServletContextListener
Separate session passivation tests into their own classes

Modified: trunk/testsuite/src/main/org/jboss/test/cluster/test/ScopedTestCase.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/cluster/test/ScopedTestCase.java	2007-07-05 22:34:30 UTC (rev 63848)
+++ trunk/testsuite/src/main/org/jboss/test/cluster/test/ScopedTestCase.java	2007-07-05 22:37:06 UTC (rev 63849)
@@ -633,122 +633,4 @@
       if( body.indexOf("j_security_check") > 0 )
          fail("get of "+baseURL1_ + protectedUrl_+" redirected to login page");       
    }
-   
-   /**
-    * Tests the ability to passivate session when max idle for session is reached
-    * 
-    * @throws Exception
-    */
-   // FIXME disabled pending resolving JBAS-3571
-   public void XtestSessionPassivationWMaxIdle() throws Exception
-   {
-      getLog().debug("Enter testSessionPassivationWMaxActive");
-
-      getLog().debug(setUrl + ":::::::" + getUrl);
-
-      // Create an instance of HttpClient.
-      HttpClient client = new HttpClient();
-      // Set the session attribute first
-      makeGet(client, baseURL0_ +setUrl);
-      
-      // Get the Attribute set
-      String attr0 = makeGet(client, baseURL0_ +getUrl);
-      
-      // Find out the session id and use it to build an FQN
-      String sessionID = getSessionID(client, servers_[0]);
-      // Strip off the jvmRoute, if there is one
-      sessionID = stripJvmRoute(sessionID);
-      String sessionFqn = "/JSESSION/localhost" + warName_ + sessionID;
-      
-      sleepThread(DEFAULT_SLEEP);
-      
-      // Make connection to server 1 and get
-      setCookieDomainToThisServer(client, servers_[1]);
-      String attr1 = makeGet(client, baseURL1_ + getUrl);
-      
-      // check for replication first
-      assertEquals("attributes match", attr0, attr1);
-      
-      // sleep up to 11 secs to allow max idle to be reached 
-      // and tomcat background process to run
-      // assuming that max idle in jboss-web.xml = 10 secs
-      // and tomcat background process is using the default = 10 secs
-      sleepThread(11000);
-      
-      RMIAdaptor[] adaptors = getAdaptors();
-      getLog().debug("Session in the cache = " + SessionTestUtil.getSessionVersion(adaptors[0], sessionFqn));
-      //session is passivate should not exist in the cache
-      assertNull("Session is passivated therefore it is not in the cache...", SessionTestUtil.getSessionVersion(adaptors[0], sessionFqn));
-      
-      // activate the session by requesting the attrribute
-      // Make connection to server 0 and get
-      setCookieDomainToThisServer(client, servers_[0]);
-      String attr2 = makeGet(client, baseURL0_ + getUrl);
-      
-      assertEquals("attribute match after activation", attr0, attr2);
-   }
-   
-   /**
-    * Tests the ability to passivate session when max number of active sessions reached
-    * 
-    * @throws Exception
-    */
-   // FIXME disabled pending resolving JBAS-3571
-   public void XtestSessionPassivationWMaxActive() throws Exception
-   {
-      getLog().debug("Enter testSessionPassivationWMaxActive");
-
-      getLog().debug(setUrl + ":::::::" + getUrl);
-
-      RMIAdaptor[] adaptors = getAdaptors();
-      // Create an instance of HttpClient.
-      HttpClient client = new HttpClient();
-      // Set the session attribute first
-      makeGet(client, baseURL0_ +setUrl);
-      
-      // Get the Attribute set
-      String attr0 = makeGet(client, baseURL0_ +getUrl);
-      
-      // Find out the session id and use it to build an FQN
-      String sessionID = getSessionID(client, servers_[0]);
-      // Strip off the jvmRoute, if there is one
-      sessionID = stripJvmRoute(sessionID);
-      String sessionFqn = "/JSESSION/localhost" + warName_ + sessionID;
-      
-      sleepThread(DEFAULT_SLEEP);
-      
-      // Make connection to server 1 and get
-      setCookieDomainToThisServer(client, servers_[1]);
-      String attr1 = makeGet(client, baseURL1_ + getUrl);
-      
-      // check for replication first
-      assertEquals("attributes match", attr0, attr1);
-      
-      // Create 3 more sessions on server0
-      // assuming that max-active-sessions is set to 20 in jboss-web.xml
-      getLog().debug("current active sessions = " + SessionTestUtil.getSessionIds(adaptors[0], warFqn_));
-      int numberOfActiveSessions = SessionTestUtil.getSessionIds(adaptors[0], warFqn_).size(); 
-      HttpClient[] clients = new HttpClient[(20 - numberOfActiveSessions + 1)];
-      String[] attrs = new String[clients.length];
-      for (int i = 0; i < clients.length; i++)
-      {
-         clients[i] = new HttpClient();
-         makeGet(clients[i], baseURL0_ +setUrl);
-         attrs[i] = makeGet(clients[i], baseURL0_ + getUrl);
-         // Set cookie domain to server1
-         this.setCookieDomainToThisServer(clients[i], servers_[1]);
-      }
-      getLog().debug("to reach max active sessions we needed to create " + clients.length + " clients");
-      
-      getLog().debug("Session in the cache = " + SessionTestUtil.getSessionVersion(adaptors[0], sessionFqn));
-      //session is passivate should not exist in the cache
-      assertNull("Session is passivated therefore it is not in the cache...",  SessionTestUtil.getSessionVersion(adaptors[0], sessionFqn));
-      
-      // activate the session by requesting the attrribute
-      // Make connection to server 0 and get
-      setCookieDomainToThisServer(client, servers_[0]);
-      String attr2 = makeGet(client, baseURL0_ + getUrl);
-      
-      assertEquals("attribute match after activation", attr0, attr2);      
-   }
 }




More information about the jboss-cvs-commits mailing list