JBoss Portal SVN: r9028 - modules/portlet/branches/JBP_PORTLET_BRANCH_1_0/test/src/main/org/jboss/portal/portlet/test.
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2007-11-19 18:54:15 -0500 (Mon, 19 Nov 2007)
New Revision: 9028
Modified:
modules/portlet/branches/JBP_PORTLET_BRANCH_1_0/test/src/main/org/jboss/portal/portlet/test/PortletControllerContextImpl.java
Log:
update portlet container 1.0.x to latest changes in web module
Modified: modules/portlet/branches/JBP_PORTLET_BRANCH_1_0/test/src/main/org/jboss/portal/portlet/test/PortletControllerContextImpl.java
===================================================================
--- modules/portlet/branches/JBP_PORTLET_BRANCH_1_0/test/src/main/org/jboss/portal/portlet/test/PortletControllerContextImpl.java 2007-11-19 23:49:13 UTC (rev 9027)
+++ modules/portlet/branches/JBP_PORTLET_BRANCH_1_0/test/src/main/org/jboss/portal/portlet/test/PortletControllerContextImpl.java 2007-11-19 23:54:15 UTC (rev 9028)
@@ -23,7 +23,8 @@
package org.jboss.portal.portlet.test;
import org.jboss.portal.web.IllegalRequestException;
-import org.jboss.portal.web.RequestInfo;
+import org.jboss.portal.web.WebRequest;
+import org.jboss.portal.web.Body;
import org.jboss.portal.portlet.test.url.ParameterDecoder;
import org.jboss.portal.common.util.ParameterMap;
import org.jboss.portal.common.util.Tools;
@@ -69,7 +70,7 @@
{
targetId = StringCodec.decode(pathInfo.substring(1));
- RequestInfo ri = new RequestInfo(req);
+ WebRequest ri = new WebRequest(req);
ParameterDecoder decoder = PortletURLRenderer.builder.createDecoder();
decoder.decode(ri.getQueryParameterMap());
@@ -108,13 +109,21 @@
//
PortletController.Request request;
String type = metaParameters.getValue("type");
+
+ //
+ ParameterMap formParameters = null;
+ if (ri.getBody() instanceof Body.Form)
+ {
+ formParameters = ((Body.Form)ri.getBody()).getParameters();
+ }
+
if ("action".equals(type))
{
- request = new PortletController.Action(targetId, actualParameters, ri.getBodyParameterMap(), mode, windowState);
+ request = new PortletController.Action(targetId, actualParameters, formParameters, mode, windowState);
}
else
{
- request = new PortletController.Render(targetId, actualParameters, ri.getBodyParameterMap(), mode, windowState);
+ request = new PortletController.Render(targetId, actualParameters, formParameters, mode, windowState);
}
//
16 years, 7 months
JBoss Portal SVN: r9027 - modules/portlet/trunk/test/src/main/org/jboss/portal/portlet/test.
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2007-11-19 18:49:13 -0500 (Mon, 19 Nov 2007)
New Revision: 9027
Modified:
modules/portlet/trunk/test/src/main/org/jboss/portal/portlet/test/PortletControllerContextImpl.java
Log:
update portlet 1.1 to latest changes in web module
Modified: modules/portlet/trunk/test/src/main/org/jboss/portal/portlet/test/PortletControllerContextImpl.java
===================================================================
--- modules/portlet/trunk/test/src/main/org/jboss/portal/portlet/test/PortletControllerContextImpl.java 2007-11-19 23:03:47 UTC (rev 9026)
+++ modules/portlet/trunk/test/src/main/org/jboss/portal/portlet/test/PortletControllerContextImpl.java 2007-11-19 23:49:13 UTC (rev 9027)
@@ -23,7 +23,8 @@
package org.jboss.portal.portlet.test;
import org.jboss.portal.web.IllegalRequestException;
-import org.jboss.portal.web.RequestInfo;
+import org.jboss.portal.web.WebRequest;
+import org.jboss.portal.web.Body;
import org.jboss.portal.portlet.test.url.ParameterDecoder;
import org.jboss.portal.common.util.ParameterMap;
import org.jboss.portal.common.util.Tools;
@@ -69,7 +70,7 @@
{
targetId = StringCodec.decode(pathInfo.substring(1));
- RequestInfo ri = new RequestInfo(req);
+ WebRequest ri = new WebRequest(req);
ParameterDecoder decoder = PortletURLRenderer.builder.createDecoder();
decoder.decode(ri.getQueryParameterMap());
@@ -108,13 +109,21 @@
//
PortletController.Request request;
String type = metaParameters.getValue("type");
+
+ //
+ ParameterMap formParameters = null;
+ if (ri.getBody() instanceof Body.Form)
+ {
+ formParameters = ((Body.Form)ri.getBody()).getParameters();
+ }
+
if ("action".equals(type))
{
- request = new PortletController.Action(targetId, actualParameters, ri.getBodyParameterMap(), mode, windowState);
+ request = new PortletController.Action(targetId, actualParameters, formParameters, mode, windowState);
}
else
{
- request = new PortletController.Render(targetId, actualParameters, ri.getBodyParameterMap(), mode, windowState);
+ request = new PortletController.Render(targetId, actualParameters, formParameters, mode, windowState);
}
//
16 years, 7 months
JBoss Portal SVN: r9026 - in modules/web/trunk/web: src/main/org/jboss/portal/test/web and 39 other directories.
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2007-11-19 18:03:47 -0500 (Mon, 19 Nov 2007)
New Revision: 9026
Added:
modules/web/trunk/web/src/main/org/jboss/portal/test/web/ServletTestCase.java
modules/web/trunk/web/src/main/org/jboss/portal/test/web/TestServlet.java
modules/web/trunk/web/src/main/org/jboss/portal/test/web/request/
modules/web/trunk/web/src/main/org/jboss/portal/test/web/request/GetTestCase.java
modules/web/trunk/web/src/main/org/jboss/portal/test/web/request/PostApplicationXWWWFormURLEncodedTestCase.java
modules/web/trunk/web/src/main/org/jboss/portal/test/web/request/PostMultipartFormDataTestCase.java
modules/web/trunk/web/src/main/org/jboss/portal/test/web/spi/SPITestCase.java
modules/web/trunk/web/src/main/org/jboss/portal/web/Body.java
modules/web/trunk/web/src/main/org/jboss/portal/web/WebRequest.java
modules/web/trunk/web/src/main/org/jboss/portal/web/WebResponse.java
modules/web/trunk/web/src/resources/portal-test-request-jar/
modules/web/trunk/web/src/resources/portal-test-request-jar/org/
modules/web/trunk/web/src/resources/portal-test-request-jar/org/jboss/
modules/web/trunk/web/src/resources/portal-test-request-jar/org/jboss/portal/
modules/web/trunk/web/src/resources/portal-test-request-jar/org/jboss/portal/test/
modules/web/trunk/web/src/resources/portal-test-request-jar/org/jboss/portal/test/web/
modules/web/trunk/web/src/resources/portal-test-request-jar/org/jboss/portal/test/web/server-beans.xml
modules/web/trunk/web/src/resources/portal-test-spi-jar/
modules/web/trunk/web/src/resources/portal-test-spi-jar/org/
modules/web/trunk/web/src/resources/portal-test-spi-jar/org/jboss/
modules/web/trunk/web/src/resources/portal-test-spi-jar/org/jboss/portal/
modules/web/trunk/web/src/resources/portal-test-spi-jar/org/jboss/portal/test/
modules/web/trunk/web/src/resources/portal-test-spi-jar/org/jboss/portal/test/web/
modules/web/trunk/web/src/resources/portal-test-spi-jar/org/jboss/portal/test/web/server-beans.xml
modules/web/trunk/web/src/resources/test/support/
modules/web/trunk/web/src/resources/test/support/jboss-4.2-container-servlet/
modules/web/trunk/web/src/resources/test/support/jboss-4.2-container-servlet/server-war/
modules/web/trunk/web/src/resources/test/support/jboss-4.2-container-servlet/server-war/WEB-INF/
modules/web/trunk/web/src/resources/test/support/jboss-4.2-container-servlet/server-war/WEB-INF/context.xml
modules/web/trunk/web/src/resources/test/support/jboss-4.2-container-servlet/server-war/WEB-INF/jboss-web.xml
modules/web/trunk/web/src/resources/test/support/jboss-4.2-container-servlet/server-war/WEB-INF/web.xml
modules/web/trunk/web/src/resources/test/support/jboss-4.2-generic/
modules/web/trunk/web/src/resources/test/support/jboss-4.2-generic/server-war/
modules/web/trunk/web/src/resources/test/support/jboss-4.2-generic/server-war/WEB-INF/
modules/web/trunk/web/src/resources/test/support/jboss-4.2-generic/server-war/WEB-INF/jboss-web.xml
modules/web/trunk/web/src/resources/test/support/jboss-4.2-generic/server-war/WEB-INF/web.xml
modules/web/trunk/web/src/resources/test/support/tomcat-6.0-container-servlet/
modules/web/trunk/web/src/resources/test/support/tomcat-6.0-container-servlet/server-war/
modules/web/trunk/web/src/resources/test/support/tomcat-6.0-container-servlet/server-war/META-INF/
modules/web/trunk/web/src/resources/test/support/tomcat-6.0-container-servlet/server-war/META-INF/context.xml
modules/web/trunk/web/src/resources/test/support/tomcat-6.0-container-servlet/server-war/WEB-INF/
modules/web/trunk/web/src/resources/test/support/tomcat-6.0-container-servlet/server-war/WEB-INF/classes/
modules/web/trunk/web/src/resources/test/support/tomcat-6.0-container-servlet/server-war/WEB-INF/classes/log4j.properties
modules/web/trunk/web/src/resources/test/support/tomcat-6.0-container-servlet/server-war/WEB-INF/classes/logging.properties
modules/web/trunk/web/src/resources/test/support/tomcat-6.0-container-servlet/server-war/WEB-INF/web.xml
modules/web/trunk/web/src/resources/test/support/tomcat-6.0-generic/
modules/web/trunk/web/src/resources/test/support/tomcat-6.0-generic/server-war/
modules/web/trunk/web/src/resources/test/support/tomcat-6.0-generic/server-war/META-INF/
modules/web/trunk/web/src/resources/test/support/tomcat-6.0-generic/server-war/META-INF/context.xml
modules/web/trunk/web/src/resources/test/support/tomcat-6.0-generic/server-war/WEB-INF/
modules/web/trunk/web/src/resources/test/support/tomcat-6.0-generic/server-war/WEB-INF/classes/
modules/web/trunk/web/src/resources/test/support/tomcat-6.0-generic/server-war/WEB-INF/classes/log4j.properties
modules/web/trunk/web/src/resources/test/support/tomcat-6.0-generic/server-war/WEB-INF/classes/logging.properties
modules/web/trunk/web/src/resources/test/support/tomcat-6.0-generic/server-war/WEB-INF/web.xml
modules/web/trunk/web/src/resources/test/support/tomcat-6.0-lifecycle-listener/
modules/web/trunk/web/src/resources/test/support/tomcat-6.0-lifecycle-listener/server-war/
modules/web/trunk/web/src/resources/test/support/tomcat-6.0-lifecycle-listener/server-war/WEB-INF/
modules/web/trunk/web/src/resources/test/support/tomcat-6.0-lifecycle-listener/server-war/WEB-INF/classes/
modules/web/trunk/web/src/resources/test/support/tomcat-6.0-lifecycle-listener/server-war/WEB-INF/classes/log4j.properties
modules/web/trunk/web/src/resources/test/support/tomcat-6.0-lifecycle-listener/server-war/WEB-INF/classes/logging.properties
modules/web/trunk/web/src/resources/test/support/tomcat-6.0-lifecycle-listener/server-war/WEB-INF/web.xml
Removed:
modules/web/trunk/web/src/main/org/jboss/portal/test/web/spi/SPITestServlet.java
modules/web/trunk/web/src/main/org/jboss/portal/web/RequestInfo.java
modules/web/trunk/web/src/resources/portal-web-test-jar/
modules/web/trunk/web/src/resources/test/spi/jboss-4.2-container-servlet/
modules/web/trunk/web/src/resources/test/spi/jboss-4.2-generic/
modules/web/trunk/web/src/resources/test/spi/tomcat-6.0-container-servlet/
modules/web/trunk/web/src/resources/test/spi/tomcat-6.0-generic/
modules/web/trunk/web/src/resources/test/spi/tomcat-6.0-lifecycle-listener/
Modified:
modules/web/trunk/web/build.xml
modules/web/trunk/web/src/main/org/jboss/portal/web/IllegalRequestException.java
Log:
added support for WebRequest that provide more info about http servlet request and added test cases for it
Modified: modules/web/trunk/web/build.xml
===================================================================
--- modules/web/trunk/web/build.xml 2007-11-19 15:25:36 UTC (rev 9025)
+++ modules/web/trunk/web/build.xml 2007-11-19 23:03:47 UTC (rev 9026)
@@ -151,7 +151,9 @@
<!-- portal-web.jar -->
<jar jarfile="${build.lib}/portal-web-lib.jar" manifest="${build.etc}/portal-web-lib-jar.mf">
- <fileset dir="${build.classes}"/>
+ <fileset dir="${build.classes}">
+ <exclude name="org/jboss/portal/test/**"/>
+ </fileset>
</jar>
</target>
@@ -252,19 +254,12 @@
<file name="jboss-kernel.jar"/>
</filelist>
- <!-- portal-web-test-lib.jar -->
- <jar jarfile="${build.lib}/portal-web-test-lib.jar">
- <fileset dir="${build.classes}" includes="org/jboss/portal/test/web/spi/**"/>
- <fileset dir="${build.resources}/portal-web-test-jar"/>
- </jar>
-
<!-- **************************** -->
<!-- Tomcat 6.0 container servlet -->
<!-- **************************** -->
<!-- -->
- <copy todir="${build.resources}/test/spi/tomcat-6.0-container-servlet/server-war/WEB-INF/lib">
- <fileset dir="${build.lib}" includes="portal-web-test-lib.jar"/>
+ <copy todir="${build.resources}/test/support/tomcat-6.0-container-servlet/server-war/WEB-INF/lib">
<fileset dir="${jboss.portal/modules/common.lib}" includes="portal-common-mc-lib.jar"/>
<fileset dir="${jboss.portal/modules/test.lib}" includes="jboss-unit-lib.jar,jboss-unit-mc-lib.jar,jboss-unit-remote-lib.jar,portal-test-generic-lib.jar,portal-test-lib.jar"/>
<fileset dir="${jboss.remoting.lib}" includes="jboss-remoting.jar"/>
@@ -283,22 +278,13 @@
<filelist refid="mc.jboss_microcontainer"/>
</copy>
<mkdir dir="${build.lib}/tomcat-6.0-container-servlet"/>
- <jar jarfile="${build.lib}/tomcat-6.0-container-servlet/test-spi-server.war">
- <fileset dir="${build.resources}/test/spi/tomcat-6.0-container-servlet/server-war"/>
- </jar>
- <!-- -->
- <jar jarfile="${build.lib}/tomcat-6.0-container-servlet/test-spi-app.war">
- <fileset dir="${build.resources}/test/spi/app-war"/>
- </jar>
-
<!-- **************************** -->
<!-- Tomcat 6.0 lifecyle listener -->
<!-- **************************** -->
<!-- -->
- <copy todir="${build.resources}/test/spi/tomcat-6.0-lifecycle-listener/server-war/WEB-INF/lib">
- <fileset dir="${build.lib}" includes="portal-web-test-lib.jar"/>
+ <copy todir="${build.resources}/test/support/tomcat-6.0-lifecycle-listener/server-war/WEB-INF/lib">
<fileset dir="${jboss.portal/modules/common.lib}" includes="portal-common-mc-lib.jar"/>
<fileset dir="${jboss.portal/modules/test.lib}" includes="jboss-unit-lib.jar,jboss-unit-mc-lib.jar,jboss-unit-remote-lib.jar,portal-test-generic-lib.jar,portal-test-lib.jar"/>
<fileset dir="${jboss.remoting.lib}" includes="jboss-remoting.jar"/>
@@ -317,23 +303,14 @@
<filelist refid="mc.jboss_microcontainer"/>
</copy>
<mkdir dir="${build.lib}/tomcat-6.0-lifecycle-listener"/>
- <jar jarfile="${build.lib}/tomcat-6.0-lifecycle-listener/test-spi-server.war">
- <fileset dir="${build.resources}/test/spi/tomcat-6.0-lifecycle-listener/server-war"/>
- </jar>
- <!-- -->
- <jar jarfile="${build.lib}/tomcat-6.0-container-servlet/test-spi-app.war">
- <fileset dir="${build.resources}/test/spi/app-war"/>
- </jar>
-
<!-- ****************** -->
<!-- Tomcat 6.0 generic -->
<!-- ****************** -->
<!-- -->
- <mkdir dir="${build.resources}/test/spi/tomcat-6.0-generic/server-war/WEB-INF/lib"/>
- <copy todir="${build.resources}/test/spi/tomcat-6.0-generic/server-war/WEB-INF/lib">
- <fileset dir="${build.lib}" includes="portal-web-test-lib.jar"/>
+ <mkdir dir="${build.resources}/test/support/tomcat-6.0-generic/server-war/WEB-INF/lib"/>
+ <copy todir="${build.resources}/test/support/tomcat-6.0-generic/server-war/WEB-INF/lib">
<fileset dir="${jboss.portal/modules/common.lib}" includes="portal-common-mc-lib.jar"/>
<fileset dir="${jboss.portal/modules/test.lib}" includes="jboss-unit-lib.jar,jboss-unit-mc-lib.jar,jboss-unit-remote-lib.jar,portal-test-generic-lib.jar,portal-test-lib.jar"/>
<fileset dir="${jboss.remoting.lib}" includes="jboss-remoting.jar"/>
@@ -352,23 +329,14 @@
<filelist refid="mc.jboss_microcontainer"/>
</copy>
<mkdir dir="${build.lib}/tomcat-6.0-generic"/>
- <jar jarfile="${build.lib}/tomcat-6.0-generic/test-spi-server.war">
- <fileset dir="${build.resources}/test/spi/tomcat-6.0-generic/server-war"/>
- </jar>
- <!-- -->
- <jar jarfile="${build.lib}/tomcat-6.0-generic/test-spi-app.war">
- <fileset dir="${build.resources}/test/spi/generic/app-war"/>
- </jar>
-
<!-- *************************** -->
<!-- JBoss 4.2 container servlet -->
<!-- *************************** -->
<!-- -->
- <copy todir="${build.resources}/test/spi/jboss-4.2-container-servlet/server-war/WEB-INF/lib">
- <fileset dir="${build.lib}" includes="portal-web-test-lib.jar"/>
- <fileset dir="${jboss.portal/modules/common.lib}" includes="portal-common-lib.jar,portal-common-mc-lib.jar"/>
+ <copy todir="${build.resources}/test/support/jboss-4.2-container-servlet/server-war/WEB-INF/lib">
+ <fileset dir="${jboss.portal/modules/common.lib}" includes="portal-common-mc-lib.jar"/>
<fileset dir="${jboss.portal/modules/test.lib}" includes="portal-test-generic-lib.jar"/>
<filelist refid="mc.trove"/>
<filelist refid="mc.javassist"/>
@@ -382,23 +350,14 @@
<filelist refid="mc.jboss_microcontainer"/>
</copy>
<mkdir dir="${build.lib}/jboss-4.2-container-servlet"/>
- <jar jarfile="${build.lib}/jboss-4.2-container-servlet/test-spi-server.war">
- <fileset dir="${build.resources}/test/spi/jboss-4.2-container-servlet/server-war"/>
- </jar>
- <!-- -->
- <jar jarfile="${build.lib}/jboss-4.2-container-servlet/test-spi-app.war">
- <fileset dir="${build.resources}/test/spi/app-war"/>
- </jar>
-
<!-- ***************** -->
<!-- JBoss 4.2 generic -->
<!-- ***************** -->
<!-- -->
- <copy todir="${build.resources}/test/spi/jboss-4.2-generic/server-war/WEB-INF/lib">
- <fileset dir="${build.lib}" includes="portal-web-test-lib.jar"/>
- <fileset dir="${jboss.portal/modules/common.lib}" includes="portal-common-lib.jar,portal-common-mc-lib.jar"/>
+ <copy todir="${build.resources}/test/support/jboss-4.2-generic/server-war/WEB-INF/lib">
+ <fileset dir="${jboss.portal/modules/common.lib}" includes="portal-common-mc-lib.jar"/>
<fileset dir="${jboss.portal/modules/test.lib}" includes="portal-test-generic-lib.jar"/>
<filelist refid="mc.trove"/>
<filelist refid="mc.javassist"/>
@@ -412,15 +371,77 @@
<filelist refid="mc.jboss_microcontainer"/>
</copy>
<mkdir dir="${build.lib}/jboss-4.2-generic"/>
- <jar jarfile="${build.lib}/jboss-4.2-generic/test-spi-server.war">
- <fileset dir="${build.resources}/test/spi/jboss-4.2-generic/server-war"/>
+
+ <!-- SPI Test case-->
+
+ <jar jarfile="${build.lib}/portal-test-spi-lib.jar">
+ <fileset dir="${build.classes}">
+ <include name="org/jboss/portal/test/web/spi/**"/>
+ <include name="org/jboss/portal/test/web/ServletTestCase.class"/>
+ <include name="org/jboss/portal/test/web/TestServlet.class"/>
+ <include name="org/jboss/portal/test/web/WebAppRegistry.class"/>
+ </fileset>
+ <fileset dir="${build.resources}/portal-test-spi-jar"/>
</jar>
- <!-- -->
+ <war jarfile="${build.lib}/tomcat-6.0-container-servlet/test-spi-server.war">
+ <fileset dir="${build.resources}/test/support/tomcat-6.0-container-servlet/server-war"/>
+ <lib dir="${build.lib}" includes="portal-test-spi-lib.jar"/>
+ </war>
+ <jar jarfile="${build.lib}/tomcat-6.0-container-servlet/test-spi-app.war">
+ <fileset dir="${build.resources}/test/spi/app-war"/>
+ </jar>
+ <war jarfile="${build.lib}/tomcat-6.0-lifecycle-listener/test-spi-server.war">
+ <fileset dir="${build.resources}/test/support/tomcat-6.0-lifecycle-listener/server-war"/>
+ <lib dir="${build.lib}" includes="portal-test-spi-lib.jar"/>
+ </war>
+ <jar jarfile="${build.lib}/tomcat-6.0-container-servlet/test-spi-app.war">
+ <fileset dir="${build.resources}/test/spi/app-war"/>
+ </jar>
+ <war jarfile="${build.lib}/tomcat-6.0-generic/test-spi-server.war">
+ <fileset dir="${build.resources}/test/support/tomcat-6.0-generic/server-war"/>
+ <lib dir="${build.lib}" includes="portal-test-spi-lib.jar"/>
+ </war>
+ <jar jarfile="${build.lib}/tomcat-6.0-generic/test-spi-app.war">
+ <fileset dir="${build.resources}/test/spi/generic/app-war"/>
+ </jar>
+ <war jarfile="${build.lib}/jboss-4.2-container-servlet/test-spi-server.war">
+ <fileset dir="${build.resources}/test/support/jboss-4.2-container-servlet/server-war"/>
+ <lib dir="${build.lib}" includes="portal-test-spi-lib.jar"/>
+ </war>
+ <jar jarfile="${build.lib}/jboss-4.2-container-servlet/test-spi-app.war">
+ <fileset dir="${build.resources}/test/spi/app-war"/>
+ </jar>
+ <war jarfile="${build.lib}/jboss-4.2-generic/test-spi-server.war">
+ <fileset dir="${build.resources}/test/support/jboss-4.2-generic/server-war"/>
+ <lib dir="${build.lib}" includes="portal-test-spi-lib.jar"/>
+ </war>
<jar jarfile="${build.lib}/jboss-4.2-generic/test-spi-app.war">
<fileset dir="${build.resources}/test/spi/generic/app-war"/>
</jar>
+ <!-- Request Test case-->
+
+ <jar jarfile="${build.lib}/portal-test-request-lib.jar">
+ <fileset dir="${build.classes}">
+ <include name="org/jboss/portal/test/web/request/**"/>
+ <include name="org/jboss/portal/test/web/ServletTestCase.class"/>
+ <include name="org/jboss/portal/test/web/TestServlet.class"/>
+ <include name="org/jboss/portal/test/web/WebAppRegistry.class"/>
+ </fileset>
+ <fileset dir="${build.resources}/portal-test-request-jar"/>
+ </jar>
+
+ <war jarfile="${build.lib}/tomcat-6.0-container-servlet/test-request-server.war">
+ <fileset dir="${build.resources}/test/support/tomcat-6.0-container-servlet/server-war"/>
+ <lib dir="${build.lib}" includes="portal-test-request-lib.jar"/>
+ </war>
+
+ <war jarfile="${build.lib}/jboss-4.2-container-servlet/test-request-server.war">
+ <fileset dir="${build.resources}/test/support/jboss-4.2-container-servlet/server-war"/>
+ <lib dir="${build.lib}" includes="portal-test-request-lib.jar"/>
+ </war>
+
</target>
<target name="cargo.setup" depends="init">
@@ -477,7 +498,7 @@
<echo message="Starting JBoss 4.2 container-servlet tests with ${test.jboss-4.2.home}"/>
<antcall target="cargo.jboss-4.2.start">
<param name="cargo.wait" value="false"/>
- <param name="test.spi.server.path" value="${build.lib}/jboss-4.2-container-servlet/test-spi-server.war"/>
+ <param name="test.spi.server.path" value="${test.archive.path}"/>
</antcall>
<antcall target="tests.remote">
<param name="test.server.name" value="${test.jboss-4.2.name}"/>
@@ -491,7 +512,7 @@
<echo message="Starting JBoss 4.2 generic tests with ${test.jboss-4.2.home}"/>
<antcall target="cargo.jboss-4.2.start">
<param name="cargo.wait" value="false"/>
- <param name="test.spi.server.path" value="${build.lib}/jboss-4.2-generic/test-spi-server.war"/>
+ <param name="test.spi.server.path" value="${test.archive.path}"/>
</antcall>
<antcall target="tests.remote">
<param name="test.server.name" value="${test.jboss-4.2.name}"/>
@@ -515,29 +536,47 @@
</condition>
</fail>
<antcall target="tests.jboss-4.2.container-servlet">
- <param name="test.id" value="JBoss-4_2_0-container-servlet"/>
+ <param name="test.id" value="JBoss-4_2_0-spi-container-servlet"/>
<param name="test.jboss-4.2.name" value="RemoteJBoss_4_2_0"/>
<param name="test.jboss-4.2.home" value="${jboss-4.2.0.home}"/>
<param name="test.jboss-4.2.home.variable-name" value="jboss-4.2.0.home"/>
+ <param name="test.archive.path" value="${build.lib}/jboss-4.2-container-servlet/test-spi-server.war"/>
</antcall>
<antcall target="tests.jboss-4.2.container-servlet">
- <param name="test.id" value="JBoss-4_2_1-container-servlet"/>
+ <param name="test.id" value="JBoss-4_2_1-spi-container-servlet"/>
<param name="test.jboss-4.2.name" value="RemoteJBoss_4_2_1"/>
<param name="test.jboss-4.2.home" value="${jboss-4.2.1.home}"/>
<param name="test.jboss-4.2.home.variable-name" value="jboss-4.2.1.home"/>
+ <param name="test.archive.path" value="${build.lib}/jboss-4.2-container-servlet/test-spi-server.war"/>
</antcall>
<antcall target="tests.jboss-4.2.generic">
- <param name="test.id" value="JBoss-4_2_0-generic"/>
+ <param name="test.id" value="JBoss-4_2_0-spi-generic"/>
<param name="test.jboss-4.2.name" value="RemoteJBoss_4_2_0"/>
<param name="test.jboss-4.2.home" value="${jboss-4.2.0.home}"/>
<param name="test.jboss-4.2.home.variable-name" value="jboss-4.2.0.home"/>
+ <param name="test.archive.path" value="${build.lib}/jboss-4.2-generic/test-spi-server.war"/>
</antcall>
<antcall target="tests.jboss-4.2.generic">
- <param name="test.id" value="JBoss-4_2_1-generic"/>
+ <param name="test.id" value="JBoss-4_2_1-spi-generic"/>
<param name="test.jboss-4.2.name" value="RemoteJBoss_4_2_1"/>
<param name="test.jboss-4.2.home" value="${jboss-4.2.1.home}"/>
<param name="test.jboss-4.2.home.variable-name" value="jboss-4.2.1.home"/>
+ <param name="test.archive.path" value="${build.lib}/jboss-4.2-generic/test-spi-server.war"/>
</antcall>
+ <antcall target="tests.jboss-4.2.container-servlet">
+ <param name="test.id" value="JBoss-4_2_0-request-container-servlet"/>
+ <param name="test.jboss-4.2.name" value="RemoteJBoss_4_2_0"/>
+ <param name="test.jboss-4.2.home" value="${jboss-4.2.0.home}"/>
+ <param name="test.jboss-4.2.home.variable-name" value="jboss-4.2.0.home"/>
+ <param name="test.archive.path" value="${build.lib}/jboss-4.2-container-servlet/test-request-server.war"/>
+ </antcall>
+ <antcall target="tests.jboss-4.2.container-servlet">
+ <param name="test.id" value="JBoss-4_2_1-request-container-servlet"/>
+ <param name="test.jboss-4.2.name" value="RemoteJBoss_4_2_1"/>
+ <param name="test.jboss-4.2.home" value="${jboss-4.2.1.home}"/>
+ <param name="test.jboss-4.2.home.variable-name" value="jboss-4.2.1.home"/>
+ <param name="test.archive.path" value="${build.lib}/jboss-4.2-container-servlet/test-request-server.war"/>
+ </antcall>
</target>
<target name="tests.jboss" depends="init">
@@ -586,7 +625,7 @@
<echo message="Starting Tomcat 6 container-servlet tests with ${test.tomcat-6.home}"/>
<antcall target="cargo.tomcat-6.start">
<param name="cargo.wait" value="false"/>
- <param name="test.spi.server.path" value="${build.lib}/tomcat-6.0-container-servlet/test-spi-server.war"/>
+ <param name="test.spi.server.path" value="${test.archive.path}"/>
</antcall>
<antcall target="tests.remote">
<param name="test.server.name" value="RemoteTomcat_6_0"/>
@@ -601,7 +640,7 @@
<echo message="Starting Tomcat 6 generic tests with ${test.tomcat-6.home}"/>
<antcall target="cargo.tomcat-6.start">
<param name="cargo.wait" value="false"/>
- <param name="test.spi.server.path" value="${build.lib}/tomcat-6.0-generic/test-spi-server.war"/>
+ <param name="test.spi.server.path" value="${test.archive.path}"/>
</antcall>
<antcall target="tests.remote">
<param name="test.server.name" value="RemoteTomcat_6_0"/>
@@ -622,21 +661,25 @@
</condition>
</fail>
<antcall target="tests.tomcat-6.container-servlet">
- <param name="test.id" value="Tomcat-6_0-container-servlet"/>
+ <param name="test.id" value="Tomcat-6_0-spi-container-servlet"/>
<param name="test.tomcat-6.name" value="RemoteTomcat_6_0"/>
<param name="test.tomcat-6.home" value="${tomcat-6.0.home}"/>
<param name="test.tomcat-6.home.variable-name" value="tomcat-6.0.home"/>
+ <param name="test.archive.path" value="${build.lib}/tomcat-6.0-container-servlet/test-spi-server.war"/>
</antcall>
<antcall target="tests.tomcat-6.generic">
- <param name="test.id" value="Tomcat-6_0-generic"/>
+ <param name="test.id" value="Tomcat-6_0-spi-generic"/>
<param name="test.tomcat-6.name" value="RemoteTomcat_6_0"/>
<param name="test.tomcat-6.home" value="${tomcat-6.0.home}"/>
<param name="test.tomcat-6.home.variable-name" value="tomcat-6.0.home"/>
+ <param name="test.archive.path" value="${build.lib}/tomcat-6.0-generic/test-spi-server.war"/>
</antcall>
- </target>
-
- <target name="tests.tomcat" depends="init">
- <antcall target="tests.tomcat-6.generic">
+ <antcall target="tests.tomcat-6.container-servlet">
+ <param name="test.id" value="Tomcat-6_0-request-container-servlet"/>
+ <param name="test.tomcat-6.name" value="RemoteTomcat_6_0"/>
+ <param name="test.tomcat-6.home" value="${tomcat-6.0.home}"/>
+ <param name="test.tomcat-6.home.variable-name" value="tomcat-6.0.home"/>
+ <param name="test.archive.path" value="${build.lib}/tomcat-6.0-container-servlet/test-request-server.war"/>
</antcall>
</target>
Added: modules/web/trunk/web/src/main/org/jboss/portal/test/web/ServletTestCase.java
===================================================================
--- modules/web/trunk/web/src/main/org/jboss/portal/test/web/ServletTestCase.java (rev 0)
+++ modules/web/trunk/web/src/main/org/jboss/portal/test/web/ServletTestCase.java 2007-11-19 23:03:47 UTC (rev 9026)
@@ -0,0 +1,180 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.test.web;
+
+import org.jboss.unit.driver.DriverResponse;
+import org.jboss.unit.driver.DriverCommand;
+import org.jboss.unit.driver.AbstractTestDriver;
+import org.jboss.unit.info.TestCaseInfo;
+import org.jboss.unit.info.ParameterInfo;
+import org.jboss.unit.info.TestInfo;
+import org.jboss.unit.TestId;
+import org.jboss.unit.remote.ResponseContext;
+import org.jboss.unit.remote.RequestContext;
+import org.jboss.unit.remote.driver.RemoteTestDriver;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import javax.servlet.ServletException;
+import java.io.IOException;
+import java.util.Map;
+import java.util.Set;
+import java.util.Collections;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public abstract class ServletTestCase extends AbstractTestDriver implements RemoteTestDriver, TestCaseInfo
+{
+
+ /** . */
+ protected TestServlet testServlet;
+
+ /** . */
+ private RequestContext requestContext;
+
+ /** . */
+ private ResponseContext responseContext;
+
+ protected ServletTestCase()
+ {
+ }
+
+ public TestInfo getInfo()
+ {
+ return this;
+ }
+
+ public DriverResponse invoke(TestId testId, DriverCommand driverCommand)
+ {
+ testServlet.currentTestCase = this;
+
+ //
+ return invoke(testServlet, driverCommand);
+ }
+
+ public String getName()
+ {
+ return getClass().getSimpleName();
+ }
+
+ public String getDescription()
+ {
+ return "No description";
+ }
+
+ public Map<String, ? extends ParameterInfo> getParameters()
+ {
+ return Collections.emptyMap();
+ }
+
+ public Set<String> getKeywords()
+ {
+ return Collections.emptySet();
+ }
+
+ public void pushContext(TestId testId, RequestContext requestContext)
+ {
+ this.requestContext = requestContext;
+ }
+
+ public ResponseContext popContext(TestId testId)
+ {
+ return responseContext;
+ }
+
+ public int getRequestCount()
+ {
+ return requestContext.getRequestCount();
+ }
+
+ protected void setResponseContext(ResponseContext responseContext)
+ {
+ this.responseContext = responseContext;
+ }
+
+ public abstract DriverResponse service(TestServlet testServlet, HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException;
+
+ public abstract DriverResponse invoke(TestServlet testServlet, DriverCommand driverCommand);
+
+
+ public static String RANGE_0_255 = computeFrom0To255();
+
+ public static String RANGE_256_512 = computeFrom256To512();
+
+ private static String computeFrom0To255()
+ {
+ return compute(0, 256);
+ }
+
+ private static String computeFrom256To512()
+ {
+ return compute(256, 512);
+ }
+
+ public static String compute(int from, int to)
+ {
+ if (from < 0)
+ {
+ throw new IllegalArgumentException();
+ }
+ if (from > to)
+ {
+ throw new IllegalArgumentException();
+ }
+ StringBuffer tmp = new StringBuffer();
+ for (int i = from; i < to; i++)
+ {
+ char c = (char)i;
+ tmp.append(c);
+ }
+ return tmp.toString();
+ }
+
+ public static String compareString(String s1, String s2)
+ {
+ if (s1 == null)
+ {
+ return "s1 is null";
+ }
+ if (s2 == null)
+ {
+ return "s2 is null";
+ }
+ if (s1.length() != s2.length())
+ {
+ return "lengths don't match " + s1.length() + "!=" + s2.length();
+ }
+ for (int i = s1.length() - 1; i >= 0; i--)
+ {
+ char c1 = s1.charAt(i);
+ char c2 = s2.charAt(i);
+ if (c1 != c2)
+ {
+ return "char at position " + i + " are diffrent " + (int)c1 + "!=" + (int)c2;
+ }
+ }
+ return null;
+ }
+}
Added: modules/web/trunk/web/src/main/org/jboss/portal/test/web/TestServlet.java
===================================================================
--- modules/web/trunk/web/src/main/org/jboss/portal/test/web/TestServlet.java (rev 0)
+++ modules/web/trunk/web/src/main/org/jboss/portal/test/web/TestServlet.java 2007-11-19 23:03:47 UTC (rev 9026)
@@ -0,0 +1,88 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.test.web;
+
+import org.jboss.unit.remote.ResponseContext;
+import org.jboss.unit.driver.impl.composite.CompositeTestDriver;
+import org.jboss.unit.driver.DriverResponse;
+import org.jboss.unit.driver.response.FailureResponse;
+import org.jboss.unit.Failure;
+import org.jboss.unit.info.TestInfo;
+
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import javax.servlet.ServletException;
+import java.io.IOException;
+import java.io.Serializable;
+import java.util.HashMap;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public final class TestServlet extends HttpServlet
+{
+
+ /** . */
+ private CompositeTestDriver testSuite;
+
+ /** . */
+ ServletTestCase currentTestCase;
+
+ public void init() throws ServletException
+ {
+ testSuite = (CompositeTestDriver)getServletContext().getAttribute("TestSuite");
+
+ // Init the test cases
+ for (String name : testSuite.getNames())
+ {
+ ((ServletTestCase)testSuite.getDriver(name)).testServlet = this;
+ }
+ }
+
+ protected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException
+ {
+ DriverResponse response;
+ try
+ {
+ response = currentTestCase.service(this, req, resp);
+ }
+ catch (AssertionError e)
+ {
+ response = new FailureResponse(Failure.createFailure(e));
+ }
+ currentTestCase.setResponseContext(new ResponseContext(response, new HashMap<String, Serializable>()));
+ resp.setStatus(200);
+ }
+
+ public void destroy()
+ {
+ testSuite = null;
+ }
+
+ public TestInfo getInfo()
+ {
+ return testSuite.getInfo();
+ }
+}
Added: modules/web/trunk/web/src/main/org/jboss/portal/test/web/request/GetTestCase.java
===================================================================
--- modules/web/trunk/web/src/main/org/jboss/portal/test/web/request/GetTestCase.java (rev 0)
+++ modules/web/trunk/web/src/main/org/jboss/portal/test/web/request/GetTestCase.java 2007-11-19 23:03:47 UTC (rev 9026)
@@ -0,0 +1,118 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.test.web.request;
+
+import org.jboss.portal.test.web.ServletTestCase;
+import org.jboss.portal.test.web.TestServlet;
+import org.jboss.portal.common.util.ParameterMap;
+import org.jboss.portal.common.text.FastURLEncoder;
+import org.jboss.portal.common.http.HttpRequest;
+import org.jboss.portal.web.WebRequest;
+import org.jboss.portal.web.IllegalRequestException;
+import org.jboss.portal.web.Body;
+import org.jboss.unit.driver.DriverResponse;
+import org.jboss.unit.driver.DriverCommand;
+import org.jboss.unit.driver.response.EndTestResponse;
+import org.jboss.unit.driver.response.FailureResponse;
+
+import static org.jboss.unit.api.Assert.*;
+import org.jboss.unit.remote.driver.handler.http.response.InvokeGetResponse;
+import org.jboss.unit.remote.driver.handler.http.response.InvokePostResponse;
+import org.jboss.unit.Failure;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import javax.servlet.ServletException;
+import java.io.IOException;
+import java.nio.charset.Charset;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class GetTestCase extends ServletTestCase
+{
+
+ /** . */
+ private final FastURLEncoder encoder = FastURLEncoder.getUTF8Instance();
+
+ public GetTestCase()
+ {
+ }
+
+ public DriverResponse service(TestServlet testServlet, HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException
+ {
+ WebRequest webRequest = new WebRequest(req);
+
+ //
+ if (getRequestCount() == 0)
+ {
+ ParameterMap queryParameters = assertNotNull(webRequest.getQueryParameterMap());
+ assertNull(webRequest.getBody());
+ assertTrue(queryParameters.isEmpty());
+
+ //
+ StringBuffer tmp = new StringBuffer("/test-request-server/");
+ tmp.append('?').append(encoder.encode("a")).append("=").append(encoder.encode("a_value"));
+ tmp.append('&').append(encoder.encode("b")).append("=").append(encoder.encode("b_value_1"));
+ tmp.append('&').append(encoder.encode("b")).append("=").append(encoder.encode("b_value_2"));
+ tmp.append('&').append(encoder.encode("c")).append("=").append(encoder.encode(RANGE_0_255));
+ return new InvokeGetResponse(tmp.toString());
+ }
+ else if (getRequestCount() == 1)
+ {
+ try
+ {
+ ParameterMap queryParameters = assertNotNull(webRequest.getQueryParameterMap());
+ assertNull(webRequest.getBody());
+ assertEquals(3, queryParameters.size());
+ assertEquals(new String[]{"a_value"}, queryParameters.get("a"));
+ assertEquals(new String[]{"b_value_1","b_value_2"}, queryParameters.get("b"));
+ assertEquals(new String[]{RANGE_0_255}, queryParameters.get("c"));
+ }
+ catch (IllegalRequestException e)
+ {
+ fail(e);
+ }
+ }
+ else
+ {
+ fail();
+ }
+
+ //
+ return new EndTestResponse();
+ }
+
+ public DriverResponse invoke(TestServlet testServlet, DriverCommand driverCommand)
+ {
+ if (getRequestCount() == -1)
+ {
+ return new InvokeGetResponse("/test-request-server/");
+ }
+ else
+ {
+ return new FailureResponse(Failure.createAssertionFailure(""));
+ }
+ }
+}
Added: modules/web/trunk/web/src/main/org/jboss/portal/test/web/request/PostApplicationXWWWFormURLEncodedTestCase.java
===================================================================
--- modules/web/trunk/web/src/main/org/jboss/portal/test/web/request/PostApplicationXWWWFormURLEncodedTestCase.java (rev 0)
+++ modules/web/trunk/web/src/main/org/jboss/portal/test/web/request/PostApplicationXWWWFormURLEncodedTestCase.java 2007-11-19 23:03:47 UTC (rev 9026)
@@ -0,0 +1,188 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.test.web.request;
+
+import org.jboss.portal.test.web.ServletTestCase;
+import org.jboss.portal.test.web.TestServlet;
+import org.jboss.portal.common.text.FastURLEncoder;
+import org.jboss.portal.common.util.ParameterMap;
+import org.jboss.portal.common.http.HttpRequest;
+import org.jboss.portal.web.WebRequest;
+import org.jboss.portal.web.IllegalRequestException;
+import org.jboss.portal.web.Body;
+import org.jboss.unit.driver.DriverResponse;
+import org.jboss.unit.driver.DriverCommand;
+import org.jboss.unit.driver.response.EndTestResponse;
+import org.jboss.unit.driver.response.FailureResponse;
+import org.jboss.unit.remote.driver.handler.http.response.InvokePostResponse;
+import org.jboss.unit.Failure;
+import org.jboss.unit.api.Assert;
+
+import static org.jboss.unit.api.Assert.*;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import javax.servlet.ServletException;
+import java.io.IOException;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class PostApplicationXWWWFormURLEncodedTestCase extends ServletTestCase
+{
+
+ /** . */
+ private final FastURLEncoder encoder = FastURLEncoder.getUTF8Instance();
+
+ public PostApplicationXWWWFormURLEncodedTestCase()
+ {
+ }
+
+ public DriverResponse service(TestServlet testServlet, HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException
+ {
+ WebRequest webRequest = new WebRequest(req);
+
+ //
+ if (getRequestCount() == 0)
+ {
+ ParameterMap queryParameters = Assert.assertNotNull(webRequest.getQueryParameterMap());
+ assertTrue(queryParameters.isEmpty());
+ Body.Form form = Assert.assertInstanceOf(webRequest.getBody(), Body.Form.class);
+ ParameterMap formParameters = form.getParameters();
+ assertTrue(formParameters.isEmpty());
+
+ //
+ InvokePostResponse post = new InvokePostResponse("/test-request-server/?a=a_value_query");
+ post.setBody(new HttpRequest.Form());
+ post.setContentType(InvokePostResponse.APPLICATION_X_WWW_FORM_URLENCODED);
+ return post;
+ }
+ else if (getRequestCount() == 1)
+ {
+ ParameterMap queryParameters = Assert.assertNotNull(webRequest.getQueryParameterMap());
+ assertEquals(1, queryParameters.size());
+ assertEquals(new String[]{"a_value_query"}, queryParameters.get("a"));
+ Body.Form form = Assert.assertInstanceOf(webRequest.getBody(), Body.Form.class);
+ ParameterMap formParameters = form.getParameters();
+ assertTrue(formParameters.isEmpty());
+
+ //
+ InvokePostResponse post = new InvokePostResponse("/test-request-server/");
+ HttpRequest.Form requestForm = new HttpRequest.Form();
+ requestForm.addParameter("a", new String[]{"a_value_body"});
+ post.setBody(requestForm);
+ post.setContentType(InvokePostResponse.APPLICATION_X_WWW_FORM_URLENCODED);
+ return post;
+ }
+ else if (getRequestCount() == 2)
+ {
+ ParameterMap queryParameters = Assert.assertNotNull(webRequest.getQueryParameterMap());
+ assertTrue(queryParameters.isEmpty());
+ Body.Form form = Assert.assertInstanceOf(webRequest.getBody(), Body.Form.class);
+ ParameterMap formParameters = form.getParameters();
+ assertEquals(1, formParameters.size());
+ assertEquals(new String[]{"a_value_body"}, formParameters.get("a"));
+
+ //
+ InvokePostResponse post = new InvokePostResponse("/test-request-server/?a=a_value_query");
+ post.setBody(new HttpRequest.Form());
+ HttpRequest.Form requestForm = new HttpRequest.Form();
+ requestForm.addParameter("a", new String[]{"a_value_form"});
+ post.setBody(requestForm);
+ post.setContentType(InvokePostResponse.APPLICATION_X_WWW_FORM_URLENCODED);
+ return post;
+ }
+ else if (getRequestCount() == 3)
+ {
+ ParameterMap queryParameters = Assert.assertNotNull(webRequest.getQueryParameterMap());
+ assertEquals(1, queryParameters.size());
+ assertEquals(new String[]{"a_value_query"}, queryParameters.get("a"));
+ Body.Form form = Assert.assertInstanceOf(webRequest.getBody(), Body.Form.class);
+ ParameterMap formParameters = form.getParameters();
+ assertEquals(1, formParameters.size());
+ assertEquals(new String[]{"a_value_form"}, formParameters.get("a"));
+
+ //
+ InvokePostResponse post = new InvokePostResponse("/test-request-server/?a=" + encoder.encode(RANGE_0_255));
+ post.setBody(new HttpRequest.Form());
+ HttpRequest.Form requestForm = new HttpRequest.Form();
+ requestForm.addParameter("a", new String[]{RANGE_256_512});
+ post.setBody(requestForm);
+ post.setContentType(InvokePostResponse.APPLICATION_X_WWW_FORM_URLENCODED + "; charset=UTF-8");
+ return post;
+ }
+ else if (getRequestCount() == 4)
+ {
+ ParameterMap queryParameters = Assert.assertNotNull(webRequest.getQueryParameterMap());
+ assertEquals(1, queryParameters.size());
+ assertNull(compareString(RANGE_0_255, queryParameters.get("a")[0]));
+ Body.Form form = Assert.assertInstanceOf(webRequest.getBody(), Body.Form.class);
+ ParameterMap formParameters = form.getParameters();
+ assertEquals(1, formParameters.size());
+ assertNull(compareString(RANGE_256_512, formParameters.get("a")[0]));
+
+ //
+ InvokePostResponse post = new InvokePostResponse("/test-request-server/?a=" + encoder.encode(RANGE_256_512));
+ post.setBody(new HttpRequest.Form());
+ HttpRequest.Form requestForm = new HttpRequest.Form();
+ requestForm.addParameter("a", new String[]{RANGE_0_255});
+ post.setBody(requestForm);
+ post.setContentType(InvokePostResponse.APPLICATION_X_WWW_FORM_URLENCODED + "; charset=UTF-8");
+ return post;
+ }
+ else if (getRequestCount() == 5)
+ {
+ ParameterMap queryParameters = Assert.assertNotNull(webRequest.getQueryParameterMap());
+ assertEquals(1, queryParameters.size());
+ assertNull(compareString(RANGE_256_512, queryParameters.get("a")[0]));
+ Body.Form form = Assert.assertInstanceOf(webRequest.getBody(), Body.Form.class);
+ ParameterMap formParameters = form.getParameters();
+ assertEquals(1, formParameters.size());
+ assertNull(compareString(RANGE_0_255, formParameters.get("a")[0]));
+ }
+ else
+ {
+ Assert.fail();
+ }
+
+ //
+ return new EndTestResponse();
+ }
+
+ public DriverResponse invoke(TestServlet testServlet, DriverCommand driverCommand)
+ {
+ if (getRequestCount() == -1)
+ {
+ InvokePostResponse post = new InvokePostResponse("/test-request-server/");
+ post.setBody(new HttpRequest.Form());
+ post.setContentType(InvokePostResponse.APPLICATION_X_WWW_FORM_URLENCODED);
+ return post;
+ }
+ else
+ {
+ return new FailureResponse(Failure.createAssertionFailure(""));
+ }
+ }
+
+}
Added: modules/web/trunk/web/src/main/org/jboss/portal/test/web/request/PostMultipartFormDataTestCase.java
===================================================================
--- modules/web/trunk/web/src/main/org/jboss/portal/test/web/request/PostMultipartFormDataTestCase.java (rev 0)
+++ modules/web/trunk/web/src/main/org/jboss/portal/test/web/request/PostMultipartFormDataTestCase.java 2007-11-19 23:03:47 UTC (rev 9026)
@@ -0,0 +1,105 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.test.web.request;
+
+import org.jboss.portal.test.web.ServletTestCase;
+import org.jboss.portal.test.web.TestServlet;
+import org.jboss.portal.common.text.FastURLEncoder;
+import org.jboss.portal.common.util.ParameterMap;
+import org.jboss.portal.common.http.HttpRequest;
+import org.jboss.portal.common.io.IOTools;
+import org.jboss.portal.web.WebRequest;
+import org.jboss.portal.web.Body;
+import org.jboss.portal.web.IllegalRequestException;
+import org.jboss.unit.driver.DriverResponse;
+import org.jboss.unit.driver.DriverCommand;
+import org.jboss.unit.driver.response.EndTestResponse;
+import org.jboss.unit.driver.response.FailureResponse;
+import org.jboss.unit.api.Assert;
+import org.jboss.unit.remote.driver.handler.http.response.InvokePostResponse;
+import org.jboss.unit.Failure;
+
+import static org.jboss.unit.api.Assert.*;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import javax.servlet.ServletException;
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.Arrays;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class PostMultipartFormDataTestCase extends ServletTestCase
+{
+
+ /** . */
+ private final FastURLEncoder encoder = FastURLEncoder.getUTF8Instance();
+
+ public PostMultipartFormDataTestCase()
+ {
+ }
+
+ public DriverResponse service(TestServlet testServlet, HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException
+ {
+ WebRequest webRequest = new WebRequest(req);
+
+ //
+ if (getRequestCount() == 0)
+ {
+ ParameterMap queryParameters = Assert.assertNotNull(webRequest.getQueryParameterMap());
+ Assert.assertTrue(queryParameters.isEmpty());
+ Body.Raw raw = Assert.assertInstanceOf(webRequest.getBody(), Body.Raw.class);
+ InputStream in = raw.getInputStream();
+ byte[] bytes = IOTools.getBytes(in);
+ assertTrue(Arrays.equals(new byte[]{0,1,1,2,3,5,8,13,21,34},bytes));
+ }
+ else
+ {
+ Assert.fail();
+ }
+
+ //
+ return new EndTestResponse();
+ }
+
+ public DriverResponse invoke(TestServlet testServlet, DriverCommand driverCommand)
+ {
+ if (getRequestCount() == -1)
+ {
+ InvokePostResponse post = new InvokePostResponse("/test-request-server/");
+ HttpRequest.Raw raw = new HttpRequest.Raw();
+ post.setBody(raw);
+ raw.setBytes(new byte[]{0,1,1,2,3,5,8,13,21,34});
+ post.setContentType(InvokePostResponse.MULTIPART_FORM_DATA);
+ return post;
+ }
+ else
+ {
+ return new FailureResponse(Failure.createAssertionFailure(""));
+ }
+ }
+
+}
Copied: modules/web/trunk/web/src/main/org/jboss/portal/test/web/spi/SPITestCase.java (from rev 8742, modules/web/trunk/web/src/main/org/jboss/portal/test/web/spi/SPITestServlet.java)
===================================================================
--- modules/web/trunk/web/src/main/org/jboss/portal/test/web/spi/SPITestCase.java (rev 0)
+++ modules/web/trunk/web/src/main/org/jboss/portal/test/web/spi/SPITestCase.java 2007-11-19 23:03:47 UTC (rev 9026)
@@ -0,0 +1,192 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.test.web.spi;
+
+import org.jboss.portal.test.web.WebAppRegistry;
+import org.jboss.portal.test.web.TestServlet;
+import org.jboss.portal.test.web.ServletTestCase;
+import org.jboss.portal.test.web.spi.callbacks.NormalCallback;
+import org.jboss.portal.test.web.spi.callbacks.ExceptionCallback;
+import org.jboss.portal.web.ServletContainer;
+import org.jboss.portal.web.WebApp;
+import org.jboss.portal.web.ServletContextDispatcher;
+import org.jboss.portal.web.impl.DefaultServletContainerFactory;
+import org.jboss.unit.driver.DriverResponse;
+import org.jboss.unit.driver.DriverCommand;
+import org.jboss.unit.driver.response.FailureResponse;
+import org.jboss.unit.driver.response.EndTestResponse;
+import org.jboss.unit.remote.driver.handler.deployer.response.UndeployResponse;
+import org.jboss.unit.remote.driver.handler.deployer.response.DeployResponse;
+import org.jboss.unit.remote.driver.handler.http.response.InvokeGetResponse;
+import org.jboss.unit.Failure;
+import static org.jboss.unit.api.Assert.*;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import javax.servlet.ServletException;
+import javax.servlet.ServletContext;
+import java.io.IOException;
+import java.util.Set;
+import java.util.HashSet;
+import java.util.Collection;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class SPITestCase extends ServletTestCase
+{
+
+ /** . */
+ private WebAppRegistry registry;
+
+ /** . */
+ private Set<String> keys;
+
+ /** . */
+ private ServletContainer container;
+
+ public DriverResponse service(TestServlet testServlet, HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException
+ {
+ if (getRequestCount() == 1)
+ {
+ // Should try
+ ServletContext appContext = testServlet.getServletContext().getContext("/test-spi-app");
+
+ //
+ if (appContext == null)
+ {
+ fail("Cannot get access to the /test-spi-app servlet context");
+ }
+
+ //
+ WebApp webApp = registry.getWebApp("/test-spi-app");
+ NormalCallback cb1 = new NormalCallback(appContext, webApp.getClassLoader());
+ Exception ex = new Exception();
+ ExceptionCallback cb2 = new ExceptionCallback(appContext, ex, ex);
+ Error err = new Error();
+ ExceptionCallback cb3 = new ExceptionCallback(appContext, err, err);
+ RuntimeException rex = new RuntimeException();
+ ExceptionCallback cb4 = new ExceptionCallback(appContext, rex, rex);
+ IOException ioe = new IOException();
+ ExceptionCallback cb5 = new ExceptionCallback(appContext, ioe, ioe);
+
+ //
+ ServletContextDispatcher dispatcher = new ServletContextDispatcher(req, resp, container);
+ DriverResponse response = cb1.test(null, dispatcher);
+ response = cb2.test(response, dispatcher);
+ response = cb3.test(response, dispatcher);
+ response = cb4.test(response, dispatcher);
+ response = cb5.test(response, dispatcher);
+
+ //
+ if (response != null)
+ {
+ return response;
+ }
+
+ // Now we undeploy
+ return new UndeployResponse("test-spi-app.war");
+ }
+ else if (getRequestCount() == 2)
+ {
+ if (!keys.equals(registry.getKeys()))
+ {
+ fail("The set of deployed web applications " + registry.getKeys() + " is not equals to the expected set " + keys);
+ }
+
+ // Remove registration
+ container.removeWebAppListener(registry);
+
+ //
+ if (registry.getKeys().size() > 0)
+ {
+ fail("The set of deployed web application should be empty instead of " + registry.getKeys());
+ }
+ else
+ {
+ return new EndTestResponse();
+ }
+ }
+
+ //
+ return new FailureResponse(Failure.createAssertionFailure(""));
+ }
+
+
+ public DriverResponse invoke(TestServlet testServlet, DriverCommand driverCommand)
+ {
+ if (getRequestCount() == -1)
+ {
+ container = DefaultServletContainerFactory.getInstance().getServletContainer();
+ if (container == null)
+ {
+ return new FailureResponse(Failure.createAssertionFailure("No servlet container present"));
+ }
+
+ // Register and save the deployed web apps
+ registry = new WebAppRegistry();
+ container.addWebAppListener(registry);
+ keys = new HashSet<String>((Collection<? extends String>)registry.getKeys());
+
+ // Deploy the application web app
+ return new DeployResponse("test-spi-app.war");
+ }
+ else if (getRequestCount() == 0)
+ {
+ // Compute the difference with the previous deployed web apps
+ Set diff = new HashSet<String>((Collection<? extends String>)registry.getKeys());
+ diff.removeAll(keys);
+
+ // It should be 1
+ if (diff.size() != 1)
+ {
+ return new FailureResponse(Failure.createAssertionFailure("The size of the new web application deployed should be 1, it is " + diff.size() + " instead." +
+ "The previous set was " + keys + " and the new set is " + registry.getKeys()));
+ }
+ String key = (String)diff.iterator().next();
+ if (!"/test-spi-app".equals(key))
+ {
+ return new FailureResponse(Failure.createAssertionFailure("The newly deployed web application should be /test-spi-war and it is " + key));
+ }
+
+ //
+ WebApp webApp = registry.getWebApp("/test-spi-app");
+ if (webApp == null)
+ {
+ return new FailureResponse(Failure.createAssertionFailure("The web app /test-spi-app was not found"));
+ }
+ if (!"/test-spi-app".equals(webApp.getContextPath()))
+ {
+ return new FailureResponse(Failure.createAssertionFailure("The web app context is not equals to the expected value but has the value " + webApp.getContextPath()));
+ }
+
+ //
+ return new InvokeGetResponse("/test-spi-server");
+ }
+ else
+ {
+ return new FailureResponse(Failure.createAssertionFailure(""));
+ }
+ }
+}
Deleted: modules/web/trunk/web/src/main/org/jboss/portal/test/web/spi/SPITestServlet.java
===================================================================
--- modules/web/trunk/web/src/main/org/jboss/portal/test/web/spi/SPITestServlet.java 2007-11-19 15:25:36 UTC (rev 9025)
+++ modules/web/trunk/web/src/main/org/jboss/portal/test/web/spi/SPITestServlet.java 2007-11-19 23:03:47 UTC (rev 9026)
@@ -1,271 +0,0 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2006, Red Hat Middleware, LLC, and individual *
- * contributors as indicated by the @authors tag. See the *
- * copyright.txt in the distribution for a full listing of *
- * individual contributors. *
- * *
- * This is free software; you can redistribute it and/or modify it *
- * under the terms of the GNU Lesser General Public License as *
- * published by the Free Software Foundation; either version 2.1 of *
- * the License, or (at your option) any later version. *
- * *
- * This software is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
- * Lesser General Public License for more details. *
- * *
- * You should have received a copy of the GNU Lesser General Public *
- * License along with this software; if not, write to the Free *
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
- ******************************************************************************/
-package org.jboss.portal.test.web.spi;
-
-import org.jboss.portal.test.web.WebAppRegistry;
-import org.jboss.portal.test.web.spi.callbacks.NormalCallback;
-import org.jboss.portal.test.web.spi.callbacks.ExceptionCallback;
-import org.jboss.portal.web.ServletContainer;
-import org.jboss.portal.web.WebApp;
-import org.jboss.portal.web.ServletContextDispatcher;
-import org.jboss.portal.web.impl.DefaultServletContainerFactory;
-import org.jboss.unit.info.TestInfo;
-import org.jboss.unit.info.impl.SimpleTestCaseInfo;
-import org.jboss.unit.driver.DriverResponse;
-import org.jboss.unit.driver.DriverCommand;
-import org.jboss.unit.driver.DriverContext;
-import org.jboss.unit.driver.DriverException;
-import org.jboss.unit.driver.impl.composite.CompositeTestDriver;
-import org.jboss.unit.driver.response.FailureResponse;
-import org.jboss.unit.driver.response.EndTestResponse;
-import org.jboss.unit.remote.driver.RemoteTestDriverServer;
-import org.jboss.unit.remote.driver.RemoteTestDriver;
-import org.jboss.unit.remote.driver.CompositeRemoteTestDriver;
-import org.jboss.unit.remote.driver.handler.deployer.response.UndeployResponse;
-import org.jboss.unit.remote.driver.handler.deployer.response.DeployResponse;
-import org.jboss.unit.remote.driver.handler.http.response.InvokeGetResponse;
-import org.jboss.unit.remote.ResponseContext;
-import org.jboss.unit.remote.RequestContext;
-import org.jboss.unit.Failure;
-import org.jboss.unit.TestId;
-
-import javax.servlet.http.HttpServlet;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-import javax.servlet.ServletException;
-import javax.servlet.ServletContext;
-import java.io.IOException;
-import java.io.Serializable;
-import java.util.Set;
-import java.util.HashSet;
-import java.util.HashMap;
-import java.util.Collection;
-
-/**
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 1.1 $
- */
-public class SPITestServlet extends HttpServlet implements RemoteTestDriver
-{
-
- /** . */
- private TestInfo info = new SimpleTestCaseInfo("test");
-
- /** . */
- private WebAppRegistry registry;
-
- /** . */
- private Set<String> keys;
-
- /** . */
- private ServletContainer container;
-
- /** . */
- private RemoteTestDriverServer driver;
-
- /** . */
- private RequestContext requestContext;
-
- /** . */
- private ResponseContext responseContext;
-
- public void init() throws ServletException
- {
- try
- {
- CompositeTestDriver suite = new CompositeTestDriver(getClass().getName());
- CompositeRemoteTestDriver remoteSuite = new CompositeRemoteTestDriver(suite);
- suite.mount(this);
- driver = (RemoteTestDriverServer)getServletContext().getAttribute("TestDriverServer");
- driver.setDelegate(remoteSuite);
- }
- catch (DriverException e)
- {
- throw new ServletException(e);
- }
- }
-
- public void destroy()
- {
- driver.setDelegate(null);
- driver = null;
- }
-
-
- public void initDriver(DriverContext driverContext)
- {
-
- }
-
- public void destroyDriver()
- {
-
- }
-
- protected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException
- {
- DriverResponse response = service2(req, resp);
- responseContext = new ResponseContext(response, new HashMap<String, Serializable>());
- resp.setStatus(200);
- }
-
- private DriverResponse service2(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException
- {
- if (requestContext.isRequestCount(1))
- {
- // Should try
- ServletContext appContext = getServletContext().getContext("/test-spi-app");
-
- //
- if (appContext == null)
- {
- return new FailureResponse(Failure.createErrorFailure("Cannot get access to the /test-spi-app servlet context"));
- }
-
- //
- WebApp webApp = registry.getWebApp("/test-spi-app");
- NormalCallback cb1 = new NormalCallback(appContext, webApp.getClassLoader());
- Exception ex = new Exception();
- ExceptionCallback cb2 = new ExceptionCallback(appContext, ex, ex);
- Error err = new Error();
- ExceptionCallback cb3 = new ExceptionCallback(appContext, err, err);
- RuntimeException rex = new RuntimeException();
- ExceptionCallback cb4 = new ExceptionCallback(appContext, rex, rex);
- IOException ioe = new IOException();
- ExceptionCallback cb5 = new ExceptionCallback(appContext, ioe, ioe);
-
- //
- ServletContextDispatcher dispatcher = new ServletContextDispatcher(req, resp, container);
- DriverResponse response = cb1.test(null, dispatcher);
- response = cb2.test(response, dispatcher);
- response = cb3.test(response, dispatcher);
- response = cb4.test(response, dispatcher);
- response = cb5.test(response, dispatcher);
-
- //
- if (response != null)
- {
- return response;
- }
-
- // Now we undeploy
- return new UndeployResponse("test-spi-app.war");
- }
- else if (requestContext.isRequestCount(2))
- {
- if (!keys.equals(registry.getKeys()))
- {
- return new FailureResponse(Failure.createAssertionFailure("The set of deployed web applications " + registry.getKeys() + " is not equals to the expected set " +
- keys));
- }
-
- // Remove registration
- container.removeWebAppListener(registry);
-
- //
- if (registry.getKeys().size() > 0)
- {
- return new FailureResponse(Failure.createAssertionFailure("The set of deployed web application should be empty instead of " + registry.getKeys()));
- }
- else
- {
- return new EndTestResponse();
- }
- }
-
- //
- return new FailureResponse(Failure.createAssertionFailure(""));
- }
-
-
- public void pushContext(TestId testId, RequestContext requestContext)
- {
- this.requestContext = requestContext;
- }
-
- public ResponseContext popContext(TestId testId)
- {
- return responseContext;
- }
-
- public TestInfo getInfo()
- {
- return info;
- }
-
- public DriverResponse invoke(TestId testId, DriverCommand driverCommand)
- {
- if (requestContext.isRequestCount(-1))
- {
- container = DefaultServletContainerFactory.getInstance().getServletContainer();
- if (container == null)
- {
- return new FailureResponse(Failure.createAssertionFailure("No servlet container present"));
- }
-
- // Register and save the deployed web apps
- registry = new WebAppRegistry();
- container.addWebAppListener(registry);
- keys = new HashSet<String>((Collection<? extends String>)registry.getKeys());
-
- // Deploy the application web app
- return new DeployResponse("test-spi-app.war");
- }
- else if (requestContext.isRequestCount(0))
- {
- // Compute the difference with the previous deployed web apps
- Set diff = new HashSet<String>((Collection<? extends String>)registry.getKeys());
- diff.removeAll(keys);
-
- // It should be 1
- if (diff.size() != 1)
- {
- return new FailureResponse(Failure.createAssertionFailure("The size of the new web application deployed should be 1, it is " + diff.size() + " instead." +
- "The previous set was " + keys + " and the new set is " + registry.getKeys()));
- }
- String key = (String)diff.iterator().next();
- if (!"/test-spi-app".equals(key))
- {
- return new FailureResponse(Failure.createAssertionFailure("The newly deployed web application should be /test-spi-war and it is " + key));
- }
-
- //
- WebApp webApp = registry.getWebApp("/test-spi-app");
- if (webApp == null)
- {
- return new FailureResponse(Failure.createAssertionFailure("The web app /test-spi-app was not found"));
- }
- if (!"/test-spi-app".equals(webApp.getContextPath()))
- {
- return new FailureResponse(Failure.createAssertionFailure("The web app context is not equals to the expected value but has the value " + webApp.getContextPath()));
- }
-
- //
- return new InvokeGetResponse("/test-spi-server");
- }
- else
- {
- return new FailureResponse(Failure.createAssertionFailure(""));
- }
- }
-}
Added: modules/web/trunk/web/src/main/org/jboss/portal/web/Body.java
===================================================================
--- modules/web/trunk/web/src/main/org/jboss/portal/web/Body.java (rev 0)
+++ modules/web/trunk/web/src/main/org/jboss/portal/web/Body.java 2007-11-19 23:03:47 UTC (rev 9026)
@@ -0,0 +1,118 @@
+/******************************************************************************
+ * 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.web;
+
+import org.jboss.portal.common.util.ParameterMap;
+
+import javax.servlet.http.HttpServletRequest;
+import java.io.InputStream;
+import java.io.BufferedReader;
+import java.io.IOException;
+
+/**
+ * The body of a request.
+ *
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class Body
+{
+
+ /** . */
+ private final String characterEncoding;
+
+ private Body(String characterEncoding)
+ {
+ this.characterEncoding = characterEncoding;
+ }
+
+ public String getCharacterEncoding()
+ {
+ return characterEncoding;
+ }
+
+ public static class Form extends Body
+ {
+
+ /** . */
+ private final ParameterMap parameters;
+
+ Form(String characterEncoding, ParameterMap parameters)
+ {
+ super(characterEncoding);
+
+ //
+ if (parameters == null)
+ {
+ throw new IllegalArgumentException();
+ }
+
+ //
+ this.parameters = parameters;
+ }
+
+ public ParameterMap getParameters()
+ {
+ return parameters;
+ }
+ }
+
+ public static class Raw extends Body
+ {
+
+ /** . */
+ private final HttpServletRequest request;
+
+ /** . */
+ private boolean consumed;
+
+ Raw(String characterEncoding, HttpServletRequest request)
+ {
+ super(characterEncoding);
+
+ //
+ this.request = request;
+ }
+
+ public InputStream getInputStream() throws IOException
+ {
+ if (consumed)
+ {
+ throw new IllegalStateException();
+ }
+ consumed = true;
+ return request.getInputStream();
+ }
+
+ public BufferedReader getReader() throws IOException
+ {
+ if (consumed)
+ {
+ throw new IllegalStateException();
+ }
+ consumed = true;
+ return request.getReader();
+ }
+ }
+
+}
Modified: modules/web/trunk/web/src/main/org/jboss/portal/web/IllegalRequestException.java
===================================================================
--- modules/web/trunk/web/src/main/org/jboss/portal/web/IllegalRequestException.java 2007-11-19 15:25:36 UTC (rev 9025)
+++ modules/web/trunk/web/src/main/org/jboss/portal/web/IllegalRequestException.java 2007-11-19 23:03:47 UTC (rev 9026)
@@ -26,7 +26,7 @@
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
* @version $Revision: 1.1 $
*/
-public class IllegalRequestException extends Exception
+public class IllegalRequestException extends RuntimeException
{
public IllegalRequestException()
{
Deleted: modules/web/trunk/web/src/main/org/jboss/portal/web/RequestInfo.java
===================================================================
--- modules/web/trunk/web/src/main/org/jboss/portal/web/RequestInfo.java 2007-11-19 15:25:36 UTC (rev 9025)
+++ modules/web/trunk/web/src/main/org/jboss/portal/web/RequestInfo.java 2007-11-19 23:03:47 UTC (rev 9026)
@@ -1,214 +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.web;
-
-import org.jboss.portal.common.http.QueryStringParser;
-import org.jboss.portal.common.util.ParameterMap;
-
-import javax.servlet.http.HttpServletRequest;
-import java.util.Map;
-import java.util.Collections;
-import java.util.Iterator;
-import java.util.HashMap;
-import java.nio.charset.Charset;
-import java.io.UnsupportedEncodingException;
-
-/**
- * Compute useful information about an <code>HttpServletRequest</code>.
- *
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 1.1 $
- */
-public class RequestInfo
-{
-
- /** . */
- public static final int GET_METHOD = 0;
-
- /** . */
- public static final int POST_METHOD = 1;
-
- /** . */
- public static final String APPLICATION_X_WWW_FORM_URLENCODED_MEDIA_TYPE = "application/x-www-form-urlencoded";
-
- /** . */
- public static final String MULTIPART_FORM_DATA_MEDIA_TYPE = "multipart/form-data";
-
- /** . */
- public static final Charset UTF_8_CHARSET = Charset.forName("UTF-8");
-
- /** . */
- private final ParameterMap queryParameterMap;
-
- /** . */
- private final ParameterMap bodyParameterMap;
-
- /** . */
- private final int method;
-
- /** . */
- private final String mediaType;
-
- public RequestInfo(HttpServletRequest req) throws UnsupportedEncodingException, IllegalRequestException
- {
- int method;
- if ("GET".equals(req.getMethod()))
- {
- method = GET_METHOD;
- }
- else if ("POST".equals(req.getMethod()))
- {
- method = POST_METHOD;
- }
- else
- {
- throw new IllegalRequestException("HTTP Method " + req.getMethod() + " not accepted");
- }
-
- // Compute the media type in the content type
- String mediaType = retrieveMediaType(req.getContentType());
-
- // Only affect the charset encoding if the servlet container will decode the request
- if (method == POST_METHOD && APPLICATION_X_WWW_FORM_URLENCODED_MEDIA_TYPE.equals(mediaType))
- {
- // Now we must ensure that we have either an equals or a trailing space after the media-type
- String characterEncoding = req.getCharacterEncoding();
- if (characterEncoding == null)
- {
- // Set out charset for the request
- req.setCharacterEncoding(UTF_8_CHARSET.name());
- }
- else
- {
- Charset charset = Charset.forName(characterEncoding);
- if (!UTF_8_CHARSET.equals(charset))
- {
- throw new IllegalRequestException("Charset " + characterEncoding + " not accepted, it should be UTF8");
- }
- }
- }
-
- // Parse the query string to have the get parameters
- // The resulting map has its parameters decoded from the x-www-form-url encoding
- Map queryParameterMap = Collections.EMPTY_MAP;
- String queryString = req.getQueryString();
- if (queryString != null)
- {
- queryParameterMap = QueryStringParser.getInstance().parseQueryString(queryString);
- }
-
- //
- Map bodyParameterMap = null;
- if (method == POST_METHOD && APPLICATION_X_WWW_FORM_URLENCODED_MEDIA_TYPE.equals(mediaType))
- {
- bodyParameterMap = Collections.EMPTY_MAP;
- for (Iterator i = req.getParameterMap().entrySet().iterator(); i.hasNext();)
- {
- Map.Entry entry = (Map.Entry)i.next();
-
- // Get param name
- String paramName = (String)entry.getKey();
-
- // Values that are aggregated from the query string and the body
- String[] paramValues = (String[])entry.getValue();
-
- // Values decoded from the query string
- String[] queryValues = (String[])queryParameterMap.get(paramName);
- if (queryValues != null)
- {
- int bodyValuesLength = paramValues.length - queryValues.length;
- if (bodyValuesLength > 0)
- {
- String[] bodyValues = new String[bodyValuesLength];
- System.arraycopy(paramValues, queryValues.length, bodyValues, 0, bodyValuesLength);
- if (bodyParameterMap.isEmpty())
- {
- bodyParameterMap = new HashMap();
- }
- bodyParameterMap.put(paramName, bodyValues);
- }
- }
- else
- {
- if (bodyParameterMap.isEmpty())
- {
- bodyParameterMap = new HashMap();
- }
- bodyParameterMap.put(paramName, paramValues);
- }
- }
-
- // Make the map unmodifiable
- bodyParameterMap = bodyParameterMap.isEmpty() ? bodyParameterMap : Collections.unmodifiableMap(bodyParameterMap);
- }
-
- //
- this.method = method;
- this.queryParameterMap = new ParameterMap(queryParameterMap);
- this.bodyParameterMap = bodyParameterMap != null ? new ParameterMap(bodyParameterMap) : null;
- this.mediaType = mediaType;
- }
-
- public ParameterMap getQueryParameterMap()
- {
- return queryParameterMap;
- }
-
- public ParameterMap getBodyParameterMap()
- {
- return bodyParameterMap;
- }
-
- public int getMethod()
- {
- return method;
- }
-
- public String getMediaType()
- {
- return mediaType;
- }
-
- private String retrieveMediaType(String contentType)
- {
- String mediaType = contentType;
-
- //
- if (mediaType != null)
- {
- // Remove any parameters
- int index = mediaType.indexOf(';');
- if (index != -1)
- {
- mediaType = contentType.substring(0, index);
- }
-
- // Trim
- mediaType = mediaType.trim();
-
- // Media type matching is case insensitive, so we convert to lower case
- mediaType = mediaType.toLowerCase();
- }
- return mediaType;
- }
-}
Copied: modules/web/trunk/web/src/main/org/jboss/portal/web/WebRequest.java (from rev 8948, modules/web/trunk/web/src/main/org/jboss/portal/web/RequestInfo.java)
===================================================================
--- modules/web/trunk/web/src/main/org/jboss/portal/web/WebRequest.java (rev 0)
+++ modules/web/trunk/web/src/main/org/jboss/portal/web/WebRequest.java 2007-11-19 23:03:47 UTC (rev 9026)
@@ -0,0 +1,218 @@
+/******************************************************************************
+ * 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.web;
+
+import org.jboss.portal.common.http.QueryStringParser;
+import org.jboss.portal.common.util.ParameterMap;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletRequestWrapper;
+import java.util.Map;
+import java.nio.charset.Charset;
+import java.io.UnsupportedEncodingException;
+
+/**
+ * Add useful information about an <code>HttpServletRequest</code>.
+ *
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class WebRequest extends HttpServletRequestWrapper
+{
+
+ public enum Verb
+ {
+ GET,
+ POST
+ }
+
+ /** . */
+ public static final String APPLICATION_X_WWW_FORM_URLENCODED_MEDIA_TYPE = "application/x-www-form-urlencoded";
+
+ /** . */
+ public static final String MULTIPART_FORM_DATA_MEDIA_TYPE = "multipart/form-data";
+
+ /** . */
+ public static final Charset UTF_8_CHARSET = Charset.forName("UTF-8");
+
+ /** . */
+ private final ParameterMap queryParameterMap;
+
+ /** . */
+ private final Body body;
+
+ /** . */
+ private final Verb verb;
+
+ /** . */
+ private final String mediaType;
+
+ public WebRequest(HttpServletRequest req) throws UnsupportedEncodingException, IllegalRequestException
+ {
+ super(req);
+
+ //
+ Verb verb;
+ if ("GET".equals(req.getMethod()))
+ {
+ verb = Verb.GET;
+ }
+ else if ("POST".equals(req.getMethod()))
+ {
+ verb = Verb.POST;
+ }
+ else
+ {
+ throw new IllegalRequestException("HTTP Method " + req.getMethod() + " not accepted");
+ }
+
+ // Compute the media type in the content type
+ String mediaType = retrieveMediaType(req.getContentType());
+
+ // Parse the query string to have the get parameters
+ // The resulting map has its parameters decoded from the x-www-form-url encoding
+ ParameterMap queryParameterMap;
+ String queryString = req.getQueryString();
+ if (queryString != null)
+ {
+ queryParameterMap = QueryStringParser.getInstance().parseQueryString(queryString);
+ }
+ else
+ {
+ queryParameterMap = new ParameterMap();
+ }
+
+ // Only affect the charset encoding if the servlet container will decode the request
+ Body body = null;
+ if (verb == Verb.POST)
+ {
+ if (APPLICATION_X_WWW_FORM_URLENCODED_MEDIA_TYPE.equals(mediaType))
+ {
+ // Now we must ensure that we have either an equals or a trailing space after the media-type
+ String characterEncoding = req.getCharacterEncoding();
+ if (characterEncoding == null)
+ {
+ // Set out charset for the request
+ req.setCharacterEncoding(UTF_8_CHARSET.name());
+ }
+ else
+ {
+ Charset charset = Charset.forName(characterEncoding);
+ if (!UTF_8_CHARSET.equals(charset))
+ {
+ throw new IllegalRequestException("Charset " + characterEncoding + " not accepted, it should be UTF8");
+ }
+ }
+
+ //
+ ParameterMap bodyParameterMap = new ParameterMap();
+ for (Map.Entry<String, String[]> entry : ((Map<String, String[]>)req.getParameterMap()).entrySet())
+ {
+ // Get param name
+ String paramName = entry.getKey();
+
+ // Values that are aggregated from the query string and the body
+ String[] paramValues = entry.getValue();
+
+ // Values decoded from the query string
+ String[] queryValues = queryParameterMap.get(paramName);
+ if (queryValues != null)
+ {
+ int bodyValuesLength = paramValues.length - queryValues.length;
+ if (bodyValuesLength > 0)
+ {
+ String[] bodyValues = new String[bodyValuesLength];
+ System.arraycopy(paramValues, queryValues.length, bodyValues, 0, bodyValuesLength);
+ bodyParameterMap.put(paramName, bodyValues);
+ }
+ }
+ else
+ {
+ bodyParameterMap.put(paramName, paramValues);
+ }
+ }
+
+ //
+ body = new Body.Form(req.getCharacterEncoding(), bodyParameterMap);
+ }
+ else
+ {
+ body = new Body.Raw(req.getCharacterEncoding(), req);
+ }
+ }
+
+ //
+ this.verb = verb;
+ this.queryParameterMap = new ParameterMap(queryParameterMap);
+ this.body = body;
+ this.mediaType = mediaType;
+ }
+
+ public Verb getVerb()
+ {
+ return verb;
+ }
+
+ public Charset getCharset()
+ {
+ return UTF_8_CHARSET;
+ }
+
+ public ParameterMap getQueryParameterMap()
+ {
+ return queryParameterMap;
+ }
+
+ public Body getBody()
+ {
+ return body;
+ }
+
+ public String getMediaType()
+ {
+ return mediaType;
+ }
+
+ private String retrieveMediaType(String contentType)
+ {
+ String mediaType = contentType;
+
+ //
+ if (mediaType != null)
+ {
+ // Remove any parameters
+ int index = mediaType.indexOf(';');
+ if (index != -1)
+ {
+ mediaType = contentType.substring(0, index);
+ }
+
+ // Trim
+ mediaType = mediaType.trim();
+
+ // Media type matching is case insensitive, so we convert to lower case
+ mediaType = mediaType.toLowerCase();
+ }
+ return mediaType;
+ }
+}
Added: modules/web/trunk/web/src/main/org/jboss/portal/web/WebResponse.java
===================================================================
--- modules/web/trunk/web/src/main/org/jboss/portal/web/WebResponse.java (rev 0)
+++ modules/web/trunk/web/src/main/org/jboss/portal/web/WebResponse.java 2007-11-19 23:03:47 UTC (rev 9026)
@@ -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.portal.web;
+
+import javax.servlet.http.HttpServletResponseWrapper;
+import javax.servlet.http.HttpServletResponse;
+
+/**
+ * todo
+ *
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class WebResponse extends HttpServletResponseWrapper
+{
+ public WebResponse(HttpServletResponse resp)
+ {
+ super(resp);
+ }
+}
Added: modules/web/trunk/web/src/resources/portal-test-request-jar/org/jboss/portal/test/web/server-beans.xml
===================================================================
--- modules/web/trunk/web/src/resources/portal-test-request-jar/org/jboss/portal/test/web/server-beans.xml (rev 0)
+++ modules/web/trunk/web/src/resources/portal-test-request-jar/org/jboss/portal/test/web/server-beans.xml 2007-11-19 23:03:47 UTC (rev 9026)
@@ -0,0 +1,87 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~ JBoss, a division of Red Hat ~
+ ~ Copyright 2006, Red Hat Middleware, LLC, and individual ~
+ ~ contributors as indicated by the @authors tag. See the ~
+ ~ copyright.txt in the distribution for a full listing of ~
+ ~ individual contributors. ~
+ ~ ~
+ ~ This is free software; you can redistribute it and/or modify it ~
+ ~ under the terms of the GNU Lesser General Public License as ~
+ ~ published by the Free Software Foundation; either version 2.1 of ~
+ ~ the License, or (at your option) any later version. ~
+ ~ ~
+ ~ This software is distributed in the hope that it will be useful, ~
+ ~ but WITHOUT ANY WARRANTY; without even the implied warranty of ~
+ ~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ~
+ ~ Lesser General Public License for more details. ~
+ ~ ~
+ ~ You should have received a copy of the GNU Lesser General Public ~
+ ~ License along with this software; if not, write to the Free ~
+ ~ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA ~
+ ~ 02110-1301 USA, or see the FSF site: http://www.fsf.org. ~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+
+<deployment xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="urn:jboss:bean-deployer bean-deployer_2_0.xsd"
+ xmlns="urn:jboss:bean-deployer:2.0">
+
+ <bean name="RemoteTestSuite" class="org.jboss.unit.remote.driver.CompositeRemoteTestDriver">
+ <constructor>
+ <parameter class="org.jboss.unit.driver.impl.composite.AbstractCompositeTestDriver"><inject bean="TestSuite"/></parameter>
+ </constructor>
+ </bean>
+
+ <bean name="TestDriverServer" class="org.jboss.unit.remote.driver.RemoteTestDriverServer">
+ <property name="delegate"><inject bean="RemoteTestSuite"/></property>
+ </bean>
+
+ <bean name="TestDriverServerExporter" class="org.jboss.portal.test.framework.impl.generic.server.GenericServiceExporter">
+ <constructor>
+ <parameter>socket://localhost:5400</parameter>
+ <parameter><inject bean="TestDriverServer"/></parameter>
+ <parameter>org.jboss.unit.remote.driver.RemoteTestDriver</parameter>
+ </constructor>
+ </bean>
+
+ <bean name="ServletContainerFactory" class="org.jboss.portal.web.impl.DefaultServletContainerFactory">
+ <constructor factoryClass="org.jboss.portal.web.impl.DefaultServletContainerFactory" factoryMethod="getInstance"/>
+ </bean>
+
+ <bean name="ServletContainer" class="org.jboss.portal.web.ServletContainer">
+ <constructor factoryMethod="getServletContainer">
+ <factory bean="ServletContainerFactory"/>
+ </constructor>
+ </bean>
+
+ <bean name="TestSuite" class="org.jboss.unit.driver.impl.composite.CompositeTestDriver"/>
+
+ <bean name="GetTestCase" class="org.jboss.portal.test.web.request.GetTestCase">
+ <install bean="TestSuite" method="mount">
+ <parameter><this/></parameter>
+ </install>
+ <uninstall bean="TestSuite" method="unmount">
+ <parameter><this/></parameter>
+ </uninstall>
+ </bean>
+
+ <bean name="PostApplicationXWWWFormURLEncodedTestCase" class="org.jboss.portal.test.web.request.PostApplicationXWWWFormURLEncodedTestCase">
+ <install bean="TestSuite" method="mount">
+ <parameter><this/></parameter>
+ </install>
+ <uninstall bean="TestSuite" method="unmount">
+ <parameter><this/></parameter>
+ </uninstall>
+ </bean>
+
+ <bean name="PostMultipartFormDataTestCase" class="org.jboss.portal.test.web.request.PostMultipartFormDataTestCase">
+ <install bean="TestSuite" method="mount">
+ <parameter><this/></parameter>
+ </install>
+ <uninstall bean="TestSuite" method="unmount">
+ <parameter><this/></parameter>
+ </uninstall>
+ </bean>
+
+</deployment>
Added: modules/web/trunk/web/src/resources/portal-test-spi-jar/org/jboss/portal/test/web/server-beans.xml
===================================================================
--- modules/web/trunk/web/src/resources/portal-test-spi-jar/org/jboss/portal/test/web/server-beans.xml (rev 0)
+++ modules/web/trunk/web/src/resources/portal-test-spi-jar/org/jboss/portal/test/web/server-beans.xml 2007-11-19 23:03:47 UTC (rev 9026)
@@ -0,0 +1,69 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~ JBoss, a division of Red Hat ~
+ ~ Copyright 2006, Red Hat Middleware, LLC, and individual ~
+ ~ contributors as indicated by the @authors tag. See the ~
+ ~ copyright.txt in the distribution for a full listing of ~
+ ~ individual contributors. ~
+ ~ ~
+ ~ This is free software; you can redistribute it and/or modify it ~
+ ~ under the terms of the GNU Lesser General Public License as ~
+ ~ published by the Free Software Foundation; either version 2.1 of ~
+ ~ the License, or (at your option) any later version. ~
+ ~ ~
+ ~ This software is distributed in the hope that it will be useful, ~
+ ~ but WITHOUT ANY WARRANTY; without even the implied warranty of ~
+ ~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ~
+ ~ Lesser General Public License for more details. ~
+ ~ ~
+ ~ You should have received a copy of the GNU Lesser General Public ~
+ ~ License along with this software; if not, write to the Free ~
+ ~ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA ~
+ ~ 02110-1301 USA, or see the FSF site: http://www.fsf.org. ~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+
+<deployment xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="urn:jboss:bean-deployer bean-deployer_2_0.xsd"
+ xmlns="urn:jboss:bean-deployer:2.0">
+
+ <bean name="RemoteTestSuite" class="org.jboss.unit.remote.driver.CompositeRemoteTestDriver">
+ <constructor>
+ <parameter class="org.jboss.unit.driver.impl.composite.AbstractCompositeTestDriver"><inject bean="TestSuite"/></parameter>
+ </constructor>
+ </bean>
+
+ <bean name="TestDriverServer" class="org.jboss.unit.remote.driver.RemoteTestDriverServer">
+ <property name="delegate"><inject bean="RemoteTestSuite"/></property>
+ </bean>
+
+ <bean name="TestDriverServerExporter" class="org.jboss.portal.test.framework.impl.generic.server.GenericServiceExporter">
+ <constructor>
+ <parameter>socket://localhost:5400</parameter>
+ <parameter><inject bean="TestDriverServer"/></parameter>
+ <parameter>org.jboss.unit.remote.driver.RemoteTestDriver</parameter>
+ </constructor>
+ </bean>
+
+ <bean name="ServletContainerFactory" GetTestCaseclass="org.jboss.portal.web.impl.DefaultServletContainerFactory">
+ <constructor factoryClass="org.jboss.portal.web.impl.DefaultServletContainerFactory" factoryMethod="getInstance"/>
+ </bean>
+
+ <bean name="ServletContainer" class="org.jboss.portal.web.ServletContainer">
+ <constructor factoryMethod="getServletContainer">
+ <factory bean="ServletContainerFactory"/>
+ </constructor>
+ </bean>
+
+ <bean name="TestSuite" class="org.jboss.unit.driver.impl.composite.CompositeTestDriver"/>
+
+ <bean name="SPITestCase" class="org.jboss.portal.test.web.spi.SPITestCase">
+ <install bean="TestSuite" method="mount">
+ <parameter><this/></parameter>
+ </install>
+ <uninstall bean="TestSuite" method="unmount">
+ <parameter><this/></parameter>
+ </uninstall>
+ </bean>
+
+</deployment>
Added: modules/web/trunk/web/src/resources/test/support/jboss-4.2-container-servlet/server-war/WEB-INF/context.xml
===================================================================
--- modules/web/trunk/web/src/resources/test/support/jboss-4.2-container-servlet/server-war/WEB-INF/context.xml (rev 0)
+++ modules/web/trunk/web/src/resources/test/support/jboss-4.2-container-servlet/server-war/WEB-INF/context.xml 2007-11-19 23:03:47 UTC (rev 9026)
@@ -0,0 +1,2 @@
+<Context privileged="true"> <!-- crossContext="true" -->
+</Context>
\ No newline at end of file
Added: modules/web/trunk/web/src/resources/test/support/jboss-4.2-container-servlet/server-war/WEB-INF/jboss-web.xml
===================================================================
--- modules/web/trunk/web/src/resources/test/support/jboss-4.2-container-servlet/server-war/WEB-INF/jboss-web.xml (rev 0)
+++ modules/web/trunk/web/src/resources/test/support/jboss-4.2-container-servlet/server-war/WEB-INF/jboss-web.xml 2007-11-19 23:03:47 UTC (rev 9026)
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~ JBoss, a division of Red Hat ~
+ ~ Copyright 2006, Red Hat Middleware, LLC, and individual ~
+ ~ contributors as indicated by the @authors tag. See the ~
+ ~ copyright.txt in the distribution for a full listing of ~
+ ~ individual contributors. ~
+ ~ ~
+ ~ This is free software; you can redistribute it and/or modify it ~
+ ~ under the terms of the GNU Lesser General Public License as ~
+ ~ published by the Free Software Foundation; either version 2.1 of ~
+ ~ the License, or (at your option) any later version. ~
+ ~ ~
+ ~ This software is distributed in the hope that it will be useful, ~
+ ~ but WITHOUT ANY WARRANTY; without even the implied warranty of ~
+ ~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ~
+ ~ Lesser General Public License for more details. ~
+ ~ ~
+ ~ You should have received a copy of the GNU Lesser General Public ~
+ ~ License along with this software; if not, write to the Free ~
+ ~ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA ~
+ ~ 02110-1301 USA, or see the FSF site: http://www.fsf.org. ~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+<!DOCTYPE jboss-web PUBLIC
+ "-//JBoss//DTD Web Application 4.2//EN"
+ "http://www.jboss.org/j2ee/dtd/jboss-web_4_2.dtd">
+<jboss-web>
+ <class-loading java2ClassLoadingCompliance="false">
+ <loader-repository>test:loader=portlet</loader-repository>
+ </class-loading>
+</jboss-web>
\ No newline at end of file
Added: modules/web/trunk/web/src/resources/test/support/jboss-4.2-container-servlet/server-war/WEB-INF/web.xml
===================================================================
--- modules/web/trunk/web/src/resources/test/support/jboss-4.2-container-servlet/server-war/WEB-INF/web.xml (rev 0)
+++ modules/web/trunk/web/src/resources/test/support/jboss-4.2-container-servlet/server-war/WEB-INF/web.xml 2007-11-19 23:03:47 UTC (rev 9026)
@@ -0,0 +1,54 @@
+<?xml version="1.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. ~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+
+<!DOCTYPE web-app PUBLIC
+ "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
+ "http://java.sun.com/dtd/web-app_2_3.dtd">
+<web-app>
+ <context-param>
+ <param-name>jboss.portal.mc.beans_resource_location</param-name>
+ <param-value>org/jboss/portal/test/web/server-beans.xml</param-value>
+ </context-param>
+ <context-param>
+ <param-name>jboss.portal.mc.beans_resource_type</param-name>
+ <param-value>classloader</param-value>
+ </context-param>
+ <listener>
+ <listener-class>org.jboss.portal.common.mc.bootstrap.WebBootstrap</listener-class>
+ </listener>
+ <servlet>
+ <servlet-name>ContainerServlet</servlet-name>
+ <servlet-class>org.jboss.portal.web.impl.tomcat.TC6ContainerServlet</servlet-class>
+ <load-on-startup>0</load-on-startup>
+ </servlet>
+ <servlet>
+ <servlet-name>TestServlet</servlet-name>
+ <servlet-class>org.jboss.portal.test.web.TestServlet</servlet-class>
+ <load-on-startup>0</load-on-startup>
+ </servlet>
+ <servlet-mapping>
+ <servlet-name>TestServlet</servlet-name>
+ <url-pattern>/</url-pattern>
+ </servlet-mapping>
+</web-app>
Added: modules/web/trunk/web/src/resources/test/support/jboss-4.2-generic/server-war/WEB-INF/jboss-web.xml
===================================================================
--- modules/web/trunk/web/src/resources/test/support/jboss-4.2-generic/server-war/WEB-INF/jboss-web.xml (rev 0)
+++ modules/web/trunk/web/src/resources/test/support/jboss-4.2-generic/server-war/WEB-INF/jboss-web.xml 2007-11-19 23:03:47 UTC (rev 9026)
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~ JBoss, a division of Red Hat ~
+ ~ Copyright 2006, Red Hat Middleware, LLC, and individual ~
+ ~ contributors as indicated by the @authors tag. See the ~
+ ~ copyright.txt in the distribution for a full listing of ~
+ ~ individual contributors. ~
+ ~ ~
+ ~ This is free software; you can redistribute it and/or modify it ~
+ ~ under the terms of the GNU Lesser General Public License as ~
+ ~ published by the Free Software Foundation; either version 2.1 of ~
+ ~ the License, or (at your option) any later version. ~
+ ~ ~
+ ~ This software is distributed in the hope that it will be useful, ~
+ ~ but WITHOUT ANY WARRANTY; without even the implied warranty of ~
+ ~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ~
+ ~ Lesser General Public License for more details. ~
+ ~ ~
+ ~ You should have received a copy of the GNU Lesser General Public ~
+ ~ License along with this software; if not, write to the Free ~
+ ~ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA ~
+ ~ 02110-1301 USA, or see the FSF site: http://www.fsf.org. ~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+<!DOCTYPE jboss-web PUBLIC
+ "-//JBoss//DTD Web Application 4.2//EN"
+ "http://www.jboss.org/j2ee/dtd/jboss-web_4_2.dtd">
+<jboss-web>
+ <class-loading java2ClassLoadingCompliance="false">
+ <loader-repository>test:loader=portlet</loader-repository>
+ </class-loading>
+</jboss-web>
\ No newline at end of file
Added: modules/web/trunk/web/src/resources/test/support/jboss-4.2-generic/server-war/WEB-INF/web.xml
===================================================================
--- modules/web/trunk/web/src/resources/test/support/jboss-4.2-generic/server-war/WEB-INF/web.xml (rev 0)
+++ modules/web/trunk/web/src/resources/test/support/jboss-4.2-generic/server-war/WEB-INF/web.xml 2007-11-19 23:03:47 UTC (rev 9026)
@@ -0,0 +1,49 @@
+<?xml version="1.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. ~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+
+<!DOCTYPE web-app PUBLIC
+ "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
+ "http://java.sun.com/dtd/web-app_2_3.dtd">
+<web-app>
+ <context-param>
+ <param-name>jboss.portal.mc.beans_resource_location</param-name>
+ <param-value>org/jboss/portal/test/web/server-beans.xml</param-value>
+ </context-param>
+ <context-param>
+ <param-name>jboss.portal.mc.beans_resource_type</param-name>
+ <param-value>classloader</param-value>
+ </context-param>
+ <listener>
+ <listener-class>org.jboss.portal.common.mc.bootstrap.WebBootstrap</listener-class>
+ </listener>
+ <servlet>
+ <servlet-name>TestServlet</servlet-name>
+ <servlet-class>org.jboss.portal.test.web.TestServlet</servlet-class>
+ <load-on-startup>0</load-on-startup>
+ </servlet>
+ <servlet-mapping>
+ <servlet-name>TestServlet</servlet-name>
+ <url-pattern>/</url-pattern>
+ </servlet-mapping>
+</web-app>
Added: modules/web/trunk/web/src/resources/test/support/tomcat-6.0-container-servlet/server-war/META-INF/context.xml
===================================================================
--- modules/web/trunk/web/src/resources/test/support/tomcat-6.0-container-servlet/server-war/META-INF/context.xml (rev 0)
+++ modules/web/trunk/web/src/resources/test/support/tomcat-6.0-container-servlet/server-war/META-INF/context.xml 2007-11-19 23:03:47 UTC (rev 9026)
@@ -0,0 +1,2 @@
+<Context privileged="true" crossContext="true">
+</Context>
\ No newline at end of file
Added: modules/web/trunk/web/src/resources/test/support/tomcat-6.0-container-servlet/server-war/WEB-INF/classes/log4j.properties
===================================================================
--- modules/web/trunk/web/src/resources/test/support/tomcat-6.0-container-servlet/server-war/WEB-INF/classes/log4j.properties (rev 0)
+++ modules/web/trunk/web/src/resources/test/support/tomcat-6.0-container-servlet/server-war/WEB-INF/classes/log4j.properties 2007-11-19 23:03:47 UTC (rev 9026)
@@ -0,0 +1,13 @@
+### ====================================================================== ###
+## ##
+## JBoss Bootstrap Log4j Configuration ##
+## ##
+### ====================================================================== ###
+
+log4j.rootCategory=ALL, CONSOLE
+
+log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender
+log4j.appender.CONSOLE.Threshold=DEBUG
+log4j.appender.CONSOLE.Target=System.out
+log4j.appender.CONSOLE.layout=org.apache.log4j.PatternLayout
+log4j.appender.CONSOLE.layout.ConversionPattern=%d{ABSOLUTE} %-5p [%c{1}] %m%n
Added: modules/web/trunk/web/src/resources/test/support/tomcat-6.0-container-servlet/server-war/WEB-INF/classes/logging.properties
===================================================================
--- modules/web/trunk/web/src/resources/test/support/tomcat-6.0-container-servlet/server-war/WEB-INF/classes/logging.properties (rev 0)
+++ modules/web/trunk/web/src/resources/test/support/tomcat-6.0-container-servlet/server-war/WEB-INF/classes/logging.properties 2007-11-19 23:03:47 UTC (rev 9026)
@@ -0,0 +1,13 @@
+handlers = org.apache.juli.FileHandler, java.util.logging.ConsoleHandler
+
+############################################################
+# Handler specific properties.
+# Describes specific configuration info for Handlers.
+############################################################
+
+org.apache.juli.FileHandler.level = FINE
+org.apache.juli.FileHandler.directory = ${catalina.base}/logs
+org.apache.juli.FileHandler.prefix = test-spi.
+
+java.util.logging.ConsoleHandler.level = FINE
+java.util.logging.ConsoleHandler.formatter = java.util.logging.SimpleFormatter
Added: modules/web/trunk/web/src/resources/test/support/tomcat-6.0-container-servlet/server-war/WEB-INF/web.xml
===================================================================
--- modules/web/trunk/web/src/resources/test/support/tomcat-6.0-container-servlet/server-war/WEB-INF/web.xml (rev 0)
+++ modules/web/trunk/web/src/resources/test/support/tomcat-6.0-container-servlet/server-war/WEB-INF/web.xml 2007-11-19 23:03:47 UTC (rev 9026)
@@ -0,0 +1,54 @@
+<?xml version="1.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. ~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+
+<!DOCTYPE web-app PUBLIC
+ "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
+ "http://java.sun.com/dtd/web-app_2_3.dtd">
+<web-app>
+ <context-param>
+ <param-name>jboss.portal.mc.beans_resource_location</param-name>
+ <param-value>org/jboss/portal/test/web/server-beans.xml</param-value>
+ </context-param>
+ <context-param>
+ <param-name>jboss.portal.mc.beans_resource_type</param-name>
+ <param-value>classloader</param-value>
+ </context-param>
+ <listener>
+ <listener-class>org.jboss.portal.common.mc.bootstrap.WebBootstrap</listener-class>
+ </listener>
+ <servlet>
+ <servlet-name>ContainerServlet</servlet-name>
+ <servlet-class>org.jboss.portal.web.impl.tomcat.TC6ContainerServlet</servlet-class>
+ <load-on-startup>0</load-on-startup>
+ </servlet>
+ <servlet>
+ <servlet-name>SPITestServlet</servlet-name>
+ <servlet-class>org.jboss.portal.test.web.TestServlet</servlet-class>
+ <load-on-startup>0</load-on-startup>
+ </servlet>
+ <servlet-mapping>
+ <servlet-name>SPITestServlet</servlet-name>
+ <url-pattern>/</url-pattern>
+ </servlet-mapping>
+</web-app>
Added: modules/web/trunk/web/src/resources/test/support/tomcat-6.0-generic/server-war/META-INF/context.xml
===================================================================
--- modules/web/trunk/web/src/resources/test/support/tomcat-6.0-generic/server-war/META-INF/context.xml (rev 0)
+++ modules/web/trunk/web/src/resources/test/support/tomcat-6.0-generic/server-war/META-INF/context.xml 2007-11-19 23:03:47 UTC (rev 9026)
@@ -0,0 +1,2 @@
+<Context crossContext="true">
+</Context>
\ No newline at end of file
Added: modules/web/trunk/web/src/resources/test/support/tomcat-6.0-generic/server-war/WEB-INF/classes/log4j.properties
===================================================================
--- modules/web/trunk/web/src/resources/test/support/tomcat-6.0-generic/server-war/WEB-INF/classes/log4j.properties (rev 0)
+++ modules/web/trunk/web/src/resources/test/support/tomcat-6.0-generic/server-war/WEB-INF/classes/log4j.properties 2007-11-19 23:03:47 UTC (rev 9026)
@@ -0,0 +1,13 @@
+### ====================================================================== ###
+## ##
+## JBoss Bootstrap Log4j Configuration ##
+## ##
+### ====================================================================== ###
+
+log4j.rootCategory=ALL, CONSOLE
+
+log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender
+log4j.appender.CONSOLE.Threshold=DEBUG
+log4j.appender.CONSOLE.Target=System.out
+log4j.appender.CONSOLE.layout=org.apache.log4j.PatternLayout
+log4j.appender.CONSOLE.layout.ConversionPattern=%d{ABSOLUTE} %-5p [%c{1}] %m%n
Added: modules/web/trunk/web/src/resources/test/support/tomcat-6.0-generic/server-war/WEB-INF/classes/logging.properties
===================================================================
--- modules/web/trunk/web/src/resources/test/support/tomcat-6.0-generic/server-war/WEB-INF/classes/logging.properties (rev 0)
+++ modules/web/trunk/web/src/resources/test/support/tomcat-6.0-generic/server-war/WEB-INF/classes/logging.properties 2007-11-19 23:03:47 UTC (rev 9026)
@@ -0,0 +1,13 @@
+handlers = org.apache.juli.FileHandler, java.util.logging.ConsoleHandler
+
+############################################################
+# Handler specific properties.
+# Describes specific configuration info for Handlers.
+############################################################
+
+org.apache.juli.FileHandler.level = FINE
+org.apache.juli.FileHandler.directory = ${catalina.base}/logs
+org.apache.juli.FileHandler.prefix = test-spi.
+
+java.util.logging.ConsoleHandler.level = FINE
+java.util.logging.ConsoleHandler.formatter = java.util.logging.SimpleFormatter
Added: modules/web/trunk/web/src/resources/test/support/tomcat-6.0-generic/server-war/WEB-INF/web.xml
===================================================================
--- modules/web/trunk/web/src/resources/test/support/tomcat-6.0-generic/server-war/WEB-INF/web.xml (rev 0)
+++ modules/web/trunk/web/src/resources/test/support/tomcat-6.0-generic/server-war/WEB-INF/web.xml 2007-11-19 23:03:47 UTC (rev 9026)
@@ -0,0 +1,49 @@
+<?xml version="1.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. ~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+
+<!DOCTYPE web-app PUBLIC
+ "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
+ "http://java.sun.com/dtd/web-app_2_3.dtd">
+<web-app>
+ <context-param>
+ <param-name>jboss.portal.mc.beans_resource_location</param-name>
+ <param-value>org/jboss/portal/test/web/server-beans.xml</param-value>
+ </context-param>
+ <context-param>
+ <param-name>jboss.portal.mc.beans_resource_type</param-name>
+ <param-value>classloader</param-value>
+ </context-param>
+ <listener>
+ <listener-class>org.jboss.portal.common.mc.bootstrap.WebBootstrap</listener-class>
+ </listener>
+ <servlet>
+ <servlet-name>TestServlet</servlet-name>
+ <servlet-class>org.jboss.portal.test.web.TestServlet</servlet-class>
+ <load-on-startup>0</load-on-startup>
+ </servlet>
+ <servlet-mapping>
+ <servlet-name>TestServlet</servlet-name>
+ <url-pattern>/</url-pattern>
+ </servlet-mapping>
+</web-app>
Added: modules/web/trunk/web/src/resources/test/support/tomcat-6.0-lifecycle-listener/server-war/WEB-INF/classes/log4j.properties
===================================================================
--- modules/web/trunk/web/src/resources/test/support/tomcat-6.0-lifecycle-listener/server-war/WEB-INF/classes/log4j.properties (rev 0)
+++ modules/web/trunk/web/src/resources/test/support/tomcat-6.0-lifecycle-listener/server-war/WEB-INF/classes/log4j.properties 2007-11-19 23:03:47 UTC (rev 9026)
@@ -0,0 +1,13 @@
+### ====================================================================== ###
+## ##
+## JBoss Bootstrap Log4j Configuration ##
+## ##
+### ====================================================================== ###
+
+log4j.rootCategory=ALL, CONSOLE
+
+log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender
+log4j.appender.CONSOLE.Threshold=DEBUG
+log4j.appender.CONSOLE.Target=System.out
+log4j.appender.CONSOLE.layout=org.apache.log4j.PatternLayout
+log4j.appender.CONSOLE.layout.ConversionPattern=%d{ABSOLUTE} %-5p [%c{1}] %m%n
Added: modules/web/trunk/web/src/resources/test/support/tomcat-6.0-lifecycle-listener/server-war/WEB-INF/classes/logging.properties
===================================================================
--- modules/web/trunk/web/src/resources/test/support/tomcat-6.0-lifecycle-listener/server-war/WEB-INF/classes/logging.properties (rev 0)
+++ modules/web/trunk/web/src/resources/test/support/tomcat-6.0-lifecycle-listener/server-war/WEB-INF/classes/logging.properties 2007-11-19 23:03:47 UTC (rev 9026)
@@ -0,0 +1,13 @@
+handlers = org.apache.juli.FileHandler, java.util.logging.ConsoleHandler
+
+############################################################
+# Handler specific properties.
+# Describes specific configuration info for Handlers.
+############################################################
+
+org.apache.juli.FileHandler.level = FINE
+org.apache.juli.FileHandler.directory = ${catalina.base}/logs
+org.apache.juli.FileHandler.prefix = test-spi.
+
+java.util.logging.ConsoleHandler.level = FINE
+java.util.logging.ConsoleHandler.formatter = java.util.logging.SimpleFormatter
Added: modules/web/trunk/web/src/resources/test/support/tomcat-6.0-lifecycle-listener/server-war/WEB-INF/web.xml
===================================================================
--- modules/web/trunk/web/src/resources/test/support/tomcat-6.0-lifecycle-listener/server-war/WEB-INF/web.xml (rev 0)
+++ modules/web/trunk/web/src/resources/test/support/tomcat-6.0-lifecycle-listener/server-war/WEB-INF/web.xml 2007-11-19 23:03:47 UTC (rev 9026)
@@ -0,0 +1,49 @@
+<?xml version="1.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. ~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+
+<!DOCTYPE web-app PUBLIC
+ "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
+ "http://java.sun.com/dtd/web-app_2_3.dtd">
+<web-app>
+ <context-param>
+ <param-name>jboss.portal.mc.beans_resource_location</param-name>
+ <param-value>org/jboss/portal/test/web/server-beans.xml</param-value>
+ </context-param>
+ <context-param>
+ <param-name>jboss.portal.mc.beans_resource_type</param-name>
+ <param-value>classloader</param-value>
+ </context-param>
+ <listener>
+ <listener-class>org.jboss.portal.common.mc.bootstrap.WebBootstrap</listener-class>
+ </listener>
+ <servlet>
+ <servlet-name>TestServlet</servlet-name>
+ <servlet-class>org.jboss.portal.test.web.TestServlet</servlet-class>
+ <load-on-startup>0</load-on-startup>
+ </servlet>
+ <servlet-mapping>
+ <servlet-name>TestServlet</servlet-name>
+ <url-pattern>/</url-pattern>
+ </servlet-mapping>
+</web-app>
16 years, 7 months
JBoss Portal SVN: r9025 - branches/JBoss_Portal_Branch_2_6/core-cms/src/resources/portal-cms-sar/META-INF.
by portal-commits@lists.jboss.org
Author: thomas.heute(a)jboss.com
Date: 2007-11-19 10:25:36 -0500 (Mon, 19 Nov 2007)
New Revision: 9025
Modified:
branches/JBoss_Portal_Branch_2_6/core-cms/src/resources/portal-cms-sar/META-INF/jboss-service.xml
Log:
Fixing Juju's bugs ;)
Modified: branches/JBoss_Portal_Branch_2_6/core-cms/src/resources/portal-cms-sar/META-INF/jboss-service.xml
===================================================================
--- branches/JBoss_Portal_Branch_2_6/core-cms/src/resources/portal-cms-sar/META-INF/jboss-service.xml 2007-11-19 15:20:59 UTC (rev 9024)
+++ branches/JBoss_Portal_Branch_2_6/core-cms/src/resources/portal-cms-sar/META-INF/jboss-service.xml 2007-11-19 15:25:36 UTC (rev 9025)
@@ -572,6 +572,9 @@
<depends
optional-attribute-name="PortalAuthorizationManagerFactory"
proxy-type="attribute">portal:service=PortalAuthorizationManagerFactory</depends>
+ <depends
+ optional-attribute-name="InstanceContainer"
+ proxy-type="attribute">portal:container=Instance</depends>
</mbean>
<!-- ApprovePublish workflow service -->
16 years, 7 months
JBoss Portal SVN: r9024 - in modules/test/trunk: unit and 13 other directories.
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2007-11-19 10:20:59 -0500 (Mon, 19 Nov 2007)
New Revision: 9024
Modified:
modules/test/trunk/remote/src/main/java/org/jboss/unit/remote/driver/RemoteTestDriverServer.java
modules/test/trunk/unit/pom.xml
modules/test/trunk/unit/src/main/java/org/jboss/unit/Failure.java
modules/test/trunk/unit/src/main/java/org/jboss/unit/FailureType.java
modules/test/trunk/unit/src/main/java/org/jboss/unit/api/Assert.java
modules/test/trunk/unit/src/main/java/org/jboss/unit/runner/model/pojo/POJOTestSuiteDef.java
modules/test/trunk/unit/src/test/java/org/jboss/test/unit/AllTests.java
modules/test/trunk/unit/src/test/java/org/jboss/test/unit/TestIdTests.java
modules/test/trunk/unit/src/test/java/org/jboss/test/unit/api/AssertTests.java
modules/test/trunk/unit/src/test/java/org/jboss/test/unit/info/InfoTests.java
modules/test/trunk/unit/src/test/java/org/jboss/test/unit/pojo/AbstractPOJOTests.java
modules/test/trunk/unit/src/test/java/org/jboss/test/unit/pojo/TestDriverPOJOTests.java
modules/test/trunk/unit/src/test/java/org/jboss/test/unit/pojo/junit/JUnitPOJOTests.java
modules/test/trunk/unit/src/test/java/org/jboss/test/unit/report/junit/JUnitReporterTests.java
modules/test/trunk/unit/src/test/java/org/jboss/test/unit/runner/AbstractTestRunnerTests.java
modules/test/trunk/unit/src/test/java/org/jboss/test/unit/runner/CompositeTestRunnerTests.java
modules/test/trunk/unit/src/test/java/org/jboss/test/unit/runner/GenericTestRunnerTests.java
modules/test/trunk/unit/src/test/java/org/jboss/test/unit/runner/POJOTestRunnerTests.java
modules/test/trunk/unit/src/test/java/org/jboss/test/unit/runner/ParametrizationTests.java
modules/test/trunk/unit/src/test/java/org/jboss/test/unit/runner/TestDriverRunnerTests.java
modules/test/trunk/unit/src/test/java/org/jboss/test/unit/runner/event/TestRunnerEventBroadcasterSupportTests.java
modules/test/trunk/unit/src/test/java/org/jboss/test/unit/runner/event/TestRunnerLifeCycleFilterTests.java
modules/test/trunk/unit/src/test/java/org/jboss/test/unit/runner/model/ModelTests.java
modules/test/trunk/unit/src/test/java/org/jboss/test/unit/sample/SampleTests.java
Log:
enable tests in jboss unit unit module + minor corrections + added test case for array equality assertion
Modified: modules/test/trunk/remote/src/main/java/org/jboss/unit/remote/driver/RemoteTestDriverServer.java
===================================================================
--- modules/test/trunk/remote/src/main/java/org/jboss/unit/remote/driver/RemoteTestDriverServer.java 2007-11-19 11:23:25 UTC (rev 9023)
+++ modules/test/trunk/remote/src/main/java/org/jboss/unit/remote/driver/RemoteTestDriverServer.java 2007-11-19 15:20:59 UTC (rev 9024)
@@ -48,7 +48,7 @@
/** . */
private RemoteTestDriver delegate;
- public TestDriver getDelegate()
+ public RemoteTestDriver getDelegate()
{
return delegate;
}
Modified: modules/test/trunk/unit/pom.xml
===================================================================
--- modules/test/trunk/unit/pom.xml 2007-11-19 11:23:25 UTC (rev 9023)
+++ modules/test/trunk/unit/pom.xml 2007-11-19 15:20:59 UTC (rev 9024)
@@ -24,10 +24,24 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
- <skip>true</skip>
+ <skip>false</skip>
<includes>
+ <include>**/AssertTests.java</include>
<include>**/TestIdTests.java</include>
- <include>**/AllTests.java</include>
+ <include>**/TestDriverPOJOTests.java</include>
+ <include>**/TestHandlerSupportPOJOTests.java</include>
+ <include>**/JUnitPOJOTests.java</include>
+ <include>**/CompositeTestRunnerTests.java</include>
+ <include>**/TestDriverRunnerTests.java</include>
+ <include>**/GenericTestRunnerTests.java</include>
+ <include>**/POJOTestRunnerTests.java</include>
+ <include>**/TestRunnerLifeCycleFilterTests.java</include>
+ <include>**/TestRunnerEventBroadcasterSupportTests.java</include>
+ <include>**/ModelTests.java</include>
+ <include>**/ParametrizationTests.java</include>
+ <include>**/InfoTests.java</include>
+ <include>**/SampleTests.java</include>
+ <!--<include>**/JUnitReporterTests.java</include>-->
</includes>
</configuration>
</plugin>
Modified: modules/test/trunk/unit/src/main/java/org/jboss/unit/Failure.java
===================================================================
--- modules/test/trunk/unit/src/main/java/org/jboss/unit/Failure.java 2007-11-19 11:23:25 UTC (rev 9023)
+++ modules/test/trunk/unit/src/main/java/org/jboss/unit/Failure.java 2007-11-19 15:20:59 UTC (rev 9024)
@@ -22,13 +22,15 @@
******************************************************************************/
package org.jboss.unit;
+import java.io.Serializable;
+
/**
* A failure, contains the description of a failure.
*
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
* @version $Revision: 1.1 $
*/
-public class Failure
+public class Failure implements Serializable
{
/** The optional failure message. */
Modified: modules/test/trunk/unit/src/main/java/org/jboss/unit/FailureType.java
===================================================================
--- modules/test/trunk/unit/src/main/java/org/jboss/unit/FailureType.java 2007-11-19 11:23:25 UTC (rev 9023)
+++ modules/test/trunk/unit/src/main/java/org/jboss/unit/FailureType.java 2007-11-19 15:20:59 UTC (rev 9024)
@@ -22,13 +22,15 @@
******************************************************************************/
package org.jboss.unit;
+import java.io.Serializable;
+
/**
* The type of a failure.
*
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
* @version $Revision: 1.1 $
*/
-public enum FailureType
+public enum FailureType implements Serializable
{
/**
* A failure that is not expected and produced an error.
Modified: modules/test/trunk/unit/src/main/java/org/jboss/unit/api/Assert.java
===================================================================
--- modules/test/trunk/unit/src/main/java/org/jboss/unit/api/Assert.java 2007-11-19 11:23:25 UTC (rev 9023)
+++ modules/test/trunk/unit/src/main/java/org/jboss/unit/api/Assert.java 2007-11-19 15:20:59 UTC (rev 9024)
@@ -335,6 +335,96 @@
}
}
+ /** @see #assertEquals(int[],int[]) */
+ public static void assertEquals(int[] expected, int[] actual)
+ {
+ assertEquals(null, expected, actual);
+ }
+
+ /** Test equality as defined by java.util.Array#equals(int[], int[]). */
+ public static void assertEquals(String message, int[] expected, int[] actual)
+ {
+ if (!Arrays.equals(expected, actual))
+ {
+ fail(format(message, expected, expected));
+ }
+ }
+
+ /** @see #assertEquals(float[],float[]) */
+ public static void assertEquals(float[] expected, float[] actual)
+ {
+ assertEquals(null, expected, actual);
+ }
+
+ /** Test equality as defined by java.util.Array#equals(float[], float[]). */
+ public static void assertEquals(String message, float[] expected, float[] actual)
+ {
+ if (!Arrays.equals(expected, actual))
+ {
+ fail(format(message, expected, expected));
+ }
+ }
+
+ /** @see #assertEquals(short[],short[]) */
+ public static void assertEquals(short[] expected, short[] actual)
+ {
+ assertEquals(null, expected, actual);
+ }
+
+ /** Test equality as defined by java.util.Array#equals(short[], short[]). */
+ public static void assertEquals(String message, short[] expected, short[] actual)
+ {
+ if (!Arrays.equals(expected, actual))
+ {
+ fail(format(message, expected, expected));
+ }
+ }
+
+ /** @see #assertEquals(long[],long[]) */
+ public static void assertEquals(long[] expected, long[] actual)
+ {
+ assertEquals(null, expected, actual);
+ }
+
+ /** Test equality as defined by java.util.Array#equals(long[], long[]). */
+ public static void assertEquals(String message, long[] expected, long[] actual)
+ {
+ if (!Arrays.equals(expected, actual))
+ {
+ fail(format(message, expected, expected));
+ }
+ }
+
+ /** @see #assertEquals(double[],double[]) */
+ public static void assertEquals(double[] expected, double[] actual)
+ {
+ assertEquals(null, expected, actual);
+ }
+
+ /** Test equality as defined by java.util.Array#equals(double[], double[]). */
+ public static void assertEquals(String message, double[] expected, double[] actual)
+ {
+ if (!Arrays.equals(expected, actual))
+ {
+ fail(format(message, expected, expected));
+ }
+ }
+
+ /** @see #assertEquals(boolean[],boolean[]) */
+ public static void assertEquals(boolean[] expected, boolean[] actual)
+ {
+ assertEquals(null, expected, actual);
+ }
+
+ /** Test equality as defined by java.util.Array#equals(boolean[], boolean[]). */
+ public static void assertEquals(String message, boolean[] expected, boolean[] actual)
+ {
+ if (!Arrays.equals(expected, actual))
+ {
+ fail(format(message, expected, expected));
+ }
+ }
+
private static String format(String message, Object expected, Object actual)
{
String formatted = "";
Modified: modules/test/trunk/unit/src/main/java/org/jboss/unit/runner/model/pojo/POJOTestSuiteDef.java
===================================================================
--- modules/test/trunk/unit/src/main/java/org/jboss/unit/runner/model/pojo/POJOTestSuiteDef.java 2007-11-19 11:23:25 UTC (rev 9023)
+++ modules/test/trunk/unit/src/main/java/org/jboss/unit/runner/model/pojo/POJOTestSuiteDef.java 2007-11-19 15:20:59 UTC (rev 9024)
@@ -50,7 +50,7 @@
testClasses.add(testDef);
}
- public Collection<TestClassDef> getTestClasses()
+ public List<TestClassDef> getTestClasses()
{
return testClasses;
}
Modified: modules/test/trunk/unit/src/test/java/org/jboss/test/unit/AllTests.java
===================================================================
--- modules/test/trunk/unit/src/test/java/org/jboss/test/unit/AllTests.java 2007-11-19 11:23:25 UTC (rev 9023)
+++ modules/test/trunk/unit/src/test/java/org/jboss/test/unit/AllTests.java 2007-11-19 15:20:59 UTC (rev 9024)
@@ -34,37 +34,13 @@
public void testAll() throws Exception
{
- SampleTests.test1();
+// SampleTests.test1();
//SampleTests.test2();
}
public static void main(String[] args) throws Exception
{
-// AssertTests.main(args);
-// TestIdTests.main(args);
-//
-// //
-// AbstractPOJOTests.main(args);
-// JUnitPOJOTests.main(args);
-// CompositeTestRunnerTests.main(args);
-// TestDriverRunnerTests.main(args);
-// GenericTestRunnerTests.main(args);
-// POJOTestRunnerTests.main(args);
-//
-// //
-// TestRunnerLifeCycleFilterTests.main(args);
-// TestRunnerEventBroadcasterSupportTests.main(args);
-// ModelTests.main(args);
-// ParametrizationTests.main(args);
-//
-// //
-// InfoTests.main(args);
-
//
- AllTests allTests = new AllTests();
- allTests.testAll();
-
- //
// JUnitReporterTests.main(args);
}
}
Modified: modules/test/trunk/unit/src/test/java/org/jboss/test/unit/TestIdTests.java
===================================================================
--- modules/test/trunk/unit/src/test/java/org/jboss/test/unit/TestIdTests.java 2007-11-19 11:23:25 UTC (rev 9023)
+++ modules/test/trunk/unit/src/test/java/org/jboss/test/unit/TestIdTests.java 2007-11-19 15:20:59 UTC (rev 9024)
@@ -39,25 +39,8 @@
public class TestIdTests extends TestCase
{
- public void testAll() throws Exception
+ public static void testGetNameThrowsIAE()
{
- testEquals();
- testCtor();
- testCtorThrowsIAE();
- testRange();
- testRangeThrowsIAE();
- testGetNameThrowsIAE();
- }
-
-
- public static void main(String[] args) throws Exception
- {
- TestIdTests tests = new TestIdTests();
- tests.testAll();
- }
-
- private static void testGetNameThrowsIAE()
- {
try
{
new TestId().getName(-1);
@@ -84,7 +67,7 @@
}
}
- private static void testRangeThrowsIAE()
+ public static void testRangeThrowsIAE()
{
try
{
@@ -120,7 +103,7 @@
}
}
- private static void testRange()
+ public static void testRange()
{
assertValue(new TestId().range(0));
assertValue(new TestId("abc").range(1));
@@ -130,7 +113,7 @@
assertValue(new TestId("abc", "def", "ghi").range(2), "ghi");
}
- private static void testEquals()
+ public static void testEquals()
{
assertEquals(new TestId(), new TestId());
assertNotEquals(new TestId(), new TestId("abc"));
@@ -143,7 +126,7 @@
assertEquals(new TestId("abc", "def"), new TestId("abc", "def"));
}
- private static void testCtor()
+ public static void testCtor()
{
assertValue(new TestId());
assertValue(new TestId("abc"), "abc");
@@ -153,7 +136,7 @@
assertValue(new TestId(list("abc", "def")), "abc", "def");
}
- private static void testCtorThrowsIAE()
+ public static void testCtorThrowsIAE()
{
try
{
@@ -205,7 +188,7 @@
}
}
- private static void assertValue(TestId id, String... names)
+ public static void assertValue(TestId id, String... names)
{
assertEquals(names.length, id.getLength());
for (int i = 0;i < id.getLength();i++)
@@ -218,7 +201,10 @@
{
tmp.add(i.next());
}
- assertEquals(names, tmp.toArray(new String[tmp.size()]));
-
+ assertEquals(names.length, tmp.size());
+ for (int i = 0;i < names.length;i++)
+ {
+ assertEquals(names[i], tmp.get(i));
+ }
}
}
Modified: modules/test/trunk/unit/src/test/java/org/jboss/test/unit/api/AssertTests.java
===================================================================
--- modules/test/trunk/unit/src/test/java/org/jboss/test/unit/api/AssertTests.java 2007-11-19 11:23:25 UTC (rev 9023)
+++ modules/test/trunk/unit/src/test/java/org/jboss/test/unit/api/AssertTests.java 2007-11-19 15:20:59 UTC (rev 9024)
@@ -22,13 +22,14 @@
******************************************************************************/
package org.jboss.test.unit.api;
+import junit.framework.TestCase;
import org.jboss.unit.api.Assert;
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
* @version $Revision: 1.1 $
*/
-public class AssertTests
+public class AssertTests extends TestCase
{
/** . */
@@ -37,20 +38,8 @@
/** . */
private final static Object o2 = new Object();
- public static void main(String[] args)
+ public static void testBoolean()
{
- testObjectEquals();
- testObjectNotEquals();
- testObjectSame();
- testObjectNotSame();
- testFail();
- testInstanceOf();
- testInteger();
- testBoolean();
- }
-
- private static void testBoolean()
- {
testAssertEquals(true, true);
testAssertEquals(true, new Boolean(true));
testAssertEquals(new Boolean(true), new Boolean(true));
@@ -65,7 +54,7 @@
testAssertNotEquals(null, new Boolean(true));
}
- private static void testInteger()
+ public static void testInteger()
{
testAssertEquals(1, 1);
testAssertEquals(1, new Integer(1));
@@ -81,7 +70,7 @@
testAssertNotEquals(null, new Integer(1));
}
- private static void testAssertEquals(Object left, Object right)
+ public static void testAssertEquals(Object left, Object right)
{
Assert.assertEquals(left, right);
try
@@ -94,7 +83,7 @@
}
}
- private static void testAssertNotEquals(Object left, Object right)
+ public static void testAssertNotEquals(Object left, Object right)
{
Assert.assertNotEquals(left, right);
try
@@ -107,7 +96,7 @@
}
}
- private static void testInstanceOf()
+ public static void testInstanceOf()
{
try
{
@@ -194,23 +183,23 @@
}
}
- private static class A
+ public static class A
{
}
- private static interface B
+ public static interface B
{
}
- private static interface C extends B
+ public static interface C extends B
{
}
- private static class D extends A implements C
+ public static class D extends A implements C
{
}
- private static void testObjectEquals()
+ public static void testObjectEquals()
{
try
{
@@ -241,7 +230,7 @@
Assert.assertEquals((Object)null, null);
}
- private static void testObjectNotEquals()
+ public static void testObjectNotEquals()
{
Assert.assertNotEquals(o1, null);
Assert.assertNotEquals(null, o1);
@@ -272,7 +261,7 @@
}
}
- private static void testObjectSame()
+ public static void testObjectSame()
{
try
{
@@ -310,7 +299,7 @@
Assert.assertSame(null, null);
}
- private static void testObjectNotSame()
+ public static void testObjectNotSame()
{
Assert.assertNotSame(o1, null);
Assert.assertNotSame(null, o1);
@@ -334,7 +323,7 @@
}
}
- private static void testFail()
+ public static void testFail()
{
try
{
@@ -387,4 +376,432 @@
}
}
}
+
+ public static void testObjectArray()
+ {
+ try
+ {
+ Assert.assertEquals(new String[0], new String[0]);
+ }
+ catch (AssertionError e)
+ {
+ throw new RuntimeException(e);
+ }
+ try
+ {
+ Assert.assertEquals(new String[]{"a"}, new String[]{"a"});
+ }
+ catch (AssertionError e)
+ {
+ throw new RuntimeException(e);
+ }
+ try
+ {
+ Assert.assertEquals(new String[]{"a","b"}, new String[]{"a","b"});
+ }
+ catch (AssertionError e)
+ {
+ throw new RuntimeException(e);
+ }
+ try
+ {
+ Assert.assertEquals(new Object[]{}, new Object[]{new Object()});
+ throw new RuntimeException();
+ }
+ catch (AssertionError e)
+ {
+ }
+ try
+ {
+ Assert.assertEquals(new Object[]{new Object()}, new Object[]{});
+ throw new RuntimeException();
+ }
+ catch (AssertionError e)
+ {
+ }
+ try
+ {
+ Assert.assertEquals(new Object[]{new Object()}, new Object[]{new Object()});
+ throw new RuntimeException();
+ }
+ catch (AssertionError e)
+ {
+ }
+ try
+ {
+ Assert.assertEquals(new Object[]{new Object()}, new Object[]{null});
+ throw new RuntimeException();
+ }
+ catch (AssertionError e)
+ {
+ }
+ try
+ {
+ Assert.assertEquals(new Object[]{null}, new Object[]{new Object()});
+ throw new RuntimeException();
+ }
+ catch (AssertionError e)
+ {
+ }
+ try
+ {
+ Assert.assertEquals(new Object[]{null}, new Object[]{null});
+ }
+ catch (AssertionError e)
+ {
+ throw new RuntimeException(e);
+ }
+ }
+
+ public static void testIntArray()
+ {
+ try
+ {
+ Assert.assertEquals(new int[0], new int[0]);
+ }
+ catch (AssertionError e)
+ {
+ throw new RuntimeException(e);
+ }
+ try
+ {
+ Assert.assertEquals(new int[]{0}, new int[]{0});
+ }
+ catch (AssertionError e)
+ {
+ throw new RuntimeException(e);
+ }
+ try
+ {
+ Assert.assertEquals(new int[]{0}, new int[]{1});
+ throw new RuntimeException();
+ }
+ catch (AssertionError e)
+ {
+ }
+ try
+ {
+ Assert.assertEquals(new int[]{0}, new int[]{0,1});
+ throw new RuntimeException();
+ }
+ catch (AssertionError e)
+ {
+ }
+ try
+ {
+ Assert.assertEquals(new int[]{0,1}, new int[]{0,1});
+ }
+ catch (AssertionError e)
+ {
+ throw new RuntimeException(e);
+ }
+ }
+
+ public static void testByteArray()
+ {
+ try
+ {
+ Assert.assertEquals(new byte[0], new byte[0]);
+ }
+ catch (AssertionError e)
+ {
+ throw new RuntimeException(e);
+ }
+ try
+ {
+ Assert.assertEquals(new byte[]{0}, new byte[]{0});
+ }
+ catch (AssertionError e)
+ {
+ throw new RuntimeException(e);
+ }
+ try
+ {
+ Assert.assertEquals(new byte[]{0}, new byte[]{1});
+ throw new RuntimeException();
+ }
+ catch (AssertionError e)
+ {
+ }
+ try
+ {
+ Assert.assertEquals(new byte[]{0}, new byte[]{0,1});
+ throw new RuntimeException();
+ }
+ catch (AssertionError e)
+ {
+ }
+ try
+ {
+ Assert.assertEquals(new byte[]{0,1}, new byte[]{0,1});
+ }
+ catch (AssertionError e)
+ {
+ throw new RuntimeException(e);
+ }
+ }
+
+ public static void testShotArray()
+ {
+ try
+ {
+ Assert.assertEquals(new short[0], new short[0]);
+ }
+ catch (AssertionError e)
+ {
+ throw new RuntimeException(e);
+ }
+ try
+ {
+ Assert.assertEquals(new short[]{0}, new short[]{0});
+ }
+ catch (AssertionError e)
+ {
+ throw new RuntimeException(e);
+ }
+ try
+ {
+ Assert.assertEquals(new short[]{0}, new short[]{1});
+ throw new RuntimeException();
+ }
+ catch (AssertionError e)
+ {
+ }
+ try
+ {
+ Assert.assertEquals(new short[]{0}, new short[]{0,1});
+ throw new RuntimeException();
+ }
+ catch (AssertionError e)
+ {
+ }
+ try
+ {
+ Assert.assertEquals(new short[]{0,1}, new short[]{0,1});
+ }
+ catch (AssertionError e)
+ {
+ throw new RuntimeException(e);
+ }
+ }
+
+ public static void testLongArray()
+ {
+ try
+ {
+ Assert.assertEquals(new long[0], new long[0]);
+ }
+ catch (AssertionError e)
+ {
+ throw new RuntimeException(e);
+ }
+ try
+ {
+ Assert.assertEquals(new long[]{0}, new long[]{0});
+ }
+ catch (AssertionError e)
+ {
+ throw new RuntimeException(e);
+ }
+ try
+ {
+ Assert.assertEquals(new long[]{0}, new long[]{1});
+ throw new RuntimeException();
+ }
+ catch (AssertionError e)
+ {
+ }
+ try
+ {
+ Assert.assertEquals(new long[]{0}, new long[]{0,1});
+ throw new RuntimeException();
+ }
+ catch (AssertionError e)
+ {
+ }
+ try
+ {
+ Assert.assertEquals(new long[]{0,1}, new long[]{0,1});
+ }
+ catch (AssertionError e)
+ {
+ throw new RuntimeException(e);
+ }
+ }
+
+ public static void testFloatArray()
+ {
+ try
+ {
+ Assert.assertEquals(new float[0], new float[0]);
+ }
+ catch (AssertionError e)
+ {
+ throw new RuntimeException(e);
+ }
+ try
+ {
+ Assert.assertEquals(new float[]{0}, new float[]{0});
+ }
+ catch (AssertionError e)
+ {
+ throw new RuntimeException(e);
+ }
+ try
+ {
+ Assert.assertEquals(new float[]{0}, new float[]{1});
+ throw new RuntimeException();
+ }
+ catch (AssertionError e)
+ {
+ }
+ try
+ {
+ Assert.assertEquals(new float[]{0}, new float[]{0,1});
+ throw new RuntimeException();
+ }
+ catch (AssertionError e)
+ {
+ }
+ try
+ {
+ Assert.assertEquals(new float[]{0,1}, new float[]{0,1});
+ }
+ catch (AssertionError e)
+ {
+ throw new RuntimeException(e);
+ }
+ }
+
+ public static void testDoubleArray()
+ {
+ try
+ {
+ Assert.assertEquals(new double[0], new double[0]);
+ }
+ catch (AssertionError e)
+ {
+ throw new RuntimeException(e);
+ }
+ try
+ {
+ Assert.assertEquals(new double[]{0}, new double[]{0});
+ }
+ catch (AssertionError e)
+ {
+ throw new RuntimeException(e);
+ }
+ try
+ {
+ Assert.assertEquals(new double[]{0}, new double[]{1});
+ throw new RuntimeException();
+ }
+ catch (AssertionError e)
+ {
+ }
+ try
+ {
+ Assert.assertEquals(new double[]{0}, new double[]{0,1});
+ throw new RuntimeException();
+ }
+ catch (AssertionError e)
+ {
+ }
+ try
+ {
+ Assert.assertEquals(new double[]{0,1}, new double[]{0,1});
+ }
+ catch (AssertionError e)
+ {
+ throw new RuntimeException(e);
+ }
+ }
+
+ public static void testCharArray()
+ {
+ try
+ {
+ Assert.assertEquals(new char[0], new char[0]);
+ }
+ catch (AssertionError e)
+ {
+ throw new RuntimeException(e);
+ }
+ try
+ {
+ Assert.assertEquals(new char[]{0}, new char[]{0});
+ }
+ catch (AssertionError e)
+ {
+ throw new RuntimeException(e);
+ }
+ try
+ {
+ Assert.assertEquals(new char[]{0}, new char[]{1});
+ throw new RuntimeException();
+ }
+ catch (AssertionError e)
+ {
+ }
+ try
+ {
+ Assert.assertEquals(new char[]{0}, new char[]{0,1});
+ throw new RuntimeException();
+ }
+ catch (AssertionError e)
+ {
+ }
+ try
+ {
+ Assert.assertEquals(new char[]{0,1}, new char[]{0,1});
+ }
+ catch (AssertionError e)
+ {
+ throw new RuntimeException(e);
+ }
+ }
+
+ public static void testBooleanArray()
+ {
+ try
+ {
+ Assert.assertEquals(new boolean[0], new boolean[0]);
+ }
+ catch (AssertionError e)
+ {
+ throw new RuntimeException(e);
+ }
+ try
+ {
+ Assert.assertEquals(new boolean[]{false}, new boolean[]{false});
+ }
+ catch (AssertionError e)
+ {
+ throw new RuntimeException(e);
+ }
+ try
+ {
+ Assert.assertEquals(new boolean[]{false}, new boolean[]{true});
+ throw new RuntimeException();
+ }
+ catch (AssertionError e)
+ {
+ }
+ try
+ {
+ Assert.assertEquals(new boolean[]{false}, new boolean[]{false,true});
+ throw new RuntimeException();
+ }
+ catch (AssertionError e)
+ {
+ }
+ try
+ {
+ Assert.assertEquals(new boolean[]{false,true}, new boolean[]{false,true});
+ }
+ catch (AssertionError e)
+ {
+ throw new RuntimeException(e);
+ }
+ }
}
Modified: modules/test/trunk/unit/src/test/java/org/jboss/test/unit/info/InfoTests.java
===================================================================
--- modules/test/trunk/unit/src/test/java/org/jboss/test/unit/info/InfoTests.java 2007-11-19 11:23:25 UTC (rev 9023)
+++ modules/test/trunk/unit/src/test/java/org/jboss/test/unit/info/InfoTests.java 2007-11-19 15:20:59 UTC (rev 9024)
@@ -22,38 +22,31 @@
******************************************************************************/
package org.jboss.test.unit.info;
-import org.jboss.unit.info.impl.SimpleParameterInfo;
-import org.jboss.unit.info.impl.SimpleTestCaseInfo;
-import org.jboss.unit.info.impl.SimpleTestSuiteInfo;
+import junit.framework.TestCase;
+import static org.jboss.unit.api.Assert.assertInstanceOf;
import org.jboss.unit.info.ParameterInfo;
import org.jboss.unit.info.TestCaseInfo;
import org.jboss.unit.info.TestSuiteInfo;
+import org.jboss.unit.info.impl.SimpleParameterInfo;
+import org.jboss.unit.info.impl.SimpleTestCaseInfo;
+import org.jboss.unit.info.impl.SimpleTestSuiteInfo;
+import static org.jboss.unit.util.CollectionTools.list;
+import static org.jboss.unit.util.CollectionTools.set;
-import static org.jboss.unit.api.Assert.*;
-import static org.jboss.unit.util.CollectionTools.*;
-
-import java.util.List;
import java.util.Collections;
-import java.util.Map;
import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
* @version $Revision: 1.1 $
*/
-public class InfoTests
+public class InfoTests extends TestCase
{
- public static void main(String[] args)
+ public static void testSuiteParameterInfo()
{
- testParameterInfo();
- testTestCaseInfo();
- testSuiteInfo();
- testSuiteParameterInfo();
- }
-
- private static void testSuiteParameterInfo()
- {
SimpleTestSuiteInfo testSuite = new SimpleTestSuiteInfo("my_test_suite");
//
@@ -84,7 +77,7 @@
assertEquals(set(), testSuite.getParameters().keySet());
}
- private static void testParameterInfo()
+ public static void testParameterInfo()
{
try
{
@@ -140,7 +133,7 @@
assertEquals(list("v1", "v2"), copy.getDefaultValues());
}
- private static void testTestCaseInfo()
+ public static void testTestCaseInfo()
{
try
{
@@ -217,7 +210,7 @@
// Test cloning
}
- private static void testSuiteInfo()
+ public static void testSuiteInfo()
{
try
{
Modified: modules/test/trunk/unit/src/test/java/org/jboss/test/unit/pojo/AbstractPOJOTests.java
===================================================================
--- modules/test/trunk/unit/src/test/java/org/jboss/test/unit/pojo/AbstractPOJOTests.java 2007-11-19 11:23:25 UTC (rev 9023)
+++ modules/test/trunk/unit/src/test/java/org/jboss/test/unit/pojo/AbstractPOJOTests.java 2007-11-19 15:20:59 UTC (rev 9024)
@@ -22,85 +22,83 @@
******************************************************************************/
package org.jboss.test.unit.pojo;
+import junit.framework.TestCase;
import org.jboss.unit.api.Assert;
+import static org.jboss.unit.util.CollectionTools.set;
-import static org.jboss.unit.util.CollectionTools.*;
-import static org.jboss.unit.api.Assert.*;
-
-import java.util.Map;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
+import java.util.Map;
import java.util.Set;
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
* @version $Revision: 1.1 $
*/
-public abstract class AbstractPOJOTests
+public abstract class AbstractPOJOTests extends TestCase
{
- public static void main(String[] args)
- {
- new TestDriverPOJOTests().test();
- new TestHandlerSupportPOJOTests().test();
- }
+// public static void main(String[] args)
+// {
+// new TestDriverPOJOTests().test();
+// new TestHandlerSupportPOJOTests().test();
+// }
+// public void test()
+// {
+// testAbstractClassWithoutAnnotations();
+// testClassWithoutAnnotations();
+// testAbstractClassAnnotatedWithTest();
+// testClassAnnotatedWithTest();
+// testClassAnnotatedWithTag();
+//
+// //
+// testMethodAnnotatedWithTest();
+// testTestMethodHavingArgumentsAnnotatedWithParameter();
+// testTestMethodAnnotatedWithConflictingAnnotations();
+// testMethodAnnotatedWithParameter();
+// testMethodAnnotatedWithCreate();
+// testMethodAnnotatedWithTag();
+//
+// //
+// testMethodAndMethodArgumentAnnotatedWithParameter();
+//
+// //
+// testClassWithoutDefaultConstructor();
+// testClassWithFailingConstructor();
+//
+// //
+// testLifeCycleSequence();
+// }
- public void test()
+ public void testClassAnnotatedWithTag()
{
- testAbstractClassWithoutAnnotations();
- testClassWithoutAnnotations();
- testAbstractClassAnnotatedWithTest();
- testClassAnnotatedWithTest();
- testClassAnnotatedWithTag();
-
- //
- testMethodAnnotatedWithTest();
- testTestMethodHavingArgumentsAnnotatedWithParameter();
- testTestMethodAnnotatedWithConflictingAnnotations();
- testMethodAnnotatedWithParameter();
- testMethodAnnotatedWithCreate();
- testMethodAnnotatedWithTag();
-
- //
- testMethodAndMethodArgumentAnnotatedWithParameter();
-
- //
- testClassWithoutDefaultConstructor();
- testClassWithFailingConstructor();
-
- //
- testLifeCycleSequence();
- }
-
- private void testClassAnnotatedWithTag()
- {
testClassAnnotatedWithTag(ClassAnnotatedWithTag1.class, set("annotation_foo"));
testClassAnnotatedWithTag(ClassAnnotatedWithTag2.class, set("annotation_foo", "annotation_bar"));
testClassAnnotatedWithTag(ClassAnnotatedWithTag3.class, new HashSet<String>());
}
- private void testClassAnnotatedWithTag(Class clazz, Set<String> keywords)
+ public void testClassAnnotatedWithTag(Class clazz, Set<String> keywords)
{
AbstractPOJOTest driver = assertCanBuildSuite(clazz);
Assert.assertEquals(keywords, driver.getKeywords());
}
- private void testMethodAnnotatedWithTag()
+ public void testMethodAnnotatedWithTag()
{
testMethodAnnotatedWithTag(MethodAnnotatedWithTag1.class, "testFoo", set("annotation_foo"));
testMethodAnnotatedWithTag(MethodAnnotatedWithTag2.class, "testFoo", set("annotation_foo", "annotation_bar"));
testMethodAnnotatedWithTag(MethodAnnotatedWithTag3.class, "testFoo", new HashSet<String>());
}
- private void testMethodAnnotatedWithTag(Class clazz, String testName, Set<String> keywords)
+ public void testMethodAnnotatedWithTag(Class clazz, String testName, Set<String> keywords)
{
AbstractPOJOTest driver = assertCanBuildSuite(clazz);
Assert.assertEquals(keywords, driver.getTestCaseKeywords(testName));
}
- private void testLifeCycleSequence()
+ public void testLifeCycleSequence()
{
testLifeCycleSequence(LifeCycleSequence01.class, AbstractPOJOTest.InvokeResult.ERROR, null, false);
testLifeCycleSequence(LifeCycleSequence02.class, AbstractPOJOTest.InvokeResult.FAILURE, null, false);
@@ -115,7 +113,7 @@
testLifeCycleSequence(LifeCycleSequence11.class, AbstractPOJOTest.InvokeResult.PASS, "CSRD", true);
}
- private void testLifeCycleSequence(Class clazz, AbstractPOJOTest.InvokeResult result, String expected, boolean invoked)
+ public void testLifeCycleSequence(Class clazz, AbstractPOJOTest.InvokeResult result, String expected, boolean invoked)
{
AbstractPOJOTest driver = assertCanBuildSuite(clazz);
@@ -126,7 +124,7 @@
Assert.assertEquals(expected, POJOAssert.buffer1);
}
- private void testMethodAnnotatedWithCreate()
+ public void testMethodAnnotatedWithCreate()
{
testMethodAnnotatedWithCreate(MethodAnnotatedWithCreate01.class);
testMethodAnnotatedWithCreate(MethodAnnotatedWithCreate02.class);
@@ -137,7 +135,7 @@
assertCannotBuildSuite(MethodAnnotatedWithCreate07.class);
}
- private void testMethodAnnotatedWithCreate(Class clazz)
+ public void testMethodAnnotatedWithCreate(Class clazz)
{
AbstractPOJOTest driver = assertCanBuildSuite(clazz);
@@ -145,7 +143,7 @@
invoke(driver, clazz, "testFoo", AbstractPOJOTest.InvokeResult.PASS, true);
}
- private void testMethodAndMethodArgumentAnnotatedWithParameter()
+ public void testMethodAndMethodArgumentAnnotatedWithParameter()
{
AbstractPOJOTest driver1 = assertCanBuildSuite(MethodAndMethodArgumentAnnotatedWithParameter1.class);
invoke(driver1, MethodAndMethodArgumentAnnotatedWithParameter1.class, "testFoo", AbstractPOJOTest.InvokeResult.PASS, true);
@@ -156,7 +154,7 @@
assertTrue(driver2.getParameterNames().containsAll(driver2.getTestCaseParameterNames("testFoo")));
}
- private void testClassWithFailingConstructor()
+ public void testClassWithFailingConstructor()
{
testClassWithFailingConstructor(ClassWithFailingConstructor1.class, AbstractPOJOTest.InvokeResult.ERROR, false);
testClassWithFailingConstructor(ClassWithFailingConstructor2.class, AbstractPOJOTest.InvokeResult.ERROR, false);
@@ -164,7 +162,7 @@
testClassWithFailingConstructor(ClassWithFailingConstructor4.class, AbstractPOJOTest.InvokeResult.FAILURE, false);
}
- private void testClassWithFailingConstructor(Class clazz, AbstractPOJOTest.InvokeResult result, boolean invoked)
+ public void testClassWithFailingConstructor(Class clazz, AbstractPOJOTest.InvokeResult result, boolean invoked)
{
AbstractPOJOTest driver = assertCanBuildSuite(clazz);
@@ -172,7 +170,7 @@
invoke(driver, clazz, "testFoo", result, invoked);
}
- private void testClassWithoutDefaultConstructor()
+ public void testClassWithoutDefaultConstructor()
{
assertCannotBuildSuite(ClassWithoutDefaultConstructor1.class);
assertCannotBuildSuite(ClassWithoutDefaultConstructor2.class);
@@ -180,7 +178,7 @@
assertCannotBuildSuite(ClassWithoutDefaultConstructor4.class);
}
- private void testMethodAnnotatedWithParameter()
+ public void testMethodAnnotatedWithParameter()
{
testMethodAnnotatedWithParameter(MethodAnnotatedWithParameter01.class, false, AbstractPOJOTest.InvokeResult.PASS, true, "foo");
testMethodAnnotatedWithParameter(MethodAnnotatedWithParameter02.class, false, AbstractPOJOTest.InvokeResult.PASS, true, "bar");
@@ -194,7 +192,7 @@
testMethodAnnotatedWithParameter(MethodAnnotatedWithParameter13.class, true, AbstractPOJOTest.InvokeResult.FAILURE, false, "foo");
}
- private void testMethodAnnotatedWithParameter(Class clazz, boolean invoke, AbstractPOJOTest.InvokeResult result, boolean invoked, String... expectedParameterNames)
+ public void testMethodAnnotatedWithParameter(Class clazz, boolean invoke, AbstractPOJOTest.InvokeResult result, boolean invoked, String... expectedParameterNames)
{
AbstractPOJOTest driver = assertCanBuildSuite(clazz);
@@ -214,7 +212,7 @@
}
}
- private void testTestMethodAnnotatedWithConflictingAnnotations()
+ public void testTestMethodAnnotatedWithConflictingAnnotations()
{
assertCannotBuildSuite(TestMethodAnnotatedWithConflictingAnnotations1.class);
assertCannotBuildSuite(TestMethodAnnotatedWithConflictingAnnotations2.class);
@@ -222,7 +220,7 @@
assertCannotBuildSuite(TestMethodAnnotatedWithConflictingAnnotations4.class);
}
- private void testTestMethodHavingArgumentsAnnotatedWithParameter(Class clazz, String... expectedParameterNames)
+ public void testTestMethodHavingArgumentsAnnotatedWithParameter(Class clazz, String... expectedParameterNames)
{
AbstractPOJOTest driver = assertCanBuildSuite(clazz);
@@ -236,7 +234,7 @@
invoke(driver, clazz, "testFoo", AbstractPOJOTest.InvokeResult.PASS, true);
}
- private void testTestMethodHavingArgumentsAnnotatedWithParameter()
+ public void testTestMethodHavingArgumentsAnnotatedWithParameter()
{
testTestMethodHavingArgumentsAnnotatedWithParameter(TestMethodHavingArgumentsAnnotatedWithParameter1.class, "paramFoo");
testTestMethodHavingArgumentsAnnotatedWithParameter(TestMethodHavingArgumentsAnnotatedWithParameter2.class, "paramFoo", "paramBar");
@@ -248,7 +246,7 @@
assertCannotBuildSuite(TestMethodHavingArgumentsAnnotatedWithParameter8.class);
}
- private void testMethodAnnotatedWithTest()
+ public void testMethodAnnotatedWithTest()
{
testMethodAnnotatedWithTest(MethodAnnotatedWithTest1.class, "testFoo");
testMethodAnnotatedWithTest(MethodAnnotatedWithTest2.class, "testBar");
@@ -259,7 +257,7 @@
assertCannotBuildSuite(MethodAnnotatedWithTest9.class);
}
- private void testMethodAnnotatedWithTest(Class clazz, String testName)
+ public void testMethodAnnotatedWithTest(Class clazz, String testName)
{
AbstractPOJOTest driver = assertCanBuildSuite(clazz);
@@ -271,38 +269,38 @@
invoke(driver, clazz, testName, AbstractPOJOTest.InvokeResult.PASS, true);
}
- private void testAbstractClassWithoutAnnotations()
+ public void testAbstractClassWithoutAnnotations()
{
assertCannotBuildSuite(AbstractClassWithoutAnnotations.class);
}
- private void testClassWithoutAnnotations()
+ public void testClassWithoutAnnotations()
{
AbstractPOJOTest driver = assertCanBuildSuite(ClassWithoutAnnotations.class);
Assert.assertEquals(new HashSet(), driver.getParameterNames());
Assert.assertEquals(new HashSet(), driver.getTestCaseNames());
}
- private void testAbstractClassAnnotatedWithTest()
+ public void testAbstractClassAnnotatedWithTest()
{
assertCannotBuildSuite(AbstractClassAnnotatedWithTest1.class);
assertCannotBuildSuite(AbstractClassAnnotatedWithTest2.class);
}
- private void testClassAnnotatedWithTest()
+ public void testClassAnnotatedWithTest()
{
testClassAnnotatedPOJO(ClassAnnotatedWithTest1.class, ClassAnnotatedWithTest1.class.getName(), null);
testClassAnnotatedPOJO(ClassAnnotatedWithTest2.class, "foo", null);
}
- private void testClassAnnotatedPOJO(Class clazz, String name, String description)
+ public void testClassAnnotatedPOJO(Class clazz, String name, String description)
{
AbstractPOJOTest driver = assertCanBuildSuite(clazz);
Assert.assertEquals(new HashSet(), driver.getParameterNames());
Assert.assertEquals(new HashSet(), driver.getTestCaseNames());
}
- private void assertParametersEquals(Set<String> parametersInfo, String... expectedParameterNames)
+ public void assertParametersEquals(Set<String> parametersInfo, String... expectedParameterNames)
{
Assert.assertEquals(expectedParameterNames.length, parametersInfo.size());
for (String expectedParameterName : expectedParameterNames)
@@ -313,7 +311,7 @@
// *************************
- private void invoke(AbstractPOJOTest driver, Class clazz, String testName, AbstractPOJOTest.InvokeResult expectedResult, boolean invoked)
+ public void invoke(AbstractPOJOTest driver, Class clazz, String testName, AbstractPOJOTest.InvokeResult expectedResult, boolean invoked)
{
Map<String, String> parametrization = new HashMap<String, String>();
Map<String,Object> expectedParameterValues = new HashMap<String, Object>();
@@ -338,7 +336,7 @@
}
}
- private void assertClassHasNoTests(Class clazz)
+ public void assertClassHasNoTests(Class clazz)
{
AbstractPOJOTest driver = assertCanBuildSuite(clazz);
Assert.assertEquals(Collections.EMPTY_SET, driver.getTestCaseNames());
Modified: modules/test/trunk/unit/src/test/java/org/jboss/test/unit/pojo/TestDriverPOJOTests.java
===================================================================
--- modules/test/trunk/unit/src/test/java/org/jboss/test/unit/pojo/TestDriverPOJOTests.java 2007-11-19 11:23:25 UTC (rev 9023)
+++ modules/test/trunk/unit/src/test/java/org/jboss/test/unit/pojo/TestDriverPOJOTests.java 2007-11-19 15:20:59 UTC (rev 9024)
@@ -42,11 +42,11 @@
}
catch (InstantiationException e)
{
- fail(e);
+ fail();
}
catch (IllegalAccessException e)
{
- fail(e);
+ fail();
}
catch (IllegalArgumentException expected)
{
Modified: modules/test/trunk/unit/src/test/java/org/jboss/test/unit/pojo/junit/JUnitPOJOTests.java
===================================================================
--- modules/test/trunk/unit/src/test/java/org/jboss/test/unit/pojo/junit/JUnitPOJOTests.java 2007-11-19 11:23:25 UTC (rev 9023)
+++ modules/test/trunk/unit/src/test/java/org/jboss/test/unit/pojo/junit/JUnitPOJOTests.java 2007-11-19 15:20:59 UTC (rev 9024)
@@ -22,19 +22,20 @@
******************************************************************************/
package org.jboss.test.unit.pojo.junit;
-import org.jboss.unit.driver.impl.pojo.POJOTestSuiteDriver;
-
-import static org.jboss.unit.util.CollectionTools.*;
-import static org.jboss.unit.api.Assert.*;
-import org.jboss.unit.TestId;
+import junit.framework.TestCase;
import org.jboss.unit.Failure;
import org.jboss.unit.FailureType;
+import org.jboss.unit.TestId;
+import static org.jboss.unit.api.Assert.assertInstanceOf;
+import static org.jboss.unit.api.Assert.createFailure;
+import org.jboss.unit.driver.DriverResponse;
+import org.jboss.unit.driver.command.StartTestCommand;
+import org.jboss.unit.driver.impl.pojo.POJOTestSuiteDriver;
+import org.jboss.unit.driver.response.EndTestResponse;
+import org.jboss.unit.driver.response.FailureResponse;
import org.jboss.unit.info.TestInfo;
import org.jboss.unit.info.TestSuiteInfo;
-import org.jboss.unit.driver.command.StartTestCommand;
-import org.jboss.unit.driver.DriverResponse;
-import org.jboss.unit.driver.response.FailureResponse;
-import org.jboss.unit.driver.response.EndTestResponse;
+import static org.jboss.unit.util.CollectionTools.set;
import java.util.HashMap;
import java.util.HashSet;
@@ -43,18 +44,18 @@
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
* @version $Revision: 1.1 $
*/
-public class JUnitPOJOTests
+public class JUnitPOJOTests extends TestCase
{
- public static void main(String[] args)
- {
- test1();
- test2();
- test3();
- test4();
- }
+// public static void main(String[] args)
+// {
+// test1();
+// test2();
+// test3();
+// test4();
+// }
- private static void test1()
+ public static void test1()
{
POJOTestSuiteDriver driver = createDriver(JUnitTest1.class);
TestInfo driverInfo = driver.getInfo();
@@ -70,7 +71,7 @@
assertEquals(FailureType.ERROR, failure.getType());
}
- private static void test2()
+ public static void test2()
{
POJOTestSuiteDriver driver = createDriver(JUnitTest2.class);
TestInfo driverInfo = driver.getInfo();
@@ -84,7 +85,7 @@
assertInstanceOf(response, EndTestResponse.class);
}
- private static void test3()
+ public static void test3()
{
POJOTestSuiteDriver driver = createDriver(JUnitTest3.class);
TestInfo driverInfo = driver.getInfo();
@@ -100,7 +101,7 @@
assertEquals(FailureType.ERROR, failure.getType());
}
- private static void test4()
+ public static void test4()
{
POJOTestSuiteDriver driver = createDriver(JUnitTest4.class);
TestInfo driverInfo = driver.getInfo();
@@ -116,7 +117,7 @@
assertEquals(FailureType.ERROR, failure.getType());
}
- private static void test5()
+ public static void test5()
{
POJOTestSuiteDriver driver = createDriver(JUnitTest5.class);
TestInfo driverInfo = driver.getInfo();
@@ -132,7 +133,7 @@
assertEquals(FailureType.ERROR, failure.getType());
}
- private static POJOTestSuiteDriver createDriver(Class clazz)
+ public static POJOTestSuiteDriver createDriver(Class clazz)
{
try
{
Modified: modules/test/trunk/unit/src/test/java/org/jboss/test/unit/report/junit/JUnitReporterTests.java
===================================================================
--- modules/test/trunk/unit/src/test/java/org/jboss/test/unit/report/junit/JUnitReporterTests.java 2007-11-19 11:23:25 UTC (rev 9023)
+++ modules/test/trunk/unit/src/test/java/org/jboss/test/unit/report/junit/JUnitReporterTests.java 2007-11-19 15:20:59 UTC (rev 9024)
@@ -22,10 +22,12 @@
******************************************************************************/
package org.jboss.test.unit.report.junit;
+import junit.framework.TestCase;
import org.jboss.unit.Failure;
import org.jboss.unit.FailureType;
import org.jboss.unit.TestId;
import org.jboss.unit.api.Assert;
+import static org.jboss.unit.report.impl.junit.XMLConstants.*;
import org.jboss.unit.runner.TestResult;
import org.jboss.unit.runner.event.EndRunnerEvent;
import org.jboss.unit.runner.event.EndTestCaseEvent;
@@ -34,30 +36,20 @@
import org.jboss.unit.runner.event.StartTestCaseEvent;
import org.jboss.unit.runner.results.TestFailure;
import org.jboss.unit.runner.results.TestSuccess;
+import static org.jboss.unit.util.XMLTools.child;
import org.w3c.dom.Element;
-import static org.jboss.unit.util.XMLTools.*;
-import static org.jboss.unit.report.impl.junit.XMLConstants.*;
-
/**
* @author <a href="mailto:emuckenh@redhat.com">Emanuel Muckenhuber</a>
* @version $Revision$
*/
-public class JUnitReporterTests
+public class JUnitReporterTests extends TestCase
{
/** The testSuiteName */
private final static String testSuiteName = JUnitReporterTests.class.getName();
- public static void main(String[] args) throws Exception
+ public static void testTestSuite()
{
- testTestSuite();
- testTestCase();
- testTestCaseFailure();
- testTestCaseClass();
- }
-
- private static void testTestSuite()
- {
MyTestReport report = new MyTestReport(testSuiteName);
// add StartRunnerEvent
report.startJUnitTestSuite(new StartRunnerEvent());
@@ -94,7 +86,7 @@
* Successful testCase
*
*/
- private static void testTestCase()
+ public static void testTestCase()
{
MyTestReport report = new MyTestReport(testSuiteName);
report.startJUnitTestSuite(new StartRunnerEvent());
@@ -127,7 +119,7 @@
* Successful testCase with class info
*
*/
- private static void testTestCaseClass()
+ public static void testTestCaseClass()
{
MyTestReport report = new MyTestReport(testSuiteName);
report.startJUnitTestSuite(new StartRunnerEvent());
@@ -161,7 +153,7 @@
}
- private static void testTestCaseFailure()
+ public static void testTestCaseFailure()
{
MyTestReport report = new MyTestReport(testSuiteName);
report.startJUnitTestSuite(new StartRunnerEvent());
Modified: modules/test/trunk/unit/src/test/java/org/jboss/test/unit/runner/AbstractTestRunnerTests.java
===================================================================
--- modules/test/trunk/unit/src/test/java/org/jboss/test/unit/runner/AbstractTestRunnerTests.java 2007-11-19 11:23:25 UTC (rev 9023)
+++ modules/test/trunk/unit/src/test/java/org/jboss/test/unit/runner/AbstractTestRunnerTests.java 2007-11-19 15:20:59 UTC (rev 9024)
@@ -22,23 +22,23 @@
******************************************************************************/
package org.jboss.test.unit.runner;
+import junit.framework.TestCase;
+import org.jboss.unit.TestId;
import org.jboss.unit.driver.AbstractTestDriver;
+import org.jboss.unit.driver.DriverCommand;
import org.jboss.unit.driver.DriverResponse;
-import org.jboss.unit.driver.DriverCommand;
import org.jboss.unit.driver.command.StartTestCommand;
-import org.jboss.unit.TestId;
-import static org.jboss.unit.api.Assert.assertEquals;
+import org.jboss.unit.info.TestInfo;
import org.jboss.unit.info.impl.SimpleTestSuiteInfo;
-import org.jboss.unit.info.TestInfo;
+import java.util.ArrayList;
import java.util.List;
-import java.util.ArrayList;
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
* @version $Revision: 1.1 $
*/
-public class AbstractTestRunnerTests
+public class AbstractTestRunnerTests extends TestCase
{
protected static class TestDriverImpl extends AbstractTestDriver
Modified: modules/test/trunk/unit/src/test/java/org/jboss/test/unit/runner/CompositeTestRunnerTests.java
===================================================================
--- modules/test/trunk/unit/src/test/java/org/jboss/test/unit/runner/CompositeTestRunnerTests.java 2007-11-19 11:23:25 UTC (rev 9023)
+++ modules/test/trunk/unit/src/test/java/org/jboss/test/unit/runner/CompositeTestRunnerTests.java 2007-11-19 15:20:59 UTC (rev 9024)
@@ -30,18 +30,19 @@
import org.jboss.unit.runner.impl.composite.CompositeTestRunner;
import org.jboss.unit.runner.impl.TestRunnerContextSupport;
-import static org.jboss.unit.api.Assert.*;
import static org.jboss.unit.util.CollectionTools.*;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
+import junit.framework.TestCase;
+
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
* @version $Revision: 1.1 $
*/
-public class CompositeTestRunnerTests
+public class CompositeTestRunnerTests extends TestCase
{
private static List<TestRunnerEvent> events = new ArrayList<TestRunnerEvent>();
@@ -54,16 +55,16 @@
}
};
- public static void main(String[] args)
- {
- testCompose();
- testComposeWithRuntimeException1();
- testComposeWithRuntimeException2();
- testComposeWithRuntimeError1();
- testComposeWithRuntimeError2();
- }
+// public static void main(String[] args)
+// {
+// testCompose();
+// testComposeWithRuntimeException1();
+// testComposeWithRuntimeException2();
+// testComposeWithRuntimeError1();
+// testComposeWithRuntimeError2();
+// }
- private static void testCompose()
+ public static void testCompose()
{
MyRunner1 runner1 = new MyRunner1();
MyRunner1 runner2 = new MyRunner1();
@@ -79,7 +80,7 @@
events.clear();
}
- private static void testComposeWithRuntimeException1()
+ public static void testComposeWithRuntimeException1()
{
MyRunner1 runner1 = new MyRunner1();
MyRunner2 runner2 = new MyRunner2();
@@ -102,7 +103,7 @@
events.clear();
}
- private static void testComposeWithRuntimeException2()
+ public static void testComposeWithRuntimeException2()
{
MyRunner2 runner1 = new MyRunner2();
MyRunner1 runner2 = new MyRunner1();
@@ -124,7 +125,7 @@
events.clear();
}
- private static void testComposeWithRuntimeError1()
+ public static void testComposeWithRuntimeError1()
{
MyRunner1 runner1 = new MyRunner1();
MyRunner3 runner2 = new MyRunner3();
@@ -147,7 +148,7 @@
events.clear();
}
- private static void testComposeWithRuntimeError2()
+ public static void testComposeWithRuntimeError2()
{
MyRunner3 runner1 = new MyRunner3();
MyRunner1 runner2 = new MyRunner1();
Modified: modules/test/trunk/unit/src/test/java/org/jboss/test/unit/runner/GenericTestRunnerTests.java
===================================================================
--- modules/test/trunk/unit/src/test/java/org/jboss/test/unit/runner/GenericTestRunnerTests.java 2007-11-19 11:23:25 UTC (rev 9023)
+++ modules/test/trunk/unit/src/test/java/org/jboss/test/unit/runner/GenericTestRunnerTests.java 2007-11-19 15:20:59 UTC (rev 9024)
@@ -22,55 +22,54 @@
******************************************************************************/
package org.jboss.test.unit.runner;
-import org.jboss.unit.runner.impl.generic.GenericTestRunner;
-import org.jboss.unit.runner.impl.TestRunnerContextSupport;
-import org.jboss.unit.runner.model.generic.GenericTestSuiteDef;
-import org.jboss.unit.runner.model.generic.TestDef;
-import org.jboss.unit.runner.model.ParametersDef;
-import org.jboss.unit.runner.model.ParameterValueDef;
-import org.jboss.unit.runner.ParametrizationSet;
-import org.jboss.unit.runner.results.TestSuccess;
-import org.jboss.unit.driver.DriverResponse;
+import junit.framework.TestCase;
+import org.jboss.unit.TestId;
import org.jboss.unit.driver.DriverCommand;
import org.jboss.unit.driver.DriverContext;
+import org.jboss.unit.driver.DriverResponse;
import org.jboss.unit.driver.TestDriver;
import org.jboss.unit.driver.command.StartTestCommand;
import org.jboss.unit.driver.response.EndTestResponse;
import org.jboss.unit.info.TestInfo;
-import org.jboss.unit.info.impl.SimpleTestSuiteInfo;
-import org.jboss.unit.info.impl.SimpleTestCaseInfo;
import org.jboss.unit.info.impl.SimpleParameterInfo;
-import org.jboss.unit.TestId;
+import org.jboss.unit.info.impl.SimpleTestCaseInfo;
+import org.jboss.unit.info.impl.SimpleTestSuiteInfo;
+import org.jboss.unit.runner.ParametrizationSet;
+import org.jboss.unit.runner.impl.TestRunnerContextSupport;
+import org.jboss.unit.runner.impl.generic.GenericTestRunner;
+import org.jboss.unit.runner.model.ParameterValueDef;
+import org.jboss.unit.runner.model.ParametersDef;
+import org.jboss.unit.runner.model.generic.GenericTestSuiteDef;
+import org.jboss.unit.runner.model.generic.TestDef;
+import org.jboss.unit.runner.results.TestSuccess;
+import static org.jboss.unit.util.CollectionTools.list;
-import static org.jboss.unit.api.Assert.*;
-import static org.jboss.unit.util.CollectionTools.*;
-
+import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
-import java.util.ArrayList;
import java.util.Map;
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
* @version $Revision: 1.1 $
*/
-public class GenericTestRunnerTests
+public class GenericTestRunnerTests extends TestCase
{
- public static void main(String[] args)
- {
- testNoTestCase();
- testOneTestCase();
- testTwoTestCases1();
- testTwoTestCases2();
- testParametrization();
- testParametrizationOverride();
- testProperties1();
- testProperties2();
- testProperties3();
- }
+// public static void main(String[] args)
+// {
+// testNoTestCase();
+// testOneTestCase();
+// testTwoTestCases1();
+// testTwoTestCases2();
+// testParametrization();
+// testParametrizationOverride();
+// testProperties1();
+// testProperties2();
+// testProperties3();
+// }
- private static void testProperties1()
+ public static void testProperties1()
{
Driver1.init();
SimpleTestCaseInfo fooInfo = new SimpleTestCaseInfo("foo");
@@ -84,7 +83,7 @@
assertEquals(expectedProperties, Driver1.properties);
}
- private static void testProperties2()
+ public static void testProperties2()
{
Driver1.init();
SimpleTestCaseInfo fooInfo = new SimpleTestCaseInfo("foo");
@@ -99,7 +98,7 @@
assertEquals(expectedProperties, Driver1.properties);
}
- private static void testProperties3()
+ public static void testProperties3()
{
Driver1.init();
SimpleTestCaseInfo fooInfo = new SimpleTestCaseInfo("foo");
@@ -119,7 +118,7 @@
assertEquals(expectedProperties, Driver1.properties);
}
- private static void testParametrization()
+ public static void testParametrization()
{
Driver1.init();
SimpleTestCaseInfo fooInfo = new SimpleTestCaseInfo("foo");
@@ -150,7 +149,7 @@
assertEquals(list(expectedParametrization1, expectedParametrization2), Driver1.parametrizations);
}
- private static void testParametrizationOverride()
+ public static void testParametrizationOverride()
{
Driver1.init();
SimpleTestCaseInfo fooInfo = new SimpleTestCaseInfo("foo");
@@ -178,7 +177,7 @@
assertEquals(list(expectedParametrization1), Driver1.parametrizations);
}
- private static void testNoTestCase()
+ public static void testNoTestCase()
{
Driver1.init();
GenericTestSuiteDef suite = new GenericTestSuiteDef(Driver1.class.getName());
@@ -192,7 +191,7 @@
assertEquals(list(), Driver1.parametrizations);
}
- private static void testOneTestCase()
+ public static void testOneTestCase()
{
Driver1.init();
Driver1.testSuiteInfo.addTest(new SimpleTestCaseInfo("foo"));
@@ -210,7 +209,7 @@
assertEquals(list(new HashMap()), Driver1.parametrizations);
}
- private static void testTwoTestCases1()
+ public static void testTwoTestCases1()
{
Driver1.init();
Driver1.testSuiteInfo.addTest(new SimpleTestCaseInfo("foo"));
@@ -229,7 +228,7 @@
assertEquals(list(new HashMap()), Driver1.parametrizations);
}
- private static void testTwoTestCases2()
+ public static void testTwoTestCases2()
{
Driver1.init();
Driver1.testSuiteInfo.addTest(new SimpleTestCaseInfo("foo"));
Modified: modules/test/trunk/unit/src/test/java/org/jboss/test/unit/runner/POJOTestRunnerTests.java
===================================================================
--- modules/test/trunk/unit/src/test/java/org/jboss/test/unit/runner/POJOTestRunnerTests.java 2007-11-19 11:23:25 UTC (rev 9023)
+++ modules/test/trunk/unit/src/test/java/org/jboss/test/unit/runner/POJOTestRunnerTests.java 2007-11-19 15:20:59 UTC (rev 9024)
@@ -53,7 +53,7 @@
testPOJO1_2();
}
- private static void testPOJO1_1()
+ public static void testPOJO1_1()
{
POJO1.instances.clear();
@@ -71,7 +71,8 @@
//
assertEquals(1, POJO1.instances.size());
- POJO1 pojo1_1 = assertNotNull(POJO1.instances.get(0));
+ assertNotNull(POJO1.instances.get(0));
+ POJO1 pojo1_1 = POJO1.instances.get(0);
assertEquals("bar_def", pojo1_1.foo);
//
@@ -82,7 +83,7 @@
listener.assertEndRunnerEvent(5);
}
- private static void testPOJO1_2()
+ public static void testPOJO1_2()
{
POJO1.instances.clear();
@@ -104,9 +105,11 @@
//
assertEquals(2, POJO1.instances.size());
- POJO1 pojo1_1 = assertNotNull(POJO1.instances.get(0));
+ assertNotNull(POJO1.instances.get(0));
+ POJO1 pojo1_1 =POJO1.instances.get(0);
assertEquals("bar_runtime_1", pojo1_1.foo);
- POJO1 pojo1_2 = assertNotNull(POJO1.instances.get(1));
+ assertNotNull(POJO1.instances.get(1));
+ POJO1 pojo1_2 = POJO1.instances.get(1);
assertEquals("bar_runtime_2", pojo1_2.foo);
//
Modified: modules/test/trunk/unit/src/test/java/org/jboss/test/unit/runner/ParametrizationTests.java
===================================================================
--- modules/test/trunk/unit/src/test/java/org/jboss/test/unit/runner/ParametrizationTests.java 2007-11-19 11:23:25 UTC (rev 9023)
+++ modules/test/trunk/unit/src/test/java/org/jboss/test/unit/runner/ParametrizationTests.java 2007-11-19 15:20:59 UTC (rev 9024)
@@ -22,7 +22,7 @@
******************************************************************************/
package org.jboss.test.unit.runner;
-import static org.jboss.unit.api.Assert.assertEquals;
+import junit.framework.TestCase;
import org.jboss.unit.runner.ParametrizationSet;
import org.jboss.unit.util.CollectionTools;
@@ -35,20 +35,11 @@
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
* @version $Revision: 1.1 $
*/
-public class ParametrizationTests
+public class ParametrizationTests extends TestCase
{
- public static void main(String[] args)
+ public static void test1()
{
- test1();
- test2();
- test3();
- test4();
- test5();
- }
-
- private static void test1()
- {
Map<String,String[]> map = new HashMap<String,String[]>();
ParametrizationSet def = new ParametrizationSet(map);
@@ -59,7 +50,7 @@
assertEquals(expectedResult, new HashSet<Map<String, String>>(def.enumerate(contraints)));
}
- private static void test2()
+ public static void test2()
{
Map<String,String[]> map = new HashMap<String,String[]>();
map.put("a", new String[]{"b"});
@@ -86,7 +77,7 @@
assertEquals(expectedResult3, new HashSet<Map<String, String>>(def.enumerate(contraints3)));
}
- private static void test3()
+ public static void test3()
{
Map<String,String[]> map = new HashMap<String,String[]>();
map.put("a", new String[]{"b","c"});
@@ -116,7 +107,7 @@
assertEquals(expectedResult3, new HashSet<Map<String, String>>(def.enumerate(contraints3)));
}
- private static void test4()
+ public static void test4()
{
Map<String,String[]> map = new HashMap<String,String[]>();
map.put("a", new String[]{"b","c"});
@@ -162,7 +153,7 @@
assertEquals(expectedResult4, new HashSet<Map<String, String>>(def.enumerate(contraints4)));
}
- private static void test5()
+ public static void test5()
{
Map<String,String[]> map = new HashMap<String,String[]>();
map.put("a", new String[]{"b","c"});
Modified: modules/test/trunk/unit/src/test/java/org/jboss/test/unit/runner/TestDriverRunnerTests.java
===================================================================
--- modules/test/trunk/unit/src/test/java/org/jboss/test/unit/runner/TestDriverRunnerTests.java 2007-11-19 11:23:25 UTC (rev 9023)
+++ modules/test/trunk/unit/src/test/java/org/jboss/test/unit/runner/TestDriverRunnerTests.java 2007-11-19 15:20:59 UTC (rev 9024)
@@ -59,39 +59,39 @@
public class TestDriverRunnerTests extends AbstractTestRunnerTests
{
- public static void main(String[] args)
- {
- testEmptyDriver();
+// public static void main(String[] args)
+// {
+// testEmptyDriver();
+//
+// //
+// testTestDriverInvokeTestCaseReturnsNull();
+// testTestDriverInvokeTestCaseReturnsAnEndTestResponse();
+// testTestDriverInvokeTestCaseReturnsAFailureResponse();
+// testTestDriverInvokeTestCaseThrowsRuntimeException();
+// testTestDriverInvokeTestCaseThrowsError();
+//
+// //
+// testInvokeTestCaseWithParameters1();
+// testInvokeTestCaseWithParameters2();
+//
+// //
+// testInvokeTestSuite();
+//
+// //
+// testEvents1();
+//
+// //
+// testInit();
+// testInitThrowsDriverException();
+// testInitThrowsRuntimeException();
+// testInitThrowsError();
+//
+// //
+// testDestroyThrowsRuntimeException();
+// testDestroyThrowsError();
+// }
- //
- testTestDriverInvokeTestCaseReturnsNull();
- testTestDriverInvokeTestCaseReturnsAnEndTestResponse();
- testTestDriverInvokeTestCaseReturnsAFailureResponse();
- testTestDriverInvokeTestCaseThrowsRuntimeException();
- testTestDriverInvokeTestCaseThrowsError();
-
- //
- testInvokeTestCaseWithParameters1();
- testInvokeTestCaseWithParameters2();
-
- //
- testInvokeTestSuite();
-
- //
- testEvents1();
-
- //
- testInit();
- testInitThrowsDriverException();
- testInitThrowsRuntimeException();
- testInitThrowsError();
-
- //
- testDestroyThrowsRuntimeException();
- testDestroyThrowsError();
- }
-
- private static void testDestroyThrowsError()
+ public static void testDestroyThrowsError()
{
final Error error = new Error();
FailureTestDriver testDriver = new FailureTestDriver()
@@ -122,7 +122,7 @@
listener.assertEndTestEvent(2, new TestId(), new TestSuccess(0));
}
- private static void testDestroyThrowsRuntimeException()
+ public static void testDestroyThrowsRuntimeException()
{
FailureTestDriver testDriver = new FailureTestDriver()
{
@@ -145,7 +145,7 @@
listener.assertEndRunnerEvent(3);
}
- private static void testInit()
+ public static void testInit()
{
FailureTestDriver testDriver = new FailureTestDriver()
{
@@ -172,7 +172,7 @@
listener.assertEndRunnerEvent(3);
}
- private static void testInitThrowsDriverException()
+ public static void testInitThrowsDriverException()
{
FailureTestDriver testDriver = new FailureTestDriver()
{
@@ -199,7 +199,7 @@
listener.assertEndRunnerEvent(2);
}
- private static void testInitThrowsRuntimeException()
+ public static void testInitThrowsRuntimeException()
{
FailureTestDriver testDriver = new FailureTestDriver()
{
@@ -226,7 +226,7 @@
listener.assertEndRunnerEvent(2);
}
- private static void testInitThrowsError()
+ public static void testInitThrowsError()
{
final Error error = new Error();
FailureTestDriver testDriver = new FailureTestDriver()
@@ -261,7 +261,7 @@
listener.assertStartRunnerEvent(0);
}
- private static void testEvents1()
+ public static void testEvents1()
{
TestDriverImpl testDriver = new TestDriverImpl()
{
@@ -293,7 +293,7 @@
listener.assertEndRunnerEvent(7);
}
- private static void testInvokeTestSuite()
+ public static void testInvokeTestSuite()
{
TestDriverImpl testDriver = new TestDriverImpl()
{
@@ -327,7 +327,7 @@
listener.assertEndRunnerEvent(7);
}
- private static void testInvokeTestCaseWithParameters1()
+ public static void testInvokeTestCaseWithParameters1()
{
Map<String,String[]> tmp = new HashMap<String, String[]>();
tmp.put("foo", new String[]{"bar"});
@@ -370,7 +370,7 @@
assertEquals(s1, s2);
}
- private static void testInvokeTestCaseWithParameters2()
+ public static void testInvokeTestCaseWithParameters2()
{
Map<String,String[]> tmp = new HashMap<String, String[]>();
tmp.put("foo", new String[]{"bar1","bar2"});
@@ -425,7 +425,7 @@
assertEquals(s1, s2);
}
- private static void testEmptyDriver()
+ public static void testEmptyDriver()
{
TestDriverImpl testDriver = new TestDriverImpl();
TestDriverRunner runner = new TestDriverRunner(testDriver, new TestId());
@@ -445,7 +445,7 @@
listener.assertEndRunnerEvent(3);
}
- private static void testTestDriverInvokeTestCaseReturnsNull()
+ public static void testTestDriverInvokeTestCaseReturnsNull()
{
TestDriverImpl testDriver = new TestDriverImpl();
testDriver.info.addTest(new SimpleTestCaseInfo("Foo"));
@@ -468,7 +468,7 @@
listener.assertEndRunnerEvent(5);
}
- private static void testTestDriverInvokeTestCaseReturnsAnEndTestResponse()
+ public static void testTestDriverInvokeTestCaseReturnsAnEndTestResponse()
{
TestDriverImpl testDriver = new TestDriverImpl()
{
@@ -497,7 +497,7 @@
listener.assertEndRunnerEvent(5);
}
- private static void testTestDriverInvokeTestCaseReturnsAFailureResponse()
+ public static void testTestDriverInvokeTestCaseReturnsAFailureResponse()
{
TestDriverImpl testDriver = new TestDriverImpl()
{
@@ -526,7 +526,7 @@
listener.assertEndRunnerEvent(5);
}
- private static void testTestDriverInvokeTestCaseThrowsRuntimeException()
+ public static void testTestDriverInvokeTestCaseThrowsRuntimeException()
{
TestDriverImpl testDriver = new TestDriverImpl()
{
@@ -555,7 +555,7 @@
listener.assertEndRunnerEvent(5);
}
- private static void testTestDriverInvokeTestCaseThrowsError()
+ public static void testTestDriverInvokeTestCaseThrowsError()
{
final Error error = new Error();
Modified: modules/test/trunk/unit/src/test/java/org/jboss/test/unit/runner/event/TestRunnerEventBroadcasterSupportTests.java
===================================================================
--- modules/test/trunk/unit/src/test/java/org/jboss/test/unit/runner/event/TestRunnerEventBroadcasterSupportTests.java 2007-11-19 11:23:25 UTC (rev 9023)
+++ modules/test/trunk/unit/src/test/java/org/jboss/test/unit/runner/event/TestRunnerEventBroadcasterSupportTests.java 2007-11-19 15:20:59 UTC (rev 9024)
@@ -22,7 +22,7 @@
******************************************************************************/
package org.jboss.test.unit.runner.event;
-import static org.jboss.unit.api.Assert.*;
+import junit.framework.TestCase;
import org.jboss.unit.runner.TestRunnerEvent;
import org.jboss.unit.runner.TestRunnerEventListener;
import org.jboss.unit.runner.impl.TestRunnerEventBroadcaster;
@@ -35,7 +35,7 @@
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
* @version $Revision: 1.1 $
*/
-public class TestRunnerEventBroadcasterSupportTests
+public class TestRunnerEventBroadcasterSupportTests extends TestCase
{
/** . */
@@ -47,20 +47,8 @@
/** . */
private MyListener listener2 = new MyListener();
- public static void main(String[] args)
+ public void testAddNullListener()
{
- new TestRunnerEventBroadcasterSupportTests().testAddNullListener();
- new TestRunnerEventBroadcasterSupportTests().testRemoveNullListener();
- new TestRunnerEventBroadcasterSupportTests().testBroadcastNullEvent();
- new TestRunnerEventBroadcasterSupportTests().testDualRegistration();
- new TestRunnerEventBroadcasterSupportTests().testRegistration();
- new TestRunnerEventBroadcasterSupportTests().testUnregistration();
- new TestRunnerEventBroadcasterSupportTests().testBroadcast();
- new TestRunnerEventBroadcasterSupportTests().testFailure();
- }
-
- private void testAddNullListener()
- {
try
{
support.addListener(null);
@@ -71,7 +59,7 @@
}
}
- private void testRemoveNullListener()
+ public void testRemoveNullListener()
{
try
{
@@ -83,7 +71,7 @@
}
}
- private void testBroadcastNullEvent()
+ public void testBroadcastNullEvent()
{
try
{
@@ -95,7 +83,7 @@
}
}
- private void testDualRegistration()
+ public void testDualRegistration()
{
MyEvent event = new MyEvent();
support.addListener(listener1);
@@ -104,7 +92,7 @@
assertEquals(list(event), listener1.events);
}
- private void testRegistration()
+ public void testRegistration()
{
MyEvent event = new MyEvent();
support.addListener(listener1);
@@ -112,7 +100,7 @@
assertEquals(list(event), listener1.events);
}
- private void testUnregistration()
+ public void testUnregistration()
{
MyEvent event = new MyEvent();
support.addListener(listener1);
@@ -121,7 +109,7 @@
assertEquals(0, listener1.events.size());
}
- private void testBroadcast()
+ public void testBroadcast()
{
MyEvent event = new MyEvent();
support.addListener(listener1);
@@ -131,7 +119,7 @@
assertEquals(list(event), listener2.events);
}
- private void testFailure()
+ public void testFailure()
{
MyEvent event = new MyEvent();
support.addListener(listener1);
Modified: modules/test/trunk/unit/src/test/java/org/jboss/test/unit/runner/event/TestRunnerLifeCycleFilterTests.java
===================================================================
--- modules/test/trunk/unit/src/test/java/org/jboss/test/unit/runner/event/TestRunnerLifeCycleFilterTests.java 2007-11-19 11:23:25 UTC (rev 9023)
+++ modules/test/trunk/unit/src/test/java/org/jboss/test/unit/runner/event/TestRunnerLifeCycleFilterTests.java 2007-11-19 15:20:59 UTC (rev 9024)
@@ -24,23 +24,24 @@
import static org.jboss.unit.api.Assert.assertNull;
import static org.jboss.unit.api.Assert.assertSame;
+import org.jboss.unit.api.pojo.junit.TestCase;
import org.jboss.unit.runner.TestRunnerEvent;
import org.jboss.unit.runner.TestRunnerEventListener;
-import org.jboss.unit.runner.impl.TestRunnerLifeCycleFilter;
import org.jboss.unit.runner.event.EndRunnerEvent;
import org.jboss.unit.runner.event.StartRunnerEvent;
+import org.jboss.unit.runner.impl.TestRunnerLifeCycleFilter;
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
* @version $Revision: 1.1 $
*/
-public class TestRunnerLifeCycleFilterTests
+public class TestRunnerLifeCycleFilterTests extends junit.framework.TestCase
{
/** . */
private static TestRunnerEvent event = null;
- public static void main(String[] args)
+ public static void testBasic()
{
TestRunnerEventListener broadcaster = new TestRunnerEventListener()
{
Modified: modules/test/trunk/unit/src/test/java/org/jboss/test/unit/runner/model/ModelTests.java
===================================================================
--- modules/test/trunk/unit/src/test/java/org/jboss/test/unit/runner/model/ModelTests.java 2007-11-19 11:23:25 UTC (rev 9023)
+++ modules/test/trunk/unit/src/test/java/org/jboss/test/unit/runner/model/ModelTests.java 2007-11-19 15:20:59 UTC (rev 9024)
@@ -22,20 +22,21 @@
******************************************************************************/
package org.jboss.test.unit.runner.model;
+import org.jboss.unit.TestId;
import static org.jboss.unit.api.Assert.*;
+import org.jboss.unit.api.pojo.junit.TestCase;
import org.jboss.unit.runner.model.ModelBuilder;
import org.jboss.unit.runner.model.ParameterValueDef;
import org.jboss.unit.runner.model.ParametersDef;
import org.jboss.unit.runner.model.TestSuiteDef;
+import org.jboss.unit.runner.model.composite.CompositeTestSuiteDef;
+import org.jboss.unit.runner.model.generic.GenericTestSuiteDef;
import org.jboss.unit.runner.model.generic.TestDef;
-import org.jboss.unit.runner.model.generic.GenericTestSuiteDef;
-import org.jboss.unit.runner.model.composite.CompositeTestSuiteDef;
import org.jboss.unit.runner.model.pojo.POJOTestSuiteDef;
+import org.jboss.unit.runner.model.pojo.TestCaseDef;
import org.jboss.unit.runner.model.pojo.TestClassDef;
-import org.jboss.unit.runner.model.pojo.TestCaseDef;
import static org.jboss.unit.util.CollectionTools.list;
import static org.jboss.unit.util.CollectionTools.set;
-import org.jboss.unit.TestId;
import org.xml.sax.InputSource;
import java.io.InputStream;
@@ -46,18 +47,9 @@
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
* @version $Revision: 1.1 $
*/
-public class ModelTests
+public class ModelTests extends junit.framework.TestCase
{
- public static void main(String[] args)
- {
- testParameterValueDef();
- buildFromXML1();
- buildFromXML2();
-
-
- }
-
private static TestSuiteDef buildTestSuite(String resourceId)
{
try
@@ -72,7 +64,7 @@
}
}
- private static void buildFromXML2()
+ public static void testBuildFromXML2()
{
TestSuiteDef suite = buildTestSuite("f2.xml");
@@ -83,19 +75,23 @@
assertEquals("foo_generic", generic.getClassName());
//
- ParametersDef parameters = assertNotNull(generic.getParameters());
+ assertNotNull(generic.getParameters());
+ ParametersDef parameters = generic.getParameters();
assertEquals(set("red"), parameters.getNames());
//
- List<TestDef> tests = assertNotNull(generic.getTests());
+ assertNotNull(generic.getTests());
+ List<TestDef> tests = generic.getTests();
assertEquals(2, tests.size());
- TestDef foo = assertNotNull(tests.get(0));
+ assertNotNull(tests.get(0));
+ TestDef foo = tests.get(0);
assertEquals(new TestId("foo"), foo.getRefId());
- TestDef fooBar = assertNotNull(tests.get(1));
+ assertNotNull(tests.get(1));
+ TestDef fooBar = tests.get(1);
assertEquals(new TestId("foo", "bar"), fooBar.getRefId());
}
- private static void buildFromXML1()
+ public static void testBuildFromXML1()
{
TestSuiteDef suite = buildTestSuite("f1.xml");
@@ -105,35 +101,41 @@
POJOTestSuiteDef pojoSuite = assertInstanceOf(composite.getSuites().iterator().next(), POJOTestSuiteDef.class);
- Iterator<TestClassDef> testClasses = pojoSuite.getTestClasses().iterator();
+ List<TestClassDef> testClasses = pojoSuite.getTestClasses();
+ assertEquals(2, testClasses.size());
//
- assertTrue(testClasses.hasNext());
- TestClassDef otherTestClass = assertNotNull(testClasses.next());
+ TestClassDef otherTestClass = testClasses.get(0);
+ assertNotNull(otherTestClass);
assertEquals("org.foo.bar.OtherTest", otherTestClass.getName());
assertEquals(0, otherTestClass.getTestCases().size());
assertNotNull(otherTestClass.getParameters());
assertEquals(set("foo"), otherTestClass.getParameters().getNames());
- ParameterValueDef fooParam = assertNotNull(otherTestClass.getParameters().getParameter("foo"));
+ assertNotNull(otherTestClass.getParameters().getParameter("foo"));
+ ParameterValueDef fooParam = otherTestClass.getParameters().getParameter("foo");
assertEquals(list("bar"), fooParam.list());
//
- assertTrue(testClasses.hasNext());
- TestClassDef barClass = assertNotNull(testClasses.next());
+ TestClassDef barClass = testClasses.get(1);
+ assertNotNull(barClass);
assertEquals("org.Bar", barClass.getName());
assertEquals(2, barClass.getTestCases().size());
- TestCaseDef barFooCase = assertNotNull(barClass.getTestCase("foo"));
+ assertNotNull(barClass.getTestCase("foo"));
+ TestCaseDef barFooCase = barClass.getTestCase("foo");
assertEquals("foo", barFooCase.getName());
- TestCaseDef barBarCase = assertNotNull(barClass.getTestCase("bar"));
+ assertNotNull(barClass.getTestCase("bar"));
+ TestCaseDef barBarCase = barClass.getTestCase("bar");
assertEquals("bar", barBarCase.getName());
assertEquals(set("foo", "blah"), barClass.getParameters().getNames());
- ParameterValueDef barClassFooParam = assertNotNull(barClass.getParameters().getParameter("foo"));
+ assertNotNull(barClass.getParameters().getParameter("foo"));
+ ParameterValueDef barClassFooParam = barClass.getParameters().getParameter("foo");
assertEquals(list("bar1", null), barClassFooParam.list());
- ParameterValueDef barClassBlahParam = assertNotNull(barClass.getParameters().getParameter("blah"));
+ assertNotNull(barClass.getParameters().getParameter("blah"));
+ ParameterValueDef barClassBlahParam = barClass.getParameters().getParameter("blah");
assertEquals(list("bluh"), barClassBlahParam.list());
}
- private static void testParameterValueDef()
+ public static void testParameterValueDef()
{
ParameterValueDef pvd1 = new ParameterValueDef();
assertEquals(list(), pvd1.list());
Modified: modules/test/trunk/unit/src/test/java/org/jboss/test/unit/sample/SampleTests.java
===================================================================
--- modules/test/trunk/unit/src/test/java/org/jboss/test/unit/sample/SampleTests.java 2007-11-19 11:23:25 UTC (rev 9023)
+++ modules/test/trunk/unit/src/test/java/org/jboss/test/unit/sample/SampleTests.java 2007-11-19 15:20:59 UTC (rev 9024)
@@ -22,6 +22,7 @@
******************************************************************************/
package org.jboss.test.unit.sample;
+import junit.framework.TestCase;
import org.jboss.unit.report.impl.junit.JUnitTestsuiteReport;
import org.jboss.unit.report.impl.writer.PrintListener;
import org.jboss.unit.runner.TestRunner;
@@ -44,17 +45,9 @@
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
* @version $Revision: 1.1 $
*/
-public class SampleTests
+public class SampleTests extends TestCase
{
- public static void main(String[] args) throws Exception
- {
-
-// test1();
- test2();
-
- }
-
public static void test1()
throws ParserConfigurationException, IOException, SAXException, BuilderException
{
16 years, 7 months
JBoss Portal SVN: r9023 - branches/JBoss_Portal_Branch_2_6/build.
by portal-commits@lists.jboss.org
Author: thomas.heute(a)jboss.com
Date: 2007-11-19 06:23:25 -0500 (Mon, 19 Nov 2007)
New Revision: 9023
Modified:
branches/JBoss_Portal_Branch_2_6/build/build.xml
Log:
JBPORTAL-1713: add proxy capabilities to the portal build
Modified: branches/JBoss_Portal_Branch_2_6/build/build.xml
===================================================================
--- branches/JBoss_Portal_Branch_2_6/build/build.xml 2007-11-19 10:33:43 UTC (rev 9022)
+++ branches/JBoss_Portal_Branch_2_6/build/build.xml 2007-11-19 11:23:25 UTC (rev 9023)
@@ -470,7 +470,7 @@
<!-- then generate a new libraries.ent file and include it in -->
<!-- the build -->
<target name="createthirdparty" unless="inhibit.downloads"
- depends="check.inhibit.downloads">
+ depends="check.inhibit.downloads,set.proxy">
<ant antfile="build-thirdparty.xml" target="generate-lib-file"/>
</target>
@@ -486,4 +486,49 @@
</condition>
</target>
+ <!-- check if the the user has specied proxy settings -->
+ <target name="check.proxy">
+ <condition property="hasproxy">
+ <and>
+ <isset property="proxy.host"/>
+ <isset property="proxy.port"/>
+ <not>
+ <equals arg1="" arg2="${proxy.host}" trim="true"/>
+ </not>
+ <not>
+ <equals arg1="" arg2="${proxy.port}" trim="true"/>
+ </not>
+ </and>
+ </condition>
+ <!-- set proxy settings -->
+ <condition property="hasproxyauth">
+ <and>
+ <isset property="hasproxy"/>
+ <isset property="proxy.username"/>
+ <isset property="proxy.password"/>
+ <not>
+ <equals arg1="" arg2="${proxy.username}" trim="true"/>
+ </not>
+ <not>
+ <equals arg1="" arg2="${proxy.password}" trim="true"/>
+ </not>
+ </and>
+ </condition>
+
+ </target>
+
+ <target name="set.proxy" depends="set.proxy.withoutauth, set.proxy.auth"/>
+
+ <!-- set proxy settings without auth -->
+ <target name="set.proxy.withoutauth" if="hasproxy" unless="hasproxyauth" depends="check.proxy">
+ <echo>Proxy is set to ${proxy.host}:${proxy.port}</echo>
+ <setproxy proxyhost="${proxy.host}" proxyport="${proxy.port}"/>
+ </target>
+
+ <!-- set proxy settings using auth -->
+ <target name="set.proxy.auth" if="hasproxyauth" depends="check.proxy">
+ <echo>Auth Proxy is set to ${proxy.host}:${proxy.port} username=[${proxy.username}]</echo>
+ <setproxy proxyhost="${proxy.host}" proxyport="${proxy.port}" proxyuser="${proxy.username}" proxypassword="${proxy.password}"/>
+ </target>
+
</project>
16 years, 7 months
JBoss Portal SVN: r9022 - in branches/JBoss_Portal_Branch_2_6/core-samples/src: main/org/jboss/portal/core/samples/weather and 3 other directories.
by portal-commits@lists.jboss.org
Author: thomas.heute(a)jboss.com
Date: 2007-11-19 05:33:43 -0500 (Mon, 19 Nov 2007)
New Revision: 9022
Added:
branches/JBoss_Portal_Branch_2_6/core-samples/src/bin/portal-weather-samples-war/images/weather_config1.png
branches/JBoss_Portal_Branch_2_6/core-samples/src/bin/portal-weather-samples-war/images/weather_config2.png
branches/JBoss_Portal_Branch_2_6/core-samples/src/bin/portal-weather-samples-war/images/weather_config3.png
branches/JBoss_Portal_Branch_2_6/core-samples/src/bin/portal-weather-samples-war/images/weather_config4.png
branches/JBoss_Portal_Branch_2_6/core-samples/src/resources/portal-weather-samples-war/WEB-INF/jsp/weather/help.jsp
Modified:
branches/JBoss_Portal_Branch_2_6/core-samples/src/main/org/jboss/portal/core/samples/weather/WeatherPortlet.java
branches/JBoss_Portal_Branch_2_6/core-samples/src/resources/portal-news-samples-war/WEB-INF/jsp/news/help.jsp
branches/JBoss_Portal_Branch_2_6/core-samples/src/resources/portal-weather-samples-war/WEB-INF/portlet.xml
Log:
Weather Help mode
Added: branches/JBoss_Portal_Branch_2_6/core-samples/src/bin/portal-weather-samples-war/images/weather_config1.png
===================================================================
(Binary files differ)
Property changes on: branches/JBoss_Portal_Branch_2_6/core-samples/src/bin/portal-weather-samples-war/images/weather_config1.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: branches/JBoss_Portal_Branch_2_6/core-samples/src/bin/portal-weather-samples-war/images/weather_config2.png
===================================================================
(Binary files differ)
Property changes on: branches/JBoss_Portal_Branch_2_6/core-samples/src/bin/portal-weather-samples-war/images/weather_config2.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: branches/JBoss_Portal_Branch_2_6/core-samples/src/bin/portal-weather-samples-war/images/weather_config3.png
===================================================================
(Binary files differ)
Property changes on: branches/JBoss_Portal_Branch_2_6/core-samples/src/bin/portal-weather-samples-war/images/weather_config3.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: branches/JBoss_Portal_Branch_2_6/core-samples/src/bin/portal-weather-samples-war/images/weather_config4.png
===================================================================
(Binary files differ)
Property changes on: branches/JBoss_Portal_Branch_2_6/core-samples/src/bin/portal-weather-samples-war/images/weather_config4.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Modified: branches/JBoss_Portal_Branch_2_6/core-samples/src/main/org/jboss/portal/core/samples/weather/WeatherPortlet.java
===================================================================
--- branches/JBoss_Portal_Branch_2_6/core-samples/src/main/org/jboss/portal/core/samples/weather/WeatherPortlet.java 2007-11-19 09:31:38 UTC (rev 9021)
+++ branches/JBoss_Portal_Branch_2_6/core-samples/src/main/org/jboss/portal/core/samples/weather/WeatherPortlet.java 2007-11-19 10:33:43 UTC (rev 9022)
@@ -62,6 +62,9 @@
/** Edit page */
private static final String JSP_EDIT = "/WEB-INF/jsp/weather/edit.jsp";
+ /** Help page */
+ private static final String JSP_HELP = "/WEB-INF/jsp/weather/help.jsp";
+
/** Default zip set in init param. */
private String DEFAULT_ZIP;
@@ -181,6 +184,13 @@
dispatcher.include(request, response);
}
+ protected void doHelp(RenderRequest request, RenderResponse response) throws IOException, PortletException
+ {
+ response.setContentType("text/html");
+ PortletRequestDispatcher dispatcher = getPortletContext().getRequestDispatcher(JSP_HELP);
+ dispatcher.include(request, response);
+ }
+
/**
* Process weather location edit and store in user preferences.
*
Modified: branches/JBoss_Portal_Branch_2_6/core-samples/src/resources/portal-news-samples-war/WEB-INF/jsp/news/help.jsp
===================================================================
--- branches/JBoss_Portal_Branch_2_6/core-samples/src/resources/portal-news-samples-war/WEB-INF/jsp/news/help.jsp 2007-11-19 09:31:38 UTC (rev 9021)
+++ branches/JBoss_Portal_Branch_2_6/core-samples/src/resources/portal-news-samples-war/WEB-INF/jsp/news/help.jsp 2007-11-19 10:33:43 UTC (rev 9022)
@@ -30,7 +30,7 @@
<br/>
<div class="portlet-font">Description: The news Portlet retrieves an RSS news feed from a URL and displays it as HTML to the user.</div>
<br/>
-<div class="portlet-font">To change the RSS feed source, simply <a href="<portlet:renderURL portletMode='edit'/>">go to the edit mode</a> and enter the URL of the new RSS feed source such as:
+<div class="portlet-font">To change the RSS feed source, simply go to the edit mode after being logged-in and enter the URL of the new RSS feed source such as:
<font style="font-style:italic">http://feeds.feedburner.com/JBossPortal</font>. The new RSS feed source will be stored and used each time the user will be logged-in.</div>
<br/>
<div class="portlet-msg-info">This sample portlet is able to handle most RSS 1.0 and RSS 2.0 feeds</div>
Added: branches/JBoss_Portal_Branch_2_6/core-samples/src/resources/portal-weather-samples-war/WEB-INF/jsp/weather/help.jsp
===================================================================
--- branches/JBoss_Portal_Branch_2_6/core-samples/src/resources/portal-weather-samples-war/WEB-INF/jsp/weather/help.jsp (rev 0)
+++ branches/JBoss_Portal_Branch_2_6/core-samples/src/resources/portal-weather-samples-war/WEB-INF/jsp/weather/help.jsp 2007-11-19 10:33:43 UTC (rev 9022)
@@ -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. ~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~--%>
+
+<%@ taglib uri="http://java.sun.com/portlet" prefix="portlet" %>
+
+<portlet:defineObjects/>
+
+<div class="portlet-font" style="font-size:larger;font-weight:bold">Weather Portlet Help:</div>
+</div>
+<br/>
+<div class="portlet-font">Description: The weather portlet retrieves an RSS weather feed, based on a key (Can be a US Postal Code), and displays it as HTML to the user.</div>
+<br/>
+<div class="portlet-font">The user can change the weather forecast for the location of his choice by going to the edit mode after being logged-in and entering the key for that
+particular location.</div>
+<br/>
+<div class="portlet-font" style="font-size:larger">How to get the key:</div>
+</div>
+<br/>
+<div class="portlet-font">For a location is the US, the key is simply the zipcode. For a location outside the US you need to get the key by
+doing the following steps:
+ <ol>
+ <li>Go to <a href="http://weather.yahoo.com" target="_blank">http://weather.yahoo.com</a></li>
+ <li>Enter your city name in the location field found on that page
+ <div style="text-align:center;margin-bottom:1em"><img src="<%= renderRequest.getContextPath() %>/images/weather_config1.png"/></div>
+ </li>
+ <li>Find your location on the list under the form and click on it (<font style="font-style:italic">Neuchatel, NE CH</font>, in this case)
+ <div style="text-align:center;margin-bottom:1em"><img src="<%= renderRequest.getContextPath() %>/images/weather_config2.png"/></div>
+ </li>
+ <li>Copy the location digits from the address bar in your browser (<font style="font-style:italic">SZXX0023</font> in this case)
+ <div style="text-align:center;margin-bottom:1em"><img src="<%= renderRequest.getContextPath() %>/images/weather_config3.png"/></div>
+ </li>
+ <li>Paste this key in the weather portlet edit form and press <font style="font-style:italic">Submit</font>.
+ <div style="text-align:center;margin-bottom:1em"><img src="<%= renderRequest.getContextPath() %>/images/weather_config4.png"/></div>
+ </li>
+ </ol>
+</div>
+<br/>
+<div class="portlet-font"><a href="<portlet:renderURL portletMode='view'/>">Back</a></div>
\ No newline at end of file
Modified: branches/JBoss_Portal_Branch_2_6/core-samples/src/resources/portal-weather-samples-war/WEB-INF/portlet.xml
===================================================================
--- branches/JBoss_Portal_Branch_2_6/core-samples/src/resources/portal-weather-samples-war/WEB-INF/portlet.xml 2007-11-19 09:31:38 UTC (rev 9021)
+++ branches/JBoss_Portal_Branch_2_6/core-samples/src/resources/portal-weather-samples-war/WEB-INF/portlet.xml 2007-11-19 10:33:43 UTC (rev 9022)
@@ -49,6 +49,7 @@
<mime-type>text/html</mime-type>
<portlet-mode>VIEW</portlet-mode>
<portlet-mode>EDIT</portlet-mode>
+ <portlet-mode>HELP</portlet-mode>
</supports>
<portlet-info>
<title>Weather Portlet</title>
16 years, 7 months
JBoss Portal SVN: r9021 - branches/JBoss_Portal_Branch_2_6/core-samples/src/main/org/jboss/portal/core/samples/news.
by portal-commits@lists.jboss.org
Author: thomas.heute(a)jboss.com
Date: 2007-11-19 04:31:38 -0500 (Mon, 19 Nov 2007)
New Revision: 9021
Modified:
branches/JBoss_Portal_Branch_2_6/core-samples/src/main/org/jboss/portal/core/samples/news/NewsPortlet.java
Log:
Oups
Modified: branches/JBoss_Portal_Branch_2_6/core-samples/src/main/org/jboss/portal/core/samples/news/NewsPortlet.java
===================================================================
--- branches/JBoss_Portal_Branch_2_6/core-samples/src/main/org/jboss/portal/core/samples/news/NewsPortlet.java 2007-11-19 09:27:32 UTC (rev 9020)
+++ branches/JBoss_Portal_Branch_2_6/core-samples/src/main/org/jboss/portal/core/samples/news/NewsPortlet.java 2007-11-19 09:31:38 UTC (rev 9021)
@@ -64,6 +64,9 @@
/** Edit page */
private static final String JSP_EDIT = "/WEB-INF/jsp/news/edit.jsp";
+ /** Help page */
+ private static final String JSP_HELP = "/WEB-INF/jsp/news/help.jsp";
+
/** RSS 2.0 XSL page for output */
private static final String RSS2_XSL = "/WEB-INF/xsl/news/Rss2.xsl";
@@ -197,6 +200,13 @@
dispatcher.include(request, response);
}
+ protected void doHelp(RenderRequest request, RenderResponse response) throws IOException, PortletException
+ {
+ response.setContentType("text/html");
+ PortletRequestDispatcher dispatcher = getPortletContext().getRequestDispatcher(JSP_HELP);
+ dispatcher.include(request, response);
+ }
+
/**
* Process RSS Feed edit.
*
16 years, 7 months
JBoss Portal SVN: r9020 - branches/JBoss_Portal_Branch_2_6/core/src/resources/portal-core-sar/conf/data.
by portal-commits@lists.jboss.org
Author: thomas.heute(a)jboss.com
Date: 2007-11-19 04:27:32 -0500 (Mon, 19 Nov 2007)
New Revision: 9020
Modified:
branches/JBoss_Portal_Branch_2_6/core/src/resources/portal-core-sar/conf/data/default-object.xml
Log:
- French mistake
Modified: branches/JBoss_Portal_Branch_2_6/core/src/resources/portal-core-sar/conf/data/default-object.xml
===================================================================
--- branches/JBoss_Portal_Branch_2_6/core/src/resources/portal-core-sar/conf/data/default-object.xml 2007-11-19 09:26:24 UTC (rev 9019)
+++ branches/JBoss_Portal_Branch_2_6/core/src/resources/portal-core-sar/conf/data/default-object.xml 2007-11-19 09:27:32 UTC (rev 9020)
@@ -139,7 +139,7 @@
<display-name xml:lang="en">Home</display-name>
<display-name xml:lang="it">Home</display-name>
<display-name xml:lang="es">Home</display-name>
- <display-name xml:lang="fr">Acceuil</display-name>
+ <display-name xml:lang="fr">Accueil</display-name>
<properties>
<property>
<name>order</name>
@@ -294,7 +294,7 @@
<display-name xml:lang="en">Home</display-name>
<display-name xml:lang="it">Home</display-name>
<display-name xml:lang="es">Home</display-name>
- <display-name xml:lang="fr">Acceuil</display-name>
+ <display-name xml:lang="fr">Accueil</display-name>
<properties>
<property>
<name>order</name>
16 years, 7 months
JBoss Portal SVN: r9019 - in branches/JBoss_Portal_Branch_2_6/core-samples/src/resources: portal-news-samples-war/WEB-INF and 3 other directories.
by portal-commits@lists.jboss.org
Author: thomas.heute(a)jboss.com
Date: 2007-11-19 04:26:24 -0500 (Mon, 19 Nov 2007)
New Revision: 9019
Added:
branches/JBoss_Portal_Branch_2_6/core-samples/src/resources/portal-jsp-samples-war/WEB-INF/web.xml
branches/JBoss_Portal_Branch_2_6/core-samples/src/resources/portal-news-samples-war/WEB-INF/jsp/news/help.jsp
branches/JBoss_Portal_Branch_2_6/core-samples/src/resources/portal-news-samples-war/WEB-INF/web.xml
branches/JBoss_Portal_Branch_2_6/core-samples/src/resources/portal-users-samples-war/WEB-INF/web.xml
branches/JBoss_Portal_Branch_2_6/core-samples/src/resources/portal-weather-samples-war/WEB-INF/web.xml
Modified:
branches/JBoss_Portal_Branch_2_6/core-samples/src/resources/portal-news-samples-war/WEB-INF/portlet.xml
Log:
- Added missing web.xml.
- Added Help on the news portlet
Added: branches/JBoss_Portal_Branch_2_6/core-samples/src/resources/portal-jsp-samples-war/WEB-INF/web.xml
===================================================================
--- branches/JBoss_Portal_Branch_2_6/core-samples/src/resources/portal-jsp-samples-war/WEB-INF/web.xml (rev 0)
+++ branches/JBoss_Portal_Branch_2_6/core-samples/src/resources/portal-jsp-samples-war/WEB-INF/web.xml 2007-11-19 09:26:24 UTC (rev 9019)
@@ -0,0 +1,28 @@
+<?xml version="1.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. ~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+
+<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
+ "http://java.sun.com/dtd/web-app_2_3.dtd">
+<web-app>
+</web-app>
Property changes on: branches/JBoss_Portal_Branch_2_6/core-samples/src/resources/portal-jsp-samples-war/WEB-INF/web.xml
___________________________________________________________________
Name: svn:executable
+ *
Added: branches/JBoss_Portal_Branch_2_6/core-samples/src/resources/portal-news-samples-war/WEB-INF/jsp/news/help.jsp
===================================================================
--- branches/JBoss_Portal_Branch_2_6/core-samples/src/resources/portal-news-samples-war/WEB-INF/jsp/news/help.jsp (rev 0)
+++ branches/JBoss_Portal_Branch_2_6/core-samples/src/resources/portal-news-samples-war/WEB-INF/jsp/news/help.jsp 2007-11-19 09:26:24 UTC (rev 9019)
@@ -0,0 +1,38 @@
+<%--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~ 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. ~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~--%>
+
+<%@ taglib uri="http://java.sun.com/portlet" prefix="portlet" %>
+
+<portlet:defineObjects/>
+
+<div class="portlet-font" style="font-size:larger;font-weight:bold">News Portlet Help:</div>
+</div>
+<br/>
+<div class="portlet-font">Description: The news Portlet retrieves an RSS news feed from a URL and displays it as HTML to the user.</div>
+<br/>
+<div class="portlet-font">To change the RSS feed source, simply <a href="<portlet:renderURL portletMode='edit'/>">go to the edit mode</a> and enter the URL of the new RSS feed source such as:
+<font style="font-style:italic">http://feeds.feedburner.com/JBossPortal</font>. The new RSS feed source will be stored and used each time the user will be logged-in.</div>
+<br/>
+<div class="portlet-msg-info">This sample portlet is able to handle most RSS 1.0 and RSS 2.0 feeds</div>
+<br/>
+<div class="portlet-font"><a href="<portlet:renderURL portletMode='view'/>">Back</a></div>
\ No newline at end of file
Modified: branches/JBoss_Portal_Branch_2_6/core-samples/src/resources/portal-news-samples-war/WEB-INF/portlet.xml
===================================================================
--- branches/JBoss_Portal_Branch_2_6/core-samples/src/resources/portal-news-samples-war/WEB-INF/portlet.xml 2007-11-19 00:37:38 UTC (rev 9018)
+++ branches/JBoss_Portal_Branch_2_6/core-samples/src/resources/portal-news-samples-war/WEB-INF/portlet.xml 2007-11-19 09:26:24 UTC (rev 9019)
@@ -49,6 +49,7 @@
<mime-type>text/html</mime-type>
<portlet-mode>VIEW</portlet-mode>
<portlet-mode>EDIT</portlet-mode>
+ <portlet-mode>HELP</portlet-mode>
</supports>
<supported-locale>en</supported-locale>
<supported-locale>fr</supported-locale>
Added: branches/JBoss_Portal_Branch_2_6/core-samples/src/resources/portal-news-samples-war/WEB-INF/web.xml
===================================================================
--- branches/JBoss_Portal_Branch_2_6/core-samples/src/resources/portal-news-samples-war/WEB-INF/web.xml (rev 0)
+++ branches/JBoss_Portal_Branch_2_6/core-samples/src/resources/portal-news-samples-war/WEB-INF/web.xml 2007-11-19 09:26:24 UTC (rev 9019)
@@ -0,0 +1,28 @@
+<?xml version="1.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. ~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+
+<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
+ "http://java.sun.com/dtd/web-app_2_3.dtd">
+<web-app>
+</web-app>
Property changes on: branches/JBoss_Portal_Branch_2_6/core-samples/src/resources/portal-news-samples-war/WEB-INF/web.xml
___________________________________________________________________
Name: svn:executable
+ *
Added: branches/JBoss_Portal_Branch_2_6/core-samples/src/resources/portal-users-samples-war/WEB-INF/web.xml
===================================================================
--- branches/JBoss_Portal_Branch_2_6/core-samples/src/resources/portal-users-samples-war/WEB-INF/web.xml (rev 0)
+++ branches/JBoss_Portal_Branch_2_6/core-samples/src/resources/portal-users-samples-war/WEB-INF/web.xml 2007-11-19 09:26:24 UTC (rev 9019)
@@ -0,0 +1,28 @@
+<?xml version="1.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. ~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+
+<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
+ "http://java.sun.com/dtd/web-app_2_3.dtd">
+<web-app>
+</web-app>
Property changes on: branches/JBoss_Portal_Branch_2_6/core-samples/src/resources/portal-users-samples-war/WEB-INF/web.xml
___________________________________________________________________
Name: svn:executable
+ *
Added: branches/JBoss_Portal_Branch_2_6/core-samples/src/resources/portal-weather-samples-war/WEB-INF/web.xml
===================================================================
--- branches/JBoss_Portal_Branch_2_6/core-samples/src/resources/portal-weather-samples-war/WEB-INF/web.xml (rev 0)
+++ branches/JBoss_Portal_Branch_2_6/core-samples/src/resources/portal-weather-samples-war/WEB-INF/web.xml 2007-11-19 09:26:24 UTC (rev 9019)
@@ -0,0 +1,28 @@
+<?xml version="1.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. ~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+
+<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
+ "http://java.sun.com/dtd/web-app_2_3.dtd">
+<web-app>
+</web-app>
Property changes on: branches/JBoss_Portal_Branch_2_6/core-samples/src/resources/portal-weather-samples-war/WEB-INF/web.xml
___________________________________________________________________
Name: svn:executable
+ *
16 years, 7 months