JBoss Portal SVN: r8567 - modules/test/trunk/build.
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2007-10-08 12:16:09 -0400 (Mon, 08 Oct 2007)
New Revision: 8567
Modified:
modules/test/trunk/build/build.xml
Log:
update build.xml to build all modules of test module
Modified: modules/test/trunk/build/build.xml
===================================================================
--- modules/test/trunk/build/build.xml 2007-10-08 16:12:51 UTC (rev 8566)
+++ modules/test/trunk/build/build.xml 2007-10-08 16:16:09 UTC (rev 8567)
@@ -112,12 +112,15 @@
<!-- Modules -->
<module name="test"/>
+ <module name="unit"/>
+ <module name="mc"/>
+ <module name="remote"/>
<!-- Module groups -->
<group name="test">
<include
- modules="test"/>
+ modules="test,unit,mc,remote"/>
</group>
<group name="default">
16 years, 8 months
JBoss Portal SVN: r8565 - in modules/test/trunk/build/ide/intellij/idea60/modules: mc and 2 other directories.
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2007-10-08 12:10:42 -0400 (Mon, 08 Oct 2007)
New Revision: 8565
Added:
modules/test/trunk/build/ide/intellij/idea60/modules/mc/
modules/test/trunk/build/ide/intellij/idea60/modules/mc/mc.iml
modules/test/trunk/build/ide/intellij/idea60/modules/remote/
modules/test/trunk/build/ide/intellij/idea60/modules/remote/remote.iml
modules/test/trunk/build/ide/intellij/idea60/modules/tooling/
modules/test/trunk/build/ide/intellij/idea60/modules/tooling/tooling.iml
Log:
missing intellij modules
Added: modules/test/trunk/build/ide/intellij/idea60/modules/mc/mc.iml
===================================================================
--- modules/test/trunk/build/ide/intellij/idea60/modules/mc/mc.iml (rev 0)
+++ modules/test/trunk/build/ide/intellij/idea60/modules/mc/mc.iml 2007-10-08 16:10:42 UTC (rev 8565)
@@ -0,0 +1,177 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<module version="4" relativePaths="true" type="JAVA_MODULE">
+ <component name="ModuleRootManager" />
+ <component name="NewModuleRootManager" inherit-compiler-output="true">
+ <exclude-output />
+ <content url="file://$MODULE_DIR$/../../../../../../mc">
+ <sourceFolder url="file://$MODULE_DIR$/../../../../../../mc/src/main" isTestSource="false" />
+ </content>
+ <orderEntry type="inheritedJdk" />
+ <orderEntry type="sourceFolder" forTests="false" />
+ <orderEntry type="module" module-name="unit" />
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../thirdparty/jboss/microcontainer/lib/jboss-dependency.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../thirdparty/jboss/microcontainer/lib/jboss-container.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../thirdparty/jboss/microcontainer/lib/jboss-aop-mc-int.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../thirdparty/jboss/microcontainer/lib/jboss-managed.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../thirdparty/jboss/microcontainer/lib/jboss-metatype.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../thirdparty/jboss/microcontainer/lib/jboss-classloader.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../thirdparty/jboss/microcontainer/lib/jboss-deployers-client.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../thirdparty/jboss/microcontainer/lib/jboss-deployers-client-spi.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../thirdparty/jboss/microcontainer/lib/jboss-deployers-impl.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../thirdparty/jboss/microcontainer/lib/jboss-container-metadata-spi.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../thirdparty/jboss/microcontainer/lib/jboss-deployers-core-spi.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../thirdparty/jboss/microcontainer/lib/jboss-kernel.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../thirdparty/jboss/microcontainer/lib/jboss-deployers-spi.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../thirdparty/jboss/microcontainer/lib/jboss-deployers-vfs-spi.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../thirdparty/jboss/microcontainer/lib/jboss-deployers-vfs.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../thirdparty/jboss/microcontainer/lib/jboss-deployers-core.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../thirdparty/jboss/microcontainer/lib/jboss-container-metadata.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../thirdparty/jboss/microcontainer/lib/jboss-deployers-structure-spi.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntryProperties />
+ </component>
+</module>
+
Added: modules/test/trunk/build/ide/intellij/idea60/modules/remote/remote.iml
===================================================================
--- modules/test/trunk/build/ide/intellij/idea60/modules/remote/remote.iml (rev 0)
+++ modules/test/trunk/build/ide/intellij/idea60/modules/remote/remote.iml 2007-10-08 16:10:42 UTC (rev 8565)
@@ -0,0 +1,43 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<module version="4" relativePaths="true" type="JAVA_MODULE">
+ <component name="ModuleRootManager" />
+ <component name="NewModuleRootManager" inherit-compiler-output="true">
+ <exclude-output />
+ <content url="file://$MODULE_DIR$/../../../../../../remote">
+ <sourceFolder url="file://$MODULE_DIR$/../../../../../../remote/src/main" isTestSource="false" />
+ </content>
+ <orderEntry type="inheritedJdk" />
+ <orderEntry type="sourceFolder" forTests="false" />
+ <orderEntry type="module" module-name="unit" />
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../thirdparty/apache-httpclient/lib/commons-httpclient.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../thirdparty/jboss-portal/modules/common/lib/portal-common-lib.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../thirdparty/apache-log4j/lib/log4j.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module" module-name="test" />
+ <orderEntryProperties />
+ </component>
+</module>
+
Added: modules/test/trunk/build/ide/intellij/idea60/modules/tooling/tooling.iml
===================================================================
--- modules/test/trunk/build/ide/intellij/idea60/modules/tooling/tooling.iml (rev 0)
+++ modules/test/trunk/build/ide/intellij/idea60/modules/tooling/tooling.iml 2007-10-08 16:10:42 UTC (rev 8565)
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<module version="4" relativePaths="true" type="JAVA_MODULE">
+ <component name="ModuleRootManager" />
+ <component name="NewModuleRootManager" inherit-compiler-output="true">
+ <exclude-output />
+ <content url="file://$MODULE_DIR$/../../../../../../tooling">
+ <sourceFolder url="file://$MODULE_DIR$/../../../../../../tooling/src/main" isTestSource="false" />
+ </content>
+ <orderEntry type="inheritedJdk" />
+ <orderEntry type="sourceFolder" forTests="false" />
+ <orderEntry type="module" module-name="unit" />
+ <orderEntryProperties />
+ </component>
+</module>
+
16 years, 8 months
JBoss Portal SVN: r8564 - in modules/test/trunk: remote and 15 other directories.
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2007-10-08 12:09:32 -0400 (Mon, 08 Oct 2007)
New Revision: 8564
Added:
modules/test/trunk/remote/
modules/test/trunk/remote/build.bat
modules/test/trunk/remote/build.sh
modules/test/trunk/remote/build.xml
modules/test/trunk/remote/src/
modules/test/trunk/remote/src/main/
modules/test/trunk/remote/src/main/org/
modules/test/trunk/remote/src/main/org/jboss/
modules/test/trunk/remote/src/main/org/jboss/test/
modules/test/trunk/remote/src/main/org/jboss/test/AllTests.java
modules/test/trunk/remote/src/main/org/jboss/unit/
modules/test/trunk/remote/src/main/org/jboss/unit/remote/
modules/test/trunk/remote/src/main/org/jboss/unit/remote/RequestContext.java
modules/test/trunk/remote/src/main/org/jboss/unit/remote/ResponseContext.java
modules/test/trunk/remote/src/main/org/jboss/unit/remote/driver/
modules/test/trunk/remote/src/main/org/jboss/unit/remote/driver/ProtocolHandler.java
modules/test/trunk/remote/src/main/org/jboss/unit/remote/driver/RemoteDriverCommandContext.java
modules/test/trunk/remote/src/main/org/jboss/unit/remote/driver/RemoteDriverResponseContext.java
modules/test/trunk/remote/src/main/org/jboss/unit/remote/driver/RemoteTestDriver.java
modules/test/trunk/remote/src/main/org/jboss/unit/remote/driver/RemoteTestDriverClient.java
modules/test/trunk/remote/src/main/org/jboss/unit/remote/driver/RemoteTestDriverServer.java
modules/test/trunk/remote/src/main/org/jboss/unit/remote/driver/TestConversation.java
modules/test/trunk/remote/src/main/org/jboss/unit/remote/driver/handler/
modules/test/trunk/remote/src/main/org/jboss/unit/remote/driver/handler/deployer/
modules/test/trunk/remote/src/main/org/jboss/unit/remote/driver/handler/deployer/DeployerHandler.java
modules/test/trunk/remote/src/main/org/jboss/unit/remote/driver/handler/deployer/response/
modules/test/trunk/remote/src/main/org/jboss/unit/remote/driver/handler/deployer/response/DeployResponse.java
modules/test/trunk/remote/src/main/org/jboss/unit/remote/driver/handler/deployer/response/DeployerResponse.java
modules/test/trunk/remote/src/main/org/jboss/unit/remote/driver/handler/deployer/response/UndeployResponse.java
modules/test/trunk/remote/src/main/org/jboss/unit/remote/driver/handler/http/
modules/test/trunk/remote/src/main/org/jboss/unit/remote/driver/handler/http/HTTPConversation.java
modules/test/trunk/remote/src/main/org/jboss/unit/remote/driver/handler/http/HTTPHandler.java
modules/test/trunk/remote/src/main/org/jboss/unit/remote/driver/handler/http/command/
modules/test/trunk/remote/src/main/org/jboss/unit/remote/driver/handler/http/command/DoGetCommand.java
modules/test/trunk/remote/src/main/org/jboss/unit/remote/driver/handler/http/command/DoMethodCommand.java
modules/test/trunk/remote/src/main/org/jboss/unit/remote/driver/handler/http/command/DoPostCommand.java
modules/test/trunk/remote/src/main/org/jboss/unit/remote/driver/handler/http/command/HTTPDriverCommand.java
modules/test/trunk/remote/src/main/org/jboss/unit/remote/driver/handler/http/response/
modules/test/trunk/remote/src/main/org/jboss/unit/remote/driver/handler/http/response/HTTPDriverResponse.java
modules/test/trunk/remote/src/main/org/jboss/unit/remote/driver/handler/http/response/InvokeGetResponse.java
modules/test/trunk/remote/src/main/org/jboss/unit/remote/driver/handler/http/response/InvokeMethodResponse.java
modules/test/trunk/remote/src/main/org/jboss/unit/remote/driver/handler/http/response/InvokePostResponse.java
modules/test/trunk/remote/src/main/org/jboss/unit/remote/server/
modules/test/trunk/remote/src/main/org/jboss/unit/remote/server/Node.java
modules/test/trunk/remote/src/main/org/jboss/unit/remote/server/NodeId.java
modules/test/trunk/remote/src/main/org/jboss/unit/remote/server/NodeManager.java
modules/test/trunk/remote/src/main/org/jboss/unit/remote/server/ServiceLookup.java
modules/test/trunk/remote/src/main/org/jboss/unit/remote/server/ServiceLookupFailedException.java
modules/test/trunk/remote/src/resources/
Log:
reimported remote as an extension of jboss unit
Added: modules/test/trunk/remote/build.bat
===================================================================
--- modules/test/trunk/remote/build.bat (rev 0)
+++ modules/test/trunk/remote/build.bat 2007-10-08 16:09:32 UTC (rev 8564)
@@ -0,0 +1,54 @@
+@echo off
+rem
+rem Invokes a script of the same name in the 'tools' module.
+rem
+rem The 'tools' module is expected to be a peer directory of the directory
+rem in which this script lives.
+rem
+rem @author Jason Dillon <jason(a)planet57.com>
+rem
+
+rem $Id: build.bat 1829 2006-03-05 13:20:08Z julien $
+
+setlocal
+
+set PROGNAME=%~nx0
+set DIRNAME=%~dp0
+
+rem Legacy shell support
+if x%PROGNAME%==x set PROGNAME=build.bat
+if x%DIRNAME%==x set DIRNAME=.\
+
+set MODULE_ROOT=%DIRNAME%
+if x%TOOLS_ROOT%==x set TOOLS_ROOT=%DIRNAME%..\tools
+set TARGET=%TOOLS_ROOT%\bin\build.bat
+set ARGS=%*
+
+rem Start'er up yo
+goto main
+
+:debug
+if not x%DEBUG%==x echo %PROGNAME%: %*
+goto :EOF
+
+:main
+call :debug PROGNAME=%PROGNAME%
+call :debug DIRNAME=%DIRNAME%
+call :debug TOOLS_ROOT=%TOOLS_ROOT%
+call :debug TARGET=%TARGET%
+
+if exist %TARGET% call :call-script & goto :EOF
+rem else fail, we can not go on
+
+echo %PROGNAME%: *ERROR* The target executable does not exist:
+echo %PROGNAME%:
+echo %PROGNAME%: %TARGET%
+echo %PROGNAME%:
+echo %PROGNAME%: Please make sure you have checked out the 'tools' module
+echo %PROGNAME%: and make sure it is up to date.
+goto :EOF
+
+:call-script
+call :debug Executing %TARGET% %ARGS%
+call %TARGET% %ARGS%
+goto :EOF
Property changes on: modules/test/trunk/remote/build.bat
___________________________________________________________________
Name: svn:executable
+ *
Added: modules/test/trunk/remote/build.sh
===================================================================
--- modules/test/trunk/remote/build.sh (rev 0)
+++ modules/test/trunk/remote/build.sh 2007-10-08 16:09:32 UTC (rev 8564)
@@ -0,0 +1,49 @@
+#!/bin/sh
+##
+## Invokes a script of the same name in the 'tools' module.
+##
+## The 'tools' module is expected to be a peer directory of the directory
+## in which this script lives.
+##
+## @author Jason Dillon <jason(a)planet57.com>
+##
+
+# $Id: build.sh 1829 2006-03-05 13:20:08Z julien $
+
+PROGNAME=`basename $0`
+DIRNAME=`dirname $0`
+
+# Buss it yo
+main() {
+ if [ "x$TOOLS_ROOT" = "x" ]; then
+ TOOLS_ROOT=`cd $DIRNAME/../tools && pwd`
+ fi
+
+ MODULE_ROOT=`cd $DIRNAME; pwd`
+ export TOOLS_ROOT MODULE_ROOT DEBUG TRACE
+
+ # Where is the target script?
+ target="$TOOLS_ROOT/bin/$PROGNAME"
+ if [ ! -f "$target" ]; then
+ echo "${PROGNAME}: *ERROR* The target executable does not exist:"
+ echo "${PROGNAME}:"
+ echo "${PROGNAME}: $target"
+ echo "${PROGNAME}:"
+ echo "${PROGNAME}: Please make sure you have checked out the 'tools' module"
+ echo "${PROGNAME}: and make sure it is up to date."
+ exit 2
+ fi
+
+ # Get busy yo!
+ if [ "x$DEBUG" != "x" ]; then
+ echo "${PROGNAME}: Executing: /bin/sh $target $@"
+ fi
+ if [ "x$TRACE" = "x" ]; then
+ exec /bin/sh $target "$@"
+ else
+ exec /bin/sh -x $target "$@"
+ fi
+}
+
+# Lets get ready to rumble!
+main "$@"
Property changes on: modules/test/trunk/remote/build.sh
___________________________________________________________________
Name: svn:executable
+ *
Added: modules/test/trunk/remote/build.xml
===================================================================
--- modules/test/trunk/remote/build.xml (rev 0)
+++ modules/test/trunk/remote/build.xml 2007-10-08 16:09:32 UTC (rev 8564)
@@ -0,0 +1,210 @@
+<?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 project [
+ <!ENTITY buildmagic SYSTEM "../tools/etc/buildfragments/buildmagic.ent">
+ <!ENTITY tools SYSTEM "../tools/etc/buildfragments/tools.ent">
+ <!ENTITY libraries SYSTEM "../thirdparty/libraries.ent">
+ <!ENTITY modules SYSTEM "../tools/etc/buildfragments/modules.ent">
+ <!ENTITY defaults SYSTEM "../tools/etc/buildfragments/defaults.ent">
+ <!ENTITY targets SYSTEM "../tools/etc/buildfragments/targets.ent">
+ ]>
+
+<!-- $Id: build.xml 7954 2007-08-16 14:51:00Z julien(a)jboss.com $ -->
+
+<!--+======================================================================+-->
+<!--| JBoss Portal (The OpenSource Portal) Build File |-->
+<!--| |-->
+<!--| Distributable under LGPL license. |-->
+<!--| See terms of license at http://www.gnu.org. |-->
+<!--| |-->
+<!--| This file has been designed to work with the 'tools' module and |-->
+<!--| Buildmagic extentions. |-->
+<!--+======================================================================+-->
+
+<project default="main" name="JBoss Portal">
+
+ <!--+====================================================================+-->
+ <!--| Setup |-->
+ <!--| |-->
+ <!--| Include the common build elements. |-->
+ <!--| |-->
+ <!--| This defines several different targets, properties and paths. |-->
+ <!--| It also sets up the basic extention tasks amoung other things. |-->
+ <!--+====================================================================+-->
+
+ &buildmagic;
+ &modules;
+ &defaults;
+ &tools;
+ &targets;
+
+
+ <!-- ================================================================== -->
+ <!-- Initialization -->
+ <!-- ================================================================== -->
+
+ <!--
+ | Initialize the build system. Must depend on '_buildmagic:init'.
+ | Other targets should depend on 'init' or things will mysteriously fail.
+ -->
+
+ <target name="init" unless="init.disable" depends="_buildmagic:init">
+ </target>
+
+ <!--+====================================================================+-->
+ <!--| Configuration |-->
+ <!--| |-->
+ <!--| This target is invoked by the Buildmagic initialization logic |-->
+ <!--| and should contain module specific configuration elements. |-->
+ <!--+====================================================================+-->
+
+ <target name="configure" unless="configure.disable">
+
+ <!-- Configure thirdparty libraries -->
+ &libraries;
+ <path id="library.classpath">
+ <path refid="jboss.portal/modules/common.classpath"/>
+ <path refid="apache.httpclient.classpath"/>
+ <path refid="apache.codec.classpath"/>
+ <path refid="apache.logging.classpath"/>
+ <path refid="apache.log4j.classpath"/>
+ </path>
+
+ <!-- Configure modules -->
+ <call target="configure-modules"/>
+ <path id="dependentmodule.classpath">
+ <path refid="portal.test.classpath"/>
+ <path refid="jboss.unit.classpath"/>
+ </path>
+
+ <!--+=======================================+-->
+ <!--| Override any default properties here. |-->
+ <!--+=======================================+-->
+
+ <!--+=======================================+-->
+ <!--| Define module specific elements here. |-->
+ <!--+=======================================+-->
+ <property name="javadoc.private" value="false"/>
+ <property name="javadoc.protected" value="false"/>
+ <property name="javadoc.packages" value="org.jboss.unit.*"/>
+
+ <!-- Configure defaults & build tools -->
+ <call target="configure-defaults"/>
+ <call target="configure-tools"/>
+
+ </target>
+
+ <!--+====================================================================+-->
+ <!--| Compile |-->
+ <!--| |-->
+ <!--| This target should depend on other compile-* targets for each |-->
+ <!--| different type of compile that needs to be performed, short of |-->
+ <!--| documentation compiles. |-->
+ <!--+====================================================================+-->
+
+ <target name="compile"
+ description="Compile all source files."
+ depends="_default:compile-classes,
+ _default:compile-etc,
+ _default:compile-resources">
+ <!-- Add module specific elements here. -->
+ </target>
+
+ <!--+====================================================================+-->
+ <!--| Generate Output |-->
+ <!--| |-->
+ <!--| Generates the target output for this module. Target output is |-->
+ <!--| the output which is ment to be released or used by external |-->
+ <!--| modules. |-->
+ <!--+====================================================================+-->
+
+ <target name="output"
+ description="Generate all target output."
+ depends="compile">
+
+ <mkdir dir="${build.lib}"/>
+
+<!--
+ <jar jarfile="${build.lib}/jboss-unit-lib.jar">
+ <fileset dir="${build.classes}">
+ <exclude name="org/jboss/test/**"/>
+ </fileset>
+ <fileset dir="${build.resources}/jboss-unit-jar"/>
+ </jar>
+
+ <jar jarfile="${build.lib}/jboss-unit-test.jar">
+ <fileset dir="${build.classes}">
+ <exclude name="org/jboss/unit/**"/>
+ </fileset>
+ </jar>
+-->
+
+ </target>
+
+ <!-- ================================================================== -->
+ <!-- Cleaning -->
+ <!-- ================================================================== -->
+
+ <!-- Clean up all build output -->
+ <target name="clean" depends="_default:clean">
+ <!-- Add module specific elements here. -->
+ </target>
+
+ <!--+====================================================================+-->
+ <!--| Documents |-->
+ <!--| |-->
+ <!--| Generate all documentation for this module. |-->
+ <!--+====================================================================+-->
+
+ <target name="docs" depends="_default:docs">
+ <!-- Add module specific elements here. -->
+ </target>
+
+ <!-- ================================================================== -->
+ <!-- Misc. -->
+ <!-- ================================================================== -->
+
+ <target name="main" depends="most"/>
+ <target name="all" depends="_default:all"/>
+ <target name="most" depends="_default:most"/>
+ <target name="help" depends="_default:help"/>
+
+ <target name="test" depends="output">
+
+ <java classname="org.jboss.test.unit.AllTests" fork="true">
+<!--
+ <jvmarg value="-Xdebug"/>
+ <jvmarg value="-Xrunjdwp:transport=dt_socket,address=7878,server=y,suspend=y"/>
+-->
+ <classpath>
+ <path location="${build.lib}/jboss-unit-lib.jar"/>
+ <path location="${build.lib}/jboss-unit-test.jar"/>
+ <path location="${build.resources}/test"/>
+ </classpath>
+ </java>
+
+ </target>
+
+</project>
Property changes on: modules/test/trunk/remote/build.xml
___________________________________________________________________
Name: svn:executable
+ *
Added: modules/test/trunk/remote/src/main/org/jboss/test/AllTests.java
===================================================================
--- modules/test/trunk/remote/src/main/org/jboss/test/AllTests.java (rev 0)
+++ modules/test/trunk/remote/src/main/org/jboss/test/AllTests.java 2007-10-08 16:09:32 UTC (rev 8564)
@@ -0,0 +1,37 @@
+/******************************************************************************
+ * 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.test;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class AllTests
+{
+
+ public static void main(String[] args)
+ {
+
+ }
+
+}
Added: modules/test/trunk/remote/src/main/org/jboss/unit/remote/RequestContext.java
===================================================================
--- modules/test/trunk/remote/src/main/org/jboss/unit/remote/RequestContext.java (rev 0)
+++ modules/test/trunk/remote/src/main/org/jboss/unit/remote/RequestContext.java 2007-10-08 16:09:32 UTC (rev 8564)
@@ -0,0 +1,50 @@
+/******************************************************************************
+ * 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.unit.remote;
+
+import java.io.Serializable;
+import java.util.Map;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class RequestContext implements Serializable
+{
+
+ /** The phase count. */
+ protected int requestCount; // todo rename to phase count
+
+ /** The parametrization. */
+ protected Map<String, String> parametrization;
+
+ /** The payload. */
+ protected Map<String, Serializable> payload;
+
+ public RequestContext(int requestCount, Map<String, String> parametrization, Map<String, Serializable> payload)
+ {
+ this.requestCount = requestCount;
+ this.parametrization = parametrization;
+ this.payload = payload;
+ }
+}
Added: modules/test/trunk/remote/src/main/org/jboss/unit/remote/ResponseContext.java
===================================================================
--- modules/test/trunk/remote/src/main/org/jboss/unit/remote/ResponseContext.java (rev 0)
+++ modules/test/trunk/remote/src/main/org/jboss/unit/remote/ResponseContext.java 2007-10-08 16:09:32 UTC (rev 8564)
@@ -0,0 +1,58 @@
+/******************************************************************************
+ * 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.unit.remote;
+
+import org.jboss.unit.driver.DriverResponse;
+
+import java.io.Serializable;
+import java.util.Map;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class ResponseContext
+{
+
+ /** The test response. */
+ protected DriverResponse response;
+
+ /** The payload. */
+ protected Map<String, Serializable> payload;
+
+ public ResponseContext(DriverResponse response, Map<String, Serializable> payload)
+ {
+ this.response = response;
+ this.payload = payload;
+ }
+
+ public DriverResponse getResponse()
+ {
+ return response;
+ }
+
+ public Map<String, Serializable> getPayload()
+ {
+ return payload;
+ }
+}
Added: modules/test/trunk/remote/src/main/org/jboss/unit/remote/driver/ProtocolHandler.java
===================================================================
--- modules/test/trunk/remote/src/main/org/jboss/unit/remote/driver/ProtocolHandler.java (rev 0)
+++ modules/test/trunk/remote/src/main/org/jboss/unit/remote/driver/ProtocolHandler.java 2007-10-08 16:09:32 UTC (rev 8564)
@@ -0,0 +1,35 @@
+/******************************************************************************
+ * 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.unit.remote.driver;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public interface ProtocolHandler
+{
+
+ RemoteDriverCommandContext handleResponse(TestConversation testConversation, RemoteDriverResponseContext responseContext);
+
+ RemoteDriverResponseContext handleCommand(TestConversation conversation, RemoteDriverCommandContext commandContext) throws Exception;
+}
Added: modules/test/trunk/remote/src/main/org/jboss/unit/remote/driver/RemoteDriverCommandContext.java
===================================================================
--- modules/test/trunk/remote/src/main/org/jboss/unit/remote/driver/RemoteDriverCommandContext.java (rev 0)
+++ modules/test/trunk/remote/src/main/org/jboss/unit/remote/driver/RemoteDriverCommandContext.java 2007-10-08 16:09:32 UTC (rev 8564)
@@ -0,0 +1,113 @@
+/******************************************************************************
+ * 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.unit.remote.driver;
+
+import org.jboss.unit.driver.DriverCommand;
+import org.jboss.unit.driver.DriverResponse;
+
+import java.util.Map;
+import java.util.HashMap;
+import java.io.Serializable;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class RemoteDriverCommandContext
+{
+
+ /** The previous response if not null. */
+ private RemoteDriverResponseContext responseContext;
+
+ /** . */
+ private final int requestCount;
+
+ /** The command to invoke. */
+ private DriverCommand command;
+
+ /** . */
+ private final Map<String, Serializable> payload;
+
+ public RemoteDriverCommandContext(RemoteDriverResponseContext responseContext, DriverCommand command)
+ {
+ this.responseContext = responseContext;
+ this.requestCount = responseContext.getCommandContext().requestCount + 1;
+ this.command = command;
+ this.payload = new HashMap<String, Serializable>(responseContext.getPayload());
+ }
+
+ public RemoteDriverCommandContext(DriverCommand command)
+ {
+ this.responseContext = null;
+ this.requestCount = -1;
+ this.command = command;
+ this.payload = new HashMap<String, Serializable>();
+ }
+
+ public RemoteDriverCommandContext(RemoteDriverCommandContext commandContext, DriverCommand command)
+ {
+ Map<String, Serializable> payload = commandContext.responseContext != null ? new HashMap<String, Serializable>(commandContext.responseContext.getPayload()) : new HashMap<String, Serializable>();
+
+ //
+ this.responseContext = commandContext.responseContext;
+ this.requestCount = commandContext.requestCount + 1;
+ this.command = command;
+ this.payload = payload;
+ }
+
+ public RemoteDriverCommandContext(RemoteDriverCommandContext commandContext)
+ {
+ Map<String, Serializable> payload = commandContext.responseContext != null ? new HashMap<String, Serializable>(commandContext.responseContext.getPayload()) : new HashMap<String, Serializable>();
+
+ //
+ this.responseContext = commandContext.responseContext;
+ this.requestCount = commandContext.requestCount + 1;
+ this.command = commandContext.command;
+ this.payload = payload;
+ }
+
+ public Map<String, Serializable> getPayload()
+ {
+ return payload;
+ }
+
+ public int getRequestCount()
+ {
+ return requestCount;
+ }
+
+ public RemoteDriverResponseContext createResponseContext(DriverResponse response)
+ {
+ return new RemoteDriverResponseContext(this, response);
+ }
+
+ public RemoteDriverResponseContext getResponseContext()
+ {
+ return responseContext;
+ }
+
+ public DriverCommand getCommand()
+ {
+ return command;
+ }
+}
Added: modules/test/trunk/remote/src/main/org/jboss/unit/remote/driver/RemoteDriverResponseContext.java
===================================================================
--- modules/test/trunk/remote/src/main/org/jboss/unit/remote/driver/RemoteDriverResponseContext.java (rev 0)
+++ modules/test/trunk/remote/src/main/org/jboss/unit/remote/driver/RemoteDriverResponseContext.java 2007-10-08 16:09:32 UTC (rev 8564)
@@ -0,0 +1,98 @@
+/******************************************************************************
+ * 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.unit.remote.driver;
+
+import org.jboss.unit.driver.DriverResponse;
+
+import java.util.Map;
+import java.util.HashMap;
+import java.io.Serializable;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class RemoteDriverResponseContext
+{
+
+ /** . */
+ private final RemoteDriverCommandContext commandContext;
+
+ /** . */
+ private final DriverResponse response;
+
+ /** . */
+ private final Map<String, Serializable> payload;
+
+ RemoteDriverResponseContext(RemoteDriverCommandContext commandContext, DriverResponse response)
+ {
+ this.commandContext = commandContext;
+ this.response = response;
+ this.payload = new HashMap<String, Serializable>();
+ }
+
+ public RemoteDriverCommandContext getCommandContext()
+ {
+ return commandContext;
+ }
+
+ public Map<String, Serializable> getPayload()
+ {
+ return payload;
+ }
+
+ public Object getPayload(String name)
+ {
+ if (name == null)
+ {
+ throw new IllegalArgumentException();
+ }
+ return payload.get(name);
+ }
+
+ public void setPayload(String name, Object value)
+ {
+ if (name == null)
+ {
+ throw new IllegalArgumentException();
+ }
+ if (value == null)
+ {
+ payload.remove(name);
+ }
+ else
+ {
+ payload.put(name, (Serializable)value);
+ }
+ }
+
+ public void removePayload(String name)
+ {
+ setPayload(name, null);
+ }
+
+ public DriverResponse getResponse()
+ {
+ return response;
+ }
+}
Added: modules/test/trunk/remote/src/main/org/jboss/unit/remote/driver/RemoteTestDriver.java
===================================================================
--- modules/test/trunk/remote/src/main/org/jboss/unit/remote/driver/RemoteTestDriver.java (rev 0)
+++ modules/test/trunk/remote/src/main/org/jboss/unit/remote/driver/RemoteTestDriver.java 2007-10-08 16:09:32 UTC (rev 8564)
@@ -0,0 +1,49 @@
+/******************************************************************************
+ * 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.unit.remote.driver;
+
+import org.jboss.unit.remote.RequestContext;
+import org.jboss.unit.remote.ResponseContext;
+import org.jboss.unit.driver.TestDriver;
+import org.jboss.unit.TestId;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public interface RemoteTestDriver extends TestDriver
+{
+
+ /** . */
+ String SERVICE_ID = "TestDriverServer";
+
+ /**
+ * A client side push of the test context for a specific test.
+ */
+ void pushContext(TestId testId, RequestContext testContext);
+
+ /**
+ * A client pop of the test context for a specific test.
+ */
+ ResponseContext popContext(TestId testId);
+}
Added: modules/test/trunk/remote/src/main/org/jboss/unit/remote/driver/RemoteTestDriverClient.java
===================================================================
--- modules/test/trunk/remote/src/main/org/jboss/unit/remote/driver/RemoteTestDriverClient.java (rev 0)
+++ modules/test/trunk/remote/src/main/org/jboss/unit/remote/driver/RemoteTestDriverClient.java 2007-10-08 16:09:32 UTC (rev 8564)
@@ -0,0 +1,181 @@
+/******************************************************************************
+ * 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.unit.remote.driver;
+
+import org.jboss.unit.remote.server.NodeId;
+import org.jboss.unit.remote.server.NodeManager;
+import org.jboss.unit.remote.server.Node;
+import org.jboss.unit.driver.TestDriver;
+import org.jboss.unit.driver.DriverCommand;
+import org.jboss.unit.driver.DriverResponse;
+import org.jboss.unit.info.TestInfo;
+import org.jboss.unit.TestId;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class RemoteTestDriverClient implements TestDriver
+{
+
+ // Config
+
+ /** . */
+ private NodeId initialNodeId;
+
+ /** . */
+ private String archivePath;
+
+ // Services
+
+ /** . */
+ private NodeManager nodeManager;
+
+ /** . */
+ private ProtocolHandler protocolHandler;
+
+ /** . */
+// private Deployer deployer;
+
+ public NodeId getInitialNodeId()
+ {
+ return initialNodeId;
+ }
+
+ public void setInitialNodeId(NodeId initialNodeId)
+ {
+ this.initialNodeId = initialNodeId;
+ }
+
+ public String getArchivePath()
+ {
+ return archivePath;
+ }
+
+ public void setArchivePath(String archivePath)
+ {
+ this.archivePath = archivePath;
+ }
+
+ public NodeManager getNodeManager()
+ {
+ return nodeManager;
+ }
+
+ public void setNodeManager(NodeManager nodeManager)
+ {
+ this.nodeManager = nodeManager;
+ }
+
+ public ProtocolHandler getProtocolHandler()
+ {
+ return protocolHandler;
+ }
+
+ public void setProtocolHandler(ProtocolHandler protocolHandler)
+ {
+ this.protocolHandler = protocolHandler;
+ }
+
+// public Deployer getDeployer()
+// {
+// return deployer;
+// }
+//
+// public void setDeployer(Deployer deployer)
+// {
+// this.deployer = deployer;
+// }
+
+ public RemoteTestDriver getServer(Node node)
+ {
+ return (RemoteTestDriver)node.lookupService(RemoteTestDriver.SERVICE_ID);
+ }
+
+ public TestInfo getInfo()
+ {
+ Node node = nodeManager.getNode(initialNodeId);
+ TestDriver server = getServer(node);
+ return server.getInfo();
+ }
+
+ public DriverResponse invoke(TestId testId, DriverCommand command) // throws TestDriverException
+ {
+ try
+ {
+ Node node = nodeManager.getNode(initialNodeId);
+
+ // Create conversation
+ TestConversation conversation = createConversation(testId, node);
+
+ //
+ return conversation.handleCommand(command);
+ }
+ catch (Exception e)
+ {
+// throw new TestDriverException(e);
+ throw new Error(e);
+ }
+ }
+
+ protected TestConversation createConversation(TestId testId, Node node)
+ {
+ return new TestConversation(protocolHandler, this, testId, node);
+ }
+
+ public Node getNode(int port)
+ {
+ NodeId nodeId = null;
+ switch (port)
+ {
+ case 8080:
+ nodeId = NodeId.DEFAULT;
+ break;
+ case 8180:
+ nodeId = NodeId.PORTS_01;
+ break;
+ case 8280:
+ nodeId = NodeId.PORTS_02;
+ break;
+ }
+ return nodeManager.getNode(nodeId);
+ }
+
+ public int getPort(Node node)
+ {
+ NodeId nodeId = node.getId();
+ if (NodeId.DEFAULT.equals(nodeId))
+ {
+ return 8080;
+ }
+ if (NodeId.PORTS_01.equals(nodeId))
+ {
+ return 8180;
+ }
+ if (NodeId.PORTS_02.equals(nodeId))
+ {
+ return 8280;
+ }
+ return -1;
+ }
+}
Added: modules/test/trunk/remote/src/main/org/jboss/unit/remote/driver/RemoteTestDriverServer.java
===================================================================
--- modules/test/trunk/remote/src/main/org/jboss/unit/remote/driver/RemoteTestDriverServer.java (rev 0)
+++ modules/test/trunk/remote/src/main/org/jboss/unit/remote/driver/RemoteTestDriverServer.java 2007-10-08 16:09:32 UTC (rev 8564)
@@ -0,0 +1,153 @@
+/******************************************************************************
+ * 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.unit.remote.driver;
+
+import org.jboss.unit.TestId;
+import org.jboss.unit.Failure;
+import org.jboss.unit.driver.DriverResponse;
+import org.jboss.unit.driver.DriverCommand;
+import org.jboss.unit.driver.TestDriver;
+import org.jboss.unit.driver.response.FailureResponse;
+import org.jboss.unit.info.TestInfo;
+import org.jboss.unit.info.impl.SimpleTestSuiteInfo;
+import org.jboss.unit.remote.RequestContext;
+import org.jboss.unit.remote.ResponseContext;
+
+import java.util.Map;
+import java.util.HashMap;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 5636 $
+ */
+public class RemoteTestDriverServer implements RemoteTestDriver
+{
+
+ /** . */
+ private SimpleTestSuiteInfo info = new SimpleTestSuiteInfo("Main");
+
+ /** . */
+ private Map<String, TestDriver> drivers = new HashMap<String, TestDriver>();
+
+ /** . */
+ private RequestContext requestContext;
+
+ /** . */
+ private ResponseContext responseContext;
+
+ public void pushContext(TestId testId, RequestContext testContext)
+ {
+ this.requestContext = testContext;
+ }
+
+ public ResponseContext popContext(TestId testId)
+ {
+ return responseContext;
+ }
+
+ public TestInfo getInfo()
+ {
+ return info;
+ }
+
+ public DriverResponse invoke(TestId id, DriverCommand command)
+ {
+ if (id.getLength() == 0)
+ {
+ return new FailureResponse(Failure.createErrorFailure("No null test id accepted"));
+ }
+
+ //
+ String name = id.getName(0);
+
+ //
+ TestDriver driver = drivers.get(name);
+
+ //
+ if (driver == null)
+ {
+ return new FailureResponse(Failure.createErrorFailure("No test driver found for name " + name));
+ }
+
+ //
+ TestId driverId = id.range(1);
+
+ //
+ return driver.invoke(driverId, command);
+ }
+
+ public void addDriver(TestDriver driver)
+ {
+ synchronized(RemoteTestDriverServer.class)
+ {
+ info.addTest(driver.getInfo());
+
+ String name = driver.getInfo().getName();
+
+ drivers.put(name, driver);
+ }
+ }
+
+ public synchronized void removeDriver(TestDriver driver)
+ {
+ synchronized(RemoteTestDriverServer.class)
+ {
+ String name = driver.getInfo().getName();
+
+ drivers.remove(name);
+
+ info.removeTest(name);
+ }
+ }
+
+
+
+
+
+
+// /** . */
+// private String initialPath = "/test";
+//
+// public String getInitialPath()
+// {
+// return initialPath;
+// }
+//
+// public void setInitialPath(String initialPath)
+// {
+// this.initialPath = initialPath;
+// }
+//
+// public void pushContext(String testId, TestContext testContext)
+// {
+// if (testContext instanceof HTTPTestContext)
+// {
+// HTTPTestContext httpTestContext = (HTTPTestContext)testContext;
+// httpTestContext.initialPath = initialPath;
+// }
+//
+// //
+// super.pushContext(testId, testContext);
+// }
+
+}
Added: modules/test/trunk/remote/src/main/org/jboss/unit/remote/driver/TestConversation.java
===================================================================
--- modules/test/trunk/remote/src/main/org/jboss/unit/remote/driver/TestConversation.java (rev 0)
+++ modules/test/trunk/remote/src/main/org/jboss/unit/remote/driver/TestConversation.java 2007-10-08 16:09:32 UTC (rev 8564)
@@ -0,0 +1,209 @@
+/******************************************************************************
+ * 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.unit.remote.driver;
+
+import org.jboss.unit.driver.DriverResponse;
+import org.jboss.unit.driver.DriverCommand;
+import org.jboss.unit.driver.response.EndTestResponse;
+import org.jboss.unit.remote.server.Node;
+import org.jboss.unit.remote.RequestContext;
+import org.jboss.unit.remote.ResponseContext;
+import org.jboss.unit.TestId;
+
+import java.util.Map;
+import java.util.HashMap;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public final class TestConversation
+{
+
+ /** . */
+// private final Logger log = Logger.getLogger(getClass());
+
+ /** The test name. */
+ private final TestId testId;
+
+ /** . */
+ private final RemoteTestDriverClient driver;
+
+ /** . */
+ private final Map<String, Object> attributes;
+
+ /** The node to invoke. */
+ private Node node;
+
+ /** The test parametrization. */
+ private Map<String, String> parametrization;
+
+ /** . */
+ private ProtocolHandler protocolHandler;
+
+ public TestConversation(ProtocolHandler protocolHandler, RemoteTestDriverClient driver, TestId testId, Node node)
+ {
+ this.protocolHandler = protocolHandler;
+ this.driver = driver;
+ this.testId = testId;
+ this.node = node;
+ this.attributes = new HashMap<String, Object>();
+ }
+
+ DriverResponse handleCommand(DriverCommand command) throws Exception
+ {
+ RemoteDriverCommandContext commandContext = new RemoteDriverCommandContext(command);
+
+ //
+ return handleCommand(commandContext);
+ }
+
+ /**
+ * Trigger an interaction with the server here.
+ *
+ * @param commandContext the command context
+ * @return the driver response
+ * @throws Exception for now any exception
+ */
+ public final DriverResponse handleCommand(RemoteDriverCommandContext commandContext) throws Exception
+ {
+ //
+// if (command instanceof StartTestCommand)
+// {
+// StartTestCommand start = (StartTestCommand)command;
+// parametrization = start.getParametrization();
+// pushContext(commandContext);
+// DriverResponse response = getDriver().getServer(node).invoke(testId, command);
+// return commandContext.createResponseContext(response);
+// }
+// else if (command instanceof HTTPDriverCommand)
+// {
+// return new HTTPTestDriverHandler().invoke(this, commandContext);
+// }
+// else
+// {
+// throw new IllegalArgumentException("Not yet handled " + command);
+// }
+
+ RemoteDriverResponseContext respCtx = protocolHandler.handleCommand(this, commandContext);
+
+ //
+ DriverResponse response = respCtx.getResponse();
+
+ //
+ if (response instanceof EndTestResponse)
+ {
+ return response;
+ }
+
+ //
+ commandContext = protocolHandler.handleResponse(this, respCtx);
+
+ //
+ return handleCommand(commandContext);
+ }
+
+ public Object getAttribute(String name)
+ {
+ if (name == null)
+ {
+ throw new IllegalArgumentException();
+ }
+ return attributes.get(name);
+ }
+
+ public void setAttribute(String name, Object value)
+ {
+ if (name == null)
+ {
+ throw new IllegalArgumentException();
+ }
+ if (value == null)
+ {
+ attributes.remove(name);
+ }
+ else
+ {
+ attributes.put(name, value);
+ }
+ }
+
+ public void removeAttribute(String name)
+ {
+ setAttribute(name, null);
+ }
+
+ public RemoteTestDriverClient getDriver()
+ {
+ return driver;
+ }
+
+ public TestId getTestId()
+ {
+ return testId;
+ }
+
+ public Node getNode()
+ {
+ return node;
+ }
+
+ public void setNode(Node node)
+ {
+ this.node = node;
+ }
+
+ public Map<String, String> getParametrization()
+ {
+ return parametrization;
+ }
+
+ public void setParametrization(Map<String, String> parametrization)
+ {
+ this.parametrization = parametrization;
+ }
+
+ public void pushContext(RemoteDriverCommandContext commandContext)
+ {
+ RequestContext ctx = new RequestContext(commandContext.getRequestCount(), parametrization, commandContext.getPayload());
+
+// new TestContext(
+// commandContext.getRequestCount(),
+// driver.getArchivePath(),
+// parametrization,
+// commandContext.getPayload());
+
+ //
+// log.info("# Updating test case context of : " + node + " : " + ctx);
+ RemoteTestDriver agent = driver.getServer(node);
+ agent.pushContext(testId, ctx);
+ }
+
+ public ResponseContext popContext()
+ {
+ RemoteTestDriver agent = driver.getServer(node);
+
+ //
+ return agent.popContext(testId);
+ }
+}
Added: modules/test/trunk/remote/src/main/org/jboss/unit/remote/driver/handler/deployer/DeployerHandler.java
===================================================================
--- modules/test/trunk/remote/src/main/org/jboss/unit/remote/driver/handler/deployer/DeployerHandler.java (rev 0)
+++ modules/test/trunk/remote/src/main/org/jboss/unit/remote/driver/handler/deployer/DeployerHandler.java 2007-10-08 16:09:32 UTC (rev 8564)
@@ -0,0 +1,113 @@
+/******************************************************************************
+ * 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.unit.remote.driver.handler.deployer;
+
+import org.jboss.unit.remote.driver.ProtocolHandler;
+import org.jboss.unit.remote.driver.RemoteDriverResponseContext;
+import org.jboss.unit.remote.driver.TestConversation;
+import org.jboss.unit.remote.driver.RemoteDriverCommandContext;
+import org.jboss.unit.remote.driver.handler.deployer.response.UndeployResponse;
+import org.jboss.unit.remote.driver.handler.deployer.response.DeployResponse;
+import org.jboss.unit.driver.DriverResponse;
+import org.jboss.portal.test.framework.deployment.Deployer;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class DeployerHandler implements ProtocolHandler
+{
+
+ /** . */
+ private ProtocolHandler nextHandler;
+
+ /** . */
+ private Deployer deployer;
+
+ /** . */
+ private String archivePath;
+
+ public ProtocolHandler getNextHandler()
+ {
+ return nextHandler;
+ }
+
+ public void setNextHandler(ProtocolHandler nextHandler)
+ {
+ this.nextHandler = nextHandler;
+ }
+
+ public Deployer getDeployer()
+ {
+ return deployer;
+ }
+
+ public void setDeployer(Deployer deployer)
+ {
+ this.deployer = deployer;
+ }
+
+ public String getArchivePath()
+ {
+ return archivePath;
+ }
+
+ public void setArchivePath(String archivePath)
+ {
+ this.archivePath = archivePath;
+ }
+
+ public RemoteDriverCommandContext handleResponse(TestConversation testConversation, RemoteDriverResponseContext responseContext)
+ {
+ DriverResponse response = responseContext.getResponse();
+
+ if (response instanceof DeployResponse)
+ {
+ DeployResponse deploy = (DeployResponse)response;
+
+ //
+// deployer.deploy(archivePath, deploy.getId(), node);
+
+ //
+ return new RemoteDriverCommandContext(responseContext.getCommandContext());
+ }
+ else if (response instanceof UndeployResponse)
+ {
+ UndeployResponse undeploy = (UndeployResponse)response;
+
+ //
+// Deployer deployer = driver.getDeployer();
+// deployer.undeploy(driver.getArchivePath(), undeploy.getId());
+
+ //
+ return new RemoteDriverCommandContext(responseContext.getCommandContext());
+ }
+
+ return null; //To change body of implemented methods use File | Settings | File Templates.
+ }
+
+ public RemoteDriverResponseContext handleCommand(TestConversation conversation, RemoteDriverCommandContext commandContext) throws Exception
+ {
+ return nextHandler.handleCommand(conversation, commandContext);
+ }
+}
Added: modules/test/trunk/remote/src/main/org/jboss/unit/remote/driver/handler/deployer/response/DeployResponse.java
===================================================================
--- modules/test/trunk/remote/src/main/org/jboss/unit/remote/driver/handler/deployer/response/DeployResponse.java (rev 0)
+++ modules/test/trunk/remote/src/main/org/jboss/unit/remote/driver/handler/deployer/response/DeployResponse.java 2007-10-08 16:09:32 UTC (rev 8564)
@@ -0,0 +1,48 @@
+/******************************************************************************
+ * 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.unit.remote.driver.handler.deployer.response;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class DeployResponse extends DeployerResponse
+{
+
+ /** . */
+ private final String id;
+
+ public DeployResponse(String id)
+ {
+ if (id == null)
+ {
+ throw new IllegalArgumentException();
+ }
+ this.id = id;
+ }
+
+ public String getId()
+ {
+ return id;
+ }
+}
Added: modules/test/trunk/remote/src/main/org/jboss/unit/remote/driver/handler/deployer/response/DeployerResponse.java
===================================================================
--- modules/test/trunk/remote/src/main/org/jboss/unit/remote/driver/handler/deployer/response/DeployerResponse.java (rev 0)
+++ modules/test/trunk/remote/src/main/org/jboss/unit/remote/driver/handler/deployer/response/DeployerResponse.java 2007-10-08 16:09:32 UTC (rev 8564)
@@ -0,0 +1,33 @@
+/******************************************************************************
+ * 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.unit.remote.driver.handler.deployer.response;
+
+import org.jboss.unit.driver.DriverResponse;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class DeployerResponse extends DriverResponse
+{
+}
Added: modules/test/trunk/remote/src/main/org/jboss/unit/remote/driver/handler/deployer/response/UndeployResponse.java
===================================================================
--- modules/test/trunk/remote/src/main/org/jboss/unit/remote/driver/handler/deployer/response/UndeployResponse.java (rev 0)
+++ modules/test/trunk/remote/src/main/org/jboss/unit/remote/driver/handler/deployer/response/UndeployResponse.java 2007-10-08 16:09:32 UTC (rev 8564)
@@ -0,0 +1,48 @@
+/******************************************************************************
+ * 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.unit.remote.driver.handler.deployer.response;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class UndeployResponse extends DeployerResponse
+{
+
+ /** . */
+ private final String id;
+
+ public UndeployResponse(String id)
+ {
+ if (id == null)
+ {
+ throw new IllegalArgumentException();
+ }
+ this.id = id;
+ }
+
+ public String getId()
+ {
+ return id;
+ }
+}
Added: modules/test/trunk/remote/src/main/org/jboss/unit/remote/driver/handler/http/HTTPConversation.java
===================================================================
--- modules/test/trunk/remote/src/main/org/jboss/unit/remote/driver/handler/http/HTTPConversation.java (rev 0)
+++ modules/test/trunk/remote/src/main/org/jboss/unit/remote/driver/handler/http/HTTPConversation.java 2007-10-08 16:09:32 UTC (rev 8564)
@@ -0,0 +1,313 @@
+/******************************************************************************
+ * 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.unit.remote.driver.handler.http;
+
+import org.apache.commons.httpclient.HttpClient;
+import org.apache.commons.httpclient.SimpleHttpConnectionManager;
+import org.apache.commons.httpclient.UsernamePasswordCredentials;
+import org.apache.commons.httpclient.NameValuePair;
+import org.apache.commons.httpclient.Header;
+import org.apache.commons.httpclient.HttpMethod;
+import org.apache.commons.httpclient.HeaderElement;
+import org.apache.commons.httpclient.methods.PostMethod;
+import org.apache.commons.httpclient.methods.ByteArrayRequestEntity;
+import org.apache.commons.httpclient.methods.GetMethod;
+import org.apache.commons.httpclient.auth.AuthScope;
+import org.apache.commons.httpclient.params.HttpMethodParams;
+import org.apache.log4j.Logger;
+import org.jboss.portal.common.http.HttpRequest;
+import org.jboss.portal.common.http.HttpHeaders;
+import org.jboss.portal.common.http.HttpHeader;
+import org.jboss.unit.remote.driver.handler.http.command.DoMethodCommand;
+import org.jboss.unit.remote.driver.handler.http.command.DoPostCommand;
+import org.jboss.unit.remote.driver.handler.http.command.DoGetCommand;
+import org.jboss.unit.remote.driver.TestConversation;
+import org.jboss.unit.remote.driver.RemoteDriverCommandContext;
+import org.jboss.unit.remote.driver.RemoteDriverResponseContext;
+import org.jboss.unit.remote.server.Node;
+import org.jboss.unit.remote.ResponseContext;
+import org.jboss.unit.driver.DriverCommand;
+import org.jboss.unit.driver.DriverResponse;
+import org.jboss.unit.driver.response.FailureResponse;
+import org.jboss.unit.Failure;
+
+import java.net.URI;
+import java.net.URL;
+import java.net.URISyntaxException;
+import java.net.MalformedURLException;
+import java.util.Collection;
+import java.util.ArrayList;
+import java.util.Iterator;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class HTTPConversation
+{
+
+ /** . */
+ private final Logger log = Logger.getLogger(getClass());
+
+ /** . */
+ private final HttpClient client;
+
+ /** . */
+ private final TestConversation conversation;
+
+ public HTTPConversation(TestConversation conversation)
+ {
+ HttpClient client = new HttpClient(new SimpleHttpConnectionManager());
+ client.getParams().setParameter(HttpMethodParams.RETRY_HANDLER, null);
+ client.getState().setCredentials(AuthScope.ANY, new UsernamePasswordCredentials("test", "test"));
+
+ //
+ this.conversation = conversation;
+ this.client = client;
+ }
+
+ public RemoteDriverResponseContext invoke(RemoteDriverCommandContext commandContext) throws Exception
+ {
+ DriverCommand command = commandContext.getCommand();
+
+ //
+ if (command instanceof DoMethodCommand)
+ {
+ DoMethodCommand method = (DoMethodCommand)command;
+ URI uri = method.getURI();
+ URL url = getURL(uri);
+ if (command instanceof DoPostCommand)
+ {
+ DoPostCommand doPostCmd = (DoPostCommand)command;
+ PostMethod post = null;
+ try
+ {
+ post = new PostMethod(url.toString());
+ post.setFollowRedirects(false);
+ HttpRequest.Body body = doPostCmd.getBody();
+ if (doPostCmd.getContentType() != null)
+ {
+ post.addRequestHeader("Content-Type", doPostCmd.getContentType());
+ }
+ if (body instanceof HttpRequest.Raw)
+ {
+ HttpRequest.Raw rb = (HttpRequest.Raw)body;
+ ByteArrayRequestEntity entity = new ByteArrayRequestEntity(rb.getBytes());
+ post.setRequestEntity(entity);
+ }
+ else if (body instanceof HttpRequest.Form)
+ {
+ HttpRequest.Form fb = (HttpRequest.Form)body;
+ Collection<NameValuePair> tmp = new ArrayList<NameValuePair>();
+ for (Object o : fb.getParameterNames())
+ {
+ String name = (String)o;
+ String[] values = fb.getParameterValues(name);
+ for (String value : values)
+ {
+ NameValuePair nvp = new NameValuePair(name, value);
+ tmp.add(nvp);
+ }
+ }
+ NameValuePair[] nvps = tmp.toArray(new NameValuePair[tmp.size()]);
+ post.setRequestBody(nvps);
+ }
+ executeHTTPMethod(commandContext, post);
+ return decodeHTTPResponse(commandContext, post);
+ }
+ finally
+ {
+ if (post != null)
+ {
+ post.releaseConnection();
+ }
+ }
+ }
+ else
+ {
+ DoGetCommand doGetCmd = (DoGetCommand)command;
+ GetMethod get = null;
+ try
+ {
+ get = new GetMethod(url.toString());
+ HttpHeaders headers = doGetCmd.getHeaders();
+ for (Iterator i = headers.headers();i.hasNext();)
+ {
+ HttpHeader header = (HttpHeader)i.next();
+ Header _header = new Header(header.getName(), header.getValue());
+ get.addRequestHeader(_header);
+ }
+ get.setFollowRedirects(false);
+ executeHTTPMethod(commandContext, get);
+ return decodeHTTPResponse(commandContext, get);
+ }
+ finally
+ {
+ if (get != null)
+ {
+ get.releaseConnection();
+ }
+ }
+ }
+ }
+ else
+ {
+ return commandContext.createResponseContext(new FailureResponse(Failure.createErrorFailure("Unexpected response")));
+ }
+ }
+
+ private URL getURL(URI uri) throws URISyntaxException, MalformedURLException
+ {
+ if (!uri.isAbsolute())
+ {
+ Node node = conversation.getNode();
+ int port = conversation.getDriver().getPort(node);
+ uri = new URI("http://localhost:" + port).resolve(uri);
+ }
+ return uri.toURL();
+ }
+
+ private RemoteDriverResponseContext decodeHTTPResponse(RemoteDriverCommandContext commandContext, HttpMethod httpMethod) throws Exception
+ {
+ ResponseContext ctx = conversation.popContext();
+ DriverResponse response = ctx.getResponse();
+ int status = httpMethod.getStatusCode();
+ switch (status)
+ {
+ case 200:
+ // HTTP response is ok
+ if (response == null)
+ {
+ response = new FailureResponse(Failure.createErrorFailure("No result for test " + conversation.getTestId() + " in the response"));
+ }
+
+ //
+ log.info("# Received '200' code");
+ break;
+ case 302:
+ // Send redirect
+ if (response == null)
+ {
+ // Satisfy the 302 code
+ Header locationHeader = httpMethod.getResponseHeader("location");
+ if (locationHeader != null)
+ {
+ String redirectLocation = locationHeader.getValue();
+ log.info("# Received '302' code --> " + redirectLocation);
+ DoGetCommand cmd = new DoGetCommand(new URI(redirectLocation));
+
+ // We should somehow stuff the response in the next payload
+ // but it's not yet proven it's usefull
+
+ // For now we don't add any contextual payload as
+ // 302 is some kind of implicit redirect response
+ return invoke(new RemoteDriverCommandContext(commandContext.getResponseContext(), cmd));
+ }
+ else
+ {
+ // The response is invalid
+ response = new FailureResponse(Failure.createErrorFailure("302 Code with corrupted data"));
+ }
+ }
+ else
+ {
+ // If any result has been setup during the action it overrides the 302 code
+ log.info("# Received Result object which overrides the 302");
+ }
+ break;
+ case 500:
+ log.info("# Received '500' code");
+ response = new FailureResponse(Failure.createErrorFailure("Received '500' code at " + httpMethod.getURI()));
+ break;
+ case 404:
+ log.info("# Received '404' code");
+ response = new FailureResponse(Failure.createErrorFailure("Received '404' code at " + httpMethod.getURI()));
+ break;
+ default:
+ response = new FailureResponse(Failure.createErrorFailure("Unexpected http code " + status + " at " + httpMethod.getURI()));
+ break;
+ }
+
+ //
+ RemoteDriverResponseContext responseCtx = commandContext.createResponseContext(response);
+
+ //
+ byte[] body = httpMethod.getResponseBody();
+ responseCtx.setPayload("http.response.body", body);
+
+ //
+ HttpHeaders _headers = new HttpHeaders();
+ Header[] headers = httpMethod.getResponseHeaders();
+ for (Header header : headers)
+ {
+ HttpHeader _header = _headers.addHeader(header.getName());
+ HeaderElement[] elts = header.getElements();
+ if (elts != null)
+ {
+ for (HeaderElement elt : elts)
+ {
+ HttpHeader.Element _elt = _header.addElement(elt.getName(), elt.getValue());
+ NameValuePair[] params = elt.getParameters();
+ if (params != null)
+ {
+ for (NameValuePair param : params)
+ {
+ _elt.addParam(param.getName(), param.getValue());
+ }
+ }
+ }
+ }
+ }
+ responseCtx.setPayload("http.response.headers", _headers);
+
+ //
+ return responseCtx;
+ }
+
+ private int executeHTTPMethod(RemoteDriverCommandContext commandContext, HttpMethod method) throws Exception
+ {
+ int port = method.getURI().getPort();
+
+ // Update to the next node
+ Node node = conversation.getDriver().getNode(port);
+ if (node == null)
+ {
+ throw new IllegalArgumentException("Wrong port " + method.getURI().getPort() + " in URI " + method.getURI());
+ }
+ conversation.setNode(node);
+
+ // Push context to the node
+ conversation.pushContext(commandContext);
+
+ //
+ log.info("# Invoking test case over http " + method.getURI());
+ int status = client.executeMethod(method);
+
+ // Force to read the response body before we close the connection
+ // otherwise the content will be lost
+ method.getResponseBody();
+
+ //
+ return status;
+ }
+}
Added: modules/test/trunk/remote/src/main/org/jboss/unit/remote/driver/handler/http/HTTPHandler.java
===================================================================
--- modules/test/trunk/remote/src/main/org/jboss/unit/remote/driver/handler/http/HTTPHandler.java (rev 0)
+++ modules/test/trunk/remote/src/main/org/jboss/unit/remote/driver/handler/http/HTTPHandler.java 2007-10-08 16:09:32 UTC (rev 8564)
@@ -0,0 +1,115 @@
+/******************************************************************************
+ * 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.unit.remote.driver.handler.http;
+
+import org.jboss.portal.common.http.HttpRequest;
+import org.jboss.unit.remote.driver.RemoteDriverResponseContext;
+import org.jboss.unit.remote.driver.RemoteDriverCommandContext;
+import org.jboss.unit.remote.driver.ProtocolHandler;
+import org.jboss.unit.remote.driver.TestConversation;
+import org.jboss.unit.remote.driver.handler.http.response.InvokePostResponse;
+import org.jboss.unit.remote.driver.handler.http.response.InvokeGetResponse;
+import org.jboss.unit.remote.driver.handler.http.response.HTTPDriverResponse;
+import org.jboss.unit.remote.driver.handler.http.response.InvokeMethodResponse;
+import org.jboss.unit.remote.driver.handler.http.command.DoPostCommand;
+import org.jboss.unit.remote.driver.handler.http.command.DoGetCommand;
+import org.jboss.unit.remote.driver.handler.http.command.HTTPDriverCommand;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class HTTPHandler implements ProtocolHandler
+{
+
+ /** . */
+ private ProtocolHandler nextHandler;
+
+ public ProtocolHandler getNextHandler()
+ {
+ return nextHandler;
+ }
+
+ public void setNextHandler(ProtocolHandler nextHandler)
+ {
+ this.nextHandler = nextHandler;
+ }
+
+ public RemoteDriverCommandContext handleResponse(TestConversation testConversation, RemoteDriverResponseContext responseContext)
+ {
+ if (responseContext.getResponse() instanceof HTTPDriverResponse)
+ {
+ HTTPDriverResponse resp = (HTTPDriverResponse)responseContext.getResponse();
+ if (resp instanceof InvokeMethodResponse)
+ {
+ if (resp instanceof InvokeGetResponse)
+ {
+ InvokeGetResponse igr = (InvokeGetResponse)resp;
+ return new RemoteDriverCommandContext(responseContext, new DoGetCommand(igr.getURI(), igr.getHeaders()));
+ }
+ else
+ {
+ InvokePostResponse ipr = (InvokePostResponse)resp;
+ HttpRequest.Body dpcb = ipr.getBody();
+ return new RemoteDriverCommandContext(responseContext, new DoPostCommand(ipr.getURI(), ipr.getContentType(), dpcb));
+ }
+ }
+ }
+
+ //
+ if (nextHandler != null)
+ {
+ return nextHandler.handleResponse(testConversation, responseContext);
+ }
+
+ //
+ return null;
+ }
+
+ public RemoteDriverResponseContext handleCommand(TestConversation conversation, RemoteDriverCommandContext commandContext) throws Exception
+ {
+ if (commandContext.getCommand() instanceof HTTPDriverCommand)
+ {
+ HTTPConversation httpConversation = (HTTPConversation)conversation.getAttribute("http.conversation");
+
+ //
+ if (httpConversation == null)
+ {
+ httpConversation = new HTTPConversation(conversation);
+ conversation.setAttribute("http.conversation", httpConversation);
+ }
+
+ //
+ return httpConversation.invoke(commandContext);
+ }
+
+ //
+ if (nextHandler != null)
+ {
+ return nextHandler.handleCommand(conversation, commandContext);
+ }
+
+ //
+ return null;
+ }
+}
Added: modules/test/trunk/remote/src/main/org/jboss/unit/remote/driver/handler/http/command/DoGetCommand.java
===================================================================
--- modules/test/trunk/remote/src/main/org/jboss/unit/remote/driver/handler/http/command/DoGetCommand.java (rev 0)
+++ modules/test/trunk/remote/src/main/org/jboss/unit/remote/driver/handler/http/command/DoGetCommand.java 2007-10-08 16:09:32 UTC (rev 8564)
@@ -0,0 +1,47 @@
+/******************************************************************************
+ * 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.unit.remote.driver.handler.http.command;
+
+import org.jboss.portal.common.http.HttpHeaders;
+
+import java.net.URI;
+
+/**
+ * Perform a get.
+ *
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 5448 $
+ */
+public class DoGetCommand extends DoMethodCommand
+{
+
+ public DoGetCommand(URI uri, HttpHeaders headers)
+ {
+ super(uri, headers);
+ }
+
+ public DoGetCommand(URI uri)
+ {
+ super(uri);
+ }
+}
Added: modules/test/trunk/remote/src/main/org/jboss/unit/remote/driver/handler/http/command/DoMethodCommand.java
===================================================================
--- modules/test/trunk/remote/src/main/org/jboss/unit/remote/driver/handler/http/command/DoMethodCommand.java (rev 0)
+++ modules/test/trunk/remote/src/main/org/jboss/unit/remote/driver/handler/http/command/DoMethodCommand.java 2007-10-08 16:09:32 UTC (rev 8564)
@@ -0,0 +1,62 @@
+/******************************************************************************
+ * 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.unit.remote.driver.handler.http.command;
+
+import org.jboss.portal.common.http.HttpHeaders;
+
+import java.net.URI;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class DoMethodCommand extends HTTPDriverCommand
+{
+
+ /** . */
+ private URI uri;
+
+ /** . */
+ private HttpHeaders headers;
+
+ public DoMethodCommand(URI uri, HttpHeaders headers)
+ {
+ this.uri = uri;
+ this.headers = headers;
+ }
+
+ public DoMethodCommand(URI uri)
+ {
+ this(uri, new HttpHeaders());
+ }
+
+ public URI getURI()
+ {
+ return uri;
+ }
+
+ public HttpHeaders getHeaders()
+ {
+ return headers;
+ }
+}
Added: modules/test/trunk/remote/src/main/org/jboss/unit/remote/driver/handler/http/command/DoPostCommand.java
===================================================================
--- modules/test/trunk/remote/src/main/org/jboss/unit/remote/driver/handler/http/command/DoPostCommand.java (rev 0)
+++ modules/test/trunk/remote/src/main/org/jboss/unit/remote/driver/handler/http/command/DoPostCommand.java 2007-10-08 16:09:32 UTC (rev 8564)
@@ -0,0 +1,66 @@
+/******************************************************************************
+ * 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.unit.remote.driver.handler.http.command;
+
+import org.jboss.portal.common.http.HttpRequest;
+
+import java.net.URI;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 5448 $
+ */
+public class DoPostCommand extends DoMethodCommand
+{
+
+ /** . */
+ private String contentType;
+
+ /** . */
+ private HttpRequest.Body body;
+
+ public DoPostCommand(URI uri, String contentType, HttpRequest.Body body)
+ {
+ super(uri);
+
+ //
+ if (body == null)
+ {
+ throw new IllegalArgumentException();
+ }
+
+ //
+ this.contentType = contentType;
+ this.body = body;
+ }
+
+ public String getContentType()
+ {
+ return contentType;
+ }
+
+ public HttpRequest.Body getBody()
+ {
+ return body;
+ }
+}
Added: modules/test/trunk/remote/src/main/org/jboss/unit/remote/driver/handler/http/command/HTTPDriverCommand.java
===================================================================
--- modules/test/trunk/remote/src/main/org/jboss/unit/remote/driver/handler/http/command/HTTPDriverCommand.java (rev 0)
+++ modules/test/trunk/remote/src/main/org/jboss/unit/remote/driver/handler/http/command/HTTPDriverCommand.java 2007-10-08 16:09:32 UTC (rev 8564)
@@ -0,0 +1,33 @@
+/******************************************************************************
+ * 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.unit.remote.driver.handler.http.command;
+
+import org.jboss.unit.driver.DriverCommand;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class HTTPDriverCommand extends DriverCommand
+{
+}
Added: modules/test/trunk/remote/src/main/org/jboss/unit/remote/driver/handler/http/response/HTTPDriverResponse.java
===================================================================
--- modules/test/trunk/remote/src/main/org/jboss/unit/remote/driver/handler/http/response/HTTPDriverResponse.java (rev 0)
+++ modules/test/trunk/remote/src/main/org/jboss/unit/remote/driver/handler/http/response/HTTPDriverResponse.java 2007-10-08 16:09:32 UTC (rev 8564)
@@ -0,0 +1,33 @@
+/******************************************************************************
+ * 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.unit.remote.driver.handler.http.response;
+
+import org.jboss.unit.driver.DriverResponse;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public abstract class HTTPDriverResponse extends DriverResponse
+{
+}
Added: modules/test/trunk/remote/src/main/org/jboss/unit/remote/driver/handler/http/response/InvokeGetResponse.java
===================================================================
--- modules/test/trunk/remote/src/main/org/jboss/unit/remote/driver/handler/http/response/InvokeGetResponse.java (rev 0)
+++ modules/test/trunk/remote/src/main/org/jboss/unit/remote/driver/handler/http/response/InvokeGetResponse.java 2007-10-08 16:09:32 UTC (rev 8564)
@@ -0,0 +1,49 @@
+/******************************************************************************
+ * 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.unit.remote.driver.handler.http.response;
+
+import java.net.URI;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @author <a href="mailto:boleslaw.dawidowicz@jboss.com">Boleslaw Dawidowicz</a>
+ * @version $Revision: 5448 $
+ */
+public class InvokeGetResponse extends InvokeMethodResponse
+{
+
+ public InvokeGetResponse(String url)
+ {
+ super(url);
+ }
+
+ public InvokeGetResponse(URI uri)
+ {
+ super(uri);
+ }
+
+ public String toString()
+ {
+ return "InvokeGet[uri=" + getURI() + "]";
+ }
+}
Added: modules/test/trunk/remote/src/main/org/jboss/unit/remote/driver/handler/http/response/InvokeMethodResponse.java
===================================================================
--- modules/test/trunk/remote/src/main/org/jboss/unit/remote/driver/handler/http/response/InvokeMethodResponse.java (rev 0)
+++ modules/test/trunk/remote/src/main/org/jboss/unit/remote/driver/handler/http/response/InvokeMethodResponse.java 2007-10-08 16:09:32 UTC (rev 8564)
@@ -0,0 +1,103 @@
+/******************************************************************************
+ * 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.unit.remote.driver.handler.http.response;
+
+import org.jboss.portal.common.http.HttpHeaders;
+import org.jboss.portal.common.http.HttpHeader;
+
+import java.net.URI;
+import java.net.URISyntaxException;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public abstract class InvokeMethodResponse extends HTTPDriverResponse
+{
+
+ /** . */
+ private URI uri;
+
+ /** . */
+ private HttpHeaders headers;
+
+ public InvokeMethodResponse(String uri) throws IllegalArgumentException
+ {
+ if (uri == null)
+ {
+ throw new IllegalArgumentException("Cannot invoke against a null URL");
+ }
+
+ //
+ URI tmp;
+ try
+ {
+ tmp = new URI(uri);
+ }
+ catch (URISyntaxException e)
+ {
+ IllegalArgumentException iae = new IllegalArgumentException("Wrong URI syntax");
+ iae.initCause(e);
+ throw iae;
+ }
+
+ //
+ if (tmp.isOpaque())
+ {
+ throw new IllegalArgumentException("No opaque URI accepted");
+ }
+
+ //
+ this.uri = tmp;
+ this.headers = new HttpHeaders();
+ }
+
+ public InvokeMethodResponse(URI uri) throws IllegalArgumentException
+ {
+ if (uri == null)
+ {
+ throw new IllegalArgumentException("Cannot invoke against a null URL");
+ }
+ this.uri = uri;
+ this.headers = new HttpHeaders();
+ }
+
+ public URI getURI()
+ {
+ return uri;
+ }
+
+ public HttpHeader addHeader(String headerName)
+ {
+ if (headerName == null)
+ {
+ throw new IllegalArgumentException("No null header name accepted");
+ }
+ return headers.addHeader(headerName);
+ }
+
+ public HttpHeaders getHeaders()
+ {
+ return headers;
+ }
+}
Added: modules/test/trunk/remote/src/main/org/jboss/unit/remote/driver/handler/http/response/InvokePostResponse.java
===================================================================
--- modules/test/trunk/remote/src/main/org/jboss/unit/remote/driver/handler/http/response/InvokePostResponse.java (rev 0)
+++ modules/test/trunk/remote/src/main/org/jboss/unit/remote/driver/handler/http/response/InvokePostResponse.java 2007-10-08 16:09:32 UTC (rev 8564)
@@ -0,0 +1,84 @@
+/******************************************************************************
+ * 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.unit.remote.driver.handler.http.response;
+
+import org.jboss.portal.common.http.HttpRequest;
+
+import java.net.URI;
+
+/**
+ * The portlet wants to invoke a post.
+ *
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 5448 $
+ */
+public class InvokePostResponse extends InvokeMethodResponse
+{
+
+ /** . */
+ public static final String APPLICATION_X_WWW_FORM_URLENCODED = "application/x-www-form-urlencoded";
+
+ /** . */
+ public static final String MULTIPART_FORM_DATA = "multipart/form-data";
+
+ /** The content type. */
+ private String contentType;
+
+ /** The post body. */
+ private HttpRequest.Body body;
+
+ public InvokePostResponse(String uri)
+ {
+ super(uri);
+ }
+
+ public InvokePostResponse(URI uri)
+ {
+ super(uri);
+ }
+
+ public HttpRequest.Body getBody()
+ {
+ return body;
+ }
+
+ public void setBody(HttpRequest.Body body)
+ {
+ this.body = body;
+ }
+
+ public String getContentType()
+ {
+ return contentType;
+ }
+
+ public void setContentType(String contentType)
+ {
+ this.contentType = contentType;
+ }
+
+ public String toString()
+ {
+ return "InvokePost[uri=" + getURI() + "]";
+ }
+}
Added: modules/test/trunk/remote/src/main/org/jboss/unit/remote/server/Node.java
===================================================================
--- modules/test/trunk/remote/src/main/org/jboss/unit/remote/server/Node.java (rev 0)
+++ modules/test/trunk/remote/src/main/org/jboss/unit/remote/server/Node.java 2007-10-08 16:09:32 UTC (rev 8564)
@@ -0,0 +1,74 @@
+/******************************************************************************
+ * 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.unit.remote.server;
+
+import java.util.Map;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 6136 $
+ */
+public class Node
+{
+
+ /** . */
+ protected final NodeId id;
+
+ /** . */
+ protected final Map serviceLookups;
+
+ public Node(String id, Map serviceLookups)
+ {
+ this.id = new NodeId(id);
+ this.serviceLookups = serviceLookups;
+ }
+
+ /**
+ * Returns the node id.
+ *
+ * @return the node id
+ */
+ public NodeId getId()
+ {
+ return id;
+ }
+
+ public Object lookupService(String serviceId) throws ServiceLookupFailedException
+ {
+ ServiceLookup lookup = (ServiceLookup)serviceLookups.get(serviceId);
+
+ //
+ if (lookup == null)
+ {
+ throw new ServiceLookupFailedException("No service lookup bound under the service id " + serviceId);
+ }
+
+ //
+ return lookup.lookupService();
+ }
+
+ public String toString()
+ {
+ return "Node[" + id + "]";
+ }
+}
Added: modules/test/trunk/remote/src/main/org/jboss/unit/remote/server/NodeId.java
===================================================================
--- modules/test/trunk/remote/src/main/org/jboss/unit/remote/server/NodeId.java (rev 0)
+++ modules/test/trunk/remote/src/main/org/jboss/unit/remote/server/NodeId.java 2007-10-08 16:09:32 UTC (rev 8564)
@@ -0,0 +1,120 @@
+/******************************************************************************
+ * 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.unit.remote.server;
+
+import java.io.Serializable;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 6136 $
+ */
+public class NodeId implements Serializable
+{
+
+ /** . */
+ public static final NodeId DEFAULT = new NodeId("default");
+
+ /** . */
+ public static final NodeId PORTS_01 = new NodeId("ports-01");
+
+ /** . */
+ public static final NodeId PORTS_02 = new NodeId("ports-02");
+
+ /** . */
+ private final String value;
+
+ public NodeId(String value)
+ {
+ if (value == null)
+ {
+ throw new IllegalArgumentException("No null value accepted");
+ }
+ this.value = value;
+ }
+
+ public String toString()
+ {
+ return value;
+ }
+
+ public boolean equals(Object o)
+ {
+ if (this == o)
+ {
+ return true;
+ }
+ if (o instanceof NodeId)
+ {
+ NodeId that = (NodeId)o;
+ return value.equals(that.value);
+ }
+ return false;
+ }
+
+ public int hashCode()
+ {
+ return value.hashCode();
+ }
+
+ /**
+ * Return the current node id.
+ *
+ * @return the current node id
+ * @throws IllegalStateException if not in a node context
+ */
+ public static NodeId locate() throws IllegalStateException
+ {
+ // Legacy jboss server name
+ String nodeName = System.getProperty("jboss.server.name");
+
+ // Otherwise use a system property specified in the command line
+ if (nodeName != null)
+ {
+ nodeName = System.getProperty("test.node.name");
+ }
+
+ // If nothing is specified we assume it is the default one
+ if (nodeName == null)
+ {
+ nodeName = "default";
+ }
+
+ //
+ if ("default".equals(nodeName))
+ {
+ return NodeId.DEFAULT;
+ }
+ else if ("ports-01".equals(nodeName))
+ {
+ return NodeId.PORTS_01;
+ }
+ else if ("ports-02".equals(nodeName))
+ {
+ return NodeId.PORTS_02;
+ }
+ else
+ {
+ throw new IllegalStateException("Cannot determine node id " + nodeName);
+ }
+ }
+}
Added: modules/test/trunk/remote/src/main/org/jboss/unit/remote/server/NodeManager.java
===================================================================
--- modules/test/trunk/remote/src/main/org/jboss/unit/remote/server/NodeManager.java (rev 0)
+++ modules/test/trunk/remote/src/main/org/jboss/unit/remote/server/NodeManager.java 2007-10-08 16:09:32 UTC (rev 8564)
@@ -0,0 +1,81 @@
+/******************************************************************************
+ * 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.unit.remote.server;
+
+import java.util.Map;
+import java.util.List;
+import java.util.HashMap;
+import java.util.Collection;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 6136 $
+ */
+public class NodeManager
+{
+
+ /** The nodes. */
+ private final Map<NodeId,Node> nodeMap;
+
+ public NodeManager(List<Node> nodes)
+ {
+ this.nodeMap = new HashMap<NodeId,Node>();
+ for (Node node : nodes)
+ {
+ nodeMap.put(node.getId(), node);
+ }
+ }
+
+ public Collection getNodes()
+ {
+ return nodeMap.values();
+ }
+
+ public Node[] getNodes(NodeId[] nodeIds)
+ {
+ if (nodeIds == null)
+ {
+ throw new IllegalArgumentException("No null node ids accepted");
+ }
+ Node[] nodes = new Node[nodeIds.length];
+ for (int i = 0;i < nodeIds.length;i++)
+ {
+ NodeId nodeId = nodeIds[i];
+ if (nodeId == null)
+ {
+ throw new IllegalArgumentException("No null node id accepted");
+ }
+ nodes[i] = getNode(nodeId);
+ }
+ return nodes;
+ }
+
+ public Node getNode(NodeId nodeId)
+ {
+ if (nodeId == null)
+ {
+ throw new IllegalArgumentException("No null node id accepted");
+ }
+ return nodeMap.get(nodeId);
+ }
+}
Added: modules/test/trunk/remote/src/main/org/jboss/unit/remote/server/ServiceLookup.java
===================================================================
--- modules/test/trunk/remote/src/main/org/jboss/unit/remote/server/ServiceLookup.java (rev 0)
+++ modules/test/trunk/remote/src/main/org/jboss/unit/remote/server/ServiceLookup.java 2007-10-08 16:09:32 UTC (rev 8564)
@@ -0,0 +1,40 @@
+/******************************************************************************
+ * 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.unit.remote.server;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public interface ServiceLookup
+{
+
+ /**
+ * Returns a proxy for the underlying service.
+ *
+ * @return the service proxy
+ * @throws ServiceLookupFailedException
+ */
+ Object lookupService() throws ServiceLookupFailedException;
+
+}
Added: modules/test/trunk/remote/src/main/org/jboss/unit/remote/server/ServiceLookupFailedException.java
===================================================================
--- modules/test/trunk/remote/src/main/org/jboss/unit/remote/server/ServiceLookupFailedException.java (rev 0)
+++ modules/test/trunk/remote/src/main/org/jboss/unit/remote/server/ServiceLookupFailedException.java 2007-10-08 16:09:32 UTC (rev 8564)
@@ -0,0 +1,49 @@
+/******************************************************************************
+ * 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.unit.remote.server;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class ServiceLookupFailedException extends RuntimeException
+{
+ public ServiceLookupFailedException()
+ {
+ }
+
+ public ServiceLookupFailedException(String message)
+ {
+ super(message);
+ }
+
+ public ServiceLookupFailedException(String message, Throwable cause)
+ {
+ super(message, cause);
+ }
+
+ public ServiceLookupFailedException(Throwable cause)
+ {
+ super(cause);
+ }
+}
16 years, 8 months
JBoss Portal SVN: r8563 - in modules/test/trunk: test and 11 other directories.
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2007-10-08 12:08:32 -0400 (Mon, 08 Oct 2007)
New Revision: 8563
Removed:
modules/test/trunk/test/selenium-java-client-driver-backport.jar
modules/test/trunk/test/selenium-java-client-driver.jar
modules/test/trunk/test/src/main/org/jboss/portal/test/framework/AbstractPortalTestCase.java
modules/test/trunk/test/src/main/org/jboss/portal/test/framework/MonoValuedTestParameterValue.java
modules/test/trunk/test/src/main/org/jboss/portal/test/framework/MultiValuedTestParameterValue.java
modules/test/trunk/test/src/main/org/jboss/portal/test/framework/TestParameterValue.java
modules/test/trunk/test/src/main/org/jboss/portal/test/framework/TestParametrization.java
modules/test/trunk/test/src/main/org/jboss/portal/test/framework/driver/
modules/test/trunk/test/src/main/org/jboss/portal/test/framework/impl/jboss/agent/JBossTestAgent.java
modules/test/trunk/test/src/main/org/jboss/portal/test/framework/impl/jboss/agent/JBossTestAgentMBean.java
modules/test/trunk/test/src/main/org/jboss/portal/test/framework/impl/jboss/jmx/MBeanServerFactory.java
modules/test/trunk/test/src/main/org/jboss/portal/test/framework/impl/jboss/jmx/RemoteMBeanProxy.java
modules/test/trunk/test/src/main/org/jboss/portal/test/framework/impl/jboss/jmx/RemoteMBeanServerAdapter.java
modules/test/trunk/test/src/main/org/jboss/portal/test/framework/impl/jboss/server/JBossServiceLookup.java
modules/test/trunk/test/src/main/org/jboss/portal/test/framework/info/
modules/test/trunk/test/src/main/org/jboss/portal/test/framework/junit/
modules/test/trunk/test/src/main/org/jboss/portal/test/framework/mc/
modules/test/trunk/test/src/main/org/jboss/portal/test/framework/runner/WebTestRunner.java
modules/test/trunk/test/src/main/org/jboss/test/InfoTestCase.java
modules/test/trunk/test/src/main/org/jboss/test/TestParameterValueTestCase.java
modules/test/trunk/test/src/main/org/jboss/test/TestParametrizationTestCase.java
modules/test/trunk/test/src/main/org/jboss/test/junit/
Modified:
modules/test/trunk/build/build-thirdparty.xml
modules/test/trunk/test/build.xml
modules/test/trunk/test/src/main/org/jboss/portal/test/framework/embedded/DSConfig.java
modules/test/trunk/test/src/main/org/jboss/portal/test/framework/embedded/DataSourceSupport.java
modules/test/trunk/test/src/main/org/jboss/portal/test/framework/embedded/apacheds/ApacheDSServiceMBean.java
modules/test/trunk/test/src/main/org/jboss/portal/test/framework/embedded/opends/OpenDSService.java
modules/test/trunk/test/src/main/org/jboss/portal/test/framework/embedded/opends/OpenDSServiceMBean.java
modules/test/trunk/test/src/main/org/jboss/portal/test/framework/embedded/opends/OpenDSUtil.java
modules/test/trunk/test/src/main/org/jboss/portal/test/framework/impl/generic/config/HTTPTestRunnerConfig.java
modules/test/trunk/test/src/main/org/jboss/portal/test/framework/runner/BaseRunner.java
modules/test/trunk/test/src/main/org/jboss/portal/test/framework/runner/HTTPTestRunner.java
modules/test/trunk/tools/etc/buildfragments/modules.ent
Log:
remove remote stuff from test module that will be reimported based on jboss unit
Modified: modules/test/trunk/build/build-thirdparty.xml
===================================================================
--- modules/test/trunk/build/build-thirdparty.xml 2007-10-08 13:26:57 UTC (rev 8562)
+++ modules/test/trunk/build/build-thirdparty.xml 2007-10-08 16:08:32 UTC (rev 8563)
@@ -52,7 +52,6 @@
<componentref name="apache-ant" version="1.6.5"/>
<componentref name="codehaus/cargo" version="0.9-portal"/>
- <componentref name="testng" version="5.5"/>
<componentref name="hibernate" version="3.2.0.CR2"/>
<componentref name="apache-log4j" version="1.2.8"/>
@@ -63,6 +62,9 @@
<componentref name="sun-opends" version="snapshot"/>
<componentref name="jboss/remoting" version="2.2.1.GA"/>
+ <!-- For embedding components -->
+ <componentref name="jbossas/core-libs" version="4.0.4.GA"/>
+
<!-- MC 2.0.0.Beta4 -->
<componentref name="jboss/microcontainer" version="2.0.0.Beta4"/>
<componentref name="jboss/aop" version="2.0.0.alpha6"/>
Modified: modules/test/trunk/test/build.xml
===================================================================
--- modules/test/trunk/test/build.xml 2007-10-08 13:26:57 UTC (rev 8562)
+++ modules/test/trunk/test/build.xml 2007-10-08 16:08:32 UTC (rev 8563)
@@ -82,25 +82,26 @@
<target name="configure" unless="configure.disable">
+ <property name="javac.excludes" value="org/jboss/portal/test/framework/runner/**"/>
+
<!-- Configure thirdparty libraries -->
&libraries;
<path id="library.classpath">
<path refid="jboss.portal/modules/common.classpath"/>
+
+ <!-- For embedded services -->
<path refid="dom4j.dom4j.classpath"/>
<path refid="jbossas/core.libs.classpath"/>
- <path refid="jboss.microcontainer.classpath"/>
<path refid="hibernate.hibernate.classpath"/>
+ <path refid="sun.opends.classpath"/>
+
<path refid="oswego.concurrent.classpath"/>
- <path refid="apache.httpclient.classpath"/>
<path refid="apache.log4j.classpath"/>
- <path refid="apache.codec.classpath"/>
- <path refid="apache.logging.classpath"/>
<path refid="junit.junit.classpath"/>
<path refid="sun.servlet.classpath"/>
<path refid="jboss.remoting.classpath"/>
<path refid="codehaus.cargo.classpath"/>
- <path location="selenium-java-client-driver-backport.jar"/>
- <!--<path refid="sun.opends.classpath"/>-->
+
</path>
<!-- Configure modules -->
Deleted: modules/test/trunk/test/selenium-java-client-driver-backport.jar
===================================================================
(Binary files differ)
Deleted: modules/test/trunk/test/selenium-java-client-driver.jar
===================================================================
(Binary files differ)
Deleted: modules/test/trunk/test/src/main/org/jboss/portal/test/framework/AbstractPortalTestCase.java
===================================================================
--- modules/test/trunk/test/src/main/org/jboss/portal/test/framework/AbstractPortalTestCase.java 2007-10-08 13:26:57 UTC (rev 8562)
+++ modules/test/trunk/test/src/main/org/jboss/portal/test/framework/AbstractPortalTestCase.java 2007-10-08 16:08:32 UTC (rev 8563)
@@ -1,144 +0,0 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2007, 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.framework;
-
-import junit.framework.TestCase;
-import junit.framework.TestSuite;
-import org.apache.log4j.Appender;
-import org.apache.log4j.ConsoleAppender;
-import org.apache.log4j.Level;
-import org.apache.log4j.Logger;
-import org.apache.log4j.SimpleLayout;
-import org.jboss.portal.common.junit.TransactionAssert;
-import org.jboss.portal.test.framework.junit.JUnitAdapter;
-import org.jboss.portal.test.framework.junit.POJOJUnitTest;
-import org.jboss.portal.test.framework.embedded.DataSourceSupport;
-import org.jboss.portal.test.framework.embedded.HibernateSupport;
-import org.jboss.portal.test.framework.mc.TestRuntimeContext;
-
-import java.net.URL;
-
-/**
- * @author <a href="mailto:Anil.Saldhana@jboss.org">Anil Saldhana</a>
- * @author <a href="mailto:chris.laprun@jboss.com">Chris Laprun</a>
- * @version $Revision: 7954 $
- * @since 2.6
- */
-public abstract class AbstractPortalTestCase extends TestCase
-{
- static
- {
- Appender appender = new ConsoleAppender(new SimpleLayout());
- Logger.getRoot().addAppender(appender);
- Logger.getRoot().setLevel(Level.DEBUG);
- Logger.getLogger("org.hibernate").setLevel(Level.ERROR);
- }
-
- /** . */
- protected TestRuntimeContext runtimeContext;
- /** . */
- protected DataSourceSupport.Config dataSourceConfigParameter;
- /** . */
- protected HibernateSupport hibernate;
-
- public HibernateSupport getHibernate()
- {
- return hibernate;
- }
-
- public DataSourceSupport.Config getDataSourceConfigParameter()
- {
- return dataSourceConfigParameter;
- }
-
- public void setDataSourceConfigParameter(DataSourceSupport.Config dataSourceConfigParameter)
- {
- this.dataSourceConfigParameter = dataSourceConfigParameter;
- }
-
- public void setHibernate(HibernateSupport hibernate)
- {
- this.hibernate = hibernate;
- }
-
- public String getName()
- {
- return super.getName() + ",ds=" + dataSourceConfigParameter.getName() + ",Config=" + getConfigParamValue();
- }
-
- protected void setUp() throws Exception
- {
- runtimeContext = new TestRuntimeContext(getConfigLocation());
- runtimeContext.addBean("TestBean", this);
- runtimeContext.addBean("DataSourceConfig", dataSourceConfigParameter);
- runtimeContext.addBean("HibernateConfig", HibernateSupport.getConfig(dataSourceConfigParameter.getName()));
- configureRuntimeContext(runtimeContext);
- runtimeContext.start();
- }
-
- /**
- * Allows sub-classes to further configure the TestRuntimeContext created in setUp. Default implementation doesn't do
- * anything.
- *
- * @param runtimeContext
- */
- protected void configureRuntimeContext(TestRuntimeContext runtimeContext)
- {
- // null implementation
- }
-
- protected void tearDown() throws Exception
- {
- // clean up any pending transaction
- TransactionAssert.endTransaction();
-
- runtimeContext.stop();
- }
-
- protected String getConfigLocation()
- {
- return getConfigLocationPrefix() + getConfigParamValue();
- }
-
- protected Object getConfigParamValue()
- {
- TestParametrization parametrization = JUnitAdapter.getParametrization();
- TestParameterValue paramValue = parametrization.getParameterValue("Config");
- return paramValue.get();
- }
-
- public static TestSuite suite(Class testClass) throws Exception
- {
- TestParametrization parametrization = JUnitAdapter.getParametrization();
- URL configsURL = Thread.currentThread().getContextClassLoader().getResource("datasources.xml");
- parametrization.setParameterValue("DataSourceConfig", DataSourceSupport.Config.fromXML2(configsURL));
- POJOJUnitTest abc = new POJOJUnitTest(testClass);
- JUnitAdapter adapter = new JUnitAdapter(abc, parametrization);
- TestSuite suite = new TestSuite();
- suite.addTest(adapter);
- return suite;
- }
-
- protected abstract String getConfigLocationPrefix();
-}
Deleted: modules/test/trunk/test/src/main/org/jboss/portal/test/framework/MonoValuedTestParameterValue.java
===================================================================
--- modules/test/trunk/test/src/main/org/jboss/portal/test/framework/MonoValuedTestParameterValue.java 2007-10-08 13:26:57 UTC (rev 8562)
+++ modules/test/trunk/test/src/main/org/jboss/portal/test/framework/MonoValuedTestParameterValue.java 2007-10-08 16:08:32 UTC (rev 8563)
@@ -1,46 +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.framework;
-
-/**
- * A mono value.
- *
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 7228 $
- */
-public class MonoValuedTestParameterValue extends TestParameterValue
-{
-
- /** The value. */
- protected final Object value;
-
- public MonoValuedTestParameterValue(Object value)
- {
- this.value = value;
- }
-
- public Object get()
- {
- return value;
- }
-}
Deleted: modules/test/trunk/test/src/main/org/jboss/portal/test/framework/MultiValuedTestParameterValue.java
===================================================================
--- modules/test/trunk/test/src/main/org/jboss/portal/test/framework/MultiValuedTestParameterValue.java 2007-10-08 13:26:57 UTC (rev 8562)
+++ modules/test/trunk/test/src/main/org/jboss/portal/test/framework/MultiValuedTestParameterValue.java 2007-10-08 16:08:32 UTC (rev 8563)
@@ -1,91 +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.framework;
-
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.Iterator;
-
-/**
- * A multi value.
- *
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 7228 $
- */
-public class MultiValuedTestParameterValue extends TestParameterValue
-{
-
- /** . */
- protected final Collection value;
-
- public MultiValuedTestParameterValue(Object[] value) throws IllegalArgumentException
- {
- if (value == null)
- {
- throw new IllegalArgumentException();
- }
-
- //
- this.value = Arrays.asList(value);
- }
-
- public MultiValuedTestParameterValue(Collection value) throws IllegalArgumentException
- {
- if (value == null)
- {
- throw new IllegalArgumentException();
- }
-
- //
- this.value = value;
- }
-
- public Object get()
- {
- return value;
- }
-
- /** Return an iterator over the values. */
- public Iterator iterator()
- {
- return new Iterator()
- {
- Iterator i = value.iterator();
-
- public boolean hasNext()
- {
- return i.hasNext();
- }
-
- public Object next()
- {
- return new MonoValuedTestParameterValue(i.next());
- }
-
- public void remove()
- {
- throw new UnsupportedOperationException();
- }
- };
- }
-}
Deleted: modules/test/trunk/test/src/main/org/jboss/portal/test/framework/TestParameterValue.java
===================================================================
--- modules/test/trunk/test/src/main/org/jboss/portal/test/framework/TestParameterValue.java 2007-10-08 13:26:57 UTC (rev 8562)
+++ modules/test/trunk/test/src/main/org/jboss/portal/test/framework/TestParameterValue.java 2007-10-08 16:08:32 UTC (rev 8563)
@@ -1,63 +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.framework;
-
-import java.io.Serializable;
-
-/**
- * The value of a test parameter.
- *
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 7228 $
- */
-public abstract class TestParameterValue implements Serializable
-{
- /**
- * Return the actual value.
- *
- * @return
- */
- public abstract Object get();
-
- public int hashCode()
- {
- Object o = get();
- return o == null ? 0 : o.hashCode();
- }
-
- public boolean equals(Object obj)
- {
- if (obj == this)
- {
- return true;
- }
- if (obj instanceof TestParameterValue)
- {
- TestParameterValue that = (TestParameterValue)obj;
- Object thisO = get();
- Object thatO = that.get();
- return thisO == null ? thatO == null : thisO.equals(thatO);
- }
- return false;
- }
-}
Deleted: modules/test/trunk/test/src/main/org/jboss/portal/test/framework/TestParametrization.java
===================================================================
--- modules/test/trunk/test/src/main/org/jboss/portal/test/framework/TestParametrization.java 2007-10-08 13:26:57 UTC (rev 8562)
+++ modules/test/trunk/test/src/main/org/jboss/portal/test/framework/TestParametrization.java 2007-10-08 16:08:32 UTC (rev 8563)
@@ -1,195 +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.framework;
-
-import org.jboss.portal.test.framework.info.TestInfo;
-
-import java.io.Serializable;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.Map;
-import java.util.Set;
-
-/**
- * The parametrization of a test.
- *
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 7230 $
- */
-public class TestParametrization implements Serializable
-{
-
- /** . */
- private Map parameterValues;
-
- public TestParametrization()
- {
- parameterValues = new HashMap();
- }
-
- public TestParametrization(Map parameterValues) throws IllegalArgumentException
- {
- this();
-
- //
- if (parameterValues == null)
- {
- throw new IllegalArgumentException();
- }
-
- //
- for (Iterator i = parameterValues.entrySet().iterator(); i.hasNext();)
- {
- Map.Entry entry = (Map.Entry)i.next();
- String parameterName = (String)entry.getKey();
- TestParameterValue parameterValue = (TestParameterValue)entry.getValue();
- setParameterValue(parameterName, parameterValue);
- }
- }
-
- /**
- * Set a parameter value, using a null value will remove the parameter.
- *
- * @param parameterName the parameter name
- * @param parameterValue the parameter value
- * @throws IllegalArgumentException if the parameter name is null
- */
- public void setParameterValue(String parameterName, TestParameterValue parameterValue) throws IllegalArgumentException
- {
- if (parameterName == null)
- {
- throw new IllegalArgumentException();
- }
- if (parameterValue == null)
- {
- parameterValues.remove(parameterName);
- }
- else
- {
- parameterValues.put(parameterName, parameterValue);
- }
- }
-
- /**
- * Return a parameter value.
- *
- * @param parameterName the parameter name
- * @return the parameter value or null if it does not exist
- * @throws IllegalArgumentException if the parameter name is null
- */
- public TestParameterValue getParameterValue(String parameterName) throws IllegalArgumentException
- {
- if (parameterName == null)
- {
- throw new IllegalArgumentException();
- }
- return (TestParameterValue)parameterValues.get(parameterName);
- }
-
- public boolean isEmpty()
- {
- return parameterValues.isEmpty();
- }
-
- public String toString()
- {
- StringBuffer tmp = new StringBuffer();
- for (Iterator i = parameterValues.entrySet().iterator(); i.hasNext();)
- {
- Map.Entry entry = (Map.Entry)i.next();
- String parameterName = (String)entry.getKey();
- TestParameterValue value = (TestParameterValue)entry.getValue();
- tmp.append(parameterName).append('=').append(value.get()).append(i.hasNext() ? "," : "");
- }
- return tmp.toString();
- }
-
- /**
- * Build a collection of parametrization that satisfies the parameters exposed by the test meta information and the
- * parameter provided by the map.
- */
- public Collection create(TestInfo info)
- {
- ArrayList c = new ArrayList();
- c.add(new HashMap());
-
- Set expectedParameters = new HashSet(info.getParameterNames());
-
- //
- for (Iterator i = parameterValues.entrySet().iterator(); i.hasNext();)
- {
- Map.Entry entry = (Map.Entry)i.next();
- String parameterName = (String)entry.getKey();
- TestParameterValue value = (TestParameterValue)entry.getValue();
-
- //
- if (expectedParameters.contains(parameterName))
- {
- expectedParameters.remove(parameterName);
-
- //
- if (value instanceof MultiValuedTestParameterValue)
- {
- MultiValuedTestParameterValue multiValue = (MultiValuedTestParameterValue)value;
- ArrayList tmp = new ArrayList();
- for (Iterator j = multiValue.iterator(); j.hasNext();)
- {
- TestParameterValue o = (TestParameterValue)j.next();
- ArrayList copy = new ArrayList(c.size());
- for (Iterator k = c.iterator(); k.hasNext();)
- {
- Map parametrization = (Map)k.next();
- parametrization = new HashMap(parametrization);
- parametrization.put(parameterName, o);
- copy.add(parametrization);
- }
- tmp.addAll(copy);
- }
- c = tmp;
- }
- else
- {
- for (int j = 0; j < c.size(); j++)
- {
- Map parametrization = (Map)c.get(j);
- parametrization.put(parameterName, value);
- }
- }
- }
- }
-
- //
- for (int i = 0; i < c.size(); i++)
- {
- Map parametrization = (Map)c.get(i);
- TestParametrization ctx = new TestParametrization(parametrization);
- c.set(i, ctx);
- }
-
- //
- return c;
- }
-}
Modified: modules/test/trunk/test/src/main/org/jboss/portal/test/framework/embedded/DSConfig.java
===================================================================
--- modules/test/trunk/test/src/main/org/jboss/portal/test/framework/embedded/DSConfig.java 2007-10-08 13:26:57 UTC (rev 8562)
+++ modules/test/trunk/test/src/main/org/jboss/portal/test/framework/embedded/DSConfig.java 2007-10-08 16:08:32 UTC (rev 8563)
@@ -25,7 +25,6 @@
import org.jboss.portal.common.xml.XMLTools;
import org.jboss.portal.common.io.IOTools;
-import org.jboss.portal.test.framework.MultiValuedTestParameterValue;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
@@ -112,12 +111,12 @@
toString();
}
- public static MultiValuedTestParameterValue fromXML2(URL url) throws Exception
- {
- DSConfig[] configs = fromXML(url);
- List list = Arrays.asList(configs);
- return new MultiValuedTestParameterValue(list);
- }
+// public static MultiValuedTestParameterValue fromXML2(URL url) throws Exception
+// {
+// DSConfig[] configs = fromXML(url);
+// List list = Arrays.asList(configs);
+// return new MultiValuedTestParameterValue(list);
+// }
public static DSConfig[] fromXML(URL url) throws Exception
{
Modified: modules/test/trunk/test/src/main/org/jboss/portal/test/framework/embedded/DataSourceSupport.java
===================================================================
--- modules/test/trunk/test/src/main/org/jboss/portal/test/framework/embedded/DataSourceSupport.java 2007-10-08 13:26:57 UTC (rev 8562)
+++ modules/test/trunk/test/src/main/org/jboss/portal/test/framework/embedded/DataSourceSupport.java 2007-10-08 16:08:32 UTC (rev 8563)
@@ -25,7 +25,6 @@
import org.jboss.portal.common.xml.XMLTools;
import org.jboss.portal.common.io.IOTools;
-import org.jboss.portal.test.framework.MultiValuedTestParameterValue;
import org.jboss.resource.adapter.jdbc.local.LocalTxDataSource;
import org.jboss.resource.connectionmanager.CachedConnectionManagerReference;
import org.w3c.dom.Document;
@@ -254,12 +253,12 @@
this.password = password;
}
- public static MultiValuedTestParameterValue fromXML2(URL url) throws Exception
- {
- Config[] configs = fromXML(url);
- List list = Arrays.asList(configs);
- return new MultiValuedTestParameterValue(list);
- }
+// public static MultiValuedTestParameterValue fromXML2(URL url) throws Exception
+// {
+// Config[] configs = fromXML(url);
+// List list = Arrays.asList(configs);
+// return new MultiValuedTestParameterValue(list);
+// }
public static Config[] fromXML(URL url) throws Exception
{
Modified: modules/test/trunk/test/src/main/org/jboss/portal/test/framework/embedded/apacheds/ApacheDSServiceMBean.java
===================================================================
--- modules/test/trunk/test/src/main/org/jboss/portal/test/framework/embedded/apacheds/ApacheDSServiceMBean.java 2007-10-08 13:26:57 UTC (rev 8562)
+++ modules/test/trunk/test/src/main/org/jboss/portal/test/framework/embedded/apacheds/ApacheDSServiceMBean.java 2007-10-08 16:08:32 UTC (rev 8563)
@@ -23,13 +23,11 @@
package org.jboss.portal.test.framework.embedded.apacheds;
-import org.jboss.system.ServiceMBean;
-
/**
* @author <a href="mailto:boleslaw.dawidowicz@jboss.org">Boleslaw Dawidowicz</a>
* @version $Revision: 1.1 $
*/
-public interface ApacheDSServiceMBean extends ServiceMBean
+public interface ApacheDSServiceMBean
{
/* public String printDiagnostics();
Modified: modules/test/trunk/test/src/main/org/jboss/portal/test/framework/embedded/opends/OpenDSService.java
===================================================================
--- modules/test/trunk/test/src/main/org/jboss/portal/test/framework/embedded/opends/OpenDSService.java 2007-10-08 13:26:57 UTC (rev 8562)
+++ modules/test/trunk/test/src/main/org/jboss/portal/test/framework/embedded/opends/OpenDSService.java 2007-10-08 16:08:32 UTC (rev 8563)
@@ -24,7 +24,7 @@
package org.jboss.portal.test.framework.embedded.opends;
import org.opends.server.core.DirectoryServer;
-import org.jboss.system.ServiceMBeanSupport;
+import org.apache.log4j.Logger;
import java.security.AccessController;
import java.security.PrivilegedAction;
@@ -41,8 +41,11 @@
* @version $Revision$
* @since Sep 13, 2006
*/
-public class OpenDSService extends ServiceMBeanSupport implements OpenDSServiceMBean
+public class OpenDSService implements OpenDSServiceMBean
{
+
+ private static final Logger log = Logger.getLogger(OpenDSService.class);
+
public static String objectName = "portal.test:service=OpenDSService";
private String newline = (String)
@@ -70,9 +73,17 @@
DirectoryServer.restart(getClass().getName(), "DS restart");
}
+ public void create() throws Exception
+ {
+ }
+
+ public void start() throws Exception
+ {
+ startService();
+ }
+
public void startService() throws Exception
{
- super.startService();
//Get the location of the conf directory
String confLoc = (String)AccessController.doPrivileged(
@@ -94,12 +105,21 @@
}
+ public void stop() throws Exception
+ {
+ stopService();
+ }
+
public void stopService() throws Exception
{
log.info("Asking DS to shutdown");
DirectoryServer.shutDown(getClass().getName(), "Shut down DS");
}
+ public void destroy() throws Exception
+ {
+ }
+
/**
*
* A GetSystemPropetyAction.
Modified: modules/test/trunk/test/src/main/org/jboss/portal/test/framework/embedded/opends/OpenDSServiceMBean.java
===================================================================
--- modules/test/trunk/test/src/main/org/jboss/portal/test/framework/embedded/opends/OpenDSServiceMBean.java 2007-10-08 13:26:57 UTC (rev 8562)
+++ modules/test/trunk/test/src/main/org/jboss/portal/test/framework/embedded/opends/OpenDSServiceMBean.java 2007-10-08 16:08:32 UTC (rev 8563)
@@ -23,13 +23,11 @@
package org.jboss.portal.test.framework.embedded.opends;
-import org.jboss.system.ServiceMBean;
-
/**
* @author <a href="mailto:boleslaw.dawidowicz@jboss.org">Boleslaw Dawidowicz</a>
* @version $Revision: 1.1 $
*/
-public interface OpenDSServiceMBean extends ServiceMBean
+public interface OpenDSServiceMBean
{
/*public String printDiagnostics();
Modified: modules/test/trunk/test/src/main/org/jboss/portal/test/framework/embedded/opends/OpenDSUtil.java
===================================================================
--- modules/test/trunk/test/src/main/org/jboss/portal/test/framework/embedded/opends/OpenDSUtil.java 2007-10-08 13:26:57 UTC (rev 8562)
+++ modules/test/trunk/test/src/main/org/jboss/portal/test/framework/embedded/opends/OpenDSUtil.java 2007-10-08 16:08:32 UTC (rev 8563)
@@ -23,11 +23,11 @@
package org.jboss.portal.test.framework.embedded.opends;
-import org.jboss.logging.Logger;
import org.opends.server.tools.LDAPCompare;
import org.opends.server.tools.LDAPDelete;
import org.opends.server.tools.LDAPModify;
import org.opends.server.tools.LDAPSearch;
+import org.apache.log4j.Logger;
import java.net.URL;
import java.io.File;
Modified: modules/test/trunk/test/src/main/org/jboss/portal/test/framework/impl/generic/config/HTTPTestRunnerConfig.java
===================================================================
--- modules/test/trunk/test/src/main/org/jboss/portal/test/framework/impl/generic/config/HTTPTestRunnerConfig.java 2007-10-08 13:26:57 UTC (rev 8562)
+++ modules/test/trunk/test/src/main/org/jboss/portal/test/framework/impl/generic/config/HTTPTestRunnerConfig.java 2007-10-08 16:08:32 UTC (rev 8563)
@@ -22,10 +22,6 @@
******************************************************************************/
package org.jboss.portal.test.framework.impl.generic.config;
-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 $
@@ -41,17 +37,17 @@
*/
public String getServerName()
{
- TestParametrization parametrization = JUnitAdapter.getParametrization();
- TestParameterValue archive = parametrization.getParameterValue("serverName");
+ // TestParametrization parametrization = JUnitAdapter.getParametrization();
+ // TestParameterValue archive = parametrization.getParameterValue("serverName");
//
- if (archive != null)
- {
- return (String)archive.get();
- }
- else
- {
+// if (archive != null)
+// {
+// return (String)archive.get();
+// }
+// else
+// {
return "RemoteTomcat-6.0";
- }
+// }
}
}
Deleted: modules/test/trunk/test/src/main/org/jboss/portal/test/framework/impl/jboss/agent/JBossTestAgent.java
===================================================================
--- modules/test/trunk/test/src/main/org/jboss/portal/test/framework/impl/jboss/agent/JBossTestAgent.java 2007-10-08 13:26:57 UTC (rev 8562)
+++ modules/test/trunk/test/src/main/org/jboss/portal/test/framework/impl/jboss/agent/JBossTestAgent.java 2007-10-08 16:08:32 UTC (rev 8563)
@@ -1,115 +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.framework.impl.jboss.agent;
-
-import org.jboss.deployment.DeploymentException;
-import org.jboss.deployment.MainDeployerMBean;
-import org.jboss.system.ServiceMBeanSupport;
-
-import java.net.URL;
-
-/**
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 5669 $
- */
-public class JBossTestAgent extends ServiceMBeanSupport implements JBossTestAgentMBean
-{
-
- /** Keep a thread local of sessions. */
- private static final ThreadLocal local = new ThreadLocal();
-
- /**
- * Record the exception that will be reused later by the same agent to be aware of the recorded exception.
- *
- * @param e the deployment exception to log.
- */
- public static void record(DeploymentException e)
- {
- Session session = (Session)local.get();
-
- // Record the exception only if we have a session otherwise we may leek the exception in the thread local.
- if (session != null && session.e == null)
- {
- session.e = e;
- }
- }
-
- /** The main deployer delegate. */
- private MainDeployerMBean mainDeployer;
-
- public MainDeployerMBean getMainDeployer()
- {
- return mainDeployer;
- }
-
- public void setMainDeployer(MainDeployerMBean mainDeployer)
- {
- this.mainDeployer = mainDeployer;
- }
-
- public void deploy(URL url) throws Exception
- {
- perform(url, true);
- }
-
- public void undeploy(URL url) throws Exception
- {
- perform(url, false);
- }
-
- private void perform(URL url, boolean deploy) throws DeploymentException
- {
- try
- {
- Session session = new Session();
- local.set(session);
-
- // The main deployer could throw an exception but that will be an exception not related to jboss portal
- if (deploy)
- {
- mainDeployer.deploy(url);
- }
- else
- {
- mainDeployer.undeploy(url);
- }
-
- // If e is not null that means an exception was thrown into jboss portal layer and we rethrow it
- // to the client
- if (session.e != null)
- {
- throw session.e;
- }
- }
- finally
- {
- local.set(null);
- }
- }
-
- /** Just a place holder for the deployment exception. */
- private static class Session
- {
- private DeploymentException e;
- }
-}
Deleted: modules/test/trunk/test/src/main/org/jboss/portal/test/framework/impl/jboss/agent/JBossTestAgentMBean.java
===================================================================
--- modules/test/trunk/test/src/main/org/jboss/portal/test/framework/impl/jboss/agent/JBossTestAgentMBean.java 2007-10-08 13:26:57 UTC (rev 8562)
+++ modules/test/trunk/test/src/main/org/jboss/portal/test/framework/impl/jboss/agent/JBossTestAgentMBean.java 2007-10-08 16:08:32 UTC (rev 8563)
@@ -1,38 +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.framework.impl.jboss.agent;
-
-import org.jboss.deployment.MainDeployerMBean;
-import org.jboss.system.ServiceMBean;
-import org.jboss.portal.test.framework.agent.TestAgent;
-
-/**
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 1.1 $
- */
-public interface JBossTestAgentMBean extends TestAgent, ServiceMBean
-{
- MainDeployerMBean getMainDeployer();
-
- void setMainDeployer(MainDeployerMBean mainDeployer);
-}
Deleted: modules/test/trunk/test/src/main/org/jboss/portal/test/framework/impl/jboss/jmx/MBeanServerFactory.java
===================================================================
--- modules/test/trunk/test/src/main/org/jboss/portal/test/framework/impl/jboss/jmx/MBeanServerFactory.java 2007-10-08 13:26:57 UTC (rev 8562)
+++ modules/test/trunk/test/src/main/org/jboss/portal/test/framework/impl/jboss/jmx/MBeanServerFactory.java 2007-10-08 16:08:32 UTC (rev 8563)
@@ -1,131 +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.framework.impl.jboss.jmx;
-
-import javax.management.MBeanServer;
-import javax.management.MBeanServerConnection;
-import javax.naming.InitialContext;
-import javax.naming.NamingException;
-import java.lang.reflect.InvocationHandler;
-import java.lang.reflect.Method;
-import java.lang.reflect.Proxy;
-import java.util.Properties;
-
-/**
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 5498 $
- */
-public class MBeanServerFactory
-{
-
- /** . */
- private MBeanServer server;
-
- /** . */
- private Properties env;
-
- public Properties getEnv()
- {
- return env;
- }
-
- public void setEnv(Properties env)
- {
- this.env = env;
- }
-
- public void create()
- {
- }
-
- public void start() throws Exception
- {
- LazyMBeanServer lms = new LazyMBeanServer(env);
- server = lms.getProxy();
- }
-
- public void stop()
- {
- server = null;
- }
-
- public void destroy()
- {
- }
-
- public MBeanServer getServer() throws Exception
- {
- return server;
- }
-
- private static class LazyMBeanServer implements InvocationHandler
- {
-
- private Properties env;
- private MBeanServerConnection remoteServer;
- private MBeanServer proxy;
-
- public LazyMBeanServer(Properties env)
- {
- this.env = env;
- this.proxy = (MBeanServer)Proxy.newProxyInstance(Thread.currentThread().getContextClassLoader(), new Class[]{MBeanServer.class}, this);
- }
-
- public MBeanServer getProxy()
- {
- return proxy;
- }
-
- public Object invoke(Object proxy, Method method, Object[] args) throws Throwable
- {
- if (remoteServer == null)
- {
- InitialContext ctx = null;
- try
- {
- ctx = new InitialContext(env);
- MBeanServerConnection adaptor = (MBeanServerConnection)ctx.lookup("jmx/invoker/RMIAdaptor");
- remoteServer = new RemoteMBeanServerAdapter(adaptor).getServer();
- }
- finally
- {
- if (ctx != null)
- {
- try
- {
- ctx.close();
- }
- catch (NamingException ignore)
- {
- }
- }
- }
- }
- Method adaptedMethod = MBeanServerConnection.class.getMethod(method.getName(), method.getParameterTypes());
- return adaptedMethod.invoke(remoteServer, args);
- }
- }
-
-
-}
Deleted: modules/test/trunk/test/src/main/org/jboss/portal/test/framework/impl/jboss/jmx/RemoteMBeanProxy.java
===================================================================
--- modules/test/trunk/test/src/main/org/jboss/portal/test/framework/impl/jboss/jmx/RemoteMBeanProxy.java 2007-10-08 13:26:57 UTC (rev 8562)
+++ modules/test/trunk/test/src/main/org/jboss/portal/test/framework/impl/jboss/jmx/RemoteMBeanProxy.java 2007-10-08 16:08:32 UTC (rev 8563)
@@ -1,43 +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.framework.impl.jboss.jmx;
-
-import org.jboss.mx.util.MBeanProxy;
-
-import javax.management.MBeanServer;
-import javax.management.MBeanServerConnection;
-import javax.management.ObjectName;
-
-/**
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 5498 $
- */
-public class RemoteMBeanProxy
-{
- public static Object get(Class itf, ObjectName name, MBeanServerConnection remoteServer) throws Exception
- {
- MBeanServer server = new RemoteMBeanServerAdapter(remoteServer).getServer();
- return MBeanProxy.get(itf, name, server);
- }
-}
Deleted: modules/test/trunk/test/src/main/org/jboss/portal/test/framework/impl/jboss/jmx/RemoteMBeanServerAdapter.java
===================================================================
--- modules/test/trunk/test/src/main/org/jboss/portal/test/framework/impl/jboss/jmx/RemoteMBeanServerAdapter.java 2007-10-08 13:26:57 UTC (rev 8562)
+++ modules/test/trunk/test/src/main/org/jboss/portal/test/framework/impl/jboss/jmx/RemoteMBeanServerAdapter.java 2007-10-08 16:08:32 UTC (rev 8563)
@@ -1,58 +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.framework.impl.jboss.jmx;
-
-import javax.management.MBeanServer;
-import javax.management.MBeanServerConnection;
-import java.lang.reflect.InvocationHandler;
-import java.lang.reflect.Method;
-import java.lang.reflect.Proxy;
-
-/**
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 5498 $
- */
-public class RemoteMBeanServerAdapter implements InvocationHandler
-{
-
- private MBeanServerConnection remoteServer;
- private MBeanServer adaptedServer;
-
- public RemoteMBeanServerAdapter(MBeanServerConnection remoteServer)
- {
- this.remoteServer = remoteServer;
- this.adaptedServer = (MBeanServer)Proxy.newProxyInstance(Thread.currentThread().getContextClassLoader(), new Class[]{MBeanServer.class}, this);
- }
-
- public MBeanServer getServer()
- {
- return adaptedServer;
- }
-
- public Object invoke(Object proxy, Method method, Object[] args) throws Throwable
- {
- Method adaptedMethod = MBeanServerConnection.class.getMethod(method.getName(), method.getParameterTypes());
- return adaptedMethod.invoke(remoteServer, args);
- }
-}
Deleted: modules/test/trunk/test/src/main/org/jboss/portal/test/framework/impl/jboss/server/JBossServiceLookup.java
===================================================================
--- modules/test/trunk/test/src/main/org/jboss/portal/test/framework/impl/jboss/server/JBossServiceLookup.java 2007-10-08 13:26:57 UTC (rev 8562)
+++ modules/test/trunk/test/src/main/org/jboss/portal/test/framework/impl/jboss/server/JBossServiceLookup.java 2007-10-08 16:08:32 UTC (rev 8563)
@@ -1,82 +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.framework.impl.jboss.server;
-
-import org.jboss.mx.util.MBeanProxy;
-import org.jboss.mx.util.MBeanProxyCreationException;
-import org.jboss.portal.test.framework.server.ServiceLookup;
-import org.jboss.portal.test.framework.server.ServiceLookupFailedException;
-
-import javax.management.ObjectName;
-import javax.management.MBeanServer;
-
-/**
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 1.1 $
- */
-public class JBossServiceLookup implements ServiceLookup
-{
-
- /** . */
- private final MBeanServer mbeanServer;
-
- /** . */
- private final ObjectName objectName;
-
- /** . */
- private final String serviceInterface;
-
- public JBossServiceLookup(MBeanServer mbeanServer, ObjectName objectName, String serviceInterface)
- {
- this.mbeanServer = mbeanServer;
- this.objectName = objectName;
- this.serviceInterface = serviceInterface;
- }
-
- public ObjectName getObjectName()
- {
- return objectName;
- }
-
- public String getServiceInterface()
- {
- return serviceInterface;
- }
-
- public Object lookupService() throws ServiceLookupFailedException
- {
- try
- {
- Class proxyInterface = Thread.currentThread().getContextClassLoader().loadClass(serviceInterface);
- return MBeanProxy.get(proxyInterface, objectName, mbeanServer);
- }
- catch (ClassNotFoundException e)
- {
- throw new ServiceLookupFailedException(e);
- }
- catch (MBeanProxyCreationException e)
- {
- throw new ServiceLookupFailedException(e);
- }
- }
-}
Modified: modules/test/trunk/test/src/main/org/jboss/portal/test/framework/runner/BaseRunner.java
===================================================================
--- modules/test/trunk/test/src/main/org/jboss/portal/test/framework/runner/BaseRunner.java 2007-10-08 13:26:57 UTC (rev 8562)
+++ modules/test/trunk/test/src/main/org/jboss/portal/test/framework/runner/BaseRunner.java 2007-10-08 16:08:32 UTC (rev 8563)
@@ -26,9 +26,6 @@
import org.jboss.portal.test.framework.server.NodeManager;
import org.jboss.portal.test.framework.server.NodeId;
import org.jboss.portal.test.framework.mc.TestRuntimeContext;
-import org.jboss.portal.test.framework.driver.remote.RemoteTestDriverClient;
-import org.jboss.portal.test.framework.junit.JUnitAdapter;
-import org.jboss.portal.test.framework.TestParametrization;
import org.apache.log4j.Logger;
import org.apache.log4j.Appender;
import org.apache.log4j.SimpleLayout;
@@ -36,7 +33,6 @@
import org.apache.log4j.ConsoleAppender;
import junit.framework.Test;
import junit.framework.TestResult;
-import junit.framework.TestCase;
import junit.framework.AssertionFailedError;
import java.net.URL;
@@ -77,7 +73,7 @@
private String archivePath;
/** . */
- private JUnitAdapter adapter;
+// private JUnitAdapter adapter;
/** . */
private int state;
@@ -86,7 +82,7 @@
private Integer testCaseCount;
/** . */
- private RemoteTestDriverClient testDriverClient;
+// private RemoteTestDriverClient testDriverClient;
/** The node id list used for this test suite. */
private NodeId[] nodeIds;
@@ -130,16 +126,16 @@
this.nodeManager = nodeManager;
}
- public RemoteTestDriverClient getTestDriverClient()
- {
- return testDriverClient;
- }
+// public RemoteTestDriverClient getTestDriverClient()
+// {
+// return testDriverClient;
+// }
+//
+// public void setTestDriverClient(RemoteTestDriverClient testDriverClient)
+// {
+// this.testDriverClient = testDriverClient;
+// }
- public void setTestDriverClient(RemoteTestDriverClient testDriverClient)
- {
- this.testDriverClient = testDriverClient;
- }
-
private void startContext() throws Exception
{
runtimeContext.start();
@@ -159,15 +155,15 @@
startContext();
// Configure driver further more (todo find a way to do that int the bean assembly)
- testDriverClient.setInitialNodeId(nodeIds[0]);
- testDriverClient.setArchivePath(archivePath);
- testDriverClient.setNodeManager(nodeManager);
+ // testDriverClient.setInitialNodeId(nodeIds[0]);
+ // testDriverClient.setArchivePath(archivePath);
+ // testDriverClient.setNodeManager(nodeManager);
// Get optional parametrization
- TestParametrization parametrization = JUnitAdapter.getParametrization();
+ // TestParametrization parametrization = JUnitAdapter.getParametrization();
//
- adapter = new JUnitAdapter(testDriverClient, parametrization);
+ // adapter = new JUnitAdapter(testDriverClient, parametrization);
state = STARTED;
}
finally
@@ -199,7 +195,7 @@
{
state = FAILED;
}
- adapter = null;
+ // adapter = null;
}
}
}
@@ -213,7 +209,7 @@
try
{
startIfNeeded();
- testCaseCount = new Integer(adapter.countTestCases());
+ // testCaseCount = new Integer(adapter.countTestCases());
}
catch (Exception e)
{
@@ -231,7 +227,7 @@
try
{
startIfNeeded();
- adapter.run(testResult);
+ // adapter.run(testResult);
}
catch (Exception e)
{
Modified: modules/test/trunk/test/src/main/org/jboss/portal/test/framework/runner/HTTPTestRunner.java
===================================================================
--- modules/test/trunk/test/src/main/org/jboss/portal/test/framework/runner/HTTPTestRunner.java 2007-10-08 13:26:57 UTC (rev 8562)
+++ modules/test/trunk/test/src/main/org/jboss/portal/test/framework/runner/HTTPTestRunner.java 2007-10-08 16:08:32 UTC (rev 8563)
@@ -23,8 +23,6 @@
package org.jboss.portal.test.framework.runner;
import org.jboss.portal.test.framework.server.NodeId;
-import org.jboss.portal.test.framework.TestParametrization;
-import org.jboss.portal.test.framework.junit.JUnitAdapter;
import java.io.File;
import java.net.MalformedURLException;
@@ -61,15 +59,15 @@
private String getArchiveName()
{
- if (archiveName == null)
- {
- TestParametrization parametrization = JUnitAdapter.getParametrization();
- return (String)parametrization.getParameterValue("archive").get();
- }
- else
- {
+// if (archiveName == null)
+// {
+// TestParametrization parametrization = JUnitAdapter.getParametrization();
+// return (String)parametrization.getParameterValue("archive").get();
+// }
+// else
+// {
return archiveName;
- }
+// }
}
public void startRunner() throws Exception
Deleted: modules/test/trunk/test/src/main/org/jboss/portal/test/framework/runner/WebTestRunner.java
===================================================================
--- modules/test/trunk/test/src/main/org/jboss/portal/test/framework/runner/WebTestRunner.java 2007-10-08 13:26:57 UTC (rev 8562)
+++ modules/test/trunk/test/src/main/org/jboss/portal/test/framework/runner/WebTestRunner.java 2007-10-08 16:08:32 UTC (rev 8563)
@@ -1,117 +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.framework.runner;
-
-import org.jboss.portal.test.framework.server.NodeId;
-import org.jboss.portal.test.framework.junit.JUnitAdapter;
-import org.jboss.portal.test.framework.TestParametrization;
-
-import java.io.File;
-import java.net.MalformedURLException;
-
-import junit.framework.AssertionFailedError;
-
-/**
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 1.1 $
- */
-public class WebTestRunner extends BaseRunner
-{
-
- /** . */
- public static final String JBOSS_BEANS_LOCATION = "org/jboss/portal/test/framework/container/web-runner-beans.xml";
-
- /** . */
- private String archiveName;
-
- public WebTestRunner()
- {
- super(JBOSS_BEANS_LOCATION);
-
- //
- init(null);
- }
-
- public WebTestRunner(NodeId[] nodeIds)
- {
- super(JBOSS_BEANS_LOCATION, nodeIds);
-
- //
- init(null);
- }
-
- public WebTestRunner(String archiveName)
- {
- super(JBOSS_BEANS_LOCATION);
-
- //
- init(archiveName);
- }
-
- public WebTestRunner(String archiveName, NodeId[] nodeIds)
- {
- super(JBOSS_BEANS_LOCATION, nodeIds);
-
- //
- init(archiveName);
- }
-
- private void init(String archiveName)
- {
- if (archiveName == null)
- {
- TestParametrization abc = JUnitAdapter.getParametrization();
- this.archiveName = (String)abc.getParameterValue("archive").get();
- }
- else
- {
- this.archiveName = archiveName;
- }
- }
-
- public void startRunner() throws Exception
- {
- File root = new File(getArchivePath());
- File f = new File(root, archiveName);
- deploy(f.toURL());
- }
-
- public void stopRunner()
- {
- try
- {
- File root = new File(getArchivePath());
- File f = new File(root, archiveName);
- undeploy(f.toURL());
- }
- catch (MalformedURLException e)
- {
- e.printStackTrace();
- }
- }
-
- public void testDummy()
- {
- throw new AssertionFailedError("Test dummy should not be called, it's a place holder so that running it from ant does not fail");
- }
-}
Deleted: modules/test/trunk/test/src/main/org/jboss/test/InfoTestCase.java
===================================================================
--- modules/test/trunk/test/src/main/org/jboss/test/InfoTestCase.java 2007-10-08 13:26:57 UTC (rev 8562)
+++ modules/test/trunk/test/src/main/org/jboss/test/InfoTestCase.java 2007-10-08 16:08:32 UTC (rev 8563)
@@ -1,231 +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.test;
-
-import junit.framework.TestCase;
-import org.jboss.portal.test.framework.info.TestContainerInfo;
-import org.jboss.portal.test.framework.info.TestInfo;
-import org.jboss.portal.test.framework.info.TestParameterInfo;
-import org.jboss.portal.common.util.CollectionBuilder;
-
-import java.util.Collections;
-import java.util.HashSet;
-
-/**
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 1.1 $
- */
-public class InfoTestCase extends TestCase
-{
-
- public void testTestContainerConstructor()
- {
- try
- {
- new TestContainerInfo((String)null);
- fail("Was expecting an IAE");
- }
- catch (IllegalArgumentException e)
- {
- }
- try
- {
- new TestContainerInfo(null, "");
- fail("Was expecting an IAE");
- }
- catch (IllegalArgumentException e)
- {
- }
-
- //
- TestContainerInfo c1 = new TestContainerInfo("foo", null);
- assertEquals("foo", c1.getName());
- assertEquals(null, c1.getDescription());
- assertEquals(Collections.EMPTY_SET, c1.getChildNames());
-
- //
- TestContainerInfo c2 = new TestContainerInfo("foo", "bar");
- assertEquals("foo", c2.getName());
- assertEquals("bar", c2.getDescription());
- assertEquals(Collections.EMPTY_SET, c2.getChildNames());
- }
-
- public void testTestConstructor()
- {
- try
- {
- new TestInfo((String)null);
- fail("Was expecting an IAE");
- }
- catch (IllegalArgumentException e)
- {
- }
- try
- {
- new TestInfo(null, "");
- fail("Was expecting an IAE");
- }
- catch (IllegalArgumentException e)
- {
- }
-
- //
- TestInfo t1 = new TestInfo("foo");
- assertEquals("foo", t1.getName());
- assertEquals(null, t1.getDescription());
-
- //
- TestInfo t2 = new TestInfo("foo", "bar");
- assertEquals("foo", t2.getName());
- assertEquals("bar", t2.getDescription());
- }
-
- public void testParameterConstructor()
- {
- try
- {
- new TestParameterInfo(null);
- fail("Was expecting an IAE");
- }
- catch (IllegalArgumentException e)
- {
- }
- try
- {
- new TestInfo(null, "");
- fail("Was expecting an IAE");
- }
- catch (IllegalArgumentException e)
- {
- }
-
- //
- TestParameterInfo p1 = new TestParameterInfo("foo");
- assertEquals("foo", p1.getName());
- assertEquals(null, p1.getDescription());
-
- //
- TestParameterInfo p2 = new TestParameterInfo("foo", "bar");
- assertEquals("foo", p2.getName());
- assertEquals("bar", p2.getDescription());
- }
-
- public void testTestParameters()
- {
- TestInfo test = new TestInfo("foo");
- assertEquals(new HashSet(), new HashSet(test.getParameterNames()));
-
- //
- TestParameterInfo p1 = new TestParameterInfo("p1");
- test.addParameter(p1);
- assertEquals(p1, test.getParameter("p1"));
- assertEquals(Collections.singleton("p1"), test.getParameterNames());
-
- //
- try
- {
- test.addParameter(new TestParameterInfo("p1"));
- fail();
- }
- catch (IllegalArgumentException expected)
- {
- }
- assertEquals(p1, test.getParameter("p1"));
- assertEquals(Collections.singleton("p1"), test.getParameterNames());
-
- //
- TestParameterInfo p2 = new TestParameterInfo("p2");
- test.addParameter(p2);
- assertEquals(p1, test.getParameter("p1"));
- assertEquals(p2, test.getParameter("p2"));
- assertEquals(new CollectionBuilder().add("p1").add("p2").toHashSet(), test.getParameterNames());
- }
-
- public void testId()
- {
- TestContainerInfo root = new TestContainerInfo("root");
- assertEquals("/", root.getId(null));
- assertEquals("", root.getId(root));
- try
- {
- root.getId(new TestContainerInfo("tmp"));
- fail();
- }
- catch (IllegalArgumentException expected)
- {
- }
-
- //
- TestInfo a = new TestInfo("a");
- root.addChild(a);
- assertEquals("/a", a.getId(null));
- assertEquals("a", a.getId(root));
- assertEquals("", a.getId(a));
-
- //
- TestContainerInfo b = new TestContainerInfo("b");
- root.addChild(b);
- assertEquals("/b", b.getId(null));
- assertEquals("b", b.getId(root));
- assertEquals("", b.getId(b));
-
- //
- TestInfo c = new TestInfo("c");
- b.addChild(c);
- assertEquals("/b/c", c.getId(null));
- assertEquals("b/c", c.getId(root));
- assertEquals("c", c.getId(b));
- assertEquals("", c.getId(c));
- }
-
- public void testClone()
- {
-
- }
-
- public void testVisitor()
- {
-
- }
-
- public void testFind()
- {
- TestContainerInfo root = new TestContainerInfo("root");
- TestInfo a = new TestInfo("a");
- root.addChild(a);
- TestContainerInfo b = new TestContainerInfo("b");
- root.addChild(b);
- TestInfo c = new TestInfo("c");
- b.addChild(c);
-
- //
- assertEquals(root, root.findItem(""));
- assertEquals(a, a.findItem(""));
- assertEquals(a, root.findItem("a"));
- assertEquals(b, b.findItem(""));
- assertEquals(b, root.findItem("b"));
- assertEquals(c, c.findItem(""));
- assertEquals(c, b.findItem("c"));
- assertEquals(c, root.findItem("b/c"));
- }
-}
Deleted: modules/test/trunk/test/src/main/org/jboss/test/TestParameterValueTestCase.java
===================================================================
--- modules/test/trunk/test/src/main/org/jboss/test/TestParameterValueTestCase.java 2007-10-08 13:26:57 UTC (rev 8562)
+++ modules/test/trunk/test/src/main/org/jboss/test/TestParameterValueTestCase.java 2007-10-08 16:08:32 UTC (rev 8563)
@@ -1,103 +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.test;
-
-import org.jboss.portal.test.framework.MonoValuedTestParameterValue;
-import org.jboss.portal.test.framework.MultiValuedTestParameterValue;
-import junit.framework.TestCase;
-
-import java.util.Collection;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.NoSuchElementException;
-
-/**
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 1.1 $
- */
-public class TestParameterValueTestCase extends TestCase
-{
-
- public void testMono()
- {
- Object o = new Object();
- assertEquals(o, new MonoValuedTestParameterValue(o).get());
- assertEquals(null, new MonoValuedTestParameterValue(null).get());
-
- //
- assertEquals(new MonoValuedTestParameterValue("abc"), new MonoValuedTestParameterValue("abc"));
- assertEquals(new MonoValuedTestParameterValue(o), new MonoValuedTestParameterValue(o));
- assertEquals(new MonoValuedTestParameterValue(null), new MonoValuedTestParameterValue(null));
-
- //
- assertFalse(new MonoValuedTestParameterValue(o).equals(new MonoValuedTestParameterValue(new Object())));
- assertFalse(new MonoValuedTestParameterValue(o).equals(new MonoValuedTestParameterValue(null)));
- assertFalse(new MonoValuedTestParameterValue(new Object()).equals(new MonoValuedTestParameterValue(o)));
- assertFalse(new MonoValuedTestParameterValue(null).equals(new MonoValuedTestParameterValue(o)));
- }
-
- public void testMulti()
- {
- try
- {
- new MultiValuedTestParameterValue((Collection)null);
- fail();
- }
- catch (IllegalArgumentException expected)
- {
- }
- try
- {
- new MultiValuedTestParameterValue((Object[])null);
- fail();
- }
- catch (IllegalArgumentException expected)
- {
- }
- ArrayList toto = new ArrayList();
- toto.add("abc");
- toto.add("def");
- MultiValuedTestParameterValue t = new MultiValuedTestParameterValue(toto);
- assertEquals(toto, t.get());
- Iterator i = t.iterator();
- assertNotNull(i);
- assertTrue(i.hasNext());
- Object i0 = i.next();
- assertNotNull(i0);
- assertTrue(i0 instanceof MonoValuedTestParameterValue);
- assertEquals("abc", ((MonoValuedTestParameterValue)i0).get());
- assertTrue(i.hasNext());
- Object i1 = i.next();
- assertNotNull(i1);
- assertTrue(i1 instanceof MonoValuedTestParameterValue);
- assertEquals("def", ((MonoValuedTestParameterValue)i1).get());
- assertFalse(i.hasNext());
- try
- {
- i.next();
- }
- catch (NoSuchElementException expected)
- {
- }
- }
-}
Deleted: modules/test/trunk/test/src/main/org/jboss/test/TestParametrizationTestCase.java
===================================================================
--- modules/test/trunk/test/src/main/org/jboss/test/TestParametrizationTestCase.java 2007-10-08 13:26:57 UTC (rev 8562)
+++ modules/test/trunk/test/src/main/org/jboss/test/TestParametrizationTestCase.java 2007-10-08 16:08:32 UTC (rev 8563)
@@ -1,116 +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.test;
-
-import junit.framework.TestCase;
-import org.jboss.portal.test.framework.info.TestInfo;
-import org.jboss.portal.test.framework.info.TestParameterInfo;
-import org.jboss.portal.test.framework.TestParametrization;
-import org.jboss.portal.test.framework.MonoValuedTestParameterValue;
-import org.jboss.portal.test.framework.MultiValuedTestParameterValue;
-import org.jboss.portal.common.util.CollectionBuilder;
-
-import java.util.Collection;
-import java.util.Iterator;
-
-/**
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 1.1 $
- */
-public class TestParametrizationTestCase extends TestCase
-{
-
- public void testGet()
- {
- try
- {
- new TestParametrization().getParameterValue(null);
- fail();
- }
- catch (IllegalArgumentException expected)
- {
- }
- }
-
- public void testSet()
- {
- try
- {
- new TestParametrization().setParameterValue(null, null);
- fail();
- }
- catch (IllegalArgumentException expected)
- {
- }
- try
- {
- new TestParametrization().setParameterValue(null, new MonoValuedTestParameterValue("abc"));
- fail();
- }
- catch (IllegalArgumentException expected)
- {
- }
- TestParametrization p = new TestParametrization();
- MonoValuedTestParameterValue v = new MonoValuedTestParameterValue("def");
- p.setParameterValue("abc", v);
- assertEquals(v, p.getParameterValue("abc"));
- p.setParameterValue("abc", null);
- assertEquals(null, p.getParameterValue("abc"));
- }
-
- public void testCreate()
- {
- TestInfo info = new TestInfo("test");
- info.addParameter(new TestParameterInfo("foo"));
- info.addParameter(new TestParameterInfo("bar"));
-
- //
- TestParametrization p1 = new TestParametrization();
- p1.setParameterValue("foo", new MonoValuedTestParameterValue("foo1"));
- p1.setParameterValue("abc", new MonoValuedTestParameterValue("def"));
- Collection c1 = p1.create(info);
- assertNotNull(c1);
- assertEquals(1, c1.size());
- TestParametrization q1 = (TestParametrization)c1.iterator().next();
- assertEquals(new MonoValuedTestParameterValue("foo1"), q1.getParameterValue("foo"));
- assertEquals(null, q1.getParameterValue("abc"));
-
- //
- TestParametrization p2 = new TestParametrization();
- p2.setParameterValue("foo", new MonoValuedTestParameterValue("foo1"));
- p2.setParameterValue("abc", new MonoValuedTestParameterValue("def"));
- p2.setParameterValue("bar", new MultiValuedTestParameterValue(new CollectionBuilder().add("bar1").add("bar2").toArrayList()));
- Collection c2 = p2.create(info);
- assertNotNull(c2);
- assertEquals(2, c2.size());
- Iterator i2 = c2.iterator();
- TestParametrization q2_1 = (TestParametrization)i2.next();
- assertEquals(new MonoValuedTestParameterValue("foo1"), q2_1.getParameterValue("foo"));
- assertEquals(new MonoValuedTestParameterValue("bar1"), q2_1.getParameterValue("bar"));
- assertEquals(null, q2_1.getParameterValue("abc"));
- TestParametrization q2_2 = (TestParametrization)i2.next();
- assertEquals(new MonoValuedTestParameterValue("foo1"), q2_2.getParameterValue("foo"));
- assertEquals(new MonoValuedTestParameterValue("bar2"), q2_2.getParameterValue("bar"));
- assertEquals(null, q2_2.getParameterValue("abc"));
- }
-}
Modified: modules/test/trunk/tools/etc/buildfragments/modules.ent
===================================================================
--- modules/test/trunk/tools/etc/buildfragments/modules.ent 2007-10-08 13:26:57 UTC (rev 8562)
+++ modules/test/trunk/tools/etc/buildfragments/modules.ent 2007-10-08 16:08:32 UTC (rev 8563)
@@ -2,204 +2,21 @@
<target name="configure-modules" unless="configure-modules.disabled">
- <!-- common -->
- <property name="jboss.portal-common.root" value="${project.root}/common/output"/>
- <property name="jboss.portal-common.lib" value="${jboss.portal-common.root}/lib"/>
- <path id="jboss.portal-common.classpath">
- <pathelement path="${jboss.portal-common.lib}/portal-common-lib.jar"/>
+ <!-- unit -->
+ <property name="jboss.unit.root" value="${project.root}/unit/output"/>
+ <property name="jboss.unit.lib" value="${jboss.unit.root}/lib"/>
+ <path id="jboss.unit.classpath">
+ <pathelement path="${jboss.unit.lib}/jboss-unit-lib.jar"/>
</path>
- <!-- web -->
- <property name="jboss.portal-web.root" value="${project.root}/web/output"/>
- <property name="jboss.portal-web.lib" value="${jboss.portal-web.root}/lib"/>
- <path id="jboss.portal-web.classpath">
- <pathelement path="${jboss.portal-web.lib}/portal-web-lib.jar"/>
+ <!-- unit -->
+ <property name="portal.test.root" value="${project.root}/test/output"/>
+ <property name="portal.test.lib" value="${portal.test.root}/lib"/>
+ <path id="portal.test.classpath">
+ <pathelement path="${portal.test.lib}/portal-test-lib.jar"/>
</path>
- <!-- test -->
- <property name="jboss.portal-test.root" value="${project.root}/test/output"/>
- <property name="jboss.portal-test.lib" value="${jboss.portal-test.root}/lib"/>
- <path id="jboss.portal-test.classpath">
- <pathelement path="${jboss.portal-test.lib}/portal-test-lib.jar"/>
- <pathelement path="${jboss.portal-test.lib}/portal-test-agent-lib.jar"/>
- </path>
- <!-- cms -->
- <property name="jboss.portal-cms.root" value="${project.root}/cms/output"/>
- <property name="jboss.portal-cms.lib" value="${jboss.portal-cms.root}/lib"/>
- <path id="jboss.portal-cms.classpath">
- <pathelement path="${jboss.portal-cms.lib}/portal-cms-lib.jar"/>
- </path>
-
- <!-- search -->
- <property name="jboss.portal-search.root" value="${project.root}/search/output"/>
- <property name="jboss.portal-search.lib" value="${jboss.portal-search.root}/lib"/>
- <path id="jboss.portal-search.classpath">
- <pathelement path="${jboss.portal-search.lib}/portal-search-lib.jar"/>
- </path>
-
- <!-- server -->
- <property name="jboss.portal-server.root" value="${project.root}/server/output"/>
- <property name="jboss.portal-server.lib" value="${jboss.portal-server.root}/lib"/>
- <path id="jboss.portal-server.classpath">
- <pathelement path="${jboss.portal-server.lib}/portal-server-lib.jar"/>
- <pathelement path="${jboss.portal-server.lib}/portal-server-test-framework-lib.jar"/>
- </path>
-
- <!-- api -->
- <property name="jboss.portlet-api.root" value="${project.root}/api/output"/>
- <property name="jboss.portlet-api.lib" value="${jboss.portlet-api.root}/lib"/>
- <path id="jboss.portlet-api.classpath">
- <pathelement path="${jboss.portlet-api.lib}/portlet-api-lib.jar"/>
- <pathelement path="${jboss.portlet-api.lib}/portal-api-lib.jar"/>
- </path>
-
- <!-- faces -->
- <property name="jboss.portal-faces.root" value="${project.root}/faces/output"/>
- <property name="jboss.portal-faces.lib" value="${jboss.portal-faces.root}/lib"/>
- <path id="jboss.portal-faces.classpath">
- <pathelement path="${jboss.portal-faces.lib}/portal-faces-lib.jar"/>
- </path>
-
- <!-- jems -->
- <property name="jboss.portal-jems.root" value="${project.root}/jems/output"/>
- <property name="jboss.portal-jems.lib" value="${jboss.portal-jems.root}/lib"/>
- <path id="jboss.portal-jems.classpath">
- <pathelement path="${jboss.portal-jems.lib}/portal-jems-lib.jar"/>
- </path>
-
- <!-- portlet -->
- <property name="jboss.portal-portlet.root" value="${project.root}/portlet/output"/>
- <property name="jboss.portal-portlet.lib" value="${jboss.portal-portlet.root}/lib"/>
- <path id="jboss.portal-portlet.classpath">
- <pathelement path="${jboss.portal-portlet.lib}/portal-portlet-lib.jar"/>
- <pathelement path="${jboss.portal-portlet.lib}/portal-portlet-test-lib.jar"/>
- <pathelement path="${jboss.portal-portlet.lib}/portal-portlet-test-framework-lib.jar"/>
- </path>
-
- <!-- portlet-server -->
- <property name="jboss.portal-portlet-server.root" value="${project.root}/portlet-server/output"/>
- <property name="jboss.portal-portlet-server.lib" value="${jboss.portal-portlet-server.root}/lib"/>
- <path id="jboss.portal-portlet-server.classpath">
- <pathelement path="${jboss.portal-portlet-server.lib}/portal-portlet-server-lib.jar"/>
- </path>
-
- <!-- portlet-federation -->
- <property name="jboss.portal-portlet-federation.root" value="${project.root}/portlet-federation/output"/>
- <property name="jboss.portal-portlet-federation.lib" value="${jboss.portal-portlet-federation.root}/lib"/>
- <path id="jboss.portal-portlet-federation.classpath">
- <pathelement path="${jboss.portal-portlet-federation.lib}/portal-portlet-federation-lib.jar"/>
- </path>
-
- <!-- bridge -->
- <property name="jboss.portal-bridge.root" value="${project.root}/bridge/output"/>
- <property name="jboss.portal-bridge.lib" value="${jboss.portal-bridge.root}/lib"/>
- <path id="jboss.portal-bridge.classpath">
- <pathelement path="${jboss.portal-bridge.lib}/portal-bridge-lib.jar"/>
- </path>
-
- <!-- format -->
- <property name="jboss.portal-format.root" value="${project.root}/format/output"/>
- <property name="jboss.portal-format.lib" value="${jboss.portal-format.root}/lib"/>
- <path id="jboss.portal-format.classpath">
- <pathelement path="${jboss.portal-format.lib}/portal-format-lib.jar"/>
- </path>
-
- <!-- core -->
- <property name="jboss.portal-core.root" value="${project.root}/core/output"/>
- <property name="jboss.portal-core.lib" value="${jboss.portal-core.root}/lib"/>
- <path id="jboss.portal-core.classpath">
- <pathelement path="${jboss.portal-core.lib}/portal-core-lib.jar"/>
- <pathelement path="${jboss.portal-core.lib}/jboss-portlet-api-lib.jar"/>
- </path>
-
- <!-- core-admin -->
- <property name="jboss.portal-core-admin.root" value="${project.root}/core-admin/output"/>
- <property name="jboss.portal-core-admin.lib" value="${jboss.portal-core-admin.root}/lib"/>
- <path id="jboss.portal-core-admin.classpath">
- <pathelement path="${jboss.portal-core-admin.lib}/portal-core-admin-lib.jar"/>
- </path>
-
- <!-- core-cms -->
- <property name="jboss.portal-core-cms.root" value="${project.root}/core-cms/output"/>
- <property name="jboss.portal-core-cms.lib" value="${jboss.portal-core-cms.root}/lib"/>
- <path id="jboss.portal-core-cms.classpath">
- <pathelement path="${jboss.portal-core-cms.lib}/portal-core-cms-lib.jar"/>
- </path>
-
- <!-- core-management -->
- <property name="jboss.portal-core-management.root" value="${project.root}/core-management/output"/>
- <property name="jboss.portal-core-management.lib" value="${jboss.portal-core-management.root}/lib"/>
- <path id="jboss.portal-core-management.classpath">
- <pathelement path="${jboss.portal-core-management.lib}/portal-core-management-lib.jar"/>
- </path>
-
- <!-- core-samples -->
- <property name="jboss.portal-core-samples.root" value="${project.root}/core-samples/output"/>
- <property name="jboss.portal-core-samples.lib" value="${jboss.portal-core-samples.root}/lib"/>
- <path id="jboss.portal-core-samples.classpath">
- <pathelement path="${jboss.portal-core-samples.lib}/portal-core-samples-lib.jar"/>
- </path>
-
- <!-- core-wsrp -->
- <property name="jboss.portal-core-wsrp.root" value="${project.root}/core-wsrp/output"/>
- <property name="jboss.portal-core-wsrp.lib" value="${jboss.portal-core-wsrp.root}/lib"/>
- <path id="jboss.portal-core-wsrp.classpath">
- <pathelement path="${jboss.portal-core-wsrp.lib}/portal-core-wsrp-lib.jar"/>
- </path>
-
- <!-- theme -->
- <property name="jboss.portal-theme.root" value="${project.root}/theme/output"/>
- <property name="jboss.portal-theme.lib" value="${jboss.portal-theme.root}/lib"/>
- <path id="jboss.portal-theme.classpath">
- <pathelement path="${jboss.portal-theme.lib}/portal-theme-lib.jar"/>
- </path>
-
- <!-- wsrp -->
- <property name="jboss.portal-wsrp.root" value="${project.root}/wsrp/output"/>
- <property name="jboss.portal-wsrp.lib" value="${jboss.portal-wsrp.root}/lib"/>
- <path id="jboss.portal-wsrp.classpath">
- <pathelement path="${jboss.portal-wsrp.lib}/portal-wsrp-lib.jar"/>
- <pathelement path="${jboss.portal-wsrp.lib}/portal-wsrp-test-lib.jar"/>
- </path>
-
- <!-- registration -->
- <property name="jboss.portal-registration.root" value="${project.root}/registration/output"/>
- <property name="jboss.portal-registration.lib" value="${jboss.portal-registration.root}/lib"/>
- <path id="jboss.portal-registration.classpath">
- <pathelement path="${jboss.portal-registration.lib}/portal-registration-lib.jar"/>
- <pathelement path="${jboss.portal-registration.lib}/portal-registration-test-lib.jar"/>
- </path>
-
- <!-- security -->
- <property name="jboss.portal-security.root" value="${project.root}/security/output"/>
- <property name="jboss.portal-security.lib" value="${jboss.portal-security.root}/lib"/>
- <path id="jboss.portal-security.classpath">
- <pathelement path="${jboss.portal-security.lib}/portal-security-lib.jar"/>
- <pathelement path="${jboss.portal-security.lib}/portal-security-test-lib.jar"/>
- </path>
-
- <!-- identity -->
- <property name="jboss.portal-identity.root" value="${project.root}/identity/output"/>
- <property name="jboss.portal-identity.lib" value="${jboss.portal-identity.root}/lib"/>
- <path id="jboss.portal-identity.classpath">
- <pathelement path="${jboss.portal-identity.lib}/portal-identity-lib.jar"/>
- </path>
-
- <!-- workflow -->
- <property name="jboss.portal-workflow.root" value="${project.root}/workflow/output"/>
- <property name="jboss.portal-workflow.lib" value="${jboss.portal-workflow.root}/lib"/>
- <path id="jboss.portal-workflow.classpath">
- <pathelement path="${jboss.portal-workflow.lib}/portal-workflow-lib.jar"/>
- </path>
-
- <!-- samples -->
- <property name="jboss.portal-samples.root" value="${project.root}/samples/output"/>
- <property name="jboss.portal-samples.lib" value="${jboss.portal-samples.root}/lib"/>
- <path id="jboss.portal-samples.classpath">
- <pathelement path="${jboss.portal-samples.lib}/portal-samples-lib.jar"/>
- </path>
-
<!-- unit module -->
<property name="jboss.unit.root" value="${project.root}/unit/output"/>
<property name="jboss.unit.lib" value="${jboss.unit.root}/lib"/>
16 years, 8 months
JBoss Portal SVN: r8562 - in modules/test/trunk: mc and 14 other directories.
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2007-10-08 09:26:57 -0400 (Mon, 08 Oct 2007)
New Revision: 8562
Added:
modules/test/trunk/mc/
modules/test/trunk/mc/build.bat
modules/test/trunk/mc/build.sh
modules/test/trunk/mc/build.xml
modules/test/trunk/mc/src/
modules/test/trunk/mc/src/main/
modules/test/trunk/mc/src/main/org/
modules/test/trunk/mc/src/main/org/jboss/
modules/test/trunk/mc/src/main/org/jboss/test/
modules/test/trunk/mc/src/main/org/jboss/test/unit/
modules/test/trunk/mc/src/main/org/jboss/test/unit/mc/
modules/test/trunk/mc/src/main/org/jboss/test/unit/mc/MCTestLifeCycleTests.java
modules/test/trunk/mc/src/main/org/jboss/test/unit/mc/MyService.java
modules/test/trunk/mc/src/main/org/jboss/test/unit/mc/SomeTest.java
modules/test/trunk/mc/src/main/org/jboss/unit/
modules/test/trunk/mc/src/main/org/jboss/unit/mc/
modules/test/trunk/mc/src/main/org/jboss/unit/mc/MCTestLifeCycle.java
modules/test/trunk/mc/src/main/org/jboss/unit/mc/MCTestProvider.java
modules/test/trunk/mc/src/main/org/jboss/unit/mc/TestCaseFactory.java
modules/test/trunk/mc/src/main/org/jboss/unit/mc/api/
modules/test/trunk/mc/src/main/org/jboss/unit/mc/api/annotations/
modules/test/trunk/mc/src/main/org/jboss/unit/mc/api/annotations/Bootstrap.java
modules/test/trunk/mc/src/resources/
modules/test/trunk/mc/src/resources/test/
modules/test/trunk/mc/src/resources/test/blah/
modules/test/trunk/mc/src/resources/test/blah/toto.xml
Log:
commited initial mc integration with jboss unit
Added: modules/test/trunk/mc/build.bat
===================================================================
--- modules/test/trunk/mc/build.bat (rev 0)
+++ modules/test/trunk/mc/build.bat 2007-10-08 13:26:57 UTC (rev 8562)
@@ -0,0 +1,54 @@
+@echo off
+rem
+rem Invokes a script of the same name in the 'tools' module.
+rem
+rem The 'tools' module is expected to be a peer directory of the directory
+rem in which this script lives.
+rem
+rem @author Jason Dillon <jason(a)planet57.com>
+rem
+
+rem $Id: build.bat 1829 2006-03-05 13:20:08Z julien $
+
+setlocal
+
+set PROGNAME=%~nx0
+set DIRNAME=%~dp0
+
+rem Legacy shell support
+if x%PROGNAME%==x set PROGNAME=build.bat
+if x%DIRNAME%==x set DIRNAME=.\
+
+set MODULE_ROOT=%DIRNAME%
+if x%TOOLS_ROOT%==x set TOOLS_ROOT=%DIRNAME%..\tools
+set TARGET=%TOOLS_ROOT%\bin\build.bat
+set ARGS=%*
+
+rem Start'er up yo
+goto main
+
+:debug
+if not x%DEBUG%==x echo %PROGNAME%: %*
+goto :EOF
+
+:main
+call :debug PROGNAME=%PROGNAME%
+call :debug DIRNAME=%DIRNAME%
+call :debug TOOLS_ROOT=%TOOLS_ROOT%
+call :debug TARGET=%TARGET%
+
+if exist %TARGET% call :call-script & goto :EOF
+rem else fail, we can not go on
+
+echo %PROGNAME%: *ERROR* The target executable does not exist:
+echo %PROGNAME%:
+echo %PROGNAME%: %TARGET%
+echo %PROGNAME%:
+echo %PROGNAME%: Please make sure you have checked out the 'tools' module
+echo %PROGNAME%: and make sure it is up to date.
+goto :EOF
+
+:call-script
+call :debug Executing %TARGET% %ARGS%
+call %TARGET% %ARGS%
+goto :EOF
Property changes on: modules/test/trunk/mc/build.bat
___________________________________________________________________
Name: svn:executable
+ *
Added: modules/test/trunk/mc/build.sh
===================================================================
--- modules/test/trunk/mc/build.sh (rev 0)
+++ modules/test/trunk/mc/build.sh 2007-10-08 13:26:57 UTC (rev 8562)
@@ -0,0 +1,49 @@
+#!/bin/sh
+##
+## Invokes a script of the same name in the 'tools' module.
+##
+## The 'tools' module is expected to be a peer directory of the directory
+## in which this script lives.
+##
+## @author Jason Dillon <jason(a)planet57.com>
+##
+
+# $Id: build.sh 1829 2006-03-05 13:20:08Z julien $
+
+PROGNAME=`basename $0`
+DIRNAME=`dirname $0`
+
+# Buss it yo
+main() {
+ if [ "x$TOOLS_ROOT" = "x" ]; then
+ TOOLS_ROOT=`cd $DIRNAME/../tools && pwd`
+ fi
+
+ MODULE_ROOT=`cd $DIRNAME; pwd`
+ export TOOLS_ROOT MODULE_ROOT DEBUG TRACE
+
+ # Where is the target script?
+ target="$TOOLS_ROOT/bin/$PROGNAME"
+ if [ ! -f "$target" ]; then
+ echo "${PROGNAME}: *ERROR* The target executable does not exist:"
+ echo "${PROGNAME}:"
+ echo "${PROGNAME}: $target"
+ echo "${PROGNAME}:"
+ echo "${PROGNAME}: Please make sure you have checked out the 'tools' module"
+ echo "${PROGNAME}: and make sure it is up to date."
+ exit 2
+ fi
+
+ # Get busy yo!
+ if [ "x$DEBUG" != "x" ]; then
+ echo "${PROGNAME}: Executing: /bin/sh $target $@"
+ fi
+ if [ "x$TRACE" = "x" ]; then
+ exec /bin/sh $target "$@"
+ else
+ exec /bin/sh -x $target "$@"
+ fi
+}
+
+# Lets get ready to rumble!
+main "$@"
Property changes on: modules/test/trunk/mc/build.sh
___________________________________________________________________
Name: svn:executable
+ *
Added: modules/test/trunk/mc/build.xml
===================================================================
--- modules/test/trunk/mc/build.xml (rev 0)
+++ modules/test/trunk/mc/build.xml 2007-10-08 13:26:57 UTC (rev 8562)
@@ -0,0 +1,220 @@
+<?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 project [
+ <!ENTITY buildmagic SYSTEM "../tools/etc/buildfragments/buildmagic.ent">
+ <!ENTITY tools SYSTEM "../tools/etc/buildfragments/tools.ent">
+ <!ENTITY libraries SYSTEM "../thirdparty/libraries.ent">
+ <!ENTITY modules SYSTEM "../tools/etc/buildfragments/modules.ent">
+ <!ENTITY defaults SYSTEM "../tools/etc/buildfragments/defaults.ent">
+ <!ENTITY targets SYSTEM "../tools/etc/buildfragments/targets.ent">
+ ]>
+
+<!-- $Id: build.xml 7954 2007-08-16 14:51:00Z julien(a)jboss.com $ -->
+
+<!--+======================================================================+-->
+<!--| JBoss Portal (The OpenSource Portal) Build File |-->
+<!--| |-->
+<!--| Distributable under LGPL license. |-->
+<!--| See terms of license at http://www.gnu.org. |-->
+<!--| |-->
+<!--| This file has been designed to work with the 'tools' module and |-->
+<!--| Buildmagic extentions. |-->
+<!--+======================================================================+-->
+
+<project default="main" name="JBoss Portal">
+
+ <!--+====================================================================+-->
+ <!--| Setup |-->
+ <!--| |-->
+ <!--| Include the common build elements. |-->
+ <!--| |-->
+ <!--| This defines several different targets, properties and paths. |-->
+ <!--| It also sets up the basic extention tasks amoung other things. |-->
+ <!--+====================================================================+-->
+
+ &buildmagic;
+ &modules;
+ &defaults;
+ &tools;
+ &targets;
+
+
+ <!-- ================================================================== -->
+ <!-- Initialization -->
+ <!-- ================================================================== -->
+
+ <!--
+ | Initialize the build system. Must depend on '_buildmagic:init'.
+ | Other targets should depend on 'init' or things will mysteriously fail.
+ -->
+
+ <target name="init" unless="init.disable" depends="_buildmagic:init">
+ </target>
+
+ <!--+====================================================================+-->
+ <!--| Configuration |-->
+ <!--| |-->
+ <!--| This target is invoked by the Buildmagic initialization logic |-->
+ <!--| and should contain module specific configuration elements. |-->
+ <!--+====================================================================+-->
+
+ <target name="configure" unless="configure.disable">
+
+ <!-- Configure thirdparty libraries -->
+ &libraries;
+ <path id="library.classpath">
+ <path refid="apache.log4j.classpath"/>
+ <path refid="jboss.microcontainer.classpath"/>
+ <path refid="jboss/common.core.classpath"/>
+ <path refid="jboss/common.logging.spi.classpath"/>
+ </path>
+
+ <!-- Configure modules -->
+ <call target="configure-modules"/>
+ <path id="dependentmodule.classpath">
+ <path refid="jboss.unit.classpath"/>
+ </path>
+
+ <!--+=======================================+-->
+ <!--| Override any default properties here. |-->
+ <!--+=======================================+-->
+
+ <!--+=======================================+-->
+ <!--| Define module specific elements here. |-->
+ <!--+=======================================+-->
+ <property name="javadoc.private" value="false"/>
+ <property name="javadoc.protected" value="false"/>
+ <property name="javadoc.packages" value="org.jboss.unit.*"/>
+
+ <!-- Configure defaults & build tools -->
+ <call target="configure-defaults"/>
+ <call target="configure-tools"/>
+
+ </target>
+
+ <!--+====================================================================+-->
+ <!--| Compile |-->
+ <!--| |-->
+ <!--| This target should depend on other compile-* targets for each |-->
+ <!--| different type of compile that needs to be performed, short of |-->
+ <!--| documentation compiles. |-->
+ <!--+====================================================================+-->
+
+ <target name="compile"
+ description="Compile all source files."
+ depends="_default:compile-classes,
+ _default:compile-etc,
+ _default:compile-resources">
+ <!-- Add module specific elements here. -->
+ </target>
+
+ <!--+====================================================================+-->
+ <!--| Generate Output |-->
+ <!--| |-->
+ <!--| Generates the target output for this module. Target output is |-->
+ <!--| the output which is ment to be released or used by external |-->
+ <!--| modules. |-->
+ <!--+====================================================================+-->
+
+ <target name="output"
+ description="Generate all target output."
+ depends="compile">
+
+ <mkdir dir="${build.lib}"/>
+
+ <jar jarfile="${build.lib}/jboss-unit-mc-lib.jar">
+ <fileset dir="${build.classes}">
+ <exclude name="org/jboss/test/**"/>
+ </fileset>
+ </jar>
+
+ <jar jarfile="${build.lib}/jboss-unit-mc-test.jar">
+ <fileset dir="${build.classes}">
+ <include name="org/jboss/test/**"/>
+ </fileset>
+ </jar>
+
+ </target>
+
+ <!-- ================================================================== -->
+ <!-- Cleaning -->
+ <!-- ================================================================== -->
+
+ <!-- Clean up all build output -->
+ <target name="clean" depends="_default:clean">
+ <!-- Add module specific elements here. -->
+ </target>
+
+ <!--+====================================================================+-->
+ <!--| Documents |-->
+ <!--| |-->
+ <!--| Generate all documentation for this module. |-->
+ <!--+====================================================================+-->
+
+ <target name="docs" depends="_default:docs">
+ <!-- Add module specific elements here. -->
+ </target>
+
+ <!-- ================================================================== -->
+ <!-- Misc. -->
+ <!-- ================================================================== -->
+
+ <target name="main" depends="most"/>
+ <target name="all" depends="_default:all"/>
+ <target name="most" depends="_default:most"/>
+ <target name="help" depends="_default:help"/>
+
+ <target name="test" depends="output">
+
+ <java classname="org.jboss.test.unit.mc.MCTestLifeCycleTests" fork="true">
+<!--
+ <jvmarg value="-Xdebug"/>
+ <jvmarg value="-Xrunjdwp:transport=dt_socket,address=7878,server=y,suspend=y"/>
+-->
+ <classpath>
+
+ <path location="${build.lib}/jboss-unit-mc-lib.jar"/>
+ <path location="${build.lib}/jboss-unit-mc-test.jar"/>
+ <path location="${build.resources}/test"/>
+
+ <path refid="jboss.unit.classpath"/>
+
+ <path refid="apache.log4j.classpath"/>
+ <path refid="jboss.microcontainer.classpath"/>
+ <path refid="jboss/common.core.classpath"/>
+ <path refid="jboss/common.logging.spi.classpath"/>
+ <path refid="jboss.aop.classpath"/>
+ <path refid="oswego.concurrent.classpath"/>
+ <path refid="javassist.javassist.classpath"/>
+ <path refid="trove.trove.classpath"/>
+ <path refid="jboss.jbossxb.classpath"/>
+ <path refid="apache.xerces.classpath"/>
+
+ </classpath>
+ </java>
+
+ </target>
+
+</project>
Property changes on: modules/test/trunk/mc/build.xml
___________________________________________________________________
Name: svn:executable
+ *
Added: modules/test/trunk/mc/src/main/org/jboss/test/unit/mc/MCTestLifeCycleTests.java
===================================================================
--- modules/test/trunk/mc/src/main/org/jboss/test/unit/mc/MCTestLifeCycleTests.java (rev 0)
+++ modules/test/trunk/mc/src/main/org/jboss/test/unit/mc/MCTestLifeCycleTests.java 2007-10-08 13:26:57 UTC (rev 8562)
@@ -0,0 +1,50 @@
+/******************************************************************************
+ * 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.test.unit.mc;
+
+import org.jboss.unit.driver.impl.pojo.POJOTestSuiteDriver;
+import org.jboss.unit.TestId;
+import org.jboss.unit.driver.command.StartTestCommand;
+
+import java.util.Map;
+import java.util.HashMap;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class MCTestLifeCycleTests
+{
+
+ public static void main(String[] args) throws Exception
+ {
+
+ POJOTestSuiteDriver driver = new POJOTestSuiteDriver(SomeTest.class);
+
+ Map<String,String> parametrization = new HashMap<String, String>();
+ parametrization.put("dataSourceName", "hsqldb");
+
+ driver.invoke(new TestId("myTest"), new StartTestCommand(parametrization));
+ }
+
+}
Added: modules/test/trunk/mc/src/main/org/jboss/test/unit/mc/MyService.java
===================================================================
--- modules/test/trunk/mc/src/main/org/jboss/test/unit/mc/MyService.java (rev 0)
+++ modules/test/trunk/mc/src/main/org/jboss/test/unit/mc/MyService.java 2007-10-08 13:26:57 UTC (rev 8562)
@@ -0,0 +1,54 @@
+/******************************************************************************
+ * 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.test.unit.mc;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class MyService
+{
+
+ private String dataSourceName;
+
+ public String getDataSourceName()
+ {
+ return dataSourceName;
+ }
+
+ public void setDataSourceName(String dataSourceName)
+ {
+ this.dataSourceName = dataSourceName;
+ }
+
+ public void start()
+ {
+ System.out.println("MyService start for data source " + dataSourceName);
+ }
+
+ public void stop()
+ {
+ System.out.println("MyService stop");
+ }
+
+}
Added: modules/test/trunk/mc/src/main/org/jboss/test/unit/mc/SomeTest.java
===================================================================
--- modules/test/trunk/mc/src/main/org/jboss/test/unit/mc/SomeTest.java (rev 0)
+++ modules/test/trunk/mc/src/main/org/jboss/test/unit/mc/SomeTest.java 2007-10-08 13:26:57 UTC (rev 8562)
@@ -0,0 +1,71 @@
+/******************************************************************************
+ * 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.test.unit.mc;
+
+import org.jboss.unit.api.pojo.annotations.Test;
+import org.jboss.unit.mc.api.annotations.Bootstrap;
+import org.jboss.beans.metadata.plugins.annotations.Inject;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+@Bootstrap(id="/blah/toto.xml")
+public class SomeTest
+{
+
+ /** . */
+ private MyService service;
+
+ public MyService getService()
+ {
+ return service;
+ }
+
+ @Inject(bean="MyService")
+ public void setService(MyService service)
+ {
+ this.service = service;
+ }
+
+ public String getDataSourceName()
+ {
+ return "hsqldb";
+ }
+
+ public void start()
+ {
+ System.out.println("SomeTest start with service " + service);
+ System.out.println("SomeTest start with service " + service);
+ System.out.println("SomeTest start with service " + service);
+ System.out.println("SomeTest start with service " + service);
+ System.out.println("SomeTest start with service " + service);
+ System.out.println("SomeTest start with service " + service);
+ }
+
+ @Test
+ public void myTest()
+ {
+
+ }
+}
Added: modules/test/trunk/mc/src/main/org/jboss/unit/mc/MCTestLifeCycle.java
===================================================================
--- modules/test/trunk/mc/src/main/org/jboss/unit/mc/MCTestLifeCycle.java (rev 0)
+++ modules/test/trunk/mc/src/main/org/jboss/unit/mc/MCTestLifeCycle.java 2007-10-08 13:26:57 UTC (rev 8562)
@@ -0,0 +1,178 @@
+/******************************************************************************
+ * 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.unit.mc;
+
+import org.jboss.unit.spi.pojo.TestLifeCycle;
+import org.jboss.unit.spi.pojo.TestCaseLifeCycleException;
+import org.jboss.unit.spi.pojo.TestCase;
+import org.jboss.unit.mc.api.annotations.Bootstrap;
+import org.jboss.kernel.plugins.bootstrap.basic.BasicBootstrap;
+import org.jboss.kernel.plugins.deployment.xml.BeanXMLDeployer;
+import org.jboss.kernel.spi.deployment.KernelDeployment;
+import org.jboss.kernel.spi.dependency.KernelControllerContext;
+import org.jboss.beans.metadata.plugins.AbstractBeanMetaData;
+import org.jboss.beans.metadata.plugins.AbstractConstructorMetaData;
+import org.jboss.beans.metadata.plugins.AbstractValueMetaData;
+
+import java.util.Map;
+import java.net.URL;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class MCTestLifeCycle extends BasicBootstrap implements TestLifeCycle
+{
+
+ /** . */
+ private TestLifeCycle delegate;
+
+ /** . */
+ private BeanXMLDeployer beanDeployer;
+
+ /** . */
+ private KernelDeployment deployment;
+
+ public MCTestLifeCycle(TestLifeCycle delegate)
+ {
+ this.delegate = delegate;
+ }
+
+ public TestCase newTestCase(String name) throws TestCaseLifeCycleException
+ {
+ return delegate.newTestCase(name);
+ }
+
+ public void testCaseParametrize(TestCase testCase, Map<String, String> parametrization) throws TestCaseLifeCycleException
+ {
+ delegate.testCaseParametrize(testCase, parametrization);
+ }
+
+ public void testCaseCreate(TestCase testCase) throws TestCaseLifeCycleException
+ {
+ Class<? extends Object> testClass = testCase.getPOJO().getClass();
+
+ //
+ Bootstrap blah = testClass.getAnnotation(Bootstrap.class);
+ if (blah == null)
+ {
+ throw new TestCaseLifeCycleException("No Bootstrap annotation found");
+ }
+
+ URL url = testClass.getResource(blah.id());
+ if (url == null)
+ {
+ throw new TestCaseLifeCycleException("No URL found for bean xml " + blah.id());
+ }
+
+ System.out.println("url = " + url);
+ System.out.println("url = " + url);
+ System.out.println("url = " + url);
+
+ // setup MC
+ run();
+
+ try
+ {
+ AbstractBeanMetaData bmd = new AbstractBeanMetaData("TestCase", testClass.getName());
+ AbstractConstructorMetaData cmd = new AbstractConstructorMetaData();
+ bmd.setConstructor(cmd);
+ TestCaseFactory factory = new TestCaseFactory(testCase.getPOJO());
+ AbstractValueMetaData vmd = new AbstractValueMetaData(factory);
+ cmd.setFactory(vmd);
+ cmd.setFactoryMethod("getTestCase");
+ getKernel().getController().install(bmd);
+ }
+ catch (Throwable throwable)
+ {
+ // Perform some MC throwable unwrap
+ if (deployment != null)
+ {
+ // This may be MC saying that something went wrong
+ if (throwable instanceof IllegalStateException)
+ {
+ // log.error("Test runtime context startup failed", throwable);
+ for (KernelControllerContext kernelControllerContext : deployment.getInstalledContexts())
+ {
+ Throwable t = kernelControllerContext.getError();
+ if (t != null)
+ {
+ throwable = t;
+ break;
+ }
+ }
+ }
+
+ // Undeploy all beans
+ if (deployment != null)
+ {
+ beanDeployer.undeploy(deployment);
+ }
+ }
+
+ //
+ throw new TestCaseLifeCycleException(throwable);
+ }
+
+ try
+ {
+ beanDeployer = new BeanXMLDeployer(getKernel());
+
+ //
+ deployment = beanDeployer.deploy(url);
+
+ //
+ beanDeployer.validate(deployment);
+ }
+ catch (Throwable throwable)
+ {
+ throw new TestCaseLifeCycleException(throwable);
+ }
+
+ //
+ delegate.testCaseCreate(testCase);
+ }
+
+ public void testCaseInvoke(TestCase testCase) throws TestCaseLifeCycleException
+ {
+ delegate.testCaseInvoke(testCase);
+ }
+
+ public void testCaseDestroy(TestCase testCase)
+ {
+ try
+ {
+ delegate.testCaseDestroy(testCase);
+ }
+ catch (Throwable t)
+ {
+ t.printStackTrace();
+ }
+
+ // Clean up MC
+ if (deployment != null)
+ {
+ beanDeployer.undeploy(deployment);
+ }
+ }
+}
Added: modules/test/trunk/mc/src/main/org/jboss/unit/mc/MCTestProvider.java
===================================================================
--- modules/test/trunk/mc/src/main/org/jboss/unit/mc/MCTestProvider.java (rev 0)
+++ modules/test/trunk/mc/src/main/org/jboss/unit/mc/MCTestProvider.java 2007-10-08 13:26:57 UTC (rev 8562)
@@ -0,0 +1,58 @@
+/******************************************************************************
+ * 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.unit.mc;
+
+import org.jboss.unit.spi.pojo.TestProvider;
+import org.jboss.unit.spi.pojo.TestSuiteDescriptor;
+import org.jboss.unit.spi.pojo.TestProviderSupport;
+import org.jboss.unit.spi.pojo.TestLifeCycle;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class MCTestProvider implements TestProvider
+{
+
+ /** . */
+ private TestProviderSupport delegate;
+
+ /** . */
+ private MCTestLifeCycle lifeCycle;
+
+ public MCTestProvider(Class testClass)
+ {
+ this.delegate = new TestProviderSupport(testClass);
+ this.lifeCycle = new MCTestLifeCycle(delegate.getLifeCycle());
+ }
+
+ public TestSuiteDescriptor getDescriptor()
+ {
+ return delegate.getDescriptor();
+ }
+
+ public TestLifeCycle getLifeCycle()
+ {
+ return lifeCycle;
+ }
+}
Added: modules/test/trunk/mc/src/main/org/jboss/unit/mc/TestCaseFactory.java
===================================================================
--- modules/test/trunk/mc/src/main/org/jboss/unit/mc/TestCaseFactory.java (rev 0)
+++ modules/test/trunk/mc/src/main/org/jboss/unit/mc/TestCaseFactory.java 2007-10-08 13:26:57 UTC (rev 8562)
@@ -0,0 +1,44 @@
+/******************************************************************************
+ * 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.unit.mc;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class TestCaseFactory
+{
+
+ /** . */
+ private final Object testCase;
+
+ public TestCaseFactory(Object testCase)
+ {
+ this.testCase = testCase;
+ }
+
+ public Object getTestCase()
+ {
+ return testCase;
+ }
+}
Added: modules/test/trunk/mc/src/main/org/jboss/unit/mc/api/annotations/Bootstrap.java
===================================================================
--- modules/test/trunk/mc/src/main/org/jboss/unit/mc/api/annotations/Bootstrap.java (rev 0)
+++ modules/test/trunk/mc/src/main/org/jboss/unit/mc/api/annotations/Bootstrap.java 2007-10-08 13:26:57 UTC (rev 8562)
@@ -0,0 +1,45 @@
+/******************************************************************************
+ * 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.unit.mc.api.annotations;
+
+import org.jboss.unit.spi.pojo.annotations.Provider;
+import org.jboss.unit.mc.MCTestProvider;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+import java.lang.annotation.ElementType;
+
+/**
+ * Annotate
+ *
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+(a)Retention(RetentionPolicy.RUNTIME)
+(a)Target({ElementType.TYPE})
+(a)Provider(MCTestProvider.class)
+public @interface Bootstrap
+{
+ String id();
+}
Added: modules/test/trunk/mc/src/resources/test/blah/toto.xml
===================================================================
--- modules/test/trunk/mc/src/resources/test/blah/toto.xml (rev 0)
+++ modules/test/trunk/mc/src/resources/test/blah/toto.xml 2007-10-08 13:26:57 UTC (rev 8562)
@@ -0,0 +1,32 @@
+<?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:2.0 bean-deployer_2_0.xsd"
+ xmlns="urn:jboss:bean-deployer:2.0">
+
+ <bean name="MyService" class="org.jboss.test.unit.mc.MyService">
+ <property name="dataSourceName"><inject bean="TestCase" property="dataSourceName" state="Instantiated"/></property>
+ </bean>
+
+</deployment>
16 years, 8 months
JBoss Portal SVN: r8561 - in modules/test/trunk/build: ide/intellij/idea60/modules/test and 1 other directory.
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2007-10-08 09:25:09 -0400 (Mon, 08 Oct 2007)
New Revision: 8561
Modified:
modules/test/trunk/build/build-thirdparty.xml
modules/test/trunk/build/ide/intellij/idea60/modules/test/test.iml
Log:
update test thirdparty to MC 2.0.0.Beta4
Modified: modules/test/trunk/build/build-thirdparty.xml
===================================================================
--- modules/test/trunk/build/build-thirdparty.xml 2007-10-08 13:12:13 UTC (rev 8560)
+++ modules/test/trunk/build/build-thirdparty.xml 2007-10-08 13:25:09 UTC (rev 8561)
@@ -54,9 +54,7 @@
<componentref name="codehaus/cargo" version="0.9-portal"/>
<componentref name="testng" version="5.5"/>
- <componentref name="jbossas/core-libs" version="4.0.4.GA"/>
<componentref name="hibernate" version="3.2.0.CR2"/>
- <componentref name="jboss/microcontainer" version="1.0.2"/>
<componentref name="apache-log4j" version="1.2.8"/>
<componentref name="junit" version="3.8.1"/>
<componentref name="sun-servlet" version="2.4"/>
@@ -64,6 +62,44 @@
<componentref name="apache-logging" version="1.0.5.SP1-jboss"/>
<componentref name="sun-opends" version="snapshot"/>
<componentref name="jboss/remoting" version="2.2.1.GA"/>
+
+ <!-- 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.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="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"/> <!-- 2.1.1 -->
+
+
+ <!-- MC 2.0.0.Beta3 -->
+<!--
+ <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"/>
+ <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="apache-xerces" version="2.7.1"/>
+ <componentref name="sun-jaf" version="1.1"/>
+ <componentref name="junit" version="3.8.1"/>
+ <componentref name="wutka-dtdparser" version="1.2.1"/>
+ <componentref name="trove" version="1.0.2"/>
+-->
+
</build>
<synchronizeinfo/>
Modified: modules/test/trunk/build/ide/intellij/idea60/modules/test/test.iml
===================================================================
--- modules/test/trunk/build/ide/intellij/idea60/modules/test/test.iml 2007-10-08 13:12:13 UTC (rev 8560)
+++ modules/test/trunk/build/ide/intellij/idea60/modules/test/test.iml 2007-10-08 13:25:09 UTC (rev 8561)
@@ -247,15 +247,6 @@
<orderEntry type="module-library">
<library>
<CLASSES>
- <root url="jar://$MODULE_DIR$/../../../../../../thirdparty/jboss/microcontainer/lib/jboss-microcontainer.jar!/" />
- </CLASSES>
- <JAVADOC />
- <SOURCES />
- </library>
- </orderEntry>
- <orderEntry type="module-library">
- <library>
- <CLASSES>
<root url="jar://$MODULE_DIR$/../../../../../../thirdparty/jboss/microcontainer/lib/jboss-container.jar!/" />
</CLASSES>
<JAVADOC />
@@ -343,6 +334,24 @@
<SOURCES />
</library>
</orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../thirdparty/jboss/microcontainer/lib/jboss-container-metadata.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../thirdparty/jboss/microcontainer/lib/jboss-kernel.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
<orderEntryProperties />
</component>
<component name="VcsManagerConfiguration">
16 years, 8 months
JBoss Portal SVN: r8560 - trunk/tools/etc/buildfragments.
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2007-10-08 09:12:13 -0400 (Mon, 08 Oct 2007)
New Revision: 8560
Modified:
trunk/tools/etc/buildfragments/defaults.ent
Log:
moved trunk to Java 5 since it does not compile with WSRP using generics and boxing/unboxing
Modified: trunk/tools/etc/buildfragments/defaults.ent
===================================================================
--- trunk/tools/etc/buildfragments/defaults.ent 2007-10-08 13:05:26 UTC (rev 8559)
+++ trunk/tools/etc/buildfragments/defaults.ent 2007-10-08 13:12:13 UTC (rev 8560)
@@ -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 -->
16 years, 8 months
JBoss Portal SVN: r8559 - modules/test/trunk/tooling.
by portal-commits@lists.jboss.org
Author: bdaw
Date: 2007-10-08 09:05:26 -0400 (Mon, 08 Oct 2007)
New Revision: 8559
Modified:
modules/test/trunk/tooling/build.xml
Log:
toto
Modified: modules/test/trunk/tooling/build.xml
===================================================================
--- modules/test/trunk/tooling/build.xml 2007-10-08 13:03:29 UTC (rev 8558)
+++ modules/test/trunk/tooling/build.xml 2007-10-08 13:05:26 UTC (rev 8559)
@@ -226,7 +226,6 @@
</tests>
<tests config="./output/resources/test/bobo-tests.xml">
- <!-- invoke all -->
<include id="testOne"/>
<include id="otherTestOne"/>
<exclude ids="testOne,testTwo"/>
16 years, 8 months
JBoss Portal SVN: r8558 - in modules/test/trunk/tooling: src/main/org/jboss/test/unit/tooling/bobo and 1 other directories.
by portal-commits@lists.jboss.org
Author: bdaw
Date: 2007-10-08 09:03:29 -0400 (Mon, 08 Oct 2007)
New Revision: 8558
Modified:
modules/test/trunk/tooling/build.xml
modules/test/trunk/tooling/src/main/org/jboss/test/unit/tooling/bobo/BoboTest1.java
modules/test/trunk/tooling/src/main/org/jboss/unit/tooling/ant/ExcludeTask.java
modules/test/trunk/tooling/src/main/org/jboss/unit/tooling/ant/IncludeTask.java
modules/test/trunk/tooling/src/main/org/jboss/unit/tooling/ant/TestsTask.java
Log:
rename attributes and make 'id' exclusive
Modified: modules/test/trunk/tooling/build.xml
===================================================================
--- modules/test/trunk/tooling/build.xml 2007-10-08 12:12:52 UTC (rev 8557)
+++ modules/test/trunk/tooling/build.xml 2007-10-08 13:03:29 UTC (rev 8558)
@@ -216,20 +216,20 @@
<jboss-unit>
<tests config="/home/bdaw/Workshop/JBoss/portal/modules/test/trunk/tooling/output/resources/test/bobo-tests.xml">
- <include names="testOne,otherTestOne"/>
- <exclude namePatterns="test.*"/>
+ <include ids="testOne,otherTestOne"/>
</tests>
<tests config="./output/resources/test/bobo-tests.xml">
- <include namePatterns="other.*,test.*"/>
+ <!-- no include tag means invoke all -->
+ <!-- but you can still exclude some tests -->
<exclude id="otherTestTwo"/>
</tests>
<tests config="./output/resources/test/bobo-tests.xml">
<!-- invoke all -->
- <include names="testOne"/>
- <include names="otherTestOne"/>
- <exclude namePatterns="test.*"/>
+ <include id="testOne"/>
+ <include id="otherTestOne"/>
+ <exclude ids="testOne,testTwo"/>
</tests>
<tests config="output/resources/test/bobo-tests.xml">
@@ -237,6 +237,17 @@
<include id="testOne"/>
<include id="otherTestTwo"/>
</tests>
+
+ <tests config="output/resources/test/bobo-tests.xml">
+ <include keywords="simpleTag"/>
+ </tests>
+
+
+ <tests config="output/resources/test/bobo-tests.xml">
+ <!-- this one should fail as attribute 'id' is exclusive -->
+ <include id="otherTestOne" ids="testOne,testTwo" keywords="lola,lolo,loli"/>
+ </tests>
+
<classpath>
Modified: modules/test/trunk/tooling/src/main/org/jboss/test/unit/tooling/bobo/BoboTest1.java
===================================================================
--- modules/test/trunk/tooling/src/main/org/jboss/test/unit/tooling/bobo/BoboTest1.java 2007-10-08 12:12:52 UTC (rev 8557)
+++ modules/test/trunk/tooling/src/main/org/jboss/test/unit/tooling/bobo/BoboTest1.java 2007-10-08 13:03:29 UTC (rev 8558)
@@ -23,6 +23,7 @@
package org.jboss.test.unit.tooling.bobo;
import org.jboss.unit.api.pojo.annotations.Test;
+import org.jboss.unit.api.pojo.annotations.Tag;
/**
* @author <a href="mailto:boleslaw dot dawidowicz at redhat anotherdot com">Boleslaw Dawidowicz</a>
@@ -31,12 +32,14 @@
public class BoboTest1
{
@Test(name = "testOne")
+ @Tag("simpleTag")
public void test1()
{
System.out.println("Executed testOne");
}
@Test(name = "testTwo")
+ @Tag("simpleTag")
public void test2()
{
System.out.println("Executed testTwo");
@@ -44,12 +47,14 @@
}
@Test(name = "otherTestOne")
+ @Tag({"simpleTag", "anotherTag"})
public void test3()
{
System.out.println("Executed otherTestOne");
}
@Test(name = "otherTestTwo")
+ @Tag("simpleTag")
public void test4()
{
System.out.println("Executed otherTestTwo");
Modified: modules/test/trunk/tooling/src/main/org/jboss/unit/tooling/ant/ExcludeTask.java
===================================================================
--- modules/test/trunk/tooling/src/main/org/jboss/unit/tooling/ant/ExcludeTask.java 2007-10-08 12:12:52 UTC (rev 8557)
+++ modules/test/trunk/tooling/src/main/org/jboss/unit/tooling/ant/ExcludeTask.java 2007-10-08 13:03:29 UTC (rev 8558)
@@ -22,8 +22,6 @@
package org.jboss.unit.tooling.ant;
-import org.apache.tools.ant.Task;
-
/**
* @author <a href="mailto:boleslaw dot dawidowicz at redhat anotherdot com">Boleslaw Dawidowicz</a>
* @version $Revision: 0.1 $
@@ -32,9 +30,9 @@
{
private String id;
- private String names;
+ private String ids;
- private String namePatterns;
+ private String idPatterns;
private String keywords;
@@ -53,25 +51,25 @@
this.id = id;
}
- public String getNames()
+ public String getIds()
{
- return names;
+ return ids;
}
- public void setNames(String names)
+ public void setIds(String ids)
{
- this.names = names;
+ this.ids = ids;
}
- public String getNamePatterns()
+ public String getIdPatterns()
{
- return namePatterns;
+ return idPatterns;
}
- public void setNamePatterns(String namePatterns)
- {
- this.namePatterns = namePatterns;
- }
+// public void setIdPatterns(String idPatterns)
+// {
+// this.idPatterns = idPatterns;
+// }
public String getKeywords()
{
Modified: modules/test/trunk/tooling/src/main/org/jboss/unit/tooling/ant/IncludeTask.java
===================================================================
--- modules/test/trunk/tooling/src/main/org/jboss/unit/tooling/ant/IncludeTask.java 2007-10-08 12:12:52 UTC (rev 8557)
+++ modules/test/trunk/tooling/src/main/org/jboss/unit/tooling/ant/IncludeTask.java 2007-10-08 13:03:29 UTC (rev 8558)
@@ -22,8 +22,6 @@
package org.jboss.unit.tooling.ant;
-import org.apache.tools.ant.Task;
-
/**
* @author <a href="mailto:boleslaw dot dawidowicz at redhat anotherdot com">Boleslaw Dawidowicz</a>
* @version $Revision: 0.1 $
@@ -32,9 +30,9 @@
{
private String id;
- private String names;
+ private String ids;
- private String namePatterns;
+ private String idPatterns;
private String keywords;
@@ -53,25 +51,25 @@
this.id = id;
}
- public String getNames()
+ public String getIds()
{
- return names;
+ return ids;
}
- public void setNames(String names)
+ public void setIds(String ids)
{
- this.names = names;
+ this.ids = ids;
}
- public String getNamePatterns()
+ public String getIdPatterns()
{
- return namePatterns;
+ return idPatterns;
}
- public void setNamePatterns(String namePatterns)
- {
- this.namePatterns = namePatterns;
- }
+// public void setIdPatterns(String idPatterns)
+// {
+// this.idPatterns = idPatterns;
+// }
public String getKeywords()
{
Modified: modules/test/trunk/tooling/src/main/org/jboss/unit/tooling/ant/TestsTask.java
===================================================================
--- modules/test/trunk/tooling/src/main/org/jboss/unit/tooling/ant/TestsTask.java 2007-10-08 12:12:52 UTC (rev 8557)
+++ modules/test/trunk/tooling/src/main/org/jboss/unit/tooling/ant/TestsTask.java 2007-10-08 13:03:29 UTC (rev 8558)
@@ -29,16 +29,11 @@
import org.apache.tools.ant.taskdefs.Java;
import org.jboss.unit.tooling.IncludeTestFilter;
import org.jboss.unit.tooling.ExcludeTestFilter;
-import org.jboss.unit.tooling.MainTestFilter;
-import org.jboss.unit.tooling.MainBuilder;
import org.jboss.unit.tooling.Main;
-import org.jboss.unit.tooling.InfoTestFilter;
-import org.jboss.unit.runner.TestFilter;
import java.util.List;
import java.util.LinkedList;
import java.util.Set;
-import java.util.HashSet;
/**
* @author <a href="mailto:boleslaw dot dawidowicz at redhat anotherdot com">Boleslaw Dawidowicz</a>
@@ -144,17 +139,25 @@
for (IncludeTask include : includes)
{
- if (include.getNames() != null)
+ //Check attributes consistency
+
+ if (include.getId() != null && (include.getIds() != null || include.getKeywords() != null))
{
- includeFilter.addUnparsedNames(include.getNames());
+ throw new IllegalStateException("The use of attribute 'id' in <include> tag should be exclusive");
}
+
+
+ if (include.getIds() != null)
+ {
+ includeFilter.addUnparsedNames(include.getIds());
+ }
if (include.getKeywords() != null)
{
includeFilter.addUnparsedKeywords(include.getKeywords());
}
- if (include.getNamePatterns() != null)
+ if (include.getIdPatterns() != null)
{
- includeFilter.addUnparsedNamePatterns(include.getNamePatterns());
+ includeFilter.addUnparsedNamePatterns(include.getIdPatterns());
}
if (include.getId() != null)
{
@@ -182,17 +185,23 @@
for (ExcludeTask exclude : excludes)
{
- if (exclude.getNames() != null)
+
+ if (exclude.getId() != null && (exclude.getIds() != null || exclude.getKeywords() != null))
{
- excludeFilter.addUnparsedNames(exclude.getNames());
+ throw new IllegalStateException("The use of attribute 'id' in <exclude> tag should be exclusive");
}
+
+ if (exclude.getIds() != null)
+ {
+ excludeFilter.addUnparsedNames(exclude.getIds());
+ }
if (exclude.getKeywords() != null)
{
excludeFilter.addUnparsedKeywords(exclude.getKeywords());
}
- if (exclude.getNamePatterns() != null)
+ if (exclude.getIdPatterns() != null)
{
- excludeFilter.addUnparsedNamePatterns(exclude.getNamePatterns());
+ excludeFilter.addUnparsedNamePatterns(exclude.getIdPatterns());
}
if (exclude.getId() != null)
{
16 years, 8 months