Author: julien(a)jboss.com
Date: 2007-10-22 16:22:50 -0400 (Mon, 22 Oct 2007)
New Revision: 8742
Added:
modules/web/trunk/web/src/resources/test/config/log4j.properties
modules/web/trunk/web/src/resources/test/local-jboss-unit.xml
modules/web/trunk/web/src/resources/test/remote-jboss-unit.xml
modules/web/trunk/web/src/resources/test/spi/jboss-4.2-container-servlet/server-war/WEB-INF/jboss-web.xml
modules/web/trunk/web/src/resources/test/spi/jboss-4.2-generic/server-war/WEB-INF/jboss-web.xml
Removed:
modules/web/trunk/web/src/main/org/jboss/portal/test/web/spi/SPITestCase.java
modules/web/trunk/web/src/main/org/jboss/portal/test/web/spi/SPITestConfig.java
modules/web/trunk/web/src/resources/portal-web-test-jar/org/jboss/portal/test/web/spi/client-beans.xml
Modified:
modules/web/trunk/build/build-thirdparty.xml
modules/web/trunk/build/ide/intellij/idea60/modules/web/web.iml
modules/web/trunk/tools/etc/buildfragments/buildmagic.ent
modules/web/trunk/tools/etc/buildfragments/defaults.ent
modules/web/trunk/web/build.xml
modules/web/trunk/web/src/main/org/jboss/portal/test/web/container/ServletContainerTestCase.java
modules/web/trunk/web/src/main/org/jboss/portal/test/web/spi/SPITestServlet.java
modules/web/trunk/web/src/main/org/jboss/portal/test/web/spi/callbacks/AbstractCallback.java
modules/web/trunk/web/src/main/org/jboss/portal/test/web/spi/callbacks/ExceptionCallback.java
modules/web/trunk/web/src/main/org/jboss/portal/test/web/spi/callbacks/NormalCallback.java
modules/web/trunk/web/src/resources/portal-web-test-jar/org/jboss/portal/test/web/spi/server-beans.xml
modules/web/trunk/web/src/resources/test/config/servers.xml
Log:
update web module to jboss unit
Modified: modules/web/trunk/build/build-thirdparty.xml
===================================================================
--- modules/web/trunk/build/build-thirdparty.xml 2007-10-22 19:51:57 UTC (rev 8741)
+++ modules/web/trunk/build/build-thirdparty.xml 2007-10-22 20:22:50 UTC (rev 8742)
@@ -48,44 +48,39 @@
-->
<componentref name="jboss-portal/modules/common"
version="trunk-SNAPSHOT"/>
- <componentref name="jboss-portal/modules/test"
version="1.0.0"/>
+ <componentref name="jboss-portal/modules/test"
version="trunk-SNAPSHOT"/>
+
+ <!-- -->
<componentref name="sun-servlet" version="2.4"/>
<componentref name="apache-tomcat" version="5.0.30"/>
<componentref name="sun-jaf" version="1.0.2"/>
+ <!-- For JBoss Unit -->
+<!--
<componentref name="jboss/remoting"
version="2.2.0.SP4"/>
-
<componentref name="apache-httpclient" version="3.0.1"/>
<componentref name="apache-logging"
version="1.0.5.SP1-jboss"/>
<componentref name="apache-codec" version="1.3.0"/>
-
- <componentref name="jboss/common"
version="1.2.0.GA-brew"/>
- <componentref name="jboss/microcontainer"
version="1.0.2"/>
- <componentref name="apache-log4j" version="1.2.14"/>
- <componentref name="oswego-concurrent" version="1.3.4"/>
- <componentref name="jboss/jbossxb"
version="1.0.0.GA-brew"/>
- <componentref name="junit" version="3.8.1"/>
-
+-->
+ <!-- Cargo -->
<componentref name="codehaus/cargo"
version="0.9-portal"/>
- <!-- Based on
http://anonsvn.jboss.org/repos/jbossas/tags/EMBEDDED_JBOSS_BETA_2/build/b...
-->
-<!--
- <componentref name="jboss/microcontainer"
version="2.0.0.Beta3"/>
- <componentref name="jboss/aop" version="2.0.0.alpha4"/>
- <componentref name="jboss/jbossxb" version="2.0.0.CR2"/>
+ <!-- MC 2.0.0.Beta4 -->
+ <componentref name="jboss/microcontainer"
version="2.0.0.Beta4"/>
+ <componentref name="jboss/aop" version="2.0.0.alpha6"/>
+ <componentref name="jboss/jbossxb" version="2.0.0.CR4"/>
<componentref name="jboss/jboss-vfs"
version="2.0.0.Beta4"/>
- <componentref name="jboss/common-core"
version="2.0.4.Alpha"/>
- <componentref name="jboss/common-logging-log4j"
version="2.0.2.GA"/>
- <componentref name="jboss/common-logging-jdk"
version="2.0.2.GA"/>
- <componentref name="jboss/common-logging-spi"
version="2.0.2.GA"/>
- <componentref name="javassist" version="3.5.0.CR1"/>
- <componentref name="apache-log4j" version="1.2.14"/>
+ <componentref name="jboss/common-core"
version="2.2.1.GA"/>
+ <componentref name="jboss/common-logging-log4j"
version="2.0.2.GA"/> <!-- 2.0.3.GA -->
+ <componentref name="jboss/common-logging-jdk"
version="2.0.2.GA"/> <!-- 2.0.3.GA -->
+ <componentref name="jboss/common-logging-spi"
version="2.0.2.GA"/> <!-- 2.0.3.GA -->
+ <componentref name="javassist" version="3.6.0.CR1"/>
<!-- 3.6-beta -->
<componentref name="apache-xerces" version="2.7.1"/>
- <componentref name="sun-jaf" version="1.1"/>
<componentref name="junit" version="3.8.1"/>
+ <componentref name="apache-log4j" version="1.2.14"/>
+ <componentref name="sun-jaf" version="1.1"/>
<componentref name="wutka-dtdparser" version="1.2.1"/>
- <componentref name="trove" version="1.0.2"/>
--->
+ <componentref name="trove" version="1.0.2"/> <!--
2.1.1 -->
</build>
@@ -102,6 +97,4 @@
<!-- Generate the targets -->
<generate generate="jbossportal-thirdparty"/>
-
-
</project>
Modified: modules/web/trunk/build/ide/intellij/idea60/modules/web/web.iml
===================================================================
--- modules/web/trunk/build/ide/intellij/idea60/modules/web/web.iml 2007-10-22 19:51:57
UTC (rev 8741)
+++ modules/web/trunk/build/ide/intellij/idea60/modules/web/web.iml 2007-10-22 20:22:50
UTC (rev 8742)
@@ -65,7 +65,7 @@
<orderEntry type="module-library">
<library>
<CLASSES>
- <root
url="jar://$MODULE_DIR$/../../../../../../thirdparty/jboss-portal/modules/test/lib/portal-test-lib.jar!/"
/>
+ <root
url="jar://$MODULE_DIR$/../../../../../../thirdparty/jboss-portal/modules/common/lib/portal-common-mc-lib.jar!/"
/>
</CLASSES>
<JAVADOC />
<SOURCES />
@@ -74,7 +74,7 @@
<orderEntry type="module-library">
<library>
<CLASSES>
- <root
url="jar://$MODULE_DIR$/../../../../../../thirdparty/jboss-portal/modules/common/lib/portal-common-mc-lib.jar!/"
/>
+ <root
url="jar://$MODULE_DIR$/../../../../../../thirdparty/jboss-portal/modules/test/lib/jboss-unit-mc-lib.jar!/"
/>
</CLASSES>
<JAVADOC />
<SOURCES />
@@ -83,12 +83,30 @@
<orderEntry type="module-library">
<library>
<CLASSES>
- <root
url="jar://$MODULE_DIR$/../../../../../../thirdparty/jboss/common/lib/jboss-common.jar!/"
/>
+ <root
url="jar://$MODULE_DIR$/../../../../../../thirdparty/jboss-portal/modules/test/lib/jboss-unit-remote-lib.jar!/"
/>
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root
url="jar://$MODULE_DIR$/../../../../../../thirdparty/jboss-portal/modules/test/lib/jboss-unit-lib.jar!/"
/>
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root
url="jar://$MODULE_DIR$/../../../../../../thirdparty/jboss-portal/modules/test/lib/portal-test-lib.jar!/"
/>
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
<orderEntryProperties />
</component>
<component name="VcsManagerConfiguration">
Modified: modules/web/trunk/tools/etc/buildfragments/buildmagic.ent
===================================================================
--- modules/web/trunk/tools/etc/buildfragments/buildmagic.ent 2007-10-22 19:51:57 UTC (rev
8741)
+++ modules/web/trunk/tools/etc/buildfragments/buildmagic.ent 2007-10-22 20:22:50 UTC (rev
8742)
@@ -165,15 +165,6 @@
<property
file="${project.root}/build/etc/${portal.database}.properties"/>
<property name="hibernate.properties"
value="${project.root}/build/etc/${portal.database}.properties"/>
- <!-- Load the junit extension -->
- <path id="junit_.task.classpath">
- <pathelement location="${project.tools}/lib/explode.jar"/>
- </path>
- <taskdef
- name="junit_"
- classname="org.jboss.portal.common.junit.ant.ConfigurableJUnitTask"
- classpathref="junit_.task.classpath"/>
-
<!-- Setup the build timestamp & build identifer properties -->
<tstamp>
<format property="build.number" pattern="yyyyMMddHHmm"/>
@@ -676,57 +667,6 @@
</target>
<!-- end _default:tests-->
- <macrodef name="execute-tests">
- <element name="x-sysproperty" optional="true"/>
- <element name="x-test"/>
- <element name="x-classpath"/>
- <sequential>
- <property name="test.reports"
value="${module.output}/tests"/>
- <echo><![CDATA[
- build.reports=${build.reports}
- test.reports=${test.reports}
- module.output=${module.output}
- driver.path=${driver.path}
- junit.printsummary=${junit.printsummary}
- junit.batchtest.haltonerror=${junit.batchtest.haltonerror}
- junit.batchtest.haltonfailure=${junit.batchtest.haltonfailure}
- junit.batchtest.fork=${junit.batchtest.fork}
- junit.timeout=${junit.timeout}
- junit.jvm=${junit.jvm}
- junit.jvm.options=${junit.jvm.options}
- junit.formatter.usefile=${junit.formatter.usefile}
- ]]></echo>
- <mkdir dir="${build.reports}"/>
- <mkdir dir="${test.reports}"/>
- <junit_
- dir="${module.output}"
- printsummary="${junit.printsummary}"
- haltonerror="${junit.haltonerror}"
- haltonfailure="${junit.haltonfailure}"
- fork="${junit.fork}"
- timeout="${junit.timeout}"
- jvm="${junit.jvm}">
- <formatter type="plain" usefile="false"/>
- <formatter
-
classname="org.jboss.portal.common.junit.ant.ConfigurableXMLJUnitResultFormatter"
- usefile="${junit.formatter.usefile}"
- extension="${jboss-junit-configuration}.xml"/>
- <sysproperty key="build.resources"
value="${build.resources}"/>
- <sysproperty key="build.lib"
value="${build.lib}"/>
- <!-- definition of the property for keeping results between configuration
-->
- <sysproperty key="jboss-junit-configuration"
value="${jboss-junit-configuration}"/>
- <x-sysproperty/>
- <jvmarg value="${junit.jvm.options}"/>
- <x-test/>
- <classpath>
- <path refid="jboss.portal/modules/test.classpath"/>
- <pathelement path="${driver.path}"/>
- <x-classpath/>
- </classpath>
- </junit_>
- </sequential>
- </macrodef>
-
<!-- ================================================================== -->
<!-- Documents -->
<!-- ================================================================== -->
Modified: modules/web/trunk/tools/etc/buildfragments/defaults.ent
===================================================================
--- modules/web/trunk/tools/etc/buildfragments/defaults.ent 2007-10-22 19:51:57 UTC (rev
8741)
+++ modules/web/trunk/tools/etc/buildfragments/defaults.ent 2007-10-22 20:22:50 UTC (rev
8742)
@@ -118,8 +118,8 @@
<property name="javac.depend.cachedir"
value="${build.cache}/depends"/>
- <property name="javac.source" value="1.4"/>
- <property name="javac.target" value="1.4"/>
+ <property name="javac.source" value="1.5"/>
+ <property name="javac.target" value="1.5"/>
<property name="rmic.stubVersion" value="1.2"/>
<!-- classpath and local.classpath must have a value using with a path -->
Modified: modules/web/trunk/web/build.xml
===================================================================
--- modules/web/trunk/web/build.xml 2007-10-22 19:51:57 UTC (rev 8741)
+++ modules/web/trunk/web/build.xml 2007-10-22 20:22:50 UTC (rev 8742)
@@ -70,6 +70,7 @@
-->
<target name="init" unless="init.disable"
depends="_buildmagic:init">
+
</target>
<!--+====================================================================+-->
@@ -95,7 +96,7 @@
<path refid="apache.log4j.classpath"/>
<path refid="junit.junit.classpath"/>
<path refid="apache.tomcat.classpath"/>
- <path refid="jboss.common.classpath"/>
+ <path refid="jboss/common.core.classpath"/>
</path>
<!-- Configure modules -->
@@ -189,6 +190,68 @@
<target name="package-tests" depends="init">
+ <filelist id="mc.concurrent"
dir="${oswego.concurrent.lib}">
+ <file name="concurrent.jar"/>
+ </filelist>
+ <filelist id="mc.trove" dir="${trove.trove.lib}">
+ <file name="trove.jar"/>
+ </filelist>
+ <filelist id="mc.xerces" dir="${apache.xerces.lib}">
+ <file name="xercesImpl.jar"/>
+ <file name="resolver.jar"/>
+ <file name="xml-apis.jar"/>
+ </filelist>
+ <filelist id="mc.javassist"
dir="${javassist.javassist.lib}">
+ <file name="javassist.jar"/>
+ </filelist>
+ <filelist id="mc.jboss_common_logging_spi"
dir="${jboss/common.logging.spi.lib}">
+ <file name="jboss-logging-spi.jar"/>
+ </filelist>
+ <filelist id="mc.jboss_common_logging_jdk"
dir="${jboss/common.logging.jdk.lib}">
+ <file name="jboss-logging-jdk.jar"/>
+ </filelist>
+ <filelist id="mc.jboss_common_logging_log4j"
dir="${jboss/common.logging.log4j.lib}">
+ <file name="jboss-logging-log4j.jar"/>
+ </filelist>
+ <filelist id="mc.jboss_common_core"
dir="${jboss/common.core.lib}">
+ <file name="jboss-common-core.jar"/>
+ </filelist>
+ <filelist id="mc.jboss_vfs"
dir="${jboss/jboss.vfs.lib}">
+ <file name="jboss-vfs.jar"/>
+ </filelist>
+ <filelist id="mc.jboss_xb" dir="${jboss.jbossxb.lib}">
+ <file name="jboss-xml-binding.jar"/>
+ </filelist>
+ <filelist id="mc.jboss_aop" dir="${jboss.aop.lib}">
+ <file name="jboss-aop-as4-deployer.jar"/>
+ <file name="jboss-aop-deployer-jdk50.jar"/>
+ <file name="jboss-aop-jdk50.jar"/>
+ <file name="jboss-aop-jdk50-client.jar"/>
+ <file name="jboss-standalone-aspect-library-jdk50.jar"/>
+ <file name="jrockit-pluggable-instrumentor.jar"/>
+ <file name="pluggable-instrumentor.jar"/>
+ </filelist>
+ <filelist id="mc.jboss_microcontainer"
dir="${jboss.microcontainer.lib}">
+ <file name="jboss-aop-mc-int.jar"/>
+ <file name="jboss-classloader.jar"/>
+ <file name="jboss-container.jar"/>
+ <file name="jboss-container-metadata.jar"/>
+ <file name="jboss-container-metadata-spi.jar"/>
+ <file name="jboss-dependency.jar"/>
+ <file name="jboss-deployers-core.jar"/>
+ <file name="jboss-deployers-core-spi.jar"/>
+ <file name="jboss-deployers-client.jar"/>
+ <file name="jboss-deployers-client-spi.jar"/>
+ <file name="jboss-deployers-impl.jar"/>
+ <file name="jboss-deployers-spi.jar"/>
+ <file name="jboss-deployers-structure-spi.jar"/>
+ <file name="jboss-deployers-vfs.jar"/>
+ <file name="jboss-deployers-vfs-spi.jar"/>
+ <file name="jboss-managed.jar"/>
+ <file name="jboss-metatype.jar"/>
+ <file name="jboss-kernel.jar"/>
+ </filelist>
+
<!-- portal-web-test-lib.jar -->
<jar jarfile="${build.lib}/portal-web-test-lib.jar">
<fileset dir="${build.classes}"
includes="org/jboss/portal/test/web/spi/**"/>
@@ -203,14 +266,21 @@
<copy
todir="${build.resources}/test/spi/tomcat-6.0-container-servlet/server-war/WEB-INF/lib">
<fileset dir="${build.lib}"
includes="portal-web-test-lib.jar"/>
<fileset dir="${jboss.portal/modules/common.lib}"
includes="portal-common-mc-lib.jar"/>
- <fileset dir="${jboss.portal/modules/test.lib}"
includes="portal-test-lib.jar,portal-test-generic-lib.jar"/>
- <fileset dir="${jboss.microcontainer.lib}"
includes="jboss-container.jar,jboss-dependency.jar,jboss-microcontainer.jar"/>
- <fileset dir="${jboss.common.lib}"
includes="jboss-common.jar"/>
- <fileset dir="${oswego.concurrent.lib}"
includes="concurrent.jar"/>
+ <fileset dir="${jboss.portal/modules/test.lib}"
includes="jboss-unit-lib.jar,jboss-unit-mc-lib.jar,jboss-unit-remote-lib.jar,portal-test-generic-lib.jar,portal-test-lib.jar"/>
<fileset dir="${jboss.remoting.lib}"
includes="jboss-remoting.jar"/>
- <fileset dir="${jboss.jbossxb.lib}"
includes="jboss-xml-binding.jar"/>
<fileset dir="${apache.log4j.lib}"
includes="log4j.jar"/>
- <fileset dir="${apache.xerces.lib}"
includes="xercesImpl.jar"/>
+ <filelist refid="mc.concurrent"/>
+ <filelist refid="mc.trove"/>
+ <filelist refid="mc.xerces"/>
+ <filelist refid="mc.javassist"/>
+ <filelist refid="mc.jboss_common_logging_spi"/>
+ <filelist refid="mc.jboss_common_logging_jdk"/>
+ <filelist refid="mc.jboss_common_logging_log4j"/>
+ <filelist refid="mc.jboss_common_core"/>
+ <filelist refid="mc.jboss_vfs"/>
+ <filelist refid="mc.jboss_xb"/>
+ <filelist refid="mc.jboss_aop"/>
+ <filelist refid="mc.jboss_microcontainer"/>
</copy>
<mkdir dir="${build.lib}/tomcat-6.0-container-servlet"/>
<jar
jarfile="${build.lib}/tomcat-6.0-container-servlet/test-spi-server.war">
@@ -230,7 +300,21 @@
<copy
todir="${build.resources}/test/spi/tomcat-6.0-lifecycle-listener/server-war/WEB-INF/lib">
<fileset dir="${build.lib}"
includes="portal-web-test-lib.jar"/>
<fileset dir="${jboss.portal/modules/common.lib}"
includes="portal-common-mc-lib.jar"/>
- <fileset dir="${jboss.portal/modules/test.lib}"
includes="portal-test-lib.jar,portal-test-generic-lib.jar"/>
+ <fileset dir="${jboss.portal/modules/test.lib}"
includes="jboss-unit-lib.jar,jboss-unit-mc-lib.jar,jboss-unit-remote-lib.jar,portal-test-generic-lib.jar,portal-test-lib.jar"/>
+ <fileset dir="${jboss.remoting.lib}"
includes="jboss-remoting.jar"/>
+ <fileset dir="${apache.log4j.lib}"
includes="log4j.jar"/>
+ <filelist refid="mc.concurrent"/>
+ <filelist refid="mc.trove"/>
+ <filelist refid="mc.xerces"/>
+ <filelist refid="mc.javassist"/>
+ <filelist refid="mc.jboss_common_logging_spi"/>
+ <filelist refid="mc.jboss_common_logging_jdk"/>
+ <filelist refid="mc.jboss_common_logging_log4j"/>
+ <filelist refid="mc.jboss_common_core"/>
+ <filelist refid="mc.jboss_vfs"/>
+ <filelist refid="mc.jboss_xb"/>
+ <filelist refid="mc.jboss_aop"/>
+ <filelist refid="mc.jboss_microcontainer"/>
</copy>
<mkdir dir="${build.lib}/tomcat-6.0-lifecycle-listener"/>
<jar
jarfile="${build.lib}/tomcat-6.0-lifecycle-listener/test-spi-server.war">
@@ -251,14 +335,21 @@
<copy
todir="${build.resources}/test/spi/tomcat-6.0-generic/server-war/WEB-INF/lib">
<fileset dir="${build.lib}"
includes="portal-web-test-lib.jar"/>
<fileset dir="${jboss.portal/modules/common.lib}"
includes="portal-common-mc-lib.jar"/>
- <fileset dir="${jboss.portal/modules/test.lib}"
includes="portal-test-lib.jar,portal-test-generic-lib.jar"/>
- <fileset dir="${jboss.microcontainer.lib}"
includes="jboss-container.jar,jboss-dependency.jar,jboss-microcontainer.jar"/>
- <fileset dir="${jboss.common.lib}"
includes="jboss-common.jar"/>
- <fileset dir="${oswego.concurrent.lib}"
includes="concurrent.jar"/>
+ <fileset dir="${jboss.portal/modules/test.lib}"
includes="jboss-unit-lib.jar,jboss-unit-mc-lib.jar,jboss-unit-remote-lib.jar,portal-test-generic-lib.jar,portal-test-lib.jar"/>
<fileset dir="${jboss.remoting.lib}"
includes="jboss-remoting.jar"/>
- <fileset dir="${jboss.jbossxb.lib}"
includes="jboss-xml-binding.jar"/>
<fileset dir="${apache.log4j.lib}"
includes="log4j.jar"/>
- <fileset dir="${apache.xerces.lib}"
includes="xercesImpl.jar"/>
+ <filelist refid="mc.concurrent"/>
+ <filelist refid="mc.trove"/>
+ <filelist refid="mc.xerces"/>
+ <filelist refid="mc.javassist"/>
+ <filelist refid="mc.jboss_common_logging_spi"/>
+ <filelist refid="mc.jboss_common_logging_jdk"/>
+ <filelist refid="mc.jboss_common_logging_log4j"/>
+ <filelist refid="mc.jboss_common_core"/>
+ <filelist refid="mc.jboss_vfs"/>
+ <filelist refid="mc.jboss_xb"/>
+ <filelist refid="mc.jboss_aop"/>
+ <filelist refid="mc.jboss_microcontainer"/>
</copy>
<mkdir dir="${build.lib}/tomcat-6.0-generic"/>
<jar
jarfile="${build.lib}/tomcat-6.0-generic/test-spi-server.war">
@@ -279,6 +370,16 @@
<fileset dir="${build.lib}"
includes="portal-web-test-lib.jar"/>
<fileset dir="${jboss.portal/modules/common.lib}"
includes="portal-common-lib.jar,portal-common-mc-lib.jar"/>
<fileset dir="${jboss.portal/modules/test.lib}"
includes="portal-test-generic-lib.jar"/>
+ <filelist refid="mc.trove"/>
+ <filelist refid="mc.javassist"/>
+ <filelist refid="mc.jboss_common_logging_spi"/>
+ <filelist refid="mc.jboss_common_logging_jdk"/>
+ <filelist refid="mc.jboss_common_logging_log4j"/>
+ <filelist refid="mc.jboss_common_core"/>
+ <filelist refid="mc.jboss_vfs"/>
+ <filelist refid="mc.jboss_xb"/>
+ <filelist refid="mc.jboss_aop"/>
+ <filelist refid="mc.jboss_microcontainer"/>
</copy>
<mkdir dir="${build.lib}/jboss-4.2-container-servlet"/>
<jar
jarfile="${build.lib}/jboss-4.2-container-servlet/test-spi-server.war">
@@ -299,6 +400,16 @@
<fileset dir="${build.lib}"
includes="portal-web-test-lib.jar"/>
<fileset dir="${jboss.portal/modules/common.lib}"
includes="portal-common-lib.jar,portal-common-mc-lib.jar"/>
<fileset dir="${jboss.portal/modules/test.lib}"
includes="portal-test-generic-lib.jar"/>
+ <filelist refid="mc.trove"/>
+ <filelist refid="mc.javassist"/>
+ <filelist refid="mc.jboss_common_logging_spi"/>
+ <filelist refid="mc.jboss_common_logging_jdk"/>
+ <filelist refid="mc.jboss_common_logging_log4j"/>
+ <filelist refid="mc.jboss_common_core"/>
+ <filelist refid="mc.jboss_vfs"/>
+ <filelist refid="mc.jboss_xb"/>
+ <filelist refid="mc.jboss_aop"/>
+ <filelist refid="mc.jboss_microcontainer"/>
</copy>
<mkdir dir="${build.lib}/jboss-4.2-generic"/>
<jar jarfile="${build.lib}/jboss-4.2-generic/test-spi-server.war">
@@ -338,8 +449,8 @@
wait="${cargo.wait}">
<sharedClasspath>
<path
location="${jboss.portal/modules/common.lib}/portal-common-lib.jar"/>
- <path
location="${jboss.portal/modules/test.lib}/portal-test-lib.jar"/>
- <path location="${junit.junit.lib}/junit.jar"/>
+ <path
location="${jboss.portal/modules/test.lib}/jboss-unit-lib.jar"/>
+ <path
location="${jboss.portal/modules/test.lib}/jboss-unit-remote-lib.jar"/>
<path location="${build.lib}/portal-web-lib.jar"/>
</sharedClasspath>
<configuration>
@@ -501,7 +612,7 @@
</target>
<target name="tests.tomcat-6" depends="init">
- <fail message="Please set the environment variable
JBOSS_6_0_HOME">
+ <fail message="Please set the environment variable
TOMCAT_6_0_HOME">
<condition>
<and>
<not>
@@ -536,87 +647,127 @@
</target>
<target name="tests.local" depends="init">
- <execute-tests>
- <x-test>
- <test todir="${test.reports}"
name="org.jboss.portal.test.web.container.ServletContainerTestCase"/>
- </x-test>
- <x-sysproperty>
- <sysproperty key="test.root"
value="${build.lib}"/>
-<!--
- <jvmarg value="-Xdebug"/>
- <jvmarg
value="-Xrunjdwp:transport=dt_socket,address=7878,server=y,suspend=y"/>
--->
- </x-sysproperty>
- <x-classpath>
+
+
+ <path id="jboss.unit.tooling.test.classpath">
+ <pathelement
location="${jboss.portal/modules/test.lib}/jboss-unit-tooling-lib.jar"/>
+ </path>
+
+ <taskdef
+ name="jboss-unit"
+ classname="org.jboss.unit.tooling.ant.JBossUnitTask"
+ classpathref="jboss.unit.tooling.test.classpath"/>
+
+ <jboss-unit>
+
+ <tests config="${build.resources}/test/local-jboss-unit.xml">
+ </tests>
+
+ <reports>
+ <xml toDir="output/tests/xml/local"/>
+ <html toDir="output/tests/html/local"/>
+ </reports>
+
+ <classpath>
+ <pathelement location="${build.resources}/test/config"/>
+ <path refid="jboss.portal/modules/common.classpath"/>
+ <path refid="jboss.portal/modules/test.classpath"/>
<pathelement location="${build.lib}/portal-web-lib.jar"/>
<pathelement
location="${build.lib}/portal-web-test-lib.jar"/>
- <pathelement location="${build.resources}/test/config"/>
+
+ <path location="../tools/lib/ant.jar"/>
+ <path location="../tools/lib/ant-launcher.jar"/>
+
+ <path refid="apache.log4j.classpath"/>
<path refid="oswego.concurrent.classpath"/>
<path refid="jboss.remoting.classpath"/>
<path refid="jboss.microcontainer.classpath"/>
+ <path refid="jboss.aop.classpath"/>
+ <path refid="jboss/jboss.vfs.classpath"/>
+ <path refid="jboss/common.core.classpath"/>
+ <path refid="jboss/common.logging.log4j.classpath"/>
+ <path refid="jboss/common.logging.jdk.classpath"/>
+ <path refid="jboss/common.logging.spi.classpath"/>
+ <path refid="trove.trove.classpath"/>
+ <path refid="javassist.javassist.classpath"/>
<path refid="jboss.jbossxb.classpath"/>
<path refid="apache.xerces.classpath"/>
-
- <path refid="jboss.common.classpath"/>
-
<path refid="apache.httpclient.classpath"/>
<path refid="apache.logging.classpath"/>
<path refid="apache.codec.classpath"/>
- <pathelement location="${build.resources}/test"/>
- <pathelement location="${source.java}"/>
- <pathelement
location="${jboss.portal-portlet.root}/classes"/>
- <pathelement
location="${jboss.portal/modules/test.lib}/portal-test-generic-lib.jar"/>
<path refid="codehaus.cargo.classpath"/>
- <path refid="library.classpath"/>
- <path refid="dependentmodule.classpath"/>
- </x-classpath>
- </execute-tests>
+ </classpath>
+
+ </jboss-unit>
+
</target>
+
<target name="tests.remote" depends="init">
- <execute-tests>
- <x-test>
- <zest
- todir="${test.reports}"
- name="org.jboss.portal.test.web.spi.SPITestCase"
-
outfile="TEST-${test.id}.org.jboss.portal.test.web.spi.SPITestCase"
- id="org.jboss.portal.test.web.spi.SPITestCase,${test.id}">
- <parameter name="serverName"
value="${test.server.name}"/>
- </zest>
- </x-test>
- <x-sysproperty>
- <sysproperty key="test.root"
value="${test.deploy.dir}"/>
-<!--
- <jvmarg value="-Xdebug"/>
- <jvmarg
value="-Xrunjdwp:transport=dt_socket,address=7878,server=y,suspend=y"/>
--->
- </x-sysproperty>
- <x-classpath>
+
+ <path id="jboss.unit.tooling.test.classpath">
+ <pathelement
location="${jboss.portal/modules/test.lib}/jboss-unit-tooling-lib.jar"/>
+ </path>
+
+ <taskdef
+ name="jboss-unit"
+ classname="org.jboss.unit.tooling.ant.JBossUnitTask"
+ classpathref="jboss.unit.tooling.test.classpath"/>
+
+ <jboss-unit>
+
+ <tests config="${build.resources}/test/remote-jboss-unit.xml">
+ <property name="archivePath"
value="${test.deploy.dir}"/>
+ <property name="serverName"
value="${test.server.name}"/>
+ </tests>
+
+ <reports>
+ <xml toDir="output/tests/xml/${test.server.name}"/>
+ <html toDir="output/tests/html/${test.server.name}"/>
+ </reports>
+
+ <classpath>
+ <pathelement location="${build.resources}/test/config"/>
+ <path refid="jboss.portal/modules/common.classpath"/>
+ <path refid="jboss.portal/modules/test.classpath"/>
<pathelement location="${build.lib}/portal-web-lib.jar"/>
<pathelement
location="${build.lib}/portal-web-test-lib.jar"/>
- <!-- The server config -->
- <pathelement location="${build.resources}/test/config"/>
-
+ <path location="../tools/lib/ant.jar"/>
+ <path location="../tools/lib/ant-launcher.jar"/>
+
+ <path refid="apache.log4j.classpath"/>
<path refid="oswego.concurrent.classpath"/>
-
<path refid="jboss.remoting.classpath"/>
<path refid="jboss.microcontainer.classpath"/>
+ <path refid="jboss.aop.classpath"/>
+ <path refid="jboss/jboss.vfs.classpath"/>
+ <path refid="jboss/common.core.classpath"/>
+ <path refid="jboss/common.logging.log4j.classpath"/>
+ <path refid="jboss/common.logging.jdk.classpath"/>
+ <path refid="jboss/common.logging.spi.classpath"/>
+ <path refid="trove.trove.classpath"/>
+ <path refid="javassist.javassist.classpath"/>
<path refid="jboss.jbossxb.classpath"/>
<path refid="apache.xerces.classpath"/>
-
- <path refid="jboss.common.classpath"/>
-
<path refid="apache.httpclient.classpath"/>
<path refid="apache.logging.classpath"/>
<path refid="apache.codec.classpath"/>
- <pathelement
location="${jboss.portal/modules/test.lib}/portal-test-generic-lib.jar"/>
<path refid="codehaus.cargo.classpath"/>
- <path refid="library.classpath"/>
- <path refid="dependentmodule.classpath"/>
- </x-classpath>
- </execute-tests>
+ </classpath>
+
+ </jboss-unit>
+
</target>
+ <target name="reports" depends="init">
+ <junitreport todir="output/tests">
+ <fileset dir="output/tests">
+ <include name="TEST-*.xml"/>
+ </fileset>
+ <report format="frames" todir="output/tests"/>
+ </junitreport>
+ </target>
+
</project>
Modified:
modules/web/trunk/web/src/main/org/jboss/portal/test/web/container/ServletContainerTestCase.java
===================================================================
---
modules/web/trunk/web/src/main/org/jboss/portal/test/web/container/ServletContainerTestCase.java 2007-10-22
19:51:57 UTC (rev 8741)
+++
modules/web/trunk/web/src/main/org/jboss/portal/test/web/container/ServletContainerTestCase.java 2007-10-22
20:22:50 UTC (rev 8742)
@@ -22,22 +22,26 @@
******************************************************************************/
package org.jboss.portal.test.web.container;
-import junit.framework.TestCase;
import org.jboss.portal.web.ServletContainer;
import org.jboss.portal.web.WebAppListener;
import org.jboss.portal.web.WebAppEvent;
import org.jboss.portal.web.spi.ServletContainerContext;
import org.jboss.portal.common.util.CollectionBuilder;
import org.jboss.portal.test.web.WebAppRegistry;
+import org.jboss.unit.api.pojo.annotations.Test;
import EDU.oswego.cs.dl.util.concurrent.SynchronizedBoolean;
+import static org.jboss.unit.api.Assert.*;
+
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
* @version $Revision: 1.1 $
*/
-public class ServletContainerTestCase extends TestCase
+@Test
+public class ServletContainerTestCase
{
+ @Test
public void testContextRegistrationLifeCycle()
{
ServletContainer container = new ServletContainer();
@@ -85,6 +89,7 @@
}
}
+ @Test
public void testConcurrentContextRegistrations()
{
ServletContainer container = new ServletContainer();
@@ -113,6 +118,7 @@
assertNotNull(scc2.registration);
}
+ @Test
public void testContextRegistrationCancellationUnregistersWebApps()
{
ServletContainer container = new ServletContainer();
@@ -135,6 +141,7 @@
assertEquals(new CollectionBuilder().toHashSet(), registry.getKeys());
}
+ @Test
public void testListenerDoubleRegistration()
{
ServletContainer container = new ServletContainer();
@@ -163,6 +170,7 @@
assertEquals(new CollectionBuilder().toHashSet(), registry.getKeys());
}
+ @Test
public void testListenerIsNotified()
{
ServletContainer container = new ServletContainer();
@@ -207,6 +215,7 @@
assertEquals(new CollectionBuilder().toHashSet(), registry.getKeys());
}
+ @Test
public void testServletContainerThrowsIAE()
{
ServletContainer container = new ServletContainer();
@@ -236,6 +245,7 @@
}
}
+ @Test
public void testServletContainerThrowsISE() throws Exception
{
ServletContainer container = new ServletContainer();
@@ -249,6 +259,7 @@
}
}
+ @Test
public void testListenerFailure()
{
ServletContainer container = new ServletContainer();
Deleted: modules/web/trunk/web/src/main/org/jboss/portal/test/web/spi/SPITestCase.java
===================================================================
---
modules/web/trunk/web/src/main/org/jboss/portal/test/web/spi/SPITestCase.java 2007-10-22
19:51:57 UTC (rev 8741)
+++
modules/web/trunk/web/src/main/org/jboss/portal/test/web/spi/SPITestCase.java 2007-10-22
20:22:50 UTC (rev 8742)
@@ -1,158 +0,0 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2006, Red Hat Middleware, LLC, and individual *
- * contributors as indicated by the @authors tag. See the *
- * copyright.txt in the distribution for a full listing of *
- * individual contributors. *
- * *
- * This is free software; you can redistribute it and/or modify it *
- * under the terms of the GNU Lesser General Public License as *
- * published by the Free Software Foundation; either version 2.1 of *
- * the License, or (at your option) any later version. *
- * *
- * This software is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
- * Lesser General Public License for more details. *
- * *
- * You should have received a copy of the GNU Lesser General Public *
- * License along with this software; if not, write to the Free *
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
- ******************************************************************************/
-package org.jboss.portal.test.web.spi;
-
-import junit.framework.TestCase;
-import junit.framework.TestResult;
-import org.jboss.portal.test.framework.mc.TestRuntimeContext;
-import org.jboss.portal.test.framework.deployment.Deployer;
-import org.jboss.portal.test.framework.server.NodeManager;
-import org.jboss.portal.test.framework.driver.TestDriver;
-import org.jboss.portal.test.framework.junit.JUnitAdapter;
-
-/**
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 1.1 $
- */
-public class SPITestCase extends TestCase
-{
-
- /** The deployer. */
- private Deployer deployer;
-
- /** The node manager. */
- private NodeManager nodeManager;
-
- /** . */
- private TestRuntimeContext runtimeContext;
-
- /** . */
- private TestDriver testDriver;
-
- /** . */
- private JUnitAdapter adapter;
-
- /** . */
- private SPITestConfig config;
-
- public SPITestConfig getConfig()
- {
- return config;
- }
-
- public void setConfig(SPITestConfig config)
- {
- this.config = config;
- }
-
- public Deployer getDeployer()
- {
- return deployer;
- }
-
- public void setDeployer(Deployer deployer)
- {
- this.deployer = deployer;
- }
-
- public NodeManager getNodeManager()
- {
- return nodeManager;
- }
-
- public void setNodeManager(NodeManager nodeManager)
- {
- this.nodeManager = nodeManager;
- }
-
- public TestDriver getTestDriver()
- {
- return testDriver;
- }
-
- public void setTestDriver(TestDriver testDriver)
- {
- this.testDriver = testDriver;
- }
-
- public JUnitAdapter getAdapter()
- {
- return adapter;
- }
-
- public void setAdapter(JUnitAdapter adapter)
- {
- this.adapter = adapter;
- }
-
- public void run(TestResult testResult)
- {
- try
- {
- runtimeContext = new
TestRuntimeContext("org/jboss/portal/test/web/spi/client-beans.xml");
- runtimeContext.addBean("This", this);
- runtimeContext.addBean("Config", new SPITestConfig());
- runtimeContext.start();
- }
- catch (Exception e)
- {
- try
- {
- this.e = e;
-
- //
- super.run(testResult);
- }
- catch (Exception e1)
- {
- this.e = null;
- }
-
- //
- return;
- }
-
- //
- try
- {
- adapter.run(testResult);
- }
- finally
- {
- runtimeContext.stop();
- }
- }
-
- /** . */
- private Exception e;
-
- public void runBare() throws Throwable
- {
- throw e;
- }
-
- public void testDummy()
- {
- throw new UnsupportedOperationException();
- }
-}
Deleted: modules/web/trunk/web/src/main/org/jboss/portal/test/web/spi/SPITestConfig.java
===================================================================
---
modules/web/trunk/web/src/main/org/jboss/portal/test/web/spi/SPITestConfig.java 2007-10-22
19:51:57 UTC (rev 8741)
+++
modules/web/trunk/web/src/main/org/jboss/portal/test/web/spi/SPITestConfig.java 2007-10-22
20:22:50 UTC (rev 8742)
@@ -1,62 +0,0 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2006, Red Hat Middleware, LLC, and individual *
- * contributors as indicated by the @authors tag. See the *
- * copyright.txt in the distribution for a full listing of *
- * individual contributors. *
- * *
- * This is free software; you can redistribute it and/or modify it *
- * under the terms of the GNU Lesser General Public License as *
- * published by the Free Software Foundation; either version 2.1 of *
- * the License, or (at your option) any later version. *
- * *
- * This software is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
- * Lesser General Public License for more details. *
- * *
- * You should have received a copy of the GNU Lesser General Public *
- * License along with this software; if not, write to the Free *
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
- ******************************************************************************/
-package org.jboss.portal.test.web.spi;
-
-import org.jboss.portal.test.framework.TestParametrization;
-import org.jboss.portal.test.framework.TestParameterValue;
-import org.jboss.portal.test.framework.junit.JUnitAdapter;
-
-/**
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 1.1 $
- */
-public class SPITestConfig
-{
-
- public String getArchivePath()
- {
- return System.getProperty("test.root");
- }
-
- /**
- * Returns the server name from the test parametrization. If no value is found then
it
- * returns the litteral string <i>RemoteTomcat-6.0</i>.
- *
- * @return the server name
- */
- public String getServerName()
- {
- TestParametrization parametrization = JUnitAdapter.getParametrization();
- TestParameterValue archive =
parametrization.getParameterValue("serverName");
-
- //
- if (archive != null)
- {
- return (String)archive.get();
- }
- else
- {
- return "RemoteTomcat-6.0";
- }
- }
-}
Modified:
modules/web/trunk/web/src/main/org/jboss/portal/test/web/spi/SPITestServlet.java
===================================================================
---
modules/web/trunk/web/src/main/org/jboss/portal/test/web/spi/SPITestServlet.java 2007-10-22
19:51:57 UTC (rev 8741)
+++
modules/web/trunk/web/src/main/org/jboss/portal/test/web/spi/SPITestServlet.java 2007-10-22
20:22:50 UTC (rev 8742)
@@ -22,19 +22,6 @@
******************************************************************************/
package org.jboss.portal.test.web.spi;
-import org.jboss.portal.test.framework.driver.TestDriverContainer;
-import org.jboss.portal.test.framework.driver.DriverResponse;
-import org.jboss.portal.test.framework.driver.DriverCommand;
-import org.jboss.portal.test.framework.driver.TestDriverException;
-import org.jboss.portal.test.framework.driver.http.response.InvokeGetResponse;
-import org.jboss.portal.test.framework.driver.remote.RemoteTestDriver;
-import org.jboss.portal.test.framework.driver.remote.TestContext;
-import org.jboss.portal.test.framework.driver.remote.response.DeployResponse;
-import org.jboss.portal.test.framework.driver.remote.response.UndeployResponse;
-import org.jboss.portal.test.framework.driver.response.EndTestResponse;
-import org.jboss.portal.test.framework.driver.response.FailureResponse;
-import org.jboss.portal.test.framework.info.TestItemInfo;
-import org.jboss.portal.test.framework.info.TestInfo;
import org.jboss.portal.test.web.WebAppRegistry;
import org.jboss.portal.test.web.spi.callbacks.NormalCallback;
import org.jboss.portal.test.web.spi.callbacks.ExceptionCallback;
@@ -42,6 +29,25 @@
import org.jboss.portal.web.WebApp;
import org.jboss.portal.web.ServletContextDispatcher;
import org.jboss.portal.web.impl.DefaultServletContainerFactory;
+import org.jboss.unit.info.TestInfo;
+import org.jboss.unit.info.impl.SimpleTestCaseInfo;
+import org.jboss.unit.driver.DriverResponse;
+import org.jboss.unit.driver.DriverCommand;
+import org.jboss.unit.driver.DriverContext;
+import org.jboss.unit.driver.DriverException;
+import org.jboss.unit.driver.impl.composite.CompositeTestDriver;
+import org.jboss.unit.driver.response.FailureResponse;
+import org.jboss.unit.driver.response.EndTestResponse;
+import org.jboss.unit.remote.driver.RemoteTestDriverServer;
+import org.jboss.unit.remote.driver.RemoteTestDriver;
+import org.jboss.unit.remote.driver.CompositeRemoteTestDriver;
+import org.jboss.unit.remote.driver.handler.deployer.response.UndeployResponse;
+import org.jboss.unit.remote.driver.handler.deployer.response.DeployResponse;
+import org.jboss.unit.remote.driver.handler.http.response.InvokeGetResponse;
+import org.jboss.unit.remote.ResponseContext;
+import org.jboss.unit.remote.RequestContext;
+import org.jboss.unit.Failure;
+import org.jboss.unit.TestId;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
@@ -49,8 +55,11 @@
import javax.servlet.ServletException;
import javax.servlet.ServletContext;
import java.io.IOException;
+import java.io.Serializable;
import java.util.Set;
import java.util.HashSet;
+import java.util.HashMap;
+import java.util.Collection;
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
@@ -60,53 +69,69 @@
{
/** . */
- private TestInfo info = new TestInfo("Main");
+ private TestInfo info = new SimpleTestCaseInfo("test");
/** . */
private WebAppRegistry registry;
/** . */
- private Set keys;
+ private Set<String> keys;
/** . */
private ServletContainer container;
+ /** . */
+ private RemoteTestDriverServer driver;
+
+ /** . */
+ private RequestContext requestContext;
+
+ /** . */
+ private ResponseContext responseContext;
+
public void init() throws ServletException
{
- TestDriverContainer driver =
(TestDriverContainer)getServletContext().getAttribute("TestDriverServer");
- driver.addDriver(this);
+ try
+ {
+ CompositeTestDriver suite = new CompositeTestDriver(getClass().getName());
+ CompositeRemoteTestDriver remoteSuite = new CompositeRemoteTestDriver(suite);
+ suite.mount(this);
+ driver =
(RemoteTestDriverServer)getServletContext().getAttribute("TestDriverServer");
+ driver.setDelegate(remoteSuite);
+ }
+ catch (DriverException e)
+ {
+ throw new ServletException(e);
+ }
}
- private TestContext testContext;
-
- public void pushContext(String testId, TestContext testContext)
+ public void destroy()
{
- this.testContext = testContext;
+ driver.setDelegate(null);
+ driver = null;
}
- public TestContext popContext(String string)
+
+ public void initDriver(DriverContext driverContext)
{
- return testContext;
+
}
- public void destroy()
+ public void destroyDriver()
{
- TestDriverContainer driver =
(TestDriverContainer)getServletContext().getAttribute("TestDriverServer");
- driver.removeDriver(this);
+
}
protected void service(HttpServletRequest req, HttpServletResponse resp) throws
ServletException, IOException
{
DriverResponse response = service2(req, resp);
- testContext.setResponse(response);
+ responseContext = new ResponseContext(response, new HashMap<String,
Serializable>());
resp.setStatus(200);
}
private DriverResponse service2(HttpServletRequest req, HttpServletResponse resp)
throws ServletException, IOException
{
-
- //
- if (testContext.isRequestCount(1))
+ if (requestContext.isRequestCount(1))
{
// Should try
ServletContext appContext =
getServletContext().getContext("/test-spi-app");
@@ -114,7 +139,7 @@
//
if (appContext == null)
{
- return new FailureResponse("Cannot get access to the /test-spi-app
servlet context");
+ return new FailureResponse(Failure.createErrorFailure("Cannot get access
to the /test-spi-app servlet context"));
}
//
@@ -146,12 +171,12 @@
// Now we undeploy
return new UndeployResponse("test-spi-app.war");
}
- else if (testContext.isRequestCount(2))
+ else if (requestContext.isRequestCount(2))
{
if (!keys.equals(registry.getKeys()))
{
- return new FailureResponse("The set of deployed web applications "
+ registry.getKeys() + " is not equals to the expected set " +
- keys);
+ return new FailureResponse(Failure.createAssertionFailure("The set of
deployed web applications " + registry.getKeys() + " is not equals to the
expected set " +
+ keys));
}
// Remove registration
@@ -160,7 +185,7 @@
//
if (registry.getKeys().size() > 0)
{
- return new FailureResponse("The set of deployed web application should
be empty instead of " + registry.getKeys());
+ return new FailureResponse(Failure.createAssertionFailure("The set of
deployed web application should be empty instead of " + registry.getKeys()));
}
else
{
@@ -169,59 +194,70 @@
}
//
- return new FailureResponse();
+ return new FailureResponse(Failure.createAssertionFailure(""));
}
- public TestItemInfo getInfo()
+
+ public void pushContext(TestId testId, RequestContext requestContext)
{
+ this.requestContext = requestContext;
+ }
+
+ public ResponseContext popContext(TestId testId)
+ {
+ return responseContext;
+ }
+
+ public TestInfo getInfo()
+ {
return info;
}
- public DriverResponse invoke(String string, DriverCommand driverCommand) throws
TestDriverException
+ public DriverResponse invoke(TestId testId, DriverCommand driverCommand)
{
- if (testContext.isRequestCount(-1))
+ if (requestContext.isRequestCount(-1))
{
container = DefaultServletContainerFactory.getInstance().getServletContainer();
if (container == null)
{
- return new FailureResponse("No servlet container present");
+ return new FailureResponse(Failure.createAssertionFailure("No servlet
container present"));
}
// Register and save the deployed web apps
registry = new WebAppRegistry();
container.addWebAppListener(registry);
- keys = new HashSet(registry.getKeys());
+ keys = new HashSet<String>((Collection<? extends
String>)registry.getKeys());
// Deploy the application web app
return new DeployResponse("test-spi-app.war");
}
- else if (testContext.isRequestCount(0))
+ else if (requestContext.isRequestCount(0))
{
// Compute the difference with the previous deployed web apps
- Set diff = new HashSet(registry.getKeys());
+ Set diff = new HashSet<String>((Collection<? extends
String>)registry.getKeys());
diff.removeAll(keys);
// It should be 1
if (diff.size() != 1)
{
- return new FailureResponse("The size of the new web application deployed
should be 1, it is " + diff.size() + " instead." +
- "The previous set was " + keys + " and the new set is " +
registry.getKeys());
+ return new FailureResponse(Failure.createAssertionFailure("The size of
the new web application deployed should be 1, it is " + diff.size() + "
instead." +
+ "The previous set was " + keys + " and the new set is " +
registry.getKeys()));
}
String key = (String)diff.iterator().next();
if (!"/test-spi-app".equals(key))
{
- return new FailureResponse("The newly deployed web application should be
/test-spi-war and it is " + key);
+ return new FailureResponse(Failure.createAssertionFailure("The newly
deployed web application should be /test-spi-war and it is " + key));
}
//
WebApp webApp = registry.getWebApp("/test-spi-app");
if (webApp == null)
{
- return new FailureResponse("The web app /test-spi-app was not
found");
+ return new FailureResponse(Failure.createAssertionFailure("The web app
/test-spi-app was not found"));
}
if (!"/test-spi-app".equals(webApp.getContextPath()))
{
- return new FailureResponse("The web app context is not equals to the
expected value but has the value " + webApp.getContextPath());
+ return new FailureResponse(Failure.createAssertionFailure("The web app
context is not equals to the expected value but has the value " +
webApp.getContextPath()));
}
//
@@ -229,7 +265,7 @@
}
else
{
- return new FailureResponse();
+ return new FailureResponse(Failure.createAssertionFailure(""));
}
}
}
Modified:
modules/web/trunk/web/src/main/org/jboss/portal/test/web/spi/callbacks/AbstractCallback.java
===================================================================
---
modules/web/trunk/web/src/main/org/jboss/portal/test/web/spi/callbacks/AbstractCallback.java 2007-10-22
19:51:57 UTC (rev 8741)
+++
modules/web/trunk/web/src/main/org/jboss/portal/test/web/spi/callbacks/AbstractCallback.java 2007-10-22
20:22:50 UTC (rev 8742)
@@ -22,9 +22,9 @@
******************************************************************************/
package org.jboss.portal.test.web.spi.callbacks;
-import org.jboss.portal.test.framework.driver.DriverResponse;
import org.jboss.portal.web.RequestDispatchCallback;
import org.jboss.portal.web.ServletContextDispatcher;
+import org.jboss.unit.driver.DriverResponse;
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
Modified:
modules/web/trunk/web/src/main/org/jboss/portal/test/web/spi/callbacks/ExceptionCallback.java
===================================================================
---
modules/web/trunk/web/src/main/org/jboss/portal/test/web/spi/callbacks/ExceptionCallback.java 2007-10-22
19:51:57 UTC (rev 8741)
+++
modules/web/trunk/web/src/main/org/jboss/portal/test/web/spi/callbacks/ExceptionCallback.java 2007-10-22
20:22:50 UTC (rev 8742)
@@ -22,9 +22,10 @@
******************************************************************************/
package org.jboss.portal.test.web.spi.callbacks;
-import org.jboss.portal.test.framework.driver.DriverResponse;
-import org.jboss.portal.test.framework.driver.response.FailureResponse;
import org.jboss.portal.web.ServletContextDispatcher;
+import org.jboss.unit.driver.DriverResponse;
+import org.jboss.unit.driver.response.FailureResponse;
+import org.jboss.unit.Failure;
import javax.servlet.ServletContext;
import javax.servlet.ServletException;
@@ -62,7 +63,7 @@
dispatcher.include(target, this, null);
//
- return new FailureResponse("Got no throwable thrown was expecting " +
expectedThrowable);
+ return new FailureResponse(Failure.createAssertionFailure("Got no throwable
thrown was expecting " + expectedThrowable));
}
catch (Throwable throwable)
{
@@ -72,7 +73,7 @@
}
if (expectedThrowable != throwable)
{
- return new FailureResponse("Got throwable " + throwable + "
instead of throwable " + expectedThrowable);
+ return new FailureResponse(Failure.createAssertionFailure("Got throwable
" + throwable + " instead of throwable " + expectedThrowable));
}
}
Modified:
modules/web/trunk/web/src/main/org/jboss/portal/test/web/spi/callbacks/NormalCallback.java
===================================================================
---
modules/web/trunk/web/src/main/org/jboss/portal/test/web/spi/callbacks/NormalCallback.java 2007-10-22
19:51:57 UTC (rev 8741)
+++
modules/web/trunk/web/src/main/org/jboss/portal/test/web/spi/callbacks/NormalCallback.java 2007-10-22
20:22:50 UTC (rev 8742)
@@ -23,8 +23,9 @@
package org.jboss.portal.test.web.spi.callbacks;
import org.jboss.portal.web.ServletContextDispatcher;
-import org.jboss.portal.test.framework.driver.DriverResponse;
-import org.jboss.portal.test.framework.driver.response.FailureResponse;
+import org.jboss.unit.driver.response.FailureResponse;
+import org.jboss.unit.driver.DriverResponse;
+import org.jboss.unit.Failure;
import javax.servlet.ServletContext;
import javax.servlet.ServletException;
@@ -91,24 +92,24 @@
//
if (!invoked)
{
- return new FailureResponse("The callback was not invoked");
+ return new FailureResponse(Failure.createAssertionFailure("The callback
was not invoked"));
}
if (expectedHandback != handback)
{
- return new FailureResponse("The provided handback is not the same than
the expected handback");
+ return new FailureResponse(Failure.createAssertionFailure("The provided
handback is not the same than the expected handback"));
}
if (expectedReturnedValue != returnedValue)
{
- return new FailureResponse("The returned value is not the same than the
expected one");
+ return new FailureResponse(Failure.createAssertionFailure("The returned
value is not the same than the expected one"));
}
if (expectedThreadContextClassLoader != threadContextClassLoader)
{
- return new FailureResponse("The thread context class loader is not the
same than the expected one");
+ return new FailureResponse(Failure.createAssertionFailure("The thread
context class loader is not the same than the expected one"));
}
}
catch (Exception e)
{
- return new FailureResponse(e);
+ return new FailureResponse(Failure.createErrorFailure(e));
}
//
Deleted:
modules/web/trunk/web/src/resources/portal-web-test-jar/org/jboss/portal/test/web/spi/client-beans.xml
===================================================================
---
modules/web/trunk/web/src/resources/portal-web-test-jar/org/jboss/portal/test/web/spi/client-beans.xml 2007-10-22
19:51:57 UTC (rev 8741)
+++
modules/web/trunk/web/src/resources/portal-web-test-jar/org/jboss/portal/test/web/spi/client-beans.xml 2007-10-22
20:22:50 UTC (rev 8742)
@@ -1,89 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- ~ JBoss, a division of Red Hat ~
- ~ Copyright 2006, Red Hat Middleware, LLC, and individual ~
- ~ contributors as indicated by the @authors tag. See the ~
- ~ copyright.txt in the distribution for a full listing of ~
- ~ individual contributors. ~
- ~ ~
- ~ This is free software; you can redistribute it and/or modify it ~
- ~ under the terms of the GNU Lesser General Public License as ~
- ~ published by the Free Software Foundation; either version 2.1 of ~
- ~ the License, or (at your option) any later version. ~
- ~ ~
- ~ This software is distributed in the hope that it will be useful, ~
- ~ but WITHOUT ANY WARRANTY; without even the implied warranty of ~
- ~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ~
- ~ Lesser General Public License for more details. ~
- ~ ~
- ~ You should have received a copy of the GNU Lesser General Public ~
- ~ License along with this software; if not, write to the Free ~
- ~ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA ~
- ~ 02110-1301 USA, or see the FSF site:
http://www.fsf.org. ~
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
-
-<deployment
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="urn:jboss:bean-deployer bean-deployer_1_0.xsd"
- xmlns="urn:jboss:bean-deployer">
-
- <bean name="Config"
class="org.jboss.portal.test.web.spi.SPITestConfig">
- <constructor factoryMethod="getBean">
- <factory bean="BeanFactory"/>
- <parameter>Config</parameter>
- </constructor>
- </bean>
-
- <bean name="NodeFactory"
class="org.jboss.portal.test.framework.impl.generic.server.GenericNodeFactory">
- <constructor>
- <parameter>servers.xml</parameter>
- <parameter><inject bean="Config"
property="serverName"/></parameter>
- </constructor>
- </bean>
-
- <bean name="Node0"
class="org.jboss.portal.test.framework.impl.generic.server.GenericNode">
- <constructor factoryMethod="getNode">
- <factory bean="NodeFactory" />
- <parameter>default</parameter>
- </constructor>
- </bean>
-
- <bean name="NodeManager"
class="org.jboss.portal.test.framework.server.NodeManager">
- <constructor>
- <parameter>
- <list>
- <inject bean="Node0"/>
- </list>
- </parameter>
- </constructor>
- </bean>
-
- <bean name="Deployer"
class="org.jboss.portal.test.framework.deployment.Deployer">
- </bean>
-
- <bean name="TestDriverClient"
class="org.jboss.portal.test.framework.driver.remote.RemoteTestDriverClient">
- <property name="initialNodeId"><inject bean="Node0"
property="id"/></property>
- <property name="archivePath"><inject bean="Config"
property="archivePath"/></property>
- <property name="nodeManager"><inject
bean="NodeManager"/></property>
- <property name="deployer"><inject
bean="Deployer"/></property>
- </bean>
-
- <bean name="JUnitAdapter"
class="org.jboss.portal.test.framework.junit.JUnitAdapter">
- <constructor>
- <parameter><inject
bean="TestDriverClient"/></parameter>
- </constructor>
- </bean>
-
- <bean name="This"
class="org.jboss.portal.test.web.spi.SPITestCase">
- <constructor factoryMethod="getBean">
- <factory bean="BeanFactory"/>
- <parameter>This</parameter>
- </constructor>
- <property name="testDriver"><inject
bean="TestDriverClient"/></property>
- <property name="deployer"><inject
bean="Deployer"/></property>
- <property name="nodeManager"><inject
bean="NodeManager"/></property>
- <property name="adapter"><inject
bean="JUnitAdapter"/></property>
- <property name="config"><inject
bean="Config"/></property>
- </bean>
-
-</deployment>
Modified:
modules/web/trunk/web/src/resources/portal-web-test-jar/org/jboss/portal/test/web/spi/server-beans.xml
===================================================================
---
modules/web/trunk/web/src/resources/portal-web-test-jar/org/jboss/portal/test/web/spi/server-beans.xml 2007-10-22
19:51:57 UTC (rev 8741)
+++
modules/web/trunk/web/src/resources/portal-web-test-jar/org/jboss/portal/test/web/spi/server-beans.xml 2007-10-22
20:22:50 UTC (rev 8742)
@@ -27,14 +27,14 @@
xsi:schemaLocation="urn:jboss:bean-deployer bean-deployer_1_0.xsd"
xmlns="urn:jboss:bean-deployer">
- <bean name="TestDriverServer"
class="org.jboss.portal.test.framework.driver.remote.RemoteTestDriverServer">
+ <bean name="TestDriverServer"
class="org.jboss.unit.remote.driver.RemoteTestDriverServer">
</bean>
<bean name="TestDriverServerExporter"
class="org.jboss.portal.test.framework.impl.generic.server.GenericServiceExporter">
<constructor>
<parameter>socket://localhost:5400</parameter>
<parameter><inject
bean="TestDriverServer"/></parameter>
-
<parameter>org.jboss.portal.test.framework.driver.remote.RemoteTestDriver</parameter>
+
<parameter>org.jboss.unit.remote.driver.RemoteTestDriver</parameter>
</constructor>
</bean>
Added: modules/web/trunk/web/src/resources/test/config/log4j.properties
===================================================================
--- modules/web/trunk/web/src/resources/test/config/log4j.properties
(rev 0)
+++ modules/web/trunk/web/src/resources/test/config/log4j.properties 2007-10-22 20:22:50
UTC (rev 8742)
@@ -0,0 +1,13 @@
+### ====================================================================== ###
+## ##
+## JBoss Bootstrap Log4j Configuration ##
+## ##
+### ====================================================================== ###
+
+log4j.rootCategory=ALL, CONSOLE
+
+log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender
+log4j.appender.CONSOLE.Threshold=DEBUG
+log4j.appender.CONSOLE.Target=System.out
+log4j.appender.CONSOLE.layout=org.apache.log4j.PatternLayout
+log4j.appender.CONSOLE.layout.ConversionPattern=%d{ABSOLUTE} %-5p [%c{1}] %m%n
Modified: modules/web/trunk/web/src/resources/test/config/servers.xml
===================================================================
--- modules/web/trunk/web/src/resources/test/config/servers.xml 2007-10-22 19:51:57 UTC
(rev 8741)
+++ modules/web/trunk/web/src/resources/test/config/servers.xml 2007-10-22 20:22:50 UTC
(rev 8742)
@@ -5,7 +5,7 @@
<node-id>default</node-id>
<service>
<service-name>TestDriverServer</service-name>
-
<interface>org.jboss.portal.test.framework.driver.remote.RemoteTestDriver</interface>
+
<interface>org.jboss.unit.remote.driver.RemoteTestDriver</interface>
<uri>socket://localhost:5400</uri>
</service>
<deployer>
@@ -27,7 +27,7 @@
<node-id>default</node-id>
<service>
<service-name>TestDriverServer</service-name>
-
<interface>org.jboss.portal.test.framework.driver.remote.RemoteTestDriver</interface>
+
<interface>org.jboss.unit.remote.driver.RemoteTestDriver</interface>
<uri>socket://localhost:5400</uri>
</service>
<deployer>
@@ -45,7 +45,7 @@
<node-id>default</node-id>
<service>
<service-name>TestDriverServer</service-name>
-
<interface>org.jboss.portal.test.framework.driver.remote.RemoteTestDriver</interface>
+
<interface>org.jboss.unit.remote.driver.RemoteTestDriver</interface>
<uri>socket://localhost:5400</uri>
</service>
<deployer>
Added: modules/web/trunk/web/src/resources/test/local-jboss-unit.xml
===================================================================
--- modules/web/trunk/web/src/resources/test/local-jboss-unit.xml
(rev 0)
+++ modules/web/trunk/web/src/resources/test/local-jboss-unit.xml 2007-10-22 20:22:50 UTC
(rev 8742)
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<jboss-unit
+ xmlns="urn:jboss:jboss-unit:1.0"
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="urn:jboss:jboss-unit:1.0 jboss-unit_1_0.xsd">
+ <pojo>
+ <test>
+ <class
name="org.jboss.portal.test.web.container.ServletContainerTestCase"/>
+ </test>
+ </pojo>
+</jboss-unit>
Added: modules/web/trunk/web/src/resources/test/remote-jboss-unit.xml
===================================================================
--- modules/web/trunk/web/src/resources/test/remote-jboss-unit.xml
(rev 0)
+++ modules/web/trunk/web/src/resources/test/remote-jboss-unit.xml 2007-10-22 20:22:50 UTC
(rev 8742)
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<jboss-unit
+ xmlns="urn:jboss:jboss-unit:1.0"
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="urn:jboss:jboss-unit:1.0 jboss-unit_1_0.xsd">
+ <generic>
+ <class
name="org.jboss.unit.remote.driver.RemoteTestDriverClient"/>
+ </generic>
+</jboss-unit>
Added:
modules/web/trunk/web/src/resources/test/spi/jboss-4.2-container-servlet/server-war/WEB-INF/jboss-web.xml
===================================================================
---
modules/web/trunk/web/src/resources/test/spi/jboss-4.2-container-servlet/server-war/WEB-INF/jboss-web.xml
(rev 0)
+++
modules/web/trunk/web/src/resources/test/spi/jboss-4.2-container-servlet/server-war/WEB-INF/jboss-web.xml 2007-10-22
20:22:50 UTC (rev 8742)
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~ JBoss, a division of Red Hat ~
+ ~ Copyright 2006, Red Hat Middleware, LLC, and individual ~
+ ~ contributors as indicated by the @authors tag. See the ~
+ ~ copyright.txt in the distribution for a full listing of ~
+ ~ individual contributors. ~
+ ~ ~
+ ~ This is free software; you can redistribute it and/or modify it ~
+ ~ under the terms of the GNU Lesser General Public License as ~
+ ~ published by the Free Software Foundation; either version 2.1 of ~
+ ~ the License, or (at your option) any later version. ~
+ ~ ~
+ ~ This software is distributed in the hope that it will be useful, ~
+ ~ but WITHOUT ANY WARRANTY; without even the implied warranty of ~
+ ~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ~
+ ~ Lesser General Public License for more details. ~
+ ~ ~
+ ~ You should have received a copy of the GNU Lesser General Public ~
+ ~ License along with this software; if not, write to the Free ~
+ ~ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA ~
+ ~ 02110-1301 USA, or see the FSF site:
http://www.fsf.org. ~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+<!DOCTYPE jboss-web PUBLIC
+ "-//JBoss//DTD Web Application 4.2//EN"
+ "http://www.jboss.org/j2ee/dtd/jboss-web_4_2.dtd">
+<jboss-web>
+ <class-loading java2ClassLoadingCompliance="false">
+ <loader-repository>test:loader=portlet</loader-repository>
+ </class-loading>
+</jboss-web>
\ No newline at end of file
Added:
modules/web/trunk/web/src/resources/test/spi/jboss-4.2-generic/server-war/WEB-INF/jboss-web.xml
===================================================================
---
modules/web/trunk/web/src/resources/test/spi/jboss-4.2-generic/server-war/WEB-INF/jboss-web.xml
(rev 0)
+++
modules/web/trunk/web/src/resources/test/spi/jboss-4.2-generic/server-war/WEB-INF/jboss-web.xml 2007-10-22
20:22:50 UTC (rev 8742)
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~ JBoss, a division of Red Hat ~
+ ~ Copyright 2006, Red Hat Middleware, LLC, and individual ~
+ ~ contributors as indicated by the @authors tag. See the ~
+ ~ copyright.txt in the distribution for a full listing of ~
+ ~ individual contributors. ~
+ ~ ~
+ ~ This is free software; you can redistribute it and/or modify it ~
+ ~ under the terms of the GNU Lesser General Public License as ~
+ ~ published by the Free Software Foundation; either version 2.1 of ~
+ ~ the License, or (at your option) any later version. ~
+ ~ ~
+ ~ This software is distributed in the hope that it will be useful, ~
+ ~ but WITHOUT ANY WARRANTY; without even the implied warranty of ~
+ ~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ~
+ ~ Lesser General Public License for more details. ~
+ ~ ~
+ ~ You should have received a copy of the GNU Lesser General Public ~
+ ~ License along with this software; if not, write to the Free ~
+ ~ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA ~
+ ~ 02110-1301 USA, or see the FSF site:
http://www.fsf.org. ~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+<!DOCTYPE jboss-web PUBLIC
+ "-//JBoss//DTD Web Application 4.2//EN"
+ "http://www.jboss.org/j2ee/dtd/jboss-web_4_2.dtd">
+<jboss-web>
+ <class-loading java2ClassLoadingCompliance="false">
+ <loader-repository>test:loader=portlet</loader-repository>
+ </class-loading>
+</jboss-web>
\ No newline at end of file