[jboss-cvs] JBoss Messaging SVN: r2930 - in trunk/tests: bin and 2 other directories.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Fri Jul 27 05:59:55 EDT 2007
Author: timfox
Date: 2007-07-27 05:59:55 -0400 (Fri, 27 Jul 2007)
New Revision: 2930
Removed:
trunk/tests/bin/start-rmi-server
trunk/tests/maven-tests.xml
trunk/tests/pom.xml
trunk/tests/src/org/jboss/test/messaging/jms/crash/ClientCrashLargeLeaseTest.java
trunk/tests/src/org/jboss/test/messaging/jms/crash/ClientCrashNegativeLeaseTest.java
trunk/tests/src/org/jboss/test/messaging/jms/crash/ClientCrashTwoConnectionsTest.java
trunk/tests/src/org/jboss/test/messaging/jms/crash/ClientCrashZeroLeaseTest.java
Modified:
trunk/tests/build.xml
trunk/tests/src/org/jboss/test/messaging/jms/crash/ClientCrashTest.java
trunk/tests/src/org/jboss/test/messaging/tools/ServerManagement.java
Log:
Removed maven crap + put crash tests in normal remote target + made some improvements to server spawning
Deleted: trunk/tests/bin/start-rmi-server
===================================================================
--- trunk/tests/bin/start-rmi-server 2007-07-27 08:54:24 UTC (rev 2929)
+++ trunk/tests/bin/start-rmi-server 2007-07-27 09:59:55 UTC (rev 2930)
@@ -1,94 +0,0 @@
-#!/bin/sh
-#
-# bash script to start the rmi server in background. Will exit immediately.
-# Look at tests/output/logs/messaging-tests-remote.trace.log to diagnose the start up process in
-# case something goes wrong.
-#
-
-reldir=`dirname $0`
-
-cygwin=false;
-case "`uname`" in
- CYGWIN*)
- cygwin=true
- ;;
-esac
-
-if [ $cygwin = true ]; then
- SEP=";"
-else
- SEP=":"
-fi
-
-index=0
-
-while [ "$1" != "" ]; do
- if [ "$1" = "-debug" ]; then
- debug=true
- elif [ "$1" = "-index" ]; then
- shift
- index=$1
- elif [ "$1" = "-use-existent-test-classpath-file" ]; then
- USE_EXISTENT_TEST_CLASSPATH_FILE=true;
- fi
- shift
-done
-
-echo
-echo "Starting remoting server $index ..."
-echo
-
-if [ "$debug" = true ]; then
- if [ $cygwin = false ]; then
- JAVA_OPTS="-Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=12348"
- else
- JAVA_OPTS="-Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_shmem,server=n,suspend=n,address=rmiserver_$index"
- fi
-fi
-
-mkdir -p $reldir/../output/logs
-
-JAVA_OPTS="$JAVA_OPTS -Xmx768M -Dmodule.output=$reldir/../output"
-
-if [ "$TEST_DATABASE" != "" ]; then
- JAVA_OPTS="$JAVA_OPTS -Dtest.database=$TEST_DATABASE"
-fi
-
-# We need to append the index even if non clustered since we may have many non clustered servers
-if [ "$TEST_REMOTING" != "" ]; then
- JAVA_OPTS="$JAVA_OPTS -Dtest.remoting=$TEST_REMOTING -Dtest.logfile.suffix=remote-server$index"
-fi
-
-if [ "$TEST_CLUSTERED" != "" ]; then
- # last defined system property on command line take precedence
- JAVA_OPTS="$JAVA_OPTS -Dtest.clustered=$TEST_CLUSTERED -Dtest.logfile.suffix=clustering-server$index"
-fi
-
-if [ "$index" != "" ]; then
- JAVA_OPTS="$JAVA_OPTS -Dtest.server.index=$index"
-fi
-
-if [ "$USE_EXISTENT_TEST_CLASSPATH_FILE" = "true" ]; then
- CLASSPATH_FILE="$reldir/.test.execution.classpath"
-else
- ant -Dtest.execution.classpath.file=bin/.startrmi.execution.classpath -f $reldir/../build.xml get-test-execution-classpath
- CLASSPATH_FILE="$reldir/.startrmi.execution.classpath"
-fi
-
-if [ ! -f $CLASSPATH_FILE ]; then
- echo "No such classpath file: $CLASSPATH_FILE"
- exit 1
-fi
-
-CLASSPATH=`cat $CLASSPATH_FILE`
-
-# for stress testing
-JAVA_OPTS="$JAVA_OPTS -Xmx768M"
-
-if [ $cygwin = false ]; then
- #IPV6 and Linux
- JAVA_OPTS="$JAVA_OPTS -Djava.net.preferIPv4Stack=true"
-fi
-
-"$JAVA_HOME/java" $JAVA_OPTS -cp $CLASSPATH -Dtest.bind.address=localhost \
-org.jboss.test.messaging.tools.container.RMITestServer $port &
Modified: trunk/tests/build.xml
===================================================================
--- trunk/tests/build.xml 2007-07-27 08:54:24 UTC (rev 2929)
+++ trunk/tests/build.xml 2007-07-27 09:59:55 UTC (rev 2930)
@@ -244,25 +244,6 @@
<property name="test.logs.cleared" value="true"/>
</target>
- <target name="start-rmi-server" depends="init"
- description="Starts the RMI server used by remote tests">
-
- <java classname="org.jboss.test.messaging.tools.container.RMITestServer" fork="true" spawn="true">
- <sysproperty key="module.output" value="${tests.output}"/>
- <sysproperty key="test.logfile.suffix" value="${remote.server.test.logfile.suffix}"/>
- <sysproperty key="test.bind.address" value="${test.bind.address}"/>
- <sysproperty key="jgroups.bind_addr" value="${test.bind.address}"/>
- <sysproperty key="test.database" value="${functional.tests.database}"/>
- <sysproperty key="test.remoting" value="${test.remoting}"/>
- <sysproperty key="java.net.preferIPv4Stack" value="true"/>
- <sysproperty key="objectstore.dir" value="${objectstore.dir}"/>
- <!--
- <jvmarg line="-Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_shmem,server=y,suspend=y,address=rmiserver"/>
- -->
- <classpath refid="test.execution.classpath"/>
- </java>
- </target>
-
<target name="stop-rmi-server" depends="init"
description="Stops the RMI server used by remote tests">
<java classname="org.jboss.test.messaging.tools.container.StopRMIServer"
@@ -485,6 +466,7 @@
<include name="**/jms/${test-mask}.class"/>
<include name="**/jms/message/**/*Test.class"/>
<include name="**/jms/selector/*Test.class"/>
+ <include name="**/jms/crash/*Test.class"/>
<exclude name="**/jms/WireFormatTest.class"/>
<exclude name="**/jms/ReferencingTest.class"/>
@@ -907,197 +889,14 @@
</fileset>
</batchtest>
</junit>
-
</target>
-
- <target name="crash-tests" depends="tests-jar, prepare-testdirs, clear-test-logs"
- description="Runs crash tests">
-
- <antcall target="stop-rmi-server"/>
-
- <!--
- ClientCrashTest over "bisocket"
- -->
-
- <antcall target="start-rmi-server">
- <param name="remote.server.test.logfile.suffix" value="remote-crash"/>
- </antcall>
-
- <antcall target="crash-test">
- <param name="crash.test.name" value="org.jboss.test.messaging.jms.crash.ClientCrashTest"/>
- </antcall>
-
- <!--
- ClientCrashTest over "http"
- -->
-
- <antcall target="start-rmi-server">
- <param name="test.remoting" value="http"/>
- <param name="remote.server.test.logfile.suffix" value="remote-crash"/>
- </antcall>
-
- <antcall target="crash-test">
- <param name="crash.test.name" value="org.jboss.test.messaging.jms.crash.ClientCrashTest"/>
- <param name="test.remoting" value="http"/>
- </antcall>
-
- <!--
- ClientCrashTwoConnectionsTest over "bisocket"
- -->
-
- <antcall target="start-rmi-server">
- <param name="remote.server.test.logfile.suffix" value="remote-crash"/>
- </antcall>
-
-
- <antcall target="crash-test">
- <param name="crash.test.name" value="org.jboss.test.messaging.jms.crash.ClientCrashTwoConnectionsTest"/>
- </antcall>
-
- <!--
- ClientCrashTwoConnectionsTest over "http"
- -->
- <antcall target="start-rmi-server">
- <param name="test.remoting" value="http"/>
- <param name="remote.server.test.logfile.suffix" value="remote-crash"/>
- </antcall>
-
- <antcall target="crash-test">
- <param name="crash.test.name" value="org.jboss.test.messaging.jms.crash.ClientCrashTwoConnectionsTest"/>
- <param name="test.remoting" value="http"/>
- </antcall>
-
- <!--
- ClientCrashNegativeLeaseTest over "bisocket"
- -->
-
- <antcall target="start-rmi-server">
- <param name="remote.server.test.logfile.suffix" value="remote-crash"/>
- </antcall>
-
-
- <antcall target="crash-test">
- <param name="crash.test.name" value="org.jboss.test.messaging.jms.crash.ClientCrashNegativeLeaseTest"/>
- </antcall>
-
- <!--
- ClientCrashNegativeLeaseTest over "http"
- -->
-
- <antcall target="start-rmi-server">
- <param name="test.remoting" value="http"/>
- <param name="remote.server.test.logfile.suffix" value="remote-crash"/>
- </antcall>
-
- <antcall target="crash-test">
- <param name="crash.test.name" value="org.jboss.test.messaging.jms.crash.ClientCrashNegativeLeaseTest"/>
- <param name="test.remoting" value="http"/>
- </antcall>
-
- <!--
- ClientCrashZeroLeaseTest over "bisocket"
- -->
-
- <antcall target="start-rmi-server">
- <param name="remote.server.test.logfile.suffix" value="remote-crash"/>
- </antcall>
-
-
- <antcall target="crash-test">
- <param name="crash.test.name" value="org.jboss.test.messaging.jms.crash.ClientCrashZeroLeaseTest"/>
- </antcall>
-
- <!--
- ClientCrashZeroLeaseTest over "http"
- -->
-
- <antcall target="start-rmi-server">
- <param name="test.remoting" value="http"/>
- <param name="remote.server.test.logfile.suffix" value="remote-crash"/>
- </antcall>
-
- <antcall target="crash-test">
- <param name="crash.test.name" value="org.jboss.test.messaging.jms.crash.ClientCrashZeroLeaseTest"/>
- <param name="test.remoting" value="http"/>
- </antcall>
-
- <!--
- ClientCrashLargeLeaseTest over "bisocket"
- -->
-
- <antcall target="start-rmi-server">
- <param name="remote.server.test.logfile.suffix" value="remote-crash"/>
- </antcall>
-
-
- <antcall target="crash-test">
- <param name="crash.test.name" value="org.jboss.test.messaging.jms.crash.ClientCrashLargeLeaseTest"/>
- </antcall>
-
- <!--
- ClientCrashLargeLeaseTest over "http"
- -->
-
- <antcall target="start-rmi-server">
- <param name="test.remoting" value="http"/>
- <param name="remote.server.test.logfile.suffix" value="remote-crash"/>
- </antcall>
-
- <antcall target="crash-test">
- <param name="crash.test.name" value="org.jboss.test.messaging.jms.crash.ClientCrashLargeLeaseTest"/>
- <param name="test.remoting" value="http"/>
- </antcall>
-
- </target>
-
- <target name="crash-test" depends="init" description="Runs crash test">
-
- <junit printsummary="${junit.printsummary}"
- fork="${junit.fork}"
- includeantruntime="yes"
- haltonerror="${junit.haltonerror}"
- haltonfailure="${junit.haltonfailure}"
- showoutput="${junit.showoutput}"
- timeout="${junit.timeout}">
-
- <sysproperty key="remote" value="true"/>
- <sysproperty key="module.output" value="${tests.output}"/>
- <sysproperty key="test.bind.address" value="${test.bind.address}"/>
- <sysproperty key="jgroups.bind_addr" value="${test.bind.address}"/>
- <sysproperty key="test.database" value="${functional.tests.database}"/>
- <sysproperty key="test.remoting" value="${test.remoting}"/>
- <sysproperty key="test.logfile.suffix" value="crash"/>
- <jvmarg value="-Xmx512M"/>
- <!--
- <jvmarg line="-Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_shmem,server=y,suspend=y,address=antjunit"/>
- -->
- <classpath>
- <path refid="test.execution.classpath"/>
- </classpath>
-
- <sysproperty key="jboss-junit-configuration" value="Crash-${test.remoting}"/>
- <formatter classname="org.jboss.ant.taskdefs.XMLJUnitMultipleResultFormatter"
- usefile="${junit.formatter.usefile}" extension="-Crash-${test.remoting}.xml"/>
-
- <test name="${crash.test.name}"
- fork="true"
- todir="${junit.batchtest.todir}"
- haltonfailure="${junit.test.haltonfailure}"
- haltonerror="${junit.test.haltonerror}">
- </test>
-
- </junit>
-
- </target>
-
<target name="test" depends="tests-jar, prepare-testdirs, clear-test-logs"
description="Runs a single test, specified by its FQ class name via 'test.classname'">
<fail unless="test.classname"
message="To run a single test, use: ./build.sh test -Dtest.classname=org.package.MyTest"/>
<echo>Module root is:${module.root}</echo>
- <antcall target="start-rmi-server"/>
<property name="test.classname" value="dummy"/>
<junit printsummary="${junit.printsummary}"
Deleted: trunk/tests/maven-tests.xml
===================================================================
--- trunk/tests/maven-tests.xml 2007-07-27 08:54:24 UTC (rev 2929)
+++ trunk/tests/maven-tests.xml 2007-07-27 09:59:55 UTC (rev 2930)
@@ -1,896 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<!-- =========================================================================================== -->
-<!-- -->
-<!-- JBoss, Home of Professional Open Source -->
-<!-- Copyright 2005, JBoss Inc., 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. -->
-<!-- -->
-<!-- =========================================================================================== -->
-
-
-<!-- =========================================================================================== -->
-<!-- -->
-<!-- $Id: build.xml 1204 2006-08-06 18:21:41Z ovidiu.feodorov at jboss.com $ -->
-<!-- -->
-<!-- =========================================================================================== -->
-
-<project default="tests" name="JBoss Messaging Tests">
-
- <!--
- 'tests' is Messaging's subproject, we're relying on the main project thirdparty and lib
- directories.
- -->
- <property name="project.root" value="${basedir}/.."/>
-
- <!--
- Import Messaging's properties, paths and everything else.
- -->
-
-
- <!-- ======================================================================================== -->
- <!-- Configuration -->
- <!-- ======================================================================================== -->
-
- <property file="build.properties"/>
-
- <property name="build.tests.remote" value="false"/>
- <property name="test.bind.address" value="localhost"/>
-
- <!--
- Functional tests.
- -->
-
- <property name="functional.tests.database" value="hsqldb"/>
- <property name="functional.tests.serialization" value="jboss"/>
-
- <!--
- Stress tests.
- -->
-
- <property name="stress.tests.database" value="mysql"/>
- <property name="stress.tests.serialization" value="jboss"/>
-
- <!--
- Project paths.
- -->
-
- <property name="tests.root" value="${basedir}"/>
- <property name="source.tests.java" value="${tests.root}/src"/>
- <property name="source.tests.stylesheets" value="${source.tests.java}/stylesheets"/>
- <property name="tests.output" value="${tests.root}/output"/>
- <property name="build.tests.classes" value="${basedir}/target/classes"/>
- <property name="build.tests.lib" value="${tests.output}/lib"/>
- <property name="build.tests.reports" value="${tests.output}/reports"/>
- <property name="build.tests.stylesheets" value="${tests.output}/stylesheets"/>
- <property name="build.tests.archive" value="jboss-messaging-tests.jar"/>
- <property name="build.tests.ejbarchive" value="jboss-messaging-tests-ejb.jar"/>
-
- <!--
- JUnit configuration (values specified in ./build.properties have priority)
- -->
-
- <property name="junit.printsummary" value="true"/>
- <property name="junit.haltonerror" value="false"/>
- <property name="junit.haltonfailure" value="false"/>
- <property name="junit.fork" value="true"/>
- <property name="junit.includeantruntime" value="true"/>
- <property name="junit.timeout" value="300000"/>
- <property name="stress.timeout" value="4800000"/>
-
- <property name="junit.showoutput" value="true"/>
- <property name="junit.jvm" value=""/>
- <property name="junit.jvm.options" value=""/>
- <property name="junit.formatter.usefile" value="true"/>
- <property name="junit.batchtest.todir" value="${build.tests.reports}"/>
- <property name="junit.batchtest.haltonerror" value="false"/>
- <property name="junit.batchtest.haltonfailure" value="false"/>
- <property name="junit.batchtest.fork" value="true"/>
- <property name="junit.test.haltonfailure" value="false"/>
- <property name="junit.test.haltonerror" value="false"/>
-
- <!--
- Locally maintained dependencies.
- -->
-
-
- <!--
- JDBC Drivers.
- -->
-
- <path id="mysql.jdbc.driver.classpath">
- <pathelement path="${tests.root}/lib/mysql-connector-java-3.1.13-bin.jar"/>
- </path>
-
- <path id="oracle.jdbc.driver.classpath">
- <pathelement path="${tests.root}/lib/ojdbc14.jar"/>
- </path>
-
- <path id="postgres.jdbc.driver.classpath">
- <pathelement path="${tests.root}/postgresql-8.1-405.jdbc3.jar"/>
- </path>
-
- <!--
- The compilation classpath.
- -->
-
-
- <echo message="${cp2}"/>
-
- <path id="test.compilation.classpath">
- <pathelement location="${cp2}"/>
- </path>
-
- <!--
- The execution classpath.
- -->
-
- <path id="test.execution.classpath">
- <pathelement location="${cp2}"/>
- <pathelement location="${tests.root}/etc"/>
- <pathelement location="${build.tests.classes}"/>
- <pathelement location="${project.root}/src/etc"/> <!-- server's configuration files -->
- <pathelement location="${basedir}/target/classes"/>
- <pathelement location="${basedir}/lib/jboss-mbeans.jar"/>
- <path refid="mysql.jdbc.driver.classpath"/>
- <path refid="oracle.jdbc.driver.classpath"/>
- <path refid="postgres.jdbc.driver.classpath"/>
-
- </path>
-
- <path id="stress.test.execution.classpath">
- <path refid="test.execution.classpath"/>
- <pathelement path="${tests.root}/etc/stress"/>
-
- </path>
-
- <!-- ======================================================================================== -->
- <!-- Compilation Tasks -->
- <!-- ======================================================================================== -->
-
- <target name="init" />
-
-
-
-
- <!-- ======================================================================================== -->
- <!-- Archival Tasks -->
- <!-- ======================================================================================== -->
-
- <target name="tests-jar" >
-
- <mkdir dir="${build.tests.lib}"/>
- <jar jarfile="${build.tests.lib}/${build.tests.archive}">
- <fileset dir="${build.tests.classes}">
- <include name="org/jboss/test/messaging/**"/>
- </fileset>
- </jar>
- </target>
-
- <!-- ======================================================================================== -->
- <!-- Execution Helper Tasks -->
- <!-- ======================================================================================== -->
-
- <target name="prepare-testdirs">
- <mkdir dir="${build.tests.reports}"/>
- <mkdir dir="${tests.output}/logs"/>
- </target>
-
- <target name="clear-test-logs" unless="test.logs.cleared">
-
- <!-- At the beginning of a test run, clean up the logs, since log4j runs in "append" mode -->
- <echo message="Cleaning test logs ${tests.output}/logs/*.log"/>
- <delete quiet="true">
- <fileset dir="${tests.output}/logs" includes="*.log"/>
- </delete>
- <property name="test.logs.cleared" value="true"/>
- </target>
-
- <target name="start-rmi-server" depends="init"
- description="Starts the RMI server used by remote tests">
-
-
- <property name="myclasspath" refid="test.execution.classpath"/>
- <echo message="classpath= ${myclasspath}"/>
-
-
-
- <java classname="org.jboss.test.messaging.tools.jmx.rmi.RMITestServer" fork="true" spawn="true">
- <sysproperty key="module.output" value="${basedir}/target"/>
- <sysproperty key="test.logfile.suffix" value="-remote-maven"/>
- <sysproperty key="test.bind.address" value="${test.bind.address}"/>
- <sysproperty key="test.database" value="${functional.tests.database}"/>
- <sysproperty key="test.serialization" value="${functional.tests.serialization}"/>
- <!--
- <jvmarg line="-Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_shmem,server=y,suspend=y,address=rmiserver"/>
- -->
- <classpath>
- <pathelement path="${cp2}"/>
- <path refid="test.execution.classpath"/>
- </classpath>
-
-
-
- </java>
-
- <echo message="is it started"/>
- </target>
-
- <target name="start-rmi-server-stress" depends="init"
- description="Starts the RMI server used by remote stress tests">
-
- <java classname="org.jboss.test.messaging.tools.jmx.rmi.RMITestServer" fork="true" spawn="true">
- <jvmarg value="-Xmx768M"/>
- <sysproperty key="module.output" value="${tests.output}"/>
- <sysproperty key="test.logfile.suffix" value="-remote-maven"/>
- <sysproperty key="test.bind.address" value="${test.bind.address}"/>
- <sysproperty key="test.database" value="${stress.tests.database}"/>
- <sysproperty key="test.serialization" value="${stress.tests.serialization}"/>
- <!-- <jvmarg line="-Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_shmem,server=y,suspend=y,address=rmiserver"/> -->
- <classpath refid="stress.test.execution.classpath"/>
- </java>
- </target>
-
- <target name="stop-rmi-server" depends="init"
- description="Stops the RMI server used by remote tests">
- <java classname="org.jboss.test.messaging.tools.jmx.rmi.StopRMIServer"
- classpathref="test.execution.classpath"/>
- </target>
-
- <!-- ======================================================================================== -->
- <!-- Test Execution Tasks -->
- <!-- ======================================================================================== -->
-
- <target name="tests" depends="tests-jar, prepare-testdirs, clear-test-logs">
- <antcall target="crash-tests"/>
- <antcall target="invm-tests"/>
- <antcall target="remote-tests"/>
- </target>
-
- <target name="stress-tests" depends="tests-jar, prepare-testdirs, clear-test-logs">
- <antcall target="invm-stress-tests"/>
- <antcall target="remote-stress-tests"/>
- </target>
-
- <target name="invm-tests" depends="tests-jar, prepare-testdirs, clear-test-logs"
- description="Runs all available tests an in-VM configuration">
-
- <echo message=""/>
- <echo message="Running invm tests, fork=${junit.fork}, junit.batchtest.fork=${junit.batchtest.fork}"/>
- <echo message=""/>
-
- <junit printsummary="${junit.printsummary}"
- fork="${junit.fork}"
- includeantruntime="${junit.includeantruntime}"
- haltonerror="${junit.haltonerror}"
- haltonfailure="${junit.haltonfailure}"
- showoutput="${junit.showoutput}"
- timeout="${junit.timeout}">
-
- <sysproperty key="remote" value="false"/>
- <sysproperty key="module.output" value="${tests.output}"/>
- <sysproperty key="test.bind.address" value="${test.bind.address}"/>
- <sysproperty key="test.database" value="${functional.tests.database}"/>
- <sysproperty key="test.serialization" value="${functional.tests.serialization}"/>
- <sysproperty key="build.lib" value="${build.lib}"/>
- <jvmarg value="-Xmx512M"/>
- <!--
- <jvmarg line="-Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_shmem,server=y,suspend=y,address=antjunit"/>
- -->
- <classpath>
- <pathelement path="${cp2}"/>
- <path refid="test.execution.classpath"/>
- <path refid="test.compilation.classpath"/>
- </classpath>
- <formatter type="xml" usefile="${junit.formatter.usefile}"/>
- <batchtest fork="${junit.batchtest.fork}"
- todir="${junit.batchtest.todir}"
- haltonfailure="${junit.batchtest.haltonfailure}"
- haltonerror="${junit.batchtest.haltonerror}">
- <formatter type="plain" usefile="${junit.formatter.usefile}"/>
- <fileset dir="${build.tests.classes}">
- <!--
- <include name="org/jboss/test/messaging/jms/JMSTest.class"/>
- -->
- <include name="**/messaging/core/**/*Test.class"/>
- <include name="**/messaging/jms/**/*Test.class"/>
- <exclude name="**/jms/stress/**"/>
- <exclude name="**/jms/crash/*Test.class"/>
- <exclude name="**/jms/MemLeakTest.class"/>
- <!-- TODO Exclude all distributed tests until after 1.0 release -->
- <exclude name="**/messaging/core/distributed/**/*Test.class"/>
- </fileset>
- </batchtest>
- </junit>
- </target>
-
- <target name="memory-leak-tests" depends="tests-jar, prepare-testdirs, clear-test-logs"
- description="Runs memory-leak tests using JBossProfiler in-VM configuration">
-
- <property name="ostarget" value="windows"/>
-
- <junit printsummary="${junit.printsummary}"
- fork="${junit.fork}"
- includeantruntime="${junit.includeantruntime}"
- haltonerror="${junit.haltonerror}"
- haltonfailure="${junit.haltonfailure}"
- showoutput="${junit.showoutput}"
- timeout="${junit.timeout}">
-
- <sysproperty key="remote" value="false"/>
- <sysproperty key="module.output" value="${tests.output}"/>
- <sysproperty key="test.bind.address" value="${test.bind.address}"/>
- <sysproperty key="test.database" value="${functional.tests.database}"/>
- <sysproperty key="test.serialization" value="${functional.tests.serialization}"/>
- <sysproperty key="build.lib" value="${build.lib}"/>
- <jvmarg value="-Xmx512M"/>
- <jvmarg value="-agentpath:${jboss.profiler.jvmti.lib}/bin/windows/jbossAgent.dll"/>
- <!--
- <jvmarg line="-Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_shmem,server=y,suspend=y,address=antjunit"/>
- -->
- <classpath refid="test.execution.classpath"/>
- <formatter type="xml" usefile="${junit.formatter.usefile}"/>
- <batchtest fork="${junit.batchtest.fork}"
- todir="${junit.batchtest.todir}"
- haltonfailure="${junit.batchtest.haltonfailure}"
- haltonerror="${junit.batchtest.haltonerror}">
- <formatter type="plain" usefile="${junit.formatter.usefile}"/>
- <fileset dir="${build.tests.classes}">
- <!-- <include name="org/jboss/test/messaging/jms/JMSTest.class"/> -->
- <include name="**/jms/MemLeakTest.class"/>
- <!-- TODO Exclude all distributed tests until after 1.0 release -->
- <exclude name="**/messaging/core/distributed/**/*Test.class"/>
- </fileset>
- </batchtest>
- </junit>
- </target>
-
- <target name="ref-test" depends="tests-jar, prepare-testdirs, clear-test-logs"
- description="Runs all available tests an in-VM configuration">
-
- <junit printsummary="${junit.printsummary}"
- fork="${junit.fork}"
- includeantruntime="${junit.includeantruntime}"
- haltonerror="${junit.haltonerror}"
- haltonfailure="${junit.haltonfailure}"
- showoutput="${junit.showoutput}"
- timeout="${junit.timeout}">
-
- <sysproperty key="remote" value="false"/>
- <sysproperty key="module.output" value="${tests.output}"/>
- <sysproperty key="test.bind.address" value="${test.bind.address}"/>
- <sysproperty key="test.database" value="${functional.tests.database}"/>
- <sysproperty key="test.serialization" value="${functional.tests.serialization}"/>
- <sysproperty key="build.lib" value="${build.lib}"/>
- <jvmarg value="-Xmx512M"/>
- <!--
- <jvmarg line="-Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_shmem,server=y,suspend=y,address=antjunit"/>
- -->
- <classpath>
- <pathelement path="${cp2}"/>
- <path refid="test.execution.classpath"/>
- <path refid="test.compilation.classpath"/>
- </classpath>
- <formatter type="xml" usefile="${junit.formatter.usefile}"/>
- <batchtest fork="${junit.batchtest.fork}"
- todir="${junit.batchtest.todir}"
- haltonfailure="${junit.batchtest.haltonfailure}"
- haltonerror="${junit.batchtest.haltonerror}">
- <formatter type="plain" usefile="${junit.formatter.usefile}"/>
- <fileset dir="${build.tests.classes}">
- <!-- <include name="org/jboss/test/messaging/jms/JMSTest.class"/> -->
- <include name="**/messaging/jms/ReferenceableTest.class"/>
- <exclude name="**/jms/stress/**"/>
- <exclude name="**/jms/crash/*Test.class"/>
- <exclude name="**/jms/MemLeakTest.class"/>
- <!-- TODO Exclude all distributed tests until after 1.0 release -->
- <exclude name="**/messaging/core/distributed/**/*Test.class"/>
- </fileset>
- </batchtest>
- </junit>
- </target>
-
- <target name="invm-stress-tests" depends="tests-jar, prepare-testdirs, clear-test-logs"
- description="Runs all stress tests in an in-VM configuration">
-
- <junit printsummary="${junit.printsummary}"
- fork="${junit.fork}"
- includeantruntime="${junit.includeantruntime}"
- haltonerror="${junit.haltonerror}"
- haltonfailure="${junit.haltonfailure}"
- showoutput="${junit.showoutput}"
- timeout="${stress.timeout}">
-
- <sysproperty key="remote" value="false"/>
- <sysproperty key="module.output" value="${tests.output}"/>
- <sysproperty key="test.bind.address" value="${test.bind.address}"/>
- <sysproperty key="test.database" value="${stress.tests.database}"/>
- <sysproperty key="test.serialization" value="${stress.tests.serialization}"/>
- <jvmarg value="-Xmx512M"/>
- <!--
- <jvmarg line="-Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_shmem,server=y,suspend=y,address=antjunit"/>
- -->
- <classpath refid="stress.test.execution.classpath"/>
- <sysproperty key="messaging-test-configuration" value="StressInVM"/>
- <formatter classname="org.jboss.test.messaging.tools.ant.XMLJUnitMultipleResultFormatter"
- usefile="${junit.formatter.usefile}" extension="-StressInVM.xml"/>
- <batchtest fork="${junit.batchtest.fork}"
- todir="${junit.batchtest.todir}"
- haltonfailure="${junit.batchtest.haltonfailure}"
- haltonerror="${junit.batchtest.haltonerror}">
- <formatter type="plain" usefile="${junit.formatter.usefile}"/>
- <fileset dir="${build.tests.classes}">
- <include name="**/jms/stress/**/*Test.class"/>
- </fileset>
- </batchtest>
- </junit>
- </target>
-
- <target name="remote-tests" depends="tests-jar, prepare-testdirs, clear-test-logs"
- description="Runs remotely all tests for which it makes sense to run remotely">
-
- <antcall target="stop-rmi-server"/>
- <antcall target="start-rmi-server"/>
-
- <mkdir dir="${build.tests.reports}"/>
-
- <echo message=""/>
- <echo message="Running remote tests, fork=${junit.fork}, junit.batchtest.fork=${junit.batchtest.fork}"/>
- <echo message=""/>
-
- <junit printsummary="${junit.printsummary}"
- fork="${junit.fork}"
- includeantruntime="yes"
- haltonerror="${junit.haltonerror}"
- haltonfailure="${junit.haltonfailure}"
- showoutput="${junit.showoutput}"
- timeout="${junit.timeout}">
-
- <sysproperty key="remote" value="true"/>
- <sysproperty key="module.output" value="${tests.output}"/>
- <sysproperty key="test.bind.address" value="${test.bind.address}"/>
- <sysproperty key="test.database" value="${functional.tests.database}"/>
- <sysproperty key="test.serialization" value="${functional.tests.serialization}"/>
- <jvmarg value="-Xmx512M"/>
- <!--
- <jvmarg line="-Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_shmem,server=y,suspend=y,address=antjunit"/>
- -->
- <classpath>
- <pathelement path="${cp2}"/>
- <path refid="test.execution.classpath"/>
- <path refid="test.compilation.classpath"/>
- </classpath>
-
- <!-- Use this when http://jira.jboss.org/jira/browse/JBAS-2554 is done -->
- <!--
- <sysproperty key="jboss-junit-configuration" value="Remote"/>
- <formatter classname="org.jboss.ant.taskdefs.XMLJUnitMultipleResultFormatter"
- usefile="${junit.formatter.usefile}" extension="-Remote.xml"/>
- -->
-
- <sysproperty key="messaging-test-configuration" value="Remote"/>
- <formatter classname="org.jboss.test.messaging.tools.ant.XMLJUnitMultipleResultFormatter"
- usefile="${junit.formatter.usefile}" extension="-Remote.xml"/>
-
- <batchtest fork="${junit.batchtest.fork}"
- todir="${junit.batchtest.todir}"
- haltonfailure="${junit.batchtest.haltonfailure}"
- haltonerror="${junit.batchtest.haltonerror}">
- <formatter type="plain" usefile="${junit.formatter.usefile}"/>
- <fileset dir="${build.tests.classes}">
- <!--
- <include name="org/jboss/test/messaging/jms/JMSTest.class"/>
- -->
- <include name="org/jboss/test/messaging/jms/**/*Test.class"/>
- <exclude name="org/jboss/test/messaging/jms/stress/**"/>
- <exclude name="org/jboss/test/messaging/jms/server/**"/>
- <exclude name="org/jboss/test/messaging/jms/persistence/**"/>
- <exclude name="org/jboss/test/messaging/jms/ReferencingTest.class"/>
- <exclude name="org/jboss/test/messaging/jms/PersistenceTest.class"/>
- <exclude name="org/jboss/test/messaging/jms/crash/*Test.class"/>
- <exclude name="org/jboss/test/messaging/jms/ManualCrashTest.class"/>
- <exclude name="org/jboss/test/messaging/jms/MemLeakTest.class"/>
- <exclude name="org/jboss/test/messaging/jms/ManifestTest.class"/>
- <exclude name="org/jboss/test/messaging/jms/XATransactionTest.class"/>
- </fileset>
- </batchtest>
- </junit>
-
- <antcall target="stop-rmi-server"/>
-
- </target>
-
- <target name="remote-stress-tests" depends="tests-jar, prepare-testdirs, clear-test-logs"
- description="Runs remotely all stress tests for which it makes sense to run remotely">
-
- <antcall target="stop-rmi-server"/>
- <antcall target="start-rmi-server-stress"/>
- <mkdir dir="${build.tests.reports}"/>
-
- <junit printsummary="${junit.printsummary}"
- fork="${junit.fork}"
- includeantruntime="yes"
- haltonerror="${junit.haltonerror}"
- haltonfailure="${junit.haltonfailure}"
- showoutput="${junit.showoutput}"
- timeout="${stress.timeout}">
-
- <sysproperty key="remote" value="true"/>
- <sysproperty key="module.output" value="${tests.output}"/>
- <sysproperty key="test.bind.address" value="${test.bind.address}"/>
- <sysproperty key="test.database" value="${stress.tests.database}"/>
- <sysproperty key="test.serialization" value="${stress.tests.serialization}"/>
- <jvmarg value="-Xmx512M"/>
- <!-- <jvmarg line="-Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_shmem,server=y,suspend=y,address=unittest"/> -->
- <classpath>
- <path refid="stress.test.execution.classpath"/>
- <!-- Add this when http://jira.jboss.org/jira/browse/JBAS-2554 is done -->
- <!--
- <path refid="jboss.test.classpath"/>
- -->
- </classpath>
-
- <!-- Use this when http://jira.jboss.org/jira/browse/JBAS-2554 is done -->
- <!--
- <sysproperty key="jboss-junit-configuration" value="Remote"/>
- <formatter classname="org.jboss.ant.taskdefs.XMLJUnitMultipleResultFormatter"
- usefile="${junit.formatter.usefile}" extension="-Remote.xml"/>
- -->
-
- <sysproperty key="messaging-test-configuration" value="StressRemote"/>
- <formatter classname="org.jboss.test.messaging.tools.ant.XMLJUnitMultipleResultFormatter"
- usefile="${junit.formatter.usefile}" extension="-StressRemote.xml"/>
-
- <batchtest fork="${junit.batchtest.fork}"
- todir="${junit.batchtest.todir}"
- haltonfailure="${junit.batchtest.haltonfailure}"
- haltonerror="${junit.batchtest.haltonerror}">
- <formatter type="plain" usefile="${junit.formatter.usefile}"/>
- <fileset dir="${build.tests.classes}">
- <include name="org/jboss/test/messaging/jms/stress/**/*Test.class"/>
- </fileset>
- </batchtest>
- </junit>
-
- <antcall target="stop-rmi-server"/>
-
- </target>
-
- <target name="crash-tests" depends="tests-jar, prepare-testdirs, clear-test-logs"
- description="Runs crash tests">
-
- <antcall target="stop-rmi-server"/>
- <antcall target="start-rmi-server"/>
-
- <antcall target="crash-test">
- <param name="crash.test.name" value="org.jboss.test.messaging.jms.crash.ClientCrashTest"/>
- </antcall>
-
- <antcall target="start-rmi-server"/>
-
- <antcall target="crash-test">
- <param name="crash.test.name" value="org.jboss.test.messaging.jms.crash.ClientCrashNegativeLeaseTest"/>
- </antcall>
-
- <antcall target="start-rmi-server"/>
-
- <antcall target="crash-test">
- <param name="crash.test.name" value="org.jboss.test.messaging.jms.crash.ClientCrashZeroLeaseTest"/>
- </antcall>
-
- <antcall target="start-rmi-server"/>
-
- <antcall target="crash-test">
- <param name="crash.test.name" value="org.jboss.test.messaging.jms.crash.ClientCrashLargeLeaseTest"/>
- </antcall>
-
- <antcall target="start-rmi-server"/>
-
- <antcall target="crash-test">
- <param name="crash.test.name" value="org.jboss.test.messaging.jms.crash.CallbackFailureTest"/>
- </antcall>
-
- </target>
-
-
- <target name="crash-test" depends="init" description="Runs crash test">
-
- <junit printsummary="${junit.printsummary}"
- fork="${junit.fork}"
- includeantruntime="yes"
- haltonerror="${junit.haltonerror}"
- haltonfailure="${junit.haltonfailure}"
- showoutput="${junit.showoutput}"
- timeout="${junit.timeout}">
-
- <sysproperty key="remote" value="true"/>
- <sysproperty key="module.output" value="${tests.output}"/>
- <sysproperty key="test.bind.address" value="${test.bind.address}"/>
- <sysproperty key="test.database" value="${functional.tests.database}"/>
- <sysproperty key="test.serialization" value="${functional.tests.serialization}"/>
- <jvmarg value="-Xmx512M"/>
- <!--
- <jvmarg line="-Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_shmem,server=y,suspend=y,address=antjunit"/>
- -->
- <classpath>
- <pathelement path="${cp2}"/>
- <path refid="test.execution.classpath"/>
- <path refid="test.compilation.classpath"/>
- </classpath>
- <!-- Use this when http://jira.jboss.org/jira/browse/JBAS-2554 is done -->
- <!--
- <sysproperty key="jboss-junit-configuration" value="Remote"/>
- <formatter classname="org.jboss.ant.taskdefs.XMLJUnitMultipleResultFormatter"
- usefile="${junit.formatter.usefile}" extension="-Remote.xml"/>
- -->
-
- <sysproperty key="messaging-test-configuration" value="Crash"/>
- <formatter classname="org.jboss.test.messaging.tools.ant.XMLJUnitMultipleResultFormatter"
- usefile="${junit.formatter.usefile}" extension="-Crash.xml"/>
-
- <test name="${crash.test.name}"
- fork="true"
- todir="${junit.batchtest.todir}"
- haltonfailure="${junit.test.haltonfailure}"
- haltonerror="${junit.test.haltonerror}">
- </test>
-
- </junit>
-
- </target>
-
-
- <target name="jmstests" depends="tests-jar, prepare-testdirs, clear-test-logs"
- description="Runs the jms tests only">
-
- <antcall target="start-rmi-server"/>
-
- <junit printsummary="${junit.printsummary}"
- fork="${junit.fork}"
- includeantruntime="${junit.includeantruntime}"
- haltonerror="${junit.haltonerror}"
- haltonfailure="${junit.haltonfailure}"
- showoutput="${junit.showoutput}"
- timeout="${junit.timeout}">
- <sysproperty key="remote" value="${build.tests.remote}"/>
- <sysproperty key="module.output" value="${tests.output}"/>
- <sysproperty key="test.bind.address" value="${test.bind.address}"/>
- <sysproperty key="test.database" value="${functional.tests.database}"/>
- <sysproperty key="test.serialization" value="${functional.tests.serialization}"/>
- <jvmarg value="-Xmx512M"/>
- <classpath refid="test.execution.classpath"/>
- <formatter type="xml" usefile="${junit.formatter.usefile}"/>
- <batchtest fork="${junit.batchtest.fork}"
- todir="${junit.batchtest.todir}"
- haltonfailure="${junit.batchtest.haltonfailure}"
- haltonerror="${junit.batchtest.haltonerror}">
- <formatter type="plain" usefile="${junit.formatter.usefile}"/>
- <fileset dir="${build.tests.classes}">
- <include name="**/messaging/jms/**/*Test.class"/>
- <exclude name="**/jms/stress/**"/>
- <exclude name="org/jboss/test/messaging/jms/ManifestTest.class"/>
- </fileset>
- </batchtest>
- </junit>
-
- <antcall target="stop-rmi-server"/>
-
- </target>
-
- <target name="messagetests" depends="tests-jar, prepare-testdirs, clear-test-logs"
- description="Runs the jms tests only">
-
- <junit printsummary="${junit.printsummary}"
- fork="${junit.fork}"
- includeantruntime="${junit.includeantruntime}"
- haltonerror="${junit.haltonerror}"
- haltonfailure="${junit.haltonfailure}"
- showoutput="${junit.showoutput}"
- timeout="${junit.timeout}">
- <sysproperty key="remote" value="${build.tests.remote}"/>
- <sysproperty key="module.output" value="${tests.output}"/>
- <sysproperty key="test.bind.address" value="${test.bind.address}"/>
- <sysproperty key="test.database" value="${functional.tests.database}"/>
- <sysproperty key="test.serialization" value="${functional.tests.serialization}"/>
- <jvmarg value="-Xmx512M"/>
- <classpath refid="test.execution.classpath"/>
- <formatter type="xml" usefile="${junit.formatter.usefile}"/>
- <batchtest fork="${junit.batchtest.fork}"
- todir="${junit.batchtest.todir}"
- haltonfailure="${junit.batchtest.haltonfailure}"
- haltonerror="${junit.batchtest.haltonerror}">
- <formatter type="plain" usefile="${junit.formatter.usefile}"/>
- <fileset dir="${build.tests.classes}">
- <include name="**/messaging/jms/message/**/*Test.class"/>
- </fileset>
- </batchtest>
- </junit>
-
- <antcall target="stop-rmi-server"/>
-
- </target>
-
- <target name="coretests" depends="tests-jar, prepare-testdirs, clear-test-logs"
- description="Runs the jms tests only">
-
- <junit printsummary="${junit.printsummary}"
- fork="${junit.fork}"
- includeantruntime="${junit.includeantruntime}"
- haltonerror="${junit.haltonerror}"
- haltonfailure="${junit.haltonfailure}"
- showoutput="${junit.showoutput}"
- timeout="${junit.timeout}">
- <sysproperty key="remote" value="${build.tests.remote}"/>
- <sysproperty key="module.output" value="${tests.output}"/>
- <sysproperty key="test.bind.address" value="${test.bind.address}"/>
- <sysproperty key="test.database" value="${functional.tests.database}"/>
- <sysproperty key="test.serialization" value="${functional.tests.serialization}"/>
- <jvmarg value="-Xmx512M"/>
- <classpath refid="test.execution.classpath"/>
- <formatter type="xml" usefile="${junit.formatter.usefile}"/>
- <batchtest fork="${junit.batchtest.fork}"
- todir="${junit.batchtest.todir}"
- haltonfailure="${junit.batchtest.haltonfailure}"
- haltonerror="${junit.batchtest.haltonerror}">
- <formatter type="plain" usefile="${junit.formatter.usefile}"/>
- <fileset dir="${build.tests.classes}">
- <include name="**/messaging/**/*Test.class"/>
- <exclude name="**/messaging/jms/**"/>
- </fileset>
- </batchtest>
- </junit>
- <antcall target="stop-rmi-server"/>
- </target>
-
- <target name="test" depends="tests-jar, prepare-testdirs, clear-test-logs"
- description="Runs a single test, specified by its FQ class name via 'test.classname'">
-
- <fail unless="test.classname"
- message="To run a single test, use: ./build.sh test -Dtest.classname=org.package.MyTest"/>
- <echo>Module root is:${module.root}</echo>
- <antcall target="start-rmi-server"/>
- <property name="test.classname" value="dummy"/>
-
- <junit printsummary="${junit.printsummary}"
- fork="${junit.fork}"
- includeantruntime="${junit.includeantruntime}"
- haltonerror="${junit.haltonerror}"
- haltonfailure="${junit.haltonfailure}"
- showoutput="${junit.showoutput}"
- timeout="${junit.timeout}">
- <sysproperty key="remote" value="${build.tests.remote}"/>
- <sysproperty key="module.output" value="${tests.output}"/>
- <sysproperty key="test.bind.address" value="${test.bind.address}"/>
- <sysproperty key="test.database" value="${functional.tests.database}"/>
- <sysproperty key="test.serialization" value="${functional.tests.serialization}"/>
- <!--
- <jvmarg line="-Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,address=5005,server=y,suspend=y"/>
- -->
- <jvmarg value="-Xmx1024M"/>
- <classpath refid="test.execution.classpath"/>
- <formatter type="xml" usefile="${junit.formatter.usefile}"/>
- <test name="${test.classname}"
- fork="false"
- todir="${junit.batchtest.todir}"
- haltonfailure="${junit.test.haltonfailure}"
- haltonerror="${junit.test.haltonerror}">
- </test>
- </junit>
- <antcall target="stop-rmi-server"/>
- </target>
-
- <!-- ======================================================================================== -->
- <!-- Report Tasks -->
- <!-- ======================================================================================== -->
-
- <target name="copy-stylesheets">
- <mkdir dir="${build.tests.stylesheets}"/>
- <copy todir="${build.tests.stylesheets}" filtering="yes">
- <fileset dir="${source.tests.stylesheets}">
- <include name="**/*"/>
- </fileset>
- </copy>
- </target>
-
- <target name="compile-report" depends="copy-stylesheets">
- <mkdir dir="${build.tests.reports}/html"/>
- <junitreport todir="${build.tests.reports}">
- <fileset dir="${build.tests.reports}">
- <include name="TEST-*.xml"/>
- </fileset>
- <report format="frames"
- todir="${build.tests.reports}/html"
- styledir="${build.tests.stylesheets}"/>
- </junitreport>
- </target>
-
- <target name="report" depends="tests, copy-stylesheets, compile-report"/>
-
- <target name="remote-tests-report" depends="remote-tests, copy-stylesheets, compile-report"/>
-
- <target name="jmsreport" depends="jmstests, copy-stylesheets, compile-report"/>
-
- <target name="messagereport" depends="messagetests, copy-stylesheets, compile-report"/>
-
- <target name="corereport" depends="coretests, copy-stylesheets, compile-report"/>
-
- <target name="stressreport" depends="stress-tests, copy-stylesheets, compile-report"/>
-
- <target name="functional-tests" depends="tests"/>
-
- <!-- ======================================================================================== -->
- <!-- Cleaning Tasks -->
- <!-- ======================================================================================== -->
-
- <target name="clean">
- <delete dir="${tests.output}"/>
- <delete quiet="true">
- <fileset dir="./bin">
- <include name=".*.classpath"/>
- </fileset>
- </delete>
- </target>
-
- <!-- ======================================================================================== -->
- <!-- Tasks required by bin/runtest -->
- <!-- ======================================================================================== -->
-
- <property name="test.execution.classpath.file" value=".test.execution.classpath"/>
-
- <target name="get-test-execution-classpath" depends="init">
- <pathconvert refid="test.execution.classpath" targetos="windows"
- property="test.execution.classpath.unix"/>
- <echo message="${test.execution.classpath.unix}" file="${test.execution.classpath.file}"/>
- </target>
-
- <!-- ======================================================================================== -->
- <!-- Miscellaneous -->
- <!-- ======================================================================================== -->
-
- <target name="tests-ejb-jar"
- description="Creates the ejb jar file containing the test ejb and mdb for testing jms from within a managed environment">
-
- <mkdir dir="${build.tests.lib}"/>
- <mkdir dir="${build.tests.classes}/META-INF"/>
- <copy file="${source.tests.java}/org/jboss/test/messaging/jms/managed/META-INF/jboss.xml"
- tofile="${build.tests.classes}/META-INF/jboss.xml"/>
- <copy file="${source.tests.java}/org/jboss/test/messaging/jms/managed/META-INF/ejb-jar.xml"
- tofile="${build.tests.classes}/META-INF/ejb-jar.xml"/>
- <!-- Build the tests ejb jar -->
- <jar jarfile="${build.tests.lib}/${build.tests.ejbarchive}">
- <fileset dir="${build.tests.classes}">
- <include name="org/jboss/test/messaging/jms/managed/**"/>
- </fileset>
- <fileset dir="${build.tests.classes}">
- <include name="META-INF/**"/>
- </fileset>
- </jar>
- </target>
-
- <target name="deployejb" depends="tests-ejb-jar">
- <copy file="${build.tests.lib}/${build.tests.ejbarchive}"
- todir="${ENV.JBOSS_HOME}/server/default/deploy"/>
- </target>
-
- <target name="undeployejb">
- <delete file="${ENV.JBOSS_HOME}/server/default/deploy/${build.tests.ejbarchive}"/>
- </target>
-
-</project>
-
Deleted: trunk/tests/pom.xml
===================================================================
--- trunk/tests/pom.xml 2007-07-27 08:54:24 UTC (rev 2929)
+++ trunk/tests/pom.xml 2007-07-27 09:59:55 UTC (rev 2930)
@@ -1,307 +0,0 @@
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
- <modelVersion>4.0.0</modelVersion>
- <groupId>jboss.messaging.tests</groupId>
- <artifactId>jboss-messaging-tests</artifactId>
- <packaging>jar</packaging>
- <version>1.0</version>
- <name>JBoss Messaging</name>
- <url>http://www.jboss.com/products/messaging</url>
- <description>BJoss Messaging provides an open source and standards-based messaging platform that brings enterprise-class messaging to the mass market.</description>
- <licenses>
- <license>
- <name>lgpl</name>
- <url>http://repository.jboss.com/licenses/lgpl.txt</url>
- </license>
- </licenses>
- <organization>
- <name>JBoss Inc.</name>
- <url>http://www.jboss.org</url>
- </organization>
-
- <repositories>
- <repository>
- <id>jboss</id>
- <name>JBoss Inc. Repository</name>
- <layout>default</layout>
- <url>http://repository.jboss.com/maven2/</url>
- <snapshots>
- <enabled>true</enabled>
- </snapshots>
- </repository>
- </repositories>
-
- <pluginRepositories>
- <pluginRepository>
- <id>jbosspluginrepo</id>
- <name>jboss plugin repository</name>
- <url>http://repository.jboss.com/maven2</url>
- <layout>default</layout>
- <snapshots>
- <enabled>false</enabled>
- <updatePolicy>never</updatePolicy>
- </snapshots>
- </pluginRepository>
- <pluginRepository>
- <id>Maven Snapshots</id>
- <url>http://snapshots.maven.codehaus.org/maven2/</url>
- <snapshots>
- <enabled>true</enabled>
- </snapshots>
- <releases>
- <enabled>false</enabled>
- </releases>
- </pluginRepository>
-
-
- </pluginRepositories>
-
-
- <build>
- <sourceDirectory>src</sourceDirectory>
-
-
- <plugins>
-
-
- <!-- define how we want compilation to take place
- here, we accept most of the defaults but say that we want the
- optimization flag set, and define the source and target to be 1.4,
- these setting will be inherited by child projects -->
- <plugin>
- <artifactId>maven-compiler-plugin</artifactId>
- <version>2.0</version>
- <configuration>
- <optimize>true</optimize>
- <source>1.4</source>
- <target>1.4</target>
- </configuration>
- </plugin>
-
-
-
-
-
- <plugin>
- <artifactId>maven-antrun-plugin</artifactId>
- <version>1.1</version>
- <inherited>true</inherited>
- <executions>
- <execution>
- <id>aopc</id>
- <phase>test</phase>
- <configuration>
- <tasks>
- <property refid="maven.compile.classpath" name="cp2"></property>
- <ant antfile="maven-tests.xml" inheritRefs="true"/>
- </tasks>
- </configuration>
- <goals>
- <goal>run</goal>
- </goals>
- </execution>
- <execution>
- <id>rmic</id>
- <phase>process-classes</phase>
- <configuration>
- <tasks>
-
-
-
- <rmic base="${basedir}/target/classes"
- includes="**/RMITestServer.class,**/RMINamingDelegate.class">
- <classpath refid="maven.compile.classpath"/>
- </rmic>
- </tasks>
- </configuration>
- <goals>
- <goal>run</goal>
- </goals>
- </execution>
- </executions>
- <dependencies>
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>3.8.1</version>
- </dependency>
- <dependency>
- <groupId>ant</groupId>
- <artifactId>ant-junit</artifactId>
- <version>1.6.5</version>
- </dependency>
- <dependency>
- <groupId>jboss.logging</groupId>
- <artifactId>jboss-logging-spi</artifactId>
- <version>1.0</version>
- </dependency>
- <dependency>
- <groupId>sun</groupId>
- <artifactId>tools</artifactId>
- <version>1.0</version>
- <scope>system</scope>
-
- <systemPath>${java.home}/../lib/tools.jar</systemPath>
- </dependency>
- </dependencies>
-
- </plugin>
-
-
-
-
- </plugins>
- </build>
- <dependencies>
- <dependency>
- <groupId>jboss</groupId>
- <artifactId>jboss-j2ee</artifactId>
- <version>SNAPSHOT</version>
- </dependency>
- <dependency>
- <groupId>jboss.jboss-aop</groupId>
- <artifactId>jboss-aop</artifactId>
- <version>1.5.0.GA</version>
- </dependency>
- <dependency>
- <groupId>jboss.logging</groupId>
- <artifactId>jboss-logging-spi</artifactId>
- <version>1.0</version>
- </dependency>
- <dependency>
- <groupId>jboss.logging.log4j</groupId>
- <artifactId>jboss-logging-log4j</artifactId>
- <version>1.0</version>
- </dependency>
- <dependency>
- <groupId>jboss.jbossxb</groupId>
- <artifactId>jbossxb</artifactId>
- <version>1.0.1.TEST</version>
- </dependency>
- <dependency>
- <groupId>oswego-concurrent</groupId>
- <artifactId>concurrent</artifactId>
- <version>1.3.4</version>
- </dependency>
- <dependency>
- <groupId>jboss</groupId>
- <artifactId>jboss-remoting</artifactId>
- <version>2.0.0.CR1</version>
- </dependency>
- <dependency>
- <groupId>jboss.common.core</groupId>
- <artifactId>jboss-common-core</artifactId>
- <version>1.0</version>
- </dependency>
- <dependency>
- <groupId>jboss</groupId>
- <artifactId>jboss-serialization</artifactId>
- <version>1.0.1.GA</version>
- </dependency>
- <dependency>
- <groupId>jboss</groupId>
- <artifactId>jboss-j2se</artifactId>
- <version>5.0-SNAPSHOT</version>
- </dependency>
- <dependency>
- <groupId>jboss</groupId>
- <artifactId>jboss-system</artifactId>
- <version>5.0-SNAPSHOT</version>
- </dependency>
- <dependency>
- <groupId>jgroups</groupId>
- <artifactId>jgroups</artifactId>
- <version>2.3</version>
- </dependency>
- <dependency>
- <groupId>jboss</groupId>
- <artifactId>jbosssx</artifactId>
- <version>5.0-SNAPSHOT</version>
- </dependency>
- <dependency>
- <groupId>jboss</groupId>
- <artifactId>jboss-jmx</artifactId>
- <version>5.0-SNAPSHOT</version>
- </dependency>
- <dependency>
- <groupId>jboss</groupId>
- <artifactId>jboss-transaction</artifactId>
- <version>5.0-SNAPSHOT</version>
- </dependency>
- <dependency>
- <groupId>jboss</groupId>
- <artifactId>jboss</artifactId>
- <version>5.0-SNAPSHOT</version>
- </dependency>
- <dependency>
- <groupId>jboss.messaging</groupId>
- <artifactId>jboss-messaging</artifactId>
- <version>1.0</version>
- </dependency>
- <dependency>
- <groupId>hsqldb</groupId>
- <artifactId>hsqldb</artifactId>
- <version>1.8.0.2</version>
- </dependency>
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>3.8.1</version>
- </dependency>
- <dependency>
- <groupId>jboss-jca</groupId>
- <artifactId>jboss-jca</artifactId>
- <version>snapshot</version>
- <scope>system</scope>
- <systemPath>${basedir}/lib/jboss-jca.jar</systemPath>
- </dependency>
- <dependency>
- <groupId>jboss-jca</groupId>
- <artifactId>jboss-local-jdbc</artifactId>
- <version>snapshot</version>
- <scope>system</scope>
- <systemPath>${basedir}/lib/jboss-local-jdbc.jar</systemPath>
- </dependency>
- <dependency>
- <groupId>jboss-jca</groupId>
- <artifactId>jboss-common-jdbc</artifactId>
- <version>snapshot</version>
- <scope>system</scope>
- <systemPath>${basedir}/lib/jboss-common-jdbc-wrapper.jar</systemPath>
- </dependency>
- <dependency>
- <groupId>jboss-jca</groupId>
- <artifactId>jms-ra</artifactId>
- <version>snapshot</version>
- <scope>system</scope>
- <systemPath>${basedir}/lib/jms-ra.jar</systemPath>
- </dependency>
- <dependency>
- <groupId>jboss.profiler.jvmti</groupId>
- <artifactId>jboss-profiler-jvmti</artifactId>
- <version>1.0.0.CR5</version>
- </dependency>
- <dependency>
- <groupId>ant</groupId>
- <artifactId>ant-junit</artifactId>
- <version>1.6.5</version>
- </dependency>
- <dependency>
- <groupId>ant</groupId>
- <artifactId>ant</artifactId>
- <version>1.6.5</version>
- </dependency>
- <dependency>
- <groupId>javassist</groupId>
- <artifactId>javassist</artifactId>
- <version>3.1</version>
- </dependency>
- <dependency>
- <groupId>trove</groupId>
- <artifactId>trove</artifactId>
- <version>2.1.1</version>
- </dependency>
- </dependencies>
-
-</project>
-
Deleted: trunk/tests/src/org/jboss/test/messaging/jms/crash/ClientCrashLargeLeaseTest.java
===================================================================
--- trunk/tests/src/org/jboss/test/messaging/jms/crash/ClientCrashLargeLeaseTest.java 2007-07-27 08:54:24 UTC (rev 2929)
+++ trunk/tests/src/org/jboss/test/messaging/jms/crash/ClientCrashLargeLeaseTest.java 2007-07-27 09:59:55 UTC (rev 2930)
@@ -1,148 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., 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.jboss.test.messaging.jms.crash;
-
-import javax.jms.ConnectionFactory;
-import javax.jms.Queue;
-import javax.naming.InitialContext;
-
-import org.jboss.jms.server.ConnectionManager;
-import org.jboss.logging.Logger;
-import org.jboss.test.messaging.MessagingTestCase;
-import org.jboss.test.messaging.tools.ServerManagement;
-import org.jboss.test.messaging.tools.container.InVMInitialContextFactory;
-import org.jboss.test.messaging.tools.container.LocalTestServer;
-import org.jboss.test.messaging.tools.container.Server;
-import org.jboss.test.messaging.tools.container.ServiceContainer;
-
-/**
- *
- * A ClientCrashLargeLeaseTest.
- *
- * @author <a href="tim.fox at jboss.com">Tim Fox</a>
- * @version <tt>$Revision$</tt>
- *
- * $Id$
- */
-public class ClientCrashLargeLeaseTest extends MessagingTestCase
-{
- // Constants -----------------------------------------------------
-
- // Static --------------------------------------------------------
-
- private static final Logger log = Logger.getLogger(ClientCrashLargeLeaseTest.class);
-
- // Attributes ----------------------------------------------------
-
- protected Server localServer;
-
- protected Server remoteServer;
-
- // Constructors --------------------------------------------------
-
- public ClientCrashLargeLeaseTest(String name)
- {
- super(name);
- }
-
- // Public --------------------------------------------------------
-
- public void setUp() throws Exception
- {
- super.setUp();
-
- // Start the local server
- localServer = new LocalTestServer();
-
- // Start all the services locally
- localServer.start("all", true);
-
- localServer.setAttribute(ServiceContainer.REMOTING_OBJECT_NAME, "LeasePeriod", "30000");
-
- localServer.deployQueue("Queue", null, false);
-
- // Connect to the remote server, but don't start a servicecontainer on it. We are only using
- // the remote server to open a client connection to the local server.
- ServerManagement.create();
-
- remoteServer = ServerManagement.getServer();
-
- log.debug("setup done");
- }
-
- public void tearDown() throws Exception
- {
- localServer.stop();
- }
-
- /**
- * Test that when a remote jms client crashes, server side resources for connections are
- * cleaned-up.
- */
- public void testClientCrash() throws Exception
- {
- InitialContext ic = new InitialContext(InVMInitialContextFactory.getJNDIEnvironment());
-
- ConnectionFactory cf = (ConnectionFactory)ic.lookup("/ConnectionFactory");
-
- Queue queue = (Queue)ic.lookup("/queue/Queue");
-
- CreateClientOnServerCommand command = new CreateClientOnServerCommand(cf, queue, true);
-
- String remotingSessionId = (String)remoteServer.executeCommand(command);
-
- ConnectionManager cm = localServer.getServerPeer().getConnectionManager();
-
- assertTrue(cm.containsRemotingSession(remotingSessionId));
-
- // Now we should have a client connection from the remote server to the local server
-
- try
- {
- remoteServer.kill();
- }
- catch (Throwable t)
- {
- //OK
- }
- log.trace("killed remote server");
-
- Thread.sleep(5000);
-
- // See if we still have a connection with this id
-
- //Connection state shouldn't have been cleared up by now
- assertTrue(cm.containsRemotingSession(remotingSessionId));
- }
-
-
- // Package protected ---------------------------------------------
-
- // Protected -----------------------------------------------------
-
- // Private -------------------------------------------------------
-
-
- // Inner classes -------------------------------------------------
-
-}
-
Deleted: trunk/tests/src/org/jboss/test/messaging/jms/crash/ClientCrashNegativeLeaseTest.java
===================================================================
--- trunk/tests/src/org/jboss/test/messaging/jms/crash/ClientCrashNegativeLeaseTest.java 2007-07-27 08:54:24 UTC (rev 2929)
+++ trunk/tests/src/org/jboss/test/messaging/jms/crash/ClientCrashNegativeLeaseTest.java 2007-07-27 09:59:55 UTC (rev 2930)
@@ -1,145 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., 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.jboss.test.messaging.jms.crash;
-
-import javax.jms.ConnectionFactory;
-import javax.jms.Queue;
-import javax.naming.InitialContext;
-
-import org.jboss.jms.server.ConnectionManager;
-import org.jboss.logging.Logger;
-import org.jboss.test.messaging.MessagingTestCase;
-import org.jboss.test.messaging.tools.ServerManagement;
-import org.jboss.test.messaging.tools.container.InVMInitialContextFactory;
-import org.jboss.test.messaging.tools.container.LocalTestServer;
-import org.jboss.test.messaging.tools.container.Server;
-import org.jboss.test.messaging.tools.container.ServiceContainer;
-
-/**
- *
- * A ClientCrashNoLeaseTest.
- *
- * @author <a href="tim.fox at jboss.com">Tim Fox</a>
- * @version <tt>$Revision$</tt>
- *
- * $Id$
- */
-public class ClientCrashNegativeLeaseTest extends MessagingTestCase
-{
- // Constants -----------------------------------------------------
-
- // Static --------------------------------------------------------
-
- private static final Logger log = Logger.getLogger(ClientCrashNegativeLeaseTest.class);
-
- // Attributes ----------------------------------------------------
-
- protected Server localServer;
-
- protected Server remoteServer;
-
- // Constructors --------------------------------------------------
-
- public ClientCrashNegativeLeaseTest(String name)
- {
- super(name);
- }
-
- // Public --------------------------------------------------------
-
- public void setUp() throws Exception
- {
- super.setUp();
-
- // Start the local server
- localServer = new LocalTestServer();
-
- // Start all the services locally
- localServer.start("all", true);
-
- //Set lease period to -1 --> this should disable leasing so the state won't be cleared up
-
- localServer.setAttribute(ServiceContainer.REMOTING_OBJECT_NAME, "LeasePeriod", "-1");
-
- localServer.deployQueue("Queue", null, false);
-
- // Connect to the remote server, but don't start a servicecontainer on it. We are only using
- // the remote server to open a client connection to the local server.
- ServerManagement.create();
-
- remoteServer = ServerManagement.getServer();
-
- log.debug("setup done");
- }
-
- public void tearDown() throws Exception
- {
- localServer.stop();
- }
-
- public void testClientCrash() throws Exception
- {
- InitialContext ic = new InitialContext(InVMInitialContextFactory.getJNDIEnvironment());
-
- ConnectionFactory cf = (ConnectionFactory)ic.lookup("/ConnectionFactory");
-
- Queue queue = (Queue)ic.lookup("/queue/Queue");
-
- CreateClientOnServerCommand command = new CreateClientOnServerCommand(cf, queue, true);
-
- String remotingSessionId = (String)remoteServer.executeCommand(command);
-
- ConnectionManager cm = localServer.getServerPeer().getConnectionManager();
-
- assertTrue(cm.containsRemotingSession(remotingSessionId));
-
- // Now we should have a client connection from the remote server to the local server
-
- try
- {
- remoteServer.kill();
- }
- catch (Throwable t)
- {
- //OK
- }
- log.trace("killed remote server");
-
- // Wait for connection resources to be cleared up
- Thread.sleep(5000);
-
- // See if we still have a connection with this id
- assertTrue(cm.containsRemotingSession(remotingSessionId));
- }
-
-
- // Package protected ---------------------------------------------
-
- // Protected -----------------------------------------------------
-
- // Private -------------------------------------------------------
-
-
- // Inner classes -------------------------------------------------
-
-}
-
Modified: trunk/tests/src/org/jboss/test/messaging/jms/crash/ClientCrashTest.java
===================================================================
--- trunk/tests/src/org/jboss/test/messaging/jms/crash/ClientCrashTest.java 2007-07-27 08:54:24 UTC (rev 2929)
+++ trunk/tests/src/org/jboss/test/messaging/jms/crash/ClientCrashTest.java 2007-07-27 09:59:55 UTC (rev 2930)
@@ -23,9 +23,11 @@
import javax.jms.ConnectionFactory;
import javax.jms.Queue;
+import javax.jms.Topic;
import javax.naming.InitialContext;
import org.jboss.jms.server.ConnectionManager;
+import org.jboss.jms.server.connectionmanager.SimpleConnectionManager;
import org.jboss.logging.Logger;
import org.jboss.test.messaging.MessagingTestCase;
import org.jboss.test.messaging.tools.ServerManagement;
@@ -68,7 +70,7 @@
public void setUp() throws Exception
{
- super.setUp();
+ ServerManagement.stop();
// Start the local server
localServer = new LocalTestServer();
@@ -77,66 +79,137 @@
localServer.start("all", true);
// This crash test is relying on a precise value of LeaseInterval, so we don't rely on
- // the default, whatever that is ...
-
- localServer.setAttribute(ServiceContainer.REMOTING_OBJECT_NAME, "LeasePeriod", "2000");
+ // the default, whatever that is ...
localServer.deployQueue("Queue", null, false);
+
localServer.deployTopic("Topic", null, false);
-
+
// Connect to the remote server, but don't start a servicecontainer on it. We are only using
// the remote server to open a client connection to the local server.
ServerManagement.create();
remoteServer = ServerManagement.getServer();
- log.debug("setup done");
+ super.setUp();
+
}
public void tearDown() throws Exception
{
localServer.stop();
+
+ super.tearDown();
}
+
+ private void performCrash(long wait, boolean contains) throws Exception
+ {
+ InitialContext theIC = new InitialContext(InVMInitialContextFactory.getJNDIEnvironment());
+ ConnectionFactory cf = (ConnectionFactory)theIC.lookup("/ConnectionFactory");
+
+ Queue queue = (Queue)theIC.lookup("/queue/Queue");
+
+ CreateClientOnServerCommand command = new CreateClientOnServerCommand(cf, queue, true);
+
+ String remotingSessionId = (String)remoteServer.executeCommand(command);
+
+ ConnectionManager cm = localServer.getServerPeer().getConnectionManager();
+
+ assertTrue(cm.containsRemotingSession(remotingSessionId));
+
+ // Now we should have a client connection from the remote server to the local server
+
+ ServerManagement.kill(0);
+
+ log.trace("killed remote server");
+
+ //Wait for connection resources to be cleared up
+ Thread.sleep(wait);
+
+ // See if we still have a connection with this id
+ assertEquals(contains, cm.containsRemotingSession(remotingSessionId));
+ }
+
/**
* Test that when a remote jms client crashes, server side resources for connections are
* cleaned-up.
*/
public void testClientCrash() throws Exception
{
+ localServer.setAttribute(ServiceContainer.REMOTING_OBJECT_NAME, "LeasePeriod", "2000");
+
+ performCrash(8000, false);
+ }
+
+ public void testClientCrashLargeLease() throws Exception
+ {
+ localServer.setAttribute(ServiceContainer.REMOTING_OBJECT_NAME, "LeasePeriod", "30000");
+
+ performCrash(8000, true);
+ }
+
+ public void testClientCrashNegativeLease() throws Exception
+ {
+ //Set lease period to -1 --> this should disable leasing so the state won't be cleared up
+
+ localServer.setAttribute(ServiceContainer.REMOTING_OBJECT_NAME, "LeasePeriod", "-1");
+
+ performCrash(8000, true);
+ }
+
+ public void testClientCrashZeroLease() throws Exception
+ {
+ //Set lease period to 0 --> this should disable leasing so the state won't be cleared up
+
+ localServer.setAttribute(ServiceContainer.REMOTING_OBJECT_NAME, "LeasePeriod", "0");
+
+ performCrash(8000, true);
+ }
+
+ public void testClientCrashWithTwoConnections() throws Exception
+ {
+ localServer.setAttribute(ServiceContainer.REMOTING_OBJECT_NAME, "LeasePeriod", "2000");
+
InitialContext ic = new InitialContext(InVMInitialContextFactory.getJNDIEnvironment());
+ Topic topic = (Topic)ic.lookup("/topic/Topic");
ConnectionFactory cf = (ConnectionFactory)ic.lookup("/ConnectionFactory");
- Queue queue = (Queue)ic.lookup("/queue/Queue");
+ CreateTwoClientOnServerCommand command = new CreateTwoClientOnServerCommand(cf, topic, true);
- CreateClientOnServerCommand command = new CreateClientOnServerCommand(cf, queue, true);
+ String remotingSessionId[] = (String[])remoteServer.executeCommand(command);
- String remotingSessionId = (String)remoteServer.executeCommand(command);
-
ConnectionManager cm = localServer.getServerPeer().getConnectionManager();
- assertTrue(cm.containsRemotingSession(remotingSessionId));
+ log.info("server(0) = " + remotingSessionId[0]);
+ log.info("server(1) = " + remotingSessionId[1]);
+ log.info("we have = " + ((SimpleConnectionManager)cm).getClients().size() + " clients registered on SimpleconnectionManager");
+ assertFalse(cm.containsRemotingSession(remotingSessionId[0]));
+ assertTrue(cm.containsRemotingSession(remotingSessionId[1]));
+
+ ServerManagement.kill(0);
+
// Now we should have a client connection from the remote server to the local server
- try
- {
- remoteServer.kill();
- }
- catch (Throwable t)
- {
- //OK
- }
- log.trace("killed remote server");
+ log.info("killed remote server");
// Wait for connection resources to be cleared up
Thread.sleep(8000);
// See if we still have a connection with this id
- assertFalse(cm.containsRemotingSession(remotingSessionId));
+
+ //Connection state should have been cleared up by now
+ assertFalse(cm.containsRemotingSession(remotingSessionId[0]));
+ assertFalse(cm.containsRemotingSession(remotingSessionId[1]));
+
+ log.info("Servers = " + ((SimpleConnectionManager)cm).getClients().size());
+
+ assertEquals(0,((SimpleConnectionManager)cm).getClients().size());
}
+
// Package protected ---------------------------------------------
// Protected -----------------------------------------------------
Deleted: trunk/tests/src/org/jboss/test/messaging/jms/crash/ClientCrashTwoConnectionsTest.java
===================================================================
--- trunk/tests/src/org/jboss/test/messaging/jms/crash/ClientCrashTwoConnectionsTest.java 2007-07-27 08:54:24 UTC (rev 2929)
+++ trunk/tests/src/org/jboss/test/messaging/jms/crash/ClientCrashTwoConnectionsTest.java 2007-07-27 09:59:55 UTC (rev 2930)
@@ -1,162 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., 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.jboss.test.messaging.jms.crash;
-
-import javax.jms.ConnectionFactory;
-import javax.jms.Topic;
-import javax.naming.InitialContext;
-
-import org.jboss.jms.server.ConnectionManager;
-import org.jboss.jms.server.connectionmanager.SimpleConnectionManager;
-import org.jboss.logging.Logger;
-import org.jboss.test.messaging.MessagingTestCase;
-import org.jboss.test.messaging.tools.ServerManagement;
-import org.jboss.test.messaging.tools.container.InVMInitialContextFactory;
-import org.jboss.test.messaging.tools.container.LocalTestServer;
-import org.jboss.test.messaging.tools.container.Server;
-import org.jboss.test.messaging.tools.container.ServiceContainer;
-
-/**
- *
- * A ClientCrashTest.
- *
- * @author <a href="tim.fox at jboss.com">Tim Fox</a>
- * @author <a href="clebert.suconic at jboss.com">Clebert Suconic</a>
- * @version <tt>$Revision$</tt>
- *
- * $Id$
- */
-public class ClientCrashTwoConnectionsTest extends MessagingTestCase
-{
- // Constants -----------------------------------------------------
-
- // Static --------------------------------------------------------
-
- private static final Logger log = Logger.getLogger(ClientCrashTwoConnectionsTest.class);
-
- // Attributes ----------------------------------------------------
-
- protected Server localServer;
-
- protected Server remoteServer;
-
- // Constructors --------------------------------------------------
-
- public ClientCrashTwoConnectionsTest(String name)
- {
- super(name);
- }
-
- // Public --------------------------------------------------------
-
- public void setUp() throws Exception
- {
- super.setUp();
-
- // Start the local server
- localServer = new LocalTestServer();
-
- // Start all the services locally
- localServer.start("all", true);
-
- // This crash test is relying on a precise value of LeaseInterval, so we don't rely on
- // the default, whatever that is ...
-
- localServer.setAttribute(ServiceContainer.REMOTING_OBJECT_NAME, "LeasePeriod", "2000");
-
- localServer.deployQueue("Queue", null, false);
- localServer.deployTopic("Topic", null, false);
-
- // Connect to the remote server, but don't start a servicecontainer on it. We are only using
- // the remote server to open a client connection to the local server.
- ServerManagement.create();
-
- remoteServer = ServerManagement.getServer();
-
- log.debug("setup done");
- }
-
- public void tearDown() throws Exception
- {
- localServer.stop();
- }
-
- /**
- * Test that when a remote jms client crashes, server side resources for connections are
- * cleaned-up.
- */
- public void testClientCrashWithTwoConnections() throws Exception
- {
- InitialContext ic = new InitialContext(InVMInitialContextFactory.getJNDIEnvironment());
- Topic topic = (Topic)ic.lookup("/topic/Topic");
-
- ConnectionFactory cf = (ConnectionFactory)ic.lookup("/ConnectionFactory");
-
- CreateTwoClientOnServerCommand command = new CreateTwoClientOnServerCommand(cf, topic, true);
-
- String remotingSessionId[] = (String[])remoteServer.executeCommand(command);
-
- ConnectionManager cm = localServer.getServerPeer().getConnectionManager();
-
- log.info("server(0) = " + remotingSessionId[0]);
- log.info("server(1) = " + remotingSessionId[1]);
- log.info("we have = " + ((SimpleConnectionManager)cm).getClients().size() + " clients registered on SimpleconnectionManager");
-
- assertFalse(cm.containsRemotingSession(remotingSessionId[0]));
- assertTrue(cm.containsRemotingSession(remotingSessionId[1]));
-
- // Now we should have a client connection from the remote server to the local server
- try
- {
- remoteServer.kill();
- }
- catch (Throwable t)
- {
- //OK
- }
- log.info("killed remote server");
-
- // Wait for connection resources to be cleared up
- Thread.sleep(8000);
-
- // See if we still have a connection with this id
-
- //Connection state should have been cleared up by now
- assertFalse(cm.containsRemotingSession(remotingSessionId[0]));
- assertFalse(cm.containsRemotingSession(remotingSessionId[1]));
-
- log.info("Servers = " + ((SimpleConnectionManager)cm).getClients().size());
-
- assertEquals(0,((SimpleConnectionManager)cm).getClients().size());
- }
-
-
- // Package protected ---------------------------------------------
-
- // Protected -----------------------------------------------------
-
- // Private -------------------------------------------------------
-
-
- // Inner classes -------------------------------------------------
-
-}
Deleted: trunk/tests/src/org/jboss/test/messaging/jms/crash/ClientCrashZeroLeaseTest.java
===================================================================
--- trunk/tests/src/org/jboss/test/messaging/jms/crash/ClientCrashZeroLeaseTest.java 2007-07-27 08:54:24 UTC (rev 2929)
+++ trunk/tests/src/org/jboss/test/messaging/jms/crash/ClientCrashZeroLeaseTest.java 2007-07-27 09:59:55 UTC (rev 2930)
@@ -1,148 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., 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.jboss.test.messaging.jms.crash;
-
-import javax.jms.ConnectionFactory;
-import javax.jms.Queue;
-import javax.naming.InitialContext;
-
-import org.jboss.jms.server.ConnectionManager;
-import org.jboss.logging.Logger;
-import org.jboss.test.messaging.MessagingTestCase;
-import org.jboss.test.messaging.tools.ServerManagement;
-import org.jboss.test.messaging.tools.container.InVMInitialContextFactory;
-import org.jboss.test.messaging.tools.container.LocalTestServer;
-import org.jboss.test.messaging.tools.container.Server;
-import org.jboss.test.messaging.tools.container.ServiceContainer;
-
-/**
- *
- * A ClientCrashZeroLeaseTest.
- *
- * @author <a href="tim.fox at jboss.com">Tim Fox</a>
- * @version <tt>$Revision$</tt>
- *
- * $Id$
- */
-public class ClientCrashZeroLeaseTest extends MessagingTestCase
-{
- // Constants -----------------------------------------------------
-
- // Static --------------------------------------------------------
-
- private static final Logger log = Logger.getLogger(ClientCrashZeroLeaseTest.class);
-
- // Attributes ----------------------------------------------------
-
- protected Server localServer;
-
- protected Server remoteServer;
-
- // Constructors --------------------------------------------------
-
- public ClientCrashZeroLeaseTest(String name)
- {
- super(name);
- }
-
- // Public --------------------------------------------------------
-
- public void setUp() throws Exception
- {
- super.setUp();
-
- // Start the local server
- localServer = new LocalTestServer();
-
- // Start all the services locally
- localServer.start("all", true);
-
- //Set lease period to 0 --> this should disable leasing so the state won't be cleared up
-
- localServer.setAttribute(ServiceContainer.REMOTING_OBJECT_NAME, "LeasePeriod", "0");
-
- localServer.deployQueue("Queue", null, false);
-
- // Connect to the remote server, but don't start a servicecontainer on it. We are only using
- // the remote server to open a client connection to the local server.
- ServerManagement.create();
-
- remoteServer = ServerManagement.getServer();
-
- log.debug("setup done");
- }
-
- public void tearDown() throws Exception
- {
- localServer.stop();
- }
-
- /**
- * Test that when a remote jms client crashes, server side resources for connections are
- * cleaned-up.
- */
- public void testClientCrash() throws Exception
- {
- InitialContext ic = new InitialContext(InVMInitialContextFactory.getJNDIEnvironment());
-
- ConnectionFactory cf = (ConnectionFactory)ic.lookup("/ConnectionFactory");
-
- Queue queue = (Queue)ic.lookup("/queue/Queue");
-
- CreateClientOnServerCommand command = new CreateClientOnServerCommand(cf, queue, true);
-
- String remotingSessionId = (String)remoteServer.executeCommand(command);
-
- ConnectionManager cm = localServer.getServerPeer().getConnectionManager();
-
- assertTrue(cm.containsRemotingSession(remotingSessionId));
-
- // Now we should have a client connection from the remote server to the local server
-
- try
- {
- remoteServer.kill();
- }
- catch (Throwable t)
- {
- //OK
- }
- log.trace("killed remote server");
-
- Thread.sleep(5000);
-
- // See if we still have a connection with this id
- assertTrue(cm.containsRemotingSession(remotingSessionId));
- }
-
-
- // Package protected ---------------------------------------------
-
- // Protected -----------------------------------------------------
-
- // Private -------------------------------------------------------
-
-
- // Inner classes -------------------------------------------------
-
-}
-
Modified: trunk/tests/src/org/jboss/test/messaging/tools/ServerManagement.java
===================================================================
--- trunk/tests/src/org/jboss/test/messaging/tools/ServerManagement.java 2007-07-27 08:54:24 UTC (rev 2929)
+++ trunk/tests/src/org/jboss/test/messaging/tools/ServerManagement.java 2007-07-27 09:59:55 UTC (rev 2930)
@@ -65,8 +65,6 @@
{
// Constants -----------------------------------------------------
- public static int wibble = 0;
-
public static final int MAX_SERVER_COUNT = 10;
// logging levels used by the remote client to forward log output on a remote server
@@ -148,17 +146,9 @@
}
else
{
- Server s = acquireRemote(10, i, true);
-
- if (s != null)
- {
- servers[i] = new ServerHolder(s, false);
- }
- else
- {
- // most likely the remote server is not started, so spawn it
- servers[i] = new ServerHolder(ServerManagement.spawn(i), true);
- }
+ //Need to spawn a new server - we DON'T use start-rmi-server any more, so we know if the servers[i] is null
+ //the server is not there - killing a server sets servers[i] to null
+ servers[i] = new ServerHolder(ServerManagement.spawn(i), true);
}
}
else
@@ -175,9 +165,6 @@
*/
public static void start(String config) throws Exception
{
- wibble++;
-
- log.info("*** wiblle is now " + wibble);
start(0, config, true);
}
@@ -220,22 +207,16 @@
}
- public static synchronized boolean isStarted(int i)
+ public static synchronized boolean isStarted(int i) throws Exception
{
if (servers[i] == null)
{
return false;
}
-
- try
+ else
{
- return servers[i].getServer().isStarted();
+ return servers[i].getServer().isStarted();
}
- catch(Exception e)
- {
- log.warn("Exception on isStarted", e);
- return false;
- }
}
public static synchronized void stop() throws Exception
@@ -356,12 +337,8 @@
}
/**
- * For a local test, is a noop, but for a remote test, the method call spawns a new VM,
- * irrespective of the fact that a server with same index may already exist (if you want to
- * avoid conflicts, you need to check this externally).
- *
- * The remote server so created is no different from a server started using start-rmi-server
- * script.
+ * For a local test, is a noop, but for a remote test, the method call spawns a new VM
+ *
*/
private static synchronized Server spawn(final int i) throws Exception
{
@@ -376,7 +353,6 @@
sb.append("-Xmx512M").append(' ');
-
String remoteDebugIndex = System.getProperty("test.remote.debug.index");
if (remoteDebugIndex != null)
{
@@ -394,8 +370,14 @@
}
sb.append("-Dmodule.output=").append(moduleOutput).append(' ');
+
+ String bindAddress = System.getProperty("test.bind.address");
+ if (bindAddress == null)
+ {
+ bindAddress = "localhost";
+ }
- sb.append("-Dtest.bind.address=localhost").append(' ');
+ sb.append("-Dtest.bind.address=").append(bindAddress).append(' ');
String jgroupsBindAddr = System.getProperty(org.jgroups.Global.BIND_ADDR);
@@ -545,20 +527,11 @@
// put the invoking thread on wait until the server is actually up and running and bound
// in the RMI registry
- long maxWaitTime = 30; // seconds
- long startTime = System.currentTimeMillis();
- Server s = null;
-
log.info("spawned server " + i + ", waiting for it to come online");
- while (System.currentTimeMillis() - startTime < maxWaitTime * 1000)
- {
- s = acquireRemote(1, i, true);
- if (s != null)
- {
- break;
- }
- }
+ Server s = acquireRemote(500, i, true);
+
+ log.info("Server contacted");
if (s == null)
{
@@ -1129,7 +1102,7 @@
String msg = "trying to connect to the remote RMI server " + index +
(attempt == 1 ? "" : ", attempt " + attempt);
- if(quiet)
+ if (quiet)
{
log.debug(msg);
}
More information about the jboss-cvs-commits
mailing list