[jboss-cvs] JBossAS SVN: r64699 - in trunk/testsuite: src/main/org/jboss/test/cluster/defaultcfg/ejb2/test and 2 other directories.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Sun Aug 19 10:29:08 EDT 2007
Author: bstansberry at jboss.com
Date: 2007-08-19 10:29:07 -0400 (Sun, 19 Aug 2007)
New Revision: 64699
Modified:
trunk/testsuite/imports/sections/cluster.xml
trunk/testsuite/src/main/org/jboss/test/cluster/defaultcfg/ejb2/test/RetryInterceptorUnitTestCase.java
trunk/testsuite/src/main/org/jboss/test/cluster/defaultcfg/ejb2/test/SingleRetryInterceptorUnitTestCase.java
trunk/testsuite/src/main/org/jboss/test/cluster/multicfg/ejb2/test/CacheInvalidationUnitTestCase.java
trunk/testsuite/src/main/org/jboss/test/cluster/testutil/DBSetup.java
Log:
Put in a workaround to JBAS-4548
Modified: trunk/testsuite/imports/sections/cluster.xml
===================================================================
--- trunk/testsuite/imports/sections/cluster.xml 2007-08-19 14:17:20 UTC (rev 64698)
+++ trunk/testsuite/imports/sections/cluster.xml 2007-08-19 14:29:07 UTC (rev 64699)
@@ -470,6 +470,10 @@
<!-- testbeancluster test -->
<target name="_jars-testbeancluster" depends="_jars-testbean">
<mkdir dir="${build.lib}"/>
+
+ <copy todir="${build.lib}"
+ file="${build.resources}/cluster/ejb2/basic/cif-ds.xml"
+ overwrite="true"/>
<!-- build testbeancluster.jar -->
<jar destfile="${build.lib}/testbeancluster.jar">
@@ -502,15 +506,15 @@
</jar>
<ear destfile="${build.lib}/test-cif.ear"
appxml="${build.resources}/cluster/ejb2/basic/application.xml">
- <metainf dir="${build.resources}/cluster/ejb2/basic">
+ <!--metainf dir="${build.resources}/cluster/ejb2/basic">
<include name="jboss-app.xml"/>
- </metainf>
+ </metainf-->
<fileset dir="${build.lib}">
<include name="test-cif.jar"/>
</fileset>
- <fileset dir="${build.resources}/cluster/ejb2/basic">
+ <!--fileset dir="${build.resources}/cluster/ejb2/basic">
<include name="cif-ds.xml"/>
- </fileset>
+ </fileset-->
</ear>
<jar destfile="${build.lib}/test-retry.jar">
@@ -530,15 +534,15 @@
</jar>
<ear destfile="${build.lib}/test-retry.ear"
appxml="${build.resources}/cluster/ejb2/basic/retry-application.xml">
- <metainf dir="${build.resources}/cluster/ejb2/basic">
+ <!--metainf dir="${build.resources}/cluster/ejb2/basic">
<include name="jboss-app.xml"/>
- </metainf>
+ </metainf-->
<fileset dir="${build.lib}">
<include name="test-retry.jar"/>
</fileset>
- <fileset dir="${build.resources}/cluster/ejb2/basic">
+ <!--fileset dir="${build.resources}/cluster/ejb2/basic">
<include name="cif-ds.xml"/>
- </fileset>
+ </fileset-->
</ear>
<jar destfile="${build.lib}/pooledha.jar">
Modified: trunk/testsuite/src/main/org/jboss/test/cluster/defaultcfg/ejb2/test/RetryInterceptorUnitTestCase.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/cluster/defaultcfg/ejb2/test/RetryInterceptorUnitTestCase.java 2007-08-19 14:17:20 UTC (rev 64698)
+++ trunk/testsuite/src/main/org/jboss/test/cluster/defaultcfg/ejb2/test/RetryInterceptorUnitTestCase.java 2007-08-19 14:29:07 UTC (rev 64699)
@@ -34,7 +34,6 @@
import junit.framework.AssertionFailedError;
import junit.framework.Test;
-import junit.framework.TestSuite;
import org.jboss.jmx.adaptor.rmi.RMIAdaptor;
import org.jboss.logging.Logger;
@@ -61,6 +60,8 @@
private static final String DISCOVERY_TTL = System.getProperty("jbosstest.udp.ip_ttl", "1");
private static final String DISCOVERY_GROUP = System.getProperty("jbosstest.udpGroup");
+ protected static Logger log;
+
private static File customJndiDir = null;
private static File customJndiProperties = null;
@@ -105,6 +106,7 @@
}
catch (Throwable t)
{
+ log.error(this + " caught an exception", t);
failure = t;
}
finally
@@ -267,16 +269,12 @@
public RetryInterceptorUnitTestCase(String name)
{
super(name);
+ log = Logger.getLogger(getClass());
}
public static Test suite() throws Exception
{
- TestSuite suite = new TestSuite();
- suite.addTest(new TestSuite(RetryInterceptorUnitTestCase.class));
-
- // Create an initializer for the test suite
- DBSetup wrapper = new DBSetup(suite);
- return wrapper;
+ return DBSetup.getDeploySetup(RetryInterceptorUnitTestCase.class, "cif-ds.xml");
}
/**
@@ -385,7 +383,7 @@
}
else if (caller.failure != null)
{
- fail(caller.failure.getMessage());
+ fail(caller.failure.getClass().getName() + " " + caller.failure.getMessage());
}
}
Modified: trunk/testsuite/src/main/org/jboss/test/cluster/defaultcfg/ejb2/test/SingleRetryInterceptorUnitTestCase.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/cluster/defaultcfg/ejb2/test/SingleRetryInterceptorUnitTestCase.java 2007-08-19 14:17:20 UTC (rev 64698)
+++ trunk/testsuite/src/main/org/jboss/test/cluster/defaultcfg/ejb2/test/SingleRetryInterceptorUnitTestCase.java 2007-08-19 14:29:07 UTC (rev 64699)
@@ -22,10 +22,10 @@
package org.jboss.test.cluster.defaultcfg.ejb2.test;
+import org.jboss.logging.Logger;
import org.jboss.test.cluster.testutil.DBSetup;
import junit.framework.Test;
-import junit.framework.TestSuite;
/**
* Tests the SingleRetryInterceptor.
@@ -53,12 +53,7 @@
public static Test suite() throws Exception
{
- TestSuite suite = new TestSuite();
- suite.addTest(new TestSuite(SingleRetryInterceptorUnitTestCase.class));
-
- // Create an initializer for the test suite
- DBSetup wrapper = new DBSetup(suite);
- return wrapper;
+ return DBSetup.getDeploySetup(SingleRetryInterceptorUnitTestCase.class, "cif-ds.xml");
}
Modified: trunk/testsuite/src/main/org/jboss/test/cluster/multicfg/ejb2/test/CacheInvalidationUnitTestCase.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/cluster/multicfg/ejb2/test/CacheInvalidationUnitTestCase.java 2007-08-19 14:17:20 UTC (rev 64698)
+++ trunk/testsuite/src/main/org/jboss/test/cluster/multicfg/ejb2/test/CacheInvalidationUnitTestCase.java 2007-08-19 14:29:07 UTC (rev 64699)
@@ -29,6 +29,7 @@
import junit.framework.TestSuite;
import org.jboss.test.JBossClusteredTestCase;
+import org.jboss.test.cluster.defaultcfg.ejb2.test.RetryInterceptorUnitTestCase;
import org.jboss.test.cluster.ejb2.basic.interfaces.NodeAnswer;
import org.jboss.test.cluster.ejb2.basic.interfaces.SessionToEntity;
import org.jboss.test.cluster.ejb2.basic.interfaces.SessionToEntityHome;
@@ -49,15 +50,8 @@
public static Test suite() throws Exception
{
- TestSuite suite = new TestSuite();
- Test t1 = getDeploySetup(CacheInvalidationUnitTestCase.class,
- "test-cif.ear");
-
- suite.addTest(t1);
-
- // Create an initializer for the test suite
- DBSetup wrapper = new DBSetup(suite);
- return wrapper;
+ return DBSetup.getDeploySetup(CacheInvalidationUnitTestCase.class,
+ "cif-ds.xml,test-cif.ear");
}
public void testCacheInvalidation()
Modified: trunk/testsuite/src/main/org/jboss/test/cluster/testutil/DBSetup.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/cluster/testutil/DBSetup.java 2007-08-19 14:17:20 UTC (rev 64698)
+++ trunk/testsuite/src/main/org/jboss/test/cluster/testutil/DBSetup.java 2007-08-19 14:29:07 UTC (rev 64699)
@@ -27,8 +27,11 @@
import java.io.File;
import java.io.IOException;
+import org.jboss.test.JBossTestClusteredSetup;
+
import junit.extensions.TestSetup;
import junit.framework.Test;
+import junit.framework.TestSuite;
/** A TestSetup that starts hypersonic before the testcase with a tcp
* listening port at 1701.
@@ -36,13 +39,27 @@
* @author Scott.Stark at jboss.org
* @version $Revison:$
*/
-public class DBSetup extends TestSetup
+public class DBSetup extends JBossTestClusteredSetup
{
- public DBSetup(Test test)
+ public DBSetup(Test test, String jarNames) throws Exception
{
- super(test);
+ super(test, jarNames);
}
+ public static Test getDeploySetup(final Test test, final String jarNames)
+ throws Exception
+ {
+ return new DBSetup(test, jarNames);
+ }
+
+ public static Test getDeploySetup(final Class clazz, final String jarNames)
+ throws Exception
+ {
+ TestSuite suite = new TestSuite();
+ suite.addTest(new TestSuite(clazz));
+ return getDeploySetup(suite, jarNames);
+ }
+
protected void setUp() throws Exception
{
File hypersoniDir = new File("output/hypersonic");
@@ -78,21 +95,30 @@
if (!serverThread.isStarted())
System.out.println("Hypersonic failed to start in a timely fashion");
+
+ super.setUp();
}
protected void tearDown() throws Exception
{
- Class.forName("org.hsqldb.jdbcDriver");
- String dbURL = "jdbc:hsqldb:hsql://localhost:1701";
- Connection conn = DriverManager.getConnection(dbURL, "sa", "");
- Statement statement = conn.createStatement();
- statement.executeQuery("SHUTDOWN COMPACT");
+ try
+ {
+ super.tearDown();
+ }
+ finally
+ {
+ Class.forName("org.hsqldb.jdbcDriver");
+ String dbURL = "jdbc:hsqldb:hsql://localhost:1701";
+ Connection conn = DriverManager.getConnection(dbURL, "sa", "");
+ Statement statement = conn.createStatement();
+ statement.executeQuery("SHUTDOWN COMPACT");
+ }
}
public static void main(String[] args) throws Exception
{
- DBSetup setup = new DBSetup(null);
+ DBSetup setup = new DBSetup(null, null);
setup.setUp();
Thread.sleep(120*1000);
setup.tearDown();
More information about the jboss-cvs-commits
mailing list