[jboss-cvs] JBossAS SVN: r91354 - in branches/JBPAPP_5_0/testsuite/src: main/org/jboss/test/cluster/defaultcfg/web/test and 3 other directories.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Thu Jul 16 16:07:09 EDT 2009


Author: bstansberry at jboss.com
Date: 2009-07-16 16:07:09 -0400 (Thu, 16 Jul 2009)
New Revision: 91354

Modified:
   branches/JBPAPP_5_0/testsuite/src/main/org/jboss/test/cluster/defaultcfg/simpleweb/test/DriverManagerPersistentStoreUnitTestCase.java
   branches/JBPAPP_5_0/testsuite/src/main/org/jboss/test/cluster/defaultcfg/simpleweb/test/PersistentStoreMaxUnreplicatedIntervalTestCase.java
   branches/JBPAPP_5_0/testsuite/src/main/org/jboss/test/cluster/defaultcfg/simpleweb/test/PersistentStoreMemoryLeakTestCase.java
   branches/JBPAPP_5_0/testsuite/src/main/org/jboss/test/cluster/defaultcfg/simpleweb/test/PersistentStoreSessionCountUnitTestCase.java
   branches/JBPAPP_5_0/testsuite/src/main/org/jboss/test/cluster/defaultcfg/simpleweb/test/PersistentStoreSessionNotificationPolicyTestCase.java
   branches/JBPAPP_5_0/testsuite/src/main/org/jboss/test/cluster/defaultcfg/web/test/PersistentManagerCrossContextCallsTestCase.java
   branches/JBPAPP_5_0/testsuite/src/main/org/jboss/test/cluster/defaultcfg/web/test/PersistentManagerUndeployTestCase.java
   branches/JBPAPP_5_0/testsuite/src/main/org/jboss/test/cluster/testutil/DBSetup.java
   branches/JBPAPP_5_0/testsuite/src/main/org/jboss/test/cluster/testutil/DBSetupDelegate.java
   branches/JBPAPP_5_0/testsuite/src/main/org/jboss/test/cluster/testutil/DelegatingClusteredTestCase.java
   branches/JBPAPP_5_0/testsuite/src/main/org/jboss/test/cluster/web/persistent/PersistentSessionTestUtil.java
   branches/JBPAPP_5_0/testsuite/src/main/org/jboss/test/cluster/web/persistent/PersistentStoreSetupDelegate.java
   branches/JBPAPP_5_0/testsuite/src/main/org/jboss/test/cluster/web/persistent/SimplePersistentStoreTestSetup.java
   branches/JBPAPP_5_0/testsuite/src/resources/cluster/persistent/httpsession-ds.xml
Log:
[JBPAPP-2257] Fix hsqldb-based tests when node0 != localhost

Modified: branches/JBPAPP_5_0/testsuite/src/main/org/jboss/test/cluster/defaultcfg/simpleweb/test/DriverManagerPersistentStoreUnitTestCase.java
===================================================================
--- branches/JBPAPP_5_0/testsuite/src/main/org/jboss/test/cluster/defaultcfg/simpleweb/test/DriverManagerPersistentStoreUnitTestCase.java	2009-07-16 19:46:40 UTC (rev 91353)
+++ branches/JBPAPP_5_0/testsuite/src/main/org/jboss/test/cluster/defaultcfg/simpleweb/test/DriverManagerPersistentStoreUnitTestCase.java	2009-07-16 20:07:09 UTC (rev 91354)
@@ -11,6 +11,7 @@
 import junit.framework.Test;
 import junit.framework.TestCase;
 
+import org.jboss.test.cluster.testutil.DBSetupDelegate;
 import org.jboss.test.cluster.web.persistent.MockOutgoingSessionData;
 import org.jboss.test.cluster.web.persistent.SimplePersistentStoreTestSetup;
 import org.jboss.web.tomcat.service.session.distributedcache.spi.DistributableSessionMetadata;
@@ -30,7 +31,10 @@
  */
 public class DriverManagerPersistentStoreUnitTestCase extends TestCase
 {
-   private static final String CONNECTION_URL = "jdbc:hsqldb:hsql://localhost:1701";
+   private static final String DB_ADDRESS = System.getProperty(DBSetupDelegate.DBADDRESS_PROPERTY, DBSetupDelegate.DEFAULT_ADDRESS);
+   
+   private static final String CONNECTION_URL = "jdbc:hsqldb:hsql://" + DB_ADDRESS + ":" + DBSetupDelegate.DEFAULT_PORT;
+   
    private static final String CONTEXT_PATH = "localhost/test";
 
    private static AtomicInteger id = new AtomicInteger();
@@ -47,7 +51,7 @@
 
    public static Test suite() throws Exception
    {
-      return SimplePersistentStoreTestSetup.getDeploySetup(DriverManagerPersistentStoreUnitTestCase.class);
+      return SimplePersistentStoreTestSetup.getDeploySetup(DriverManagerPersistentStoreUnitTestCase.class, DB_ADDRESS, DBSetupDelegate.DEFAULT_PORT);
    }
    
    private static String nextId()

Modified: branches/JBPAPP_5_0/testsuite/src/main/org/jboss/test/cluster/defaultcfg/simpleweb/test/PersistentStoreMaxUnreplicatedIntervalTestCase.java
===================================================================
--- branches/JBPAPP_5_0/testsuite/src/main/org/jboss/test/cluster/defaultcfg/simpleweb/test/PersistentStoreMaxUnreplicatedIntervalTestCase.java	2009-07-16 19:46:40 UTC (rev 91353)
+++ branches/JBPAPP_5_0/testsuite/src/main/org/jboss/test/cluster/defaultcfg/simpleweb/test/PersistentStoreMaxUnreplicatedIntervalTestCase.java	2009-07-16 20:07:09 UTC (rev 91354)
@@ -34,6 +34,7 @@
 import org.jboss.metadata.web.jboss.ReplicationGranularity;
 import org.jboss.metadata.web.jboss.ReplicationTrigger;
 import org.jboss.test.JBossTestCase;
+import org.jboss.test.cluster.testutil.DBSetupDelegate;
 import org.jboss.test.cluster.testutil.SessionTestUtil;
 import org.jboss.test.cluster.web.CacheHelper;
 import org.jboss.test.cluster.web.mocks.BasicRequestHandler;
@@ -68,7 +69,8 @@
 
    public static Test suite() throws Exception
    {
-      return SimplePersistentStoreTestSetup.getDeploySetup(PersistentStoreMaxUnreplicatedIntervalTestCase.class);
+      String dbAddress = System.getProperty(DBSetupDelegate.DBADDRESS_PROPERTY, DBSetupDelegate.DEFAULT_ADDRESS);
+      return SimplePersistentStoreTestSetup.getDeploySetup(PersistentStoreMaxUnreplicatedIntervalTestCase.class, dbAddress, DBSetupDelegate.DEFAULT_PORT);
    }
 
    

Modified: branches/JBPAPP_5_0/testsuite/src/main/org/jboss/test/cluster/defaultcfg/simpleweb/test/PersistentStoreMemoryLeakTestCase.java
===================================================================
--- branches/JBPAPP_5_0/testsuite/src/main/org/jboss/test/cluster/defaultcfg/simpleweb/test/PersistentStoreMemoryLeakTestCase.java	2009-07-16 19:46:40 UTC (rev 91353)
+++ branches/JBPAPP_5_0/testsuite/src/main/org/jboss/test/cluster/defaultcfg/simpleweb/test/PersistentStoreMemoryLeakTestCase.java	2009-07-16 20:07:09 UTC (rev 91354)
@@ -39,6 +39,7 @@
 import org.jboss.metadata.web.jboss.ReplicationGranularity;
 import org.jboss.metadata.web.jboss.ReplicationTrigger;
 import org.jboss.test.JBossTestCase;
+import org.jboss.test.cluster.testutil.DBSetupDelegate;
 import org.jboss.test.cluster.testutil.SessionTestUtil;
 import org.jboss.test.cluster.web.mocks.BasicRequestHandler;
 import org.jboss.test.cluster.web.mocks.InvalidateSessionRequestHandler;
@@ -78,7 +79,8 @@
 
    public static Test suite() throws Exception
    {
-      return SimplePersistentStoreTestSetup.getDeploySetup(PersistentStoreMemoryLeakTestCase.class);
+      String dbAddress = System.getProperty(DBSetupDelegate.DBADDRESS_PROPERTY, DBSetupDelegate.DEFAULT_ADDRESS);
+      return SimplePersistentStoreTestSetup.getDeploySetup(PersistentStoreMemoryLeakTestCase.class, dbAddress, DBSetupDelegate.DEFAULT_PORT);
    }
 
    @Override

Modified: branches/JBPAPP_5_0/testsuite/src/main/org/jboss/test/cluster/defaultcfg/simpleweb/test/PersistentStoreSessionCountUnitTestCase.java
===================================================================
--- branches/JBPAPP_5_0/testsuite/src/main/org/jboss/test/cluster/defaultcfg/simpleweb/test/PersistentStoreSessionCountUnitTestCase.java	2009-07-16 19:46:40 UTC (rev 91353)
+++ branches/JBPAPP_5_0/testsuite/src/main/org/jboss/test/cluster/defaultcfg/simpleweb/test/PersistentStoreSessionCountUnitTestCase.java	2009-07-16 20:07:09 UTC (rev 91354)
@@ -28,6 +28,7 @@
 import org.apache.catalina.Manager;
 import org.apache.catalina.Session;
 import org.jboss.logging.Logger;
+import org.jboss.test.cluster.testutil.DBSetupDelegate;
 import org.jboss.test.cluster.testutil.SessionTestUtil;
 import org.jboss.test.cluster.web.persistent.PersistentSessionTestUtil;
 import org.jboss.test.cluster.web.persistent.SimplePersistentStoreTestSetup;
@@ -57,7 +58,8 @@
 
    public static Test suite() throws Exception
    {
-      return SimplePersistentStoreTestSetup.getDeploySetup(PersistentStoreSessionCountUnitTestCase.class);
+      String dbAddress = System.getProperty(DBSetupDelegate.DBADDRESS_PROPERTY, DBSetupDelegate.DEFAULT_ADDRESS);
+      return SimplePersistentStoreTestSetup.getDeploySetup(PersistentStoreSessionCountUnitTestCase.class, dbAddress, DBSetupDelegate.DEFAULT_PORT);
    }
 
    public void testStandaloneMaxSessions() throws Exception

Modified: branches/JBPAPP_5_0/testsuite/src/main/org/jboss/test/cluster/defaultcfg/simpleweb/test/PersistentStoreSessionNotificationPolicyTestCase.java
===================================================================
--- branches/JBPAPP_5_0/testsuite/src/main/org/jboss/test/cluster/defaultcfg/simpleweb/test/PersistentStoreSessionNotificationPolicyTestCase.java	2009-07-16 19:46:40 UTC (rev 91353)
+++ branches/JBPAPP_5_0/testsuite/src/main/org/jboss/test/cluster/defaultcfg/simpleweb/test/PersistentStoreSessionNotificationPolicyTestCase.java	2009-07-16 20:07:09 UTC (rev 91354)
@@ -36,6 +36,7 @@
 import org.jboss.metadata.web.jboss.ReplicationGranularity;
 import org.jboss.metadata.web.jboss.ReplicationTrigger;
 import org.jboss.test.JBossTestCase;
+import org.jboss.test.cluster.testutil.DBSetupDelegate;
 import org.jboss.test.cluster.testutil.SessionTestUtil;
 import org.jboss.test.cluster.web.mocks.BasicRequestHandler;
 import org.jboss.test.cluster.web.mocks.InvalidateSessionRequestHandler;
@@ -79,7 +80,8 @@
 
    public static Test suite() throws Exception
    {
-      return SimplePersistentStoreTestSetup.getDeploySetup(PersistentStoreSessionNotificationPolicyTestCase.class);
+      String dbAddress = System.getProperty(DBSetupDelegate.DBADDRESS_PROPERTY, DBSetupDelegate.DEFAULT_ADDRESS);
+      return SimplePersistentStoreTestSetup.getDeploySetup(PersistentStoreSessionNotificationPolicyTestCase.class, dbAddress, DBSetupDelegate.DEFAULT_PORT);
    }
 
    

Modified: branches/JBPAPP_5_0/testsuite/src/main/org/jboss/test/cluster/defaultcfg/web/test/PersistentManagerCrossContextCallsTestCase.java
===================================================================
--- branches/JBPAPP_5_0/testsuite/src/main/org/jboss/test/cluster/defaultcfg/web/test/PersistentManagerCrossContextCallsTestCase.java	2009-07-16 19:46:40 UTC (rev 91353)
+++ branches/JBPAPP_5_0/testsuite/src/main/org/jboss/test/cluster/defaultcfg/web/test/PersistentManagerCrossContextCallsTestCase.java	2009-07-16 20:07:09 UTC (rev 91354)
@@ -27,8 +27,8 @@
 import junit.framework.Test;
 
 import org.jboss.test.cluster.testutil.DBSetupDelegate;
+import org.jboss.test.cluster.testutil.DelegatingClusteredTestCase;
 import org.jboss.test.cluster.testutil.TestSetupDelegate;
-import org.jboss.test.cluster.web.JBossClusteredWebTestCase;
 import org.jboss.test.cluster.web.persistent.PersistentStoreSetupDelegate;
 
 public class PersistentManagerCrossContextCallsTestCase extends CrossContextCallsTestCase
@@ -41,11 +41,12 @@
 
    public static Test suite() throws Exception
    {
-      TestSetupDelegate dbDelegate = new DBSetupDelegate();
-      TestSetupDelegate storeDelegate = new PersistentStoreSetupDelegate();
+      String dbAddress = System.getProperty(DBSetupDelegate.DBADDRESS_PROPERTY, DBSetupDelegate.DEFAULT_ADDRESS);
+      TestSetupDelegate dbDelegate = new DBSetupDelegate(dbAddress, DBSetupDelegate.DEFAULT_PORT);
+      TestSetupDelegate storeDelegate = new PersistentStoreSetupDelegate(dbAddress, DBSetupDelegate.DEFAULT_PORT);
       List<TestSetupDelegate> list = Arrays.asList(new TestSetupDelegate[]{dbDelegate, storeDelegate});
-      return JBossClusteredWebTestCase.getDeploySetup(PersistentManagerCrossContextCallsTestCase.class,
-                                                      "disable-manager-override.beans, httpsession-ds.xml, " +
+      return DelegatingClusteredTestCase.getDeploySetup(PersistentManagerCrossContextCallsTestCase.class,
+                                                      "httpsession-ds.xml, disable-manager-override.beans, " +
                                                       "http-cross-ctx-persistent.ear", list);
    }
 }

Modified: branches/JBPAPP_5_0/testsuite/src/main/org/jboss/test/cluster/defaultcfg/web/test/PersistentManagerUndeployTestCase.java
===================================================================
--- branches/JBPAPP_5_0/testsuite/src/main/org/jboss/test/cluster/defaultcfg/web/test/PersistentManagerUndeployTestCase.java	2009-07-16 19:46:40 UTC (rev 91353)
+++ branches/JBPAPP_5_0/testsuite/src/main/org/jboss/test/cluster/defaultcfg/web/test/PersistentManagerUndeployTestCase.java	2009-07-16 20:07:09 UTC (rev 91354)
@@ -28,10 +28,10 @@
 
 import org.apache.commons.httpclient.HttpClient;
 import org.jboss.test.cluster.testutil.DBSetupDelegate;
+import org.jboss.test.cluster.testutil.DelegatingClusteredTestCase;
 import org.jboss.test.cluster.testutil.SessionTestUtil;
 import org.jboss.test.cluster.testutil.TestSetupDelegate;
 import org.jboss.test.cluster.testutil.WebTestBase;
-import org.jboss.test.cluster.web.JBossClusteredWebTestCase;
 import org.jboss.test.cluster.web.persistent.PersistentStoreSetupDelegate;
 
 /**
@@ -74,11 +74,12 @@
 
    public static Test suite() throws Exception
    {
-      TestSetupDelegate dbDelegate = new DBSetupDelegate();
-      TestSetupDelegate storeDelegate = new PersistentStoreSetupDelegate();
+      String dbAddress = System.getProperty(DBSetupDelegate.DBADDRESS_PROPERTY, DBSetupDelegate.DEFAULT_ADDRESS);
+      TestSetupDelegate dbDelegate = new DBSetupDelegate(dbAddress, DBSetupDelegate.DEFAULT_PORT);
+      TestSetupDelegate storeDelegate = new PersistentStoreSetupDelegate(dbAddress, DBSetupDelegate.DEFAULT_PORT);
       List<TestSetupDelegate> list = Arrays.asList(new TestSetupDelegate[]{dbDelegate, storeDelegate});
-      return JBossClusteredWebTestCase.getDeploySetup(PersistentManagerUndeployTestCase.class,
-                                                      "disable-manager-override.beans, httpsession-ds.xml, " +
+      return DelegatingClusteredTestCase.getDeploySetup(PersistentManagerUndeployTestCase.class,
+                                                      "httpsession-ds.xml, disable-manager-override.beans, " +
                                                       "http-scoped-persistent.war", list);
    }
 

Modified: branches/JBPAPP_5_0/testsuite/src/main/org/jboss/test/cluster/testutil/DBSetup.java
===================================================================
--- branches/JBPAPP_5_0/testsuite/src/main/org/jboss/test/cluster/testutil/DBSetup.java	2009-07-16 19:46:40 UTC (rev 91353)
+++ branches/JBPAPP_5_0/testsuite/src/main/org/jboss/test/cluster/testutil/DBSetup.java	2009-07-16 20:07:09 UTC (rev 91354)
@@ -41,6 +41,12 @@
       super(test, jarNames);
       this.delegate = new DBSetupDelegate();
    }
+   
+   public DBSetup(Test test, String jarNames, String dbAddress, int dbPort) throws Exception
+   {
+      super(test, jarNames);
+      this.delegate = new DBSetupDelegate(dbAddress, dbPort);
+   }
 
    public static Test getDeploySetup(final Test test, final String jarNames)
       throws Exception
@@ -56,6 +62,20 @@
       return getDeploySetup(suite, jarNames);
    }
 
+   public static Test getDeploySetup(final Test test, final String jarNames, String dbAddress, int dbPort)
+      throws Exception
+   {
+      return new DBSetup(test, jarNames, dbAddress, dbPort);
+   }
+
+   public static Test getDeploySetup(final Class<?> clazz, final String jarNames, String dbAddress, int dbPort)
+      throws Exception
+   {
+      TestSuite suite = new TestSuite();
+      suite.addTest(new TestSuite(clazz));
+      return getDeploySetup(suite, jarNames, dbAddress, dbPort);
+   }
+
    protected void setUp() throws Exception
    {
          delegate.setUp();

Modified: branches/JBPAPP_5_0/testsuite/src/main/org/jboss/test/cluster/testutil/DBSetupDelegate.java
===================================================================
--- branches/JBPAPP_5_0/testsuite/src/main/org/jboss/test/cluster/testutil/DBSetupDelegate.java	2009-07-16 19:46:40 UTC (rev 91353)
+++ branches/JBPAPP_5_0/testsuite/src/main/org/jboss/test/cluster/testutil/DBSetupDelegate.java	2009-07-16 20:07:09 UTC (rev 91354)
@@ -37,6 +37,28 @@
  */
 public class DBSetupDelegate implements TestSetupDelegate
 {
+   public static final String DBADDRESS_PROPERTY = "jbosstest.cluster.node0";
+   public static final String DEFAULT_ADDRESS = "localhost";
+   public static final int DEFAULT_PORT = 1701;
+   
+   private final String address;
+   private final int port;
+   
+   public DBSetupDelegate()
+   {
+      this(DEFAULT_ADDRESS, DEFAULT_PORT);
+   }
+   
+   public DBSetupDelegate(String address, int port)
+   {
+      if (address == null)
+      {
+         throw new IllegalArgumentException("Null address");
+      }
+      this.address = address;
+      this.port = port;
+   }
+   
    public void setTestServices(JBossTestServices services)
    {
       // no-op      
@@ -88,7 +110,7 @@
    public void tearDown() throws Exception
    {
       Class.forName("org.hsqldb.jdbcDriver");
-      String dbURL = "jdbc:hsqldb:hsql://localhost:1701";
+      String dbURL = "jdbc:hsqldb:hsql://" + address + ":" + port;
       Connection conn = DriverManager.getConnection(dbURL, "sa", "");
       Statement statement = conn.createStatement();      
       statement.executeQuery("SHUTDOWN COMPACT");      
@@ -121,7 +143,9 @@
                   "-database",
                   dbPath.toString(),
                   "-port",
-                  String.valueOf(1701),
+                  String.valueOf(DBSetupDelegate.this.port),
+                  "-address",
+                  DBSetupDelegate.this.address,
                   "-silent",
                   "true",
                   "-trace",

Modified: branches/JBPAPP_5_0/testsuite/src/main/org/jboss/test/cluster/testutil/DelegatingClusteredTestCase.java
===================================================================
--- branches/JBPAPP_5_0/testsuite/src/main/org/jboss/test/cluster/testutil/DelegatingClusteredTestCase.java	2009-07-16 19:46:40 UTC (rev 91353)
+++ branches/JBPAPP_5_0/testsuite/src/main/org/jboss/test/cluster/testutil/DelegatingClusteredTestCase.java	2009-07-16 20:07:09 UTC (rev 91354)
@@ -173,13 +173,30 @@
          String[] depoyments = new String[st.countTokens()];
          for (int i = depoyments.length - 1; i >= 0; i--)
             depoyments[i] = st.nextToken();
+         Exception failure = null;
          for (int i = 0; i < depoyments.length; i++)
          {
             String jarName = depoyments[i];
             this.getLog().debug("Attempt undeploy of " + jarName);
-            this.undeploy(jarName);
-            this.getLog().debug("undeployed package: " + jarName);
+            try
+            {
+               this.undeploy(jarName);
+               this.getLog().debug("undeployed package: " + jarName);
+            }
+            catch (Exception e)
+            {
+               log.error("Failure undeploying " + jarName, e);
+               if (failure == null)
+               {
+                  failure = e;
+               }
+            }
          }   
+         
+         if (failure != null)
+         {
+            throw failure;
+         }
       }
 
    }

Modified: branches/JBPAPP_5_0/testsuite/src/main/org/jboss/test/cluster/web/persistent/PersistentSessionTestUtil.java
===================================================================
--- branches/JBPAPP_5_0/testsuite/src/main/org/jboss/test/cluster/web/persistent/PersistentSessionTestUtil.java	2009-07-16 19:46:40 UTC (rev 91353)
+++ branches/JBPAPP_5_0/testsuite/src/main/org/jboss/test/cluster/web/persistent/PersistentSessionTestUtil.java	2009-07-16 20:07:09 UTC (rev 91354)
@@ -34,6 +34,7 @@
 import org.jboss.metadata.web.jboss.ReplicationGranularity;
 import org.jboss.metadata.web.jboss.ReplicationTrigger;
 import org.jboss.metadata.web.jboss.SnapshotMode;
+import org.jboss.test.cluster.testutil.DBSetupDelegate;
 import org.jboss.test.cluster.web.mocks.MockEngine;
 import org.jboss.test.cluster.web.mocks.MockHost;
 import org.jboss.web.tomcat.service.session.persistent.AbstractPersistentManager;
@@ -58,8 +59,8 @@
          try
          {
             Driver driver = org.hsqldb.jdbcDriver.class.newInstance();
-            String host = System.getProperty("node0.bind.address", "localhost");
-            String jdbcURL = "jdbc:hsqldb:hsql://" + host + ":1701";
+            String host = System.getProperty(DBSetupDelegate.DBADDRESS_PROPERTY, DBSetupDelegate.DEFAULT_ADDRESS);
+            String jdbcURL = "jdbc:hsqldb:hsql://" + host + ":" + DBSetupDelegate.DEFAULT_PORT;
             datasource = new MockDataSource(driver, jdbcURL, "sa", null);
          }
          catch (InstantiationException e)

Modified: branches/JBPAPP_5_0/testsuite/src/main/org/jboss/test/cluster/web/persistent/PersistentStoreSetupDelegate.java
===================================================================
--- branches/JBPAPP_5_0/testsuite/src/main/org/jboss/test/cluster/web/persistent/PersistentStoreSetupDelegate.java	2009-07-16 19:46:40 UTC (rev 91353)
+++ branches/JBPAPP_5_0/testsuite/src/main/org/jboss/test/cluster/web/persistent/PersistentStoreSetupDelegate.java	2009-07-16 20:07:09 UTC (rev 91354)
@@ -18,6 +18,24 @@
  */
 public class PersistentStoreSetupDelegate implements TestSetupDelegate
 {
+   
+   private final String address;
+   private final int port;
+   
+   public PersistentStoreSetupDelegate()
+   {
+      this(DBSetupDelegate.DEFAULT_ADDRESS, DBSetupDelegate.DEFAULT_PORT);
+   }
+   
+   public PersistentStoreSetupDelegate(String address, int port)
+   {
+      if (address == null)
+      {
+         throw new IllegalArgumentException("Null address");
+      }
+      this.address = address;
+      this.port = port;
+   }
 
    public void setTestServices(JBossTestServices services)
    {
@@ -28,8 +46,7 @@
    {
       
       PersistentStoreTableSetup tableSetup = new PersistentStoreTableSetup();
-      String host = System.getProperty("node0.bind.address", "localhost");
-      tableSetup.setJdbcURL("jdbc:hsqldb:hsql://" + host + ":1701");
+      tableSetup.setJdbcURL("jdbc:hsqldb:hsql://" + address + ":" + port);
       tableSetup.start();
    }
 

Modified: branches/JBPAPP_5_0/testsuite/src/main/org/jboss/test/cluster/web/persistent/SimplePersistentStoreTestSetup.java
===================================================================
--- branches/JBPAPP_5_0/testsuite/src/main/org/jboss/test/cluster/web/persistent/SimplePersistentStoreTestSetup.java	2009-07-16 19:46:40 UTC (rev 91353)
+++ branches/JBPAPP_5_0/testsuite/src/main/org/jboss/test/cluster/web/persistent/SimplePersistentStoreTestSetup.java	2009-07-16 20:07:09 UTC (rev 91354)
@@ -36,6 +36,18 @@
       this.tableDelegate = new PersistentStoreSetupDelegate();
    }
 
+   /**
+    * @param test
+    * @param jarNames
+    * @throws Exception
+    */
+   public SimplePersistentStoreTestSetup(Test test, String dbAddress, int port) throws Exception
+   {
+      super(test);
+      this.dbDelegate = new DBSetupDelegate(dbAddress, port);
+      this.tableDelegate = new PersistentStoreSetupDelegate(dbAddress, port);
+   }
+
    public static Test getDeploySetup(final Test test)
       throws Exception
    {
@@ -50,6 +62,20 @@
       return getDeploySetup(suite);
    }
 
+   public static Test getDeploySetup(final Test test, String dbAddress, int port)
+      throws Exception
+   {
+      return new SimplePersistentStoreTestSetup(test, dbAddress, port);
+   }
+
+   public static Test getDeploySetup(final Class<?> clazz, String dbAddress, int port)
+      throws Exception
+   {
+      TestSuite suite = new TestSuite();
+      suite.addTest(new TestSuite(clazz));
+      return getDeploySetup(suite, dbAddress, port);
+   }
+
    protected void setUp() throws Exception
    {
       dbDelegate.setUp();

Modified: branches/JBPAPP_5_0/testsuite/src/resources/cluster/persistent/httpsession-ds.xml
===================================================================
--- branches/JBPAPP_5_0/testsuite/src/resources/cluster/persistent/httpsession-ds.xml	2009-07-16 19:46:40 UTC (rev 91353)
+++ branches/JBPAPP_5_0/testsuite/src/resources/cluster/persistent/httpsession-ds.xml	2009-07-16 20:07:09 UTC (rev 91354)
@@ -85,32 +85,7 @@
       <metadata>
          <type-mapping>Hypersonic SQL</type-mapping>
       </metadata>
-
-      <!-- When using in-process (standalone) mode
-      <depends>jboss:service=Hypersonic,database=localDB</depends>
- -->
-      <!-- Uncomment when using hsqldb in server mode-->
-      <depends>jboss:service=Hypersonic</depends>
       
    </local-tx-datasource>
-
-   <!-- Uncomment if you want hsqldb accessed over tcp (server mode)-->
-   <mbean code="org.jboss.jdbc.HypersonicDatabase" 
-     name="jboss:service=Hypersonic">
-     <attribute name="Port">1701</attribute>
-     <attribute name="BindAddress">${jboss.bind.address}</attribute>     
-     <attribute name="Silent">true</attribute>
-     <attribute name="Database">default</attribute>
-     <attribute name="Trace">false</attribute>
-     <attribute name="No_system_exit">true</attribute>
-   </mbean>
    
-
-   <!-- For hsqldb accessed from jboss only, in-process (standalone) mode  
-   <mbean code="org.jboss.jdbc.HypersonicDatabase" 
-     name="jboss:service=Hypersonic,database=localDB">
-     <attribute name="Database">localDB</attribute>
-     <attribute name="InProcessMode">true</attribute>
-   </mbean>
-   -->
 </datasources>




More information about the jboss-cvs-commits mailing list