Author: julien(a)jboss.com
Date: 2007-04-21 08:07:46 -0400 (Sat, 21 Apr 2007)
New Revision: 7017
Added:
trunk/test/selenium-java-client-driver-backport.jar
trunk/test/selenium-java-client-driver.jar
trunk/test/src/main/org/jboss/portal/test/framework/driver/http/HTTPTestConversation.java
trunk/test/src/main/org/jboss/portal/test/framework/driver/remote/
trunk/test/src/main/org/jboss/portal/test/framework/driver/remote/RemoteTestCase.java
trunk/test/src/main/org/jboss/portal/test/framework/driver/remote/RemoteTestDriver.java
trunk/test/src/main/org/jboss/portal/test/framework/driver/remote/RemoteTestDriverClient.java
trunk/test/src/main/org/jboss/portal/test/framework/driver/remote/RemoteTestDriverServer.java
trunk/test/src/main/org/jboss/portal/test/framework/driver/remote/RemoteTestSuite.java
trunk/test/src/main/org/jboss/portal/test/framework/driver/remote/TestContext.java
trunk/test/src/main/org/jboss/portal/test/framework/driver/remote/TestConversation.java
trunk/test/src/main/org/jboss/portal/test/framework/driver/remote/command/
trunk/test/src/main/org/jboss/portal/test/framework/driver/remote/command/RemoteDriverCommandContext.java
trunk/test/src/main/org/jboss/portal/test/framework/driver/remote/response/
trunk/test/src/main/org/jboss/portal/test/framework/driver/remote/response/RemoteDriverResponseContext.java
trunk/test/src/main/org/jboss/portal/test/framework/driver/web/
trunk/test/src/main/org/jboss/portal/test/framework/driver/web/WebTestCase.java
trunk/test/src/main/org/jboss/portal/test/framework/driver/web/WebTestConversation.java
trunk/test/src/main/org/jboss/portal/test/framework/driver/web/WebTestDriverClient.java
trunk/test/src/main/org/jboss/portal/test/framework/driver/web/command/
trunk/test/src/main/org/jboss/portal/test/framework/driver/web/command/GetPageCommand.java
trunk/test/src/main/org/jboss/portal/test/framework/driver/web/command/PerformClickCommand.java
trunk/test/src/main/org/jboss/portal/test/framework/driver/web/command/WebDriverCommand.java
trunk/test/src/main/org/jboss/portal/test/framework/driver/web/command/WebDriverCommandContext.java
trunk/test/src/main/org/jboss/portal/test/framework/driver/web/response/
trunk/test/src/main/org/jboss/portal/test/framework/driver/web/response/GetPageResponse.java
trunk/test/src/main/org/jboss/portal/test/framework/driver/web/response/PerformClickResponse.java
trunk/test/src/main/org/jboss/portal/test/framework/driver/web/response/WebDriverResponse.java
trunk/test/src/main/org/jboss/portal/test/framework/driver/web/response/WebDriverResponseContext.java
trunk/test/src/main/org/jboss/portal/test/framework/runner/HTTPTestRunner.java
trunk/test/src/main/org/jboss/portal/test/framework/runner/WebTestRunner.java
trunk/test/src/resources/portal-test-jar/org/jboss/portal/test/framework/container/http-runner-beans.xml
trunk/test/src/resources/portal-test-jar/org/jboss/portal/test/framework/container/web-runner-beans.xml
trunk/theme/src/main/org/jboss/portal/test/theme/DynaTestContext.java
trunk/theme/src/main/org/jboss/portal/test/theme/ThemeTestRunner.java
trunk/theme/src/main/org/jboss/portal/test/theme/dyna/
trunk/theme/src/main/org/jboss/portal/test/theme/dyna/tests/
trunk/theme/src/main/org/jboss/portal/test/theme/dyna/tests/LinkTest.java
Removed:
trunk/test/src/main/org/jboss/portal/test/framework/driver/http/HTTPTestSuite.java
trunk/test/src/main/org/jboss/portal/test/framework/driver/http/HttpTestDriverServer.java
trunk/test/src/main/org/jboss/portal/test/framework/runner/ServerTestRunner.java
trunk/test/src/resources/portal-test-jar/org/jboss/portal/test/framework/container/jboss-beans.xml
trunk/theme/src/main/org/jboss/portal/test/theme/TestContext.java
trunk/theme/src/main/org/jboss/portal/test/theme/command/
Modified:
trunk/cms/src/main/org/jboss/portal/test/cms/clustering/FileDeleteTest.java
trunk/cms/src/main/org/jboss/portal/test/cms/clustering/FileUpdateTest.java
trunk/portlet-server/src/resources/test-sar/META-INF/jboss-service.xml
trunk/portlet-server/src/resources/test/info/test-info-sar/META-INF/jboss-service.xml
trunk/portlet/src/main/org/jboss/portal/test/framework/portlet/PortletTestContext.java
trunk/portlet/src/main/org/jboss/portal/test/framework/portlet/PortletTestDriver.java
trunk/portlet/src/main/org/jboss/portal/test/portlet/ha/session/SessionTestCase.java
trunk/portlet/src/main/org/jboss/portal/test/portlet/info/AbstractInfoTest.java
trunk/portlet/src/main/org/jboss/portal/test/portlet/info/InfoTestCase.java
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/ActionRequestTestCase.java
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/ActionResponseTestCase.java
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/PortalContextTestCase.java
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/PortletConfigTestCase.java
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/PortletContextTestCase.java
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/PortletModeTestCase.java
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/PortletPreferencesTestCase.java
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/PortletSessionTestCase.java
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/PortletSessionUtilTestCase.java
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/PortletURLTestCase.java
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/RenderRequestTestCase.java
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/RenderResponseTestCase.java
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/WindowStateTestCase.java
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/DispatcherTestCase.java
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/ExpiringCacheTestCase.java
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/NeverExpiringCacheTestCase.java
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/NoCacheTestCase.java
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/PortletConfigTestCase.java
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/PortletModeTestCase.java
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/PortletRequestsTestCase.java
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/PortletResponsesTestCase.java
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/PreferencesTestCase.java
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/SessionTestCase.java
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/misc/Log4jTestCase.java
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/DispatcherTestCase.java
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/PortletConfigTestCase.java
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/PortletContextTestCase.java
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/PortletInterfaceTestCase.java
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/PortletModeTestCase.java
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/PortletRequestsTestCase.java
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/PortletResponsesTestCase.java
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/PortletSessionTestCase.java
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/PortletURLTestCase.java
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/PreferencesTestCase.java
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/WindowStatesTestCase.java
trunk/server/src/main/org/jboss/portal/test/framework/server/driver/AbstractTest.java
trunk/server/src/main/org/jboss/portal/test/server/CharsetTestCase.java
trunk/server/src/main/org/jboss/portal/test/server/ParametersTestCase.java
trunk/server/src/main/org/jboss/portal/test/server/ResponseTestCase.java
trunk/server/src/main/org/jboss/portal/test/server/ServletTestCase.java
trunk/server/src/main/org/jboss/portal/test/server/TestRequestController.java
trunk/server/src/main/org/jboss/portal/test/server/charset/GetTest.java
trunk/server/src/main/org/jboss/portal/test/server/charset/PostMultipartFormDataNoCharsetTest.java
trunk/server/src/main/org/jboss/portal/test/server/charset/PostMultipartFormDataUTF8Test.java
trunk/server/src/main/org/jboss/portal/test/server/charset/PostTest.java
trunk/server/src/main/org/jboss/portal/test/server/charset/PostXWWWFormURLEncodedNoCharsetTest.java
trunk/server/src/main/org/jboss/portal/test/server/charset/PostXWWWFormURLEncodedUTF8Test.java
trunk/server/src/main/org/jboss/portal/test/server/parameters/GetTest.java
trunk/server/src/main/org/jboss/portal/test/server/parameters/PostApplicationXWWWFormURLEncodedTest.java
trunk/server/src/main/org/jboss/portal/test/server/parameters/PostMultipartFormDataTest.java
trunk/server/src/main/org/jboss/portal/test/server/response/EncodeResponseTest.java
trunk/server/src/main/org/jboss/portal/test/server/servlet/DefaultServletMappingTest.java
trunk/server/src/main/org/jboss/portal/test/server/servlet/PathMappingTest.java
trunk/server/src/main/org/jboss/portal/test/server/servlet/RootPathMappingTest.java
trunk/server/src/resources/test/test-charset-sar/META-INF/jboss-service.xml
trunk/server/src/resources/test/test-parameters-sar/META-INF/jboss-service.xml
trunk/server/src/resources/test/test-response-sar/META-INF/jboss-service.xml
trunk/server/src/resources/test/test-servlet-sar/META-INF/jboss-service.xml
trunk/test/build.xml
trunk/test/src/main/org/jboss/portal/test/framework/driver/http/HttpTestCase.java
trunk/test/src/main/org/jboss/portal/test/framework/driver/http/HttpTestContext.java
trunk/test/src/main/org/jboss/portal/test/framework/driver/http/HttpTestDriver.java
trunk/test/src/main/org/jboss/portal/test/framework/driver/http/HttpTestDriverClient.java
trunk/test/src/main/org/jboss/portal/test/framework/driver/http/command/HttpDriverCommandContext.java
trunk/test/src/main/org/jboss/portal/test/framework/driver/http/response/HttpDriverResponseContext.java
trunk/test/src/main/org/jboss/portal/test/framework/runner/BaseRunner.java
trunk/theme/build.xml
trunk/theme/src/main/org/jboss/portal/test/theme/DynaTest.java
trunk/theme/src/main/org/jboss/portal/test/theme/MyTest.java
trunk/theme/src/main/org/jboss/portal/test/theme/RequestContext.java
trunk/theme/src/main/org/jboss/portal/test/theme/TestInfoServlet.java
trunk/theme/src/main/org/jboss/portal/test/theme/TestServlet.java
trunk/theme/src/main/org/jboss/portal/theme/impl/render/dynamic/DynaWindowRenderer.java
trunk/theme/src/resources/test/theme-test-sar/META-INF/jboss-service.xml
trunk/wsrp/src/main/org/jboss/portal/test/wsrp/WSRPBaseTest.java
trunk/wsrp/src/main/org/jboss/portal/test/wsrp/v1/consumer/ConsumerTestCase.java
trunk/wsrp/src/main/org/jboss/portal/test/wsrp/v1/consumer/MarkupTestRunner.java
trunk/wsrp/src/main/org/jboss/portal/test/wsrp/v1/consumer/PortletManagementTestRunner.java
trunk/wsrp/src/main/org/jboss/portal/test/wsrp/v1/consumer/ServiceDescriptionTestRunner.java
trunk/wsrp/src/main/org/jboss/portal/test/wsrp/v1/producer/MarkupTestRunner.java
trunk/wsrp/src/main/org/jboss/portal/test/wsrp/v1/producer/PortletManagementTestRunner.java
trunk/wsrp/src/main/org/jboss/portal/test/wsrp/v1/producer/ProducerTestCase.java
trunk/wsrp/src/main/org/jboss/portal/test/wsrp/v1/producer/RegistrationTestRunner.java
trunk/wsrp/src/main/org/jboss/portal/test/wsrp/v1/producer/ServiceDescriptionTestRunner.java
trunk/wsrp/src/resources/tests/test-wsrp-consumer-markup-sar/META-INF/jboss-service.xml
trunk/wsrp/src/resources/tests/test-wsrp-consumer-portletmanagement-sar/META-INF/jboss-service.xml
trunk/wsrp/src/resources/tests/test-wsrp-consumer-sar/META-INF/jboss-service.xml
trunk/wsrp/src/resources/tests/test-wsrp-consumer-servicedescription-sar/META-INF/jboss-service.xml
trunk/wsrp/src/resources/tests/test-wsrp-producer-markup-sar/META-INF/jboss-service.xml
trunk/wsrp/src/resources/tests/test-wsrp-producer-portletmanagement-sar/META-INF/jboss-service.xml
trunk/wsrp/src/resources/tests/test-wsrp-producer-registration-sar/META-INF/jboss-service.xml
trunk/wsrp/src/resources/tests/test-wsrp-producer-sar/META-INF/jboss-service.xml
trunk/wsrp/src/resources/tests/test-wsrp-producer-servicedescription-sar/META-INF/jboss-service.xml
Log:
- introduced an abstraction for remote test
- make the http test stuff use extend the remote test abstraction
- added support for web UI tests
Modified: trunk/cms/src/main/org/jboss/portal/test/cms/clustering/FileDeleteTest.java
===================================================================
--- trunk/cms/src/main/org/jboss/portal/test/cms/clustering/FileDeleteTest.java 2007-04-20
20:59:43 UTC (rev 7016)
+++ trunk/cms/src/main/org/jboss/portal/test/cms/clustering/FileDeleteTest.java 2007-04-21
12:07:46 UTC (rev 7017)
@@ -25,6 +25,7 @@
import org.jboss.portal.test.framework.server.driver.AbstractTest;
import org.jboss.portal.test.framework.driver.http.HttpTestContext;
import org.jboss.portal.test.framework.driver.http.response.InvokeGetResponse;
+import org.jboss.portal.test.framework.driver.remote.TestContext;
import org.jboss.portal.test.framework.server.NodeId;
import org.jboss.portal.common.test.driver.DriverResponse;
import org.jboss.portal.common.test.driver.response.FailureResponse;
@@ -75,7 +76,7 @@
this.service = service;
}
- public DriverResponse execute(ServerInvocation invocation, HttpTestContext
testContext)
+ public DriverResponse execute(ServerInvocation invocation, TestContext testContext)
{
try
{
Modified: trunk/cms/src/main/org/jboss/portal/test/cms/clustering/FileUpdateTest.java
===================================================================
--- trunk/cms/src/main/org/jboss/portal/test/cms/clustering/FileUpdateTest.java 2007-04-20
20:59:43 UTC (rev 7016)
+++ trunk/cms/src/main/org/jboss/portal/test/cms/clustering/FileUpdateTest.java 2007-04-21
12:07:46 UTC (rev 7017)
@@ -36,6 +36,7 @@
import org.jboss.portal.test.framework.server.driver.AbstractTest;
import org.jboss.portal.test.framework.driver.http.HttpTestContext;
import org.jboss.portal.test.framework.driver.http.response.InvokeGetResponse;
+import org.jboss.portal.test.framework.driver.remote.TestContext;
import org.jboss.portal.test.framework.server.NodeId;
import org.jboss.portal.server.ServerInvocation;
import org.jboss.portal.server.AbstractServerURL;
@@ -75,7 +76,7 @@
this.service = service;
}
- public DriverResponse execute(ServerInvocation invocation, HttpTestContext
testContext)
+ public DriverResponse execute(ServerInvocation invocation, TestContext testContext)
{
try
{
Modified:
trunk/portlet/src/main/org/jboss/portal/test/framework/portlet/PortletTestContext.java
===================================================================
---
trunk/portlet/src/main/org/jboss/portal/test/framework/portlet/PortletTestContext.java 2007-04-20
20:59:43 UTC (rev 7016)
+++
trunk/portlet/src/main/org/jboss/portal/test/framework/portlet/PortletTestContext.java 2007-04-21
12:07:46 UTC (rev 7017)
@@ -24,7 +24,7 @@
import org.jboss.portal.common.test.driver.DriverResponse;
import org.jboss.portal.common.test.TestParameterValue;
-import org.jboss.portal.test.framework.driver.http.HttpTestContext;
+import org.jboss.portal.test.framework.driver.remote.TestContext;
import org.jboss.portal.test.framework.server.NodeId;
import java.net.MalformedURLException;
@@ -39,16 +39,16 @@
final String testName;
/** . */
- final HttpTestContext httpTestContext;
+ final TestContext testContext;
- public PortletTestContext(String testName, HttpTestContext httpTestContext)
+ public PortletTestContext(String testName, TestContext httpTestContext)
{
if (httpTestContext == null)
{
throw new IllegalArgumentException("No http test context to wrap");
}
this.testName = testName;
- this.httpTestContext = httpTestContext;
+ this.testContext = httpTestContext;
}
public String getTestName()
@@ -58,17 +58,17 @@
public void setResponse(DriverResponse response)
{
- httpTestContext.setResponse(response);
+ testContext.setResponse(response);
}
public int getRequestCount()
{
- return httpTestContext.getRequestCount();
+ return testContext.getRequestCount();
}
public String rewriteURLForNode(String url, NodeId nodeId) throws
MalformedURLException
{
- return httpTestContext.rewriteURLForNode(url, nodeId);
+ return testContext.rewriteURLForNode(url, nodeId);
}
public String getParameter(String parameterName)
@@ -77,7 +77,7 @@
{
throw new IllegalArgumentException();
}
- TestParameterValue parameterValue =
httpTestContext.getParametrization().getParameterValue(parameterName);
+ TestParameterValue parameterValue =
testContext.getParametrization().getParameterValue(parameterName);
return parameterValue != null ? (String)parameterValue.get() : null;
}
}
Modified:
trunk/portlet/src/main/org/jboss/portal/test/framework/portlet/PortletTestDriver.java
===================================================================
---
trunk/portlet/src/main/org/jboss/portal/test/framework/portlet/PortletTestDriver.java 2007-04-20
20:59:43 UTC (rev 7016)
+++
trunk/portlet/src/main/org/jboss/portal/test/framework/portlet/PortletTestDriver.java 2007-04-21
12:07:46 UTC (rev 7017)
@@ -31,7 +31,7 @@
import org.jboss.portal.common.test.driver.TestDriverException;
import org.jboss.portal.test.framework.driver.http.response.InvokeGetResponse;
import org.jboss.portal.test.framework.driver.http.HttpTestDriver;
-import org.jboss.portal.test.framework.driver.http.HttpTestContext;
+import org.jboss.portal.test.framework.driver.remote.TestContext;
import java.util.HashMap;
import java.util.Map;
@@ -121,14 +121,14 @@
return new InvokeGetResponse("/test/" + info.getName());
}
- public void pushContext(String testId, HttpTestContext testContext)
+ public void pushContext(String testId, TestContext testContext)
{
context = new PortletTestContext(testId, testContext);
}
- public HttpTestContext popContext(String testId)
+ public TestContext popContext(String testId)
{
- return context.httpTestContext;
+ return context.testContext;
}
/**
Modified:
trunk/portlet/src/main/org/jboss/portal/test/portlet/ha/session/SessionTestCase.java
===================================================================
---
trunk/portlet/src/main/org/jboss/portal/test/portlet/ha/session/SessionTestCase.java 2007-04-20
20:59:43 UTC (rev 7016)
+++
trunk/portlet/src/main/org/jboss/portal/test/portlet/ha/session/SessionTestCase.java 2007-04-21
12:07:46 UTC (rev 7017)
@@ -22,14 +22,14 @@
******************************************************************************/
package org.jboss.portal.test.portlet.ha.session;
-import org.jboss.portal.test.framework.runner.ServerTestRunner;
+import org.jboss.portal.test.framework.runner.HTTPTestRunner;
import org.jboss.portal.test.framework.server.NodeId;
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
* @version $Revision: 1.1 $
*/
-public class SessionTestCase extends ServerTestRunner
+public class SessionTestCase extends HTTPTestRunner
{
public SessionTestCase()
{
Modified: trunk/portlet/src/main/org/jboss/portal/test/portlet/info/AbstractInfoTest.java
===================================================================
---
trunk/portlet/src/main/org/jboss/portal/test/portlet/info/AbstractInfoTest.java 2007-04-20
20:59:43 UTC (rev 7016)
+++
trunk/portlet/src/main/org/jboss/portal/test/portlet/info/AbstractInfoTest.java 2007-04-21
12:07:46 UTC (rev 7017)
@@ -23,7 +23,6 @@
package org.jboss.portal.test.portlet.info;
import org.jboss.portal.portlet.container.PortletApplicationRegistry;
-import org.jboss.portal.common.test.driver.TestDriver;
import org.jboss.portal.common.test.driver.DriverResponse;
import org.jboss.portal.common.test.driver.DriverCommand;
import org.jboss.portal.common.test.driver.TestDriverException;
@@ -34,7 +33,7 @@
import org.jboss.portal.common.test.info.TestItemInfo;
import org.jboss.portal.common.test.info.TestInfo;
import org.jboss.portal.test.framework.driver.http.HttpTestDriver;
-import org.jboss.portal.test.framework.driver.http.HttpTestContext;
+import org.jboss.portal.test.framework.driver.remote.TestContext;
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
@@ -56,7 +55,7 @@
protected TestDriverContainer testDriverContainer;
/** Not really used for now, we need the concept of non http test context. */
- private HttpTestContext testContext;
+ private TestContext testContext;
public AbstractInfoTest(String testCaseId)
{
@@ -70,12 +69,12 @@
this.testInfo = new TestInfo(testCaseId);
}
- public void pushContext(String testId, HttpTestContext testContext)
+ public void pushContext(String testId, TestContext testContext)
{
this.testContext = testContext;
}
- public HttpTestContext popContext(String testId)
+ public TestContext popContext(String testId)
{
return testContext;
}
Modified: trunk/portlet/src/main/org/jboss/portal/test/portlet/info/InfoTestCase.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/test/portlet/info/InfoTestCase.java 2007-04-20
20:59:43 UTC (rev 7016)
+++ trunk/portlet/src/main/org/jboss/portal/test/portlet/info/InfoTestCase.java 2007-04-21
12:07:46 UTC (rev 7017)
@@ -22,13 +22,13 @@
******************************************************************************/
package org.jboss.portal.test.portlet.info;
-import org.jboss.portal.test.framework.runner.ServerTestRunner;
+import org.jboss.portal.test.framework.runner.HTTPTestRunner;
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
* @version $Revision: 1.1 $
*/
-public class InfoTestCase extends ServerTestRunner
+public class InfoTestCase extends HTTPTestRunner
{
public InfoTestCase()
{
Modified:
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/ActionRequestTestCase.java
===================================================================
---
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/ActionRequestTestCase.java 2007-04-20
20:59:43 UTC (rev 7016)
+++
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/ActionRequestTestCase.java 2007-04-21
12:07:46 UTC (rev 7017)
@@ -22,13 +22,13 @@
******************************************************************************/
package org.jboss.portal.test.portlet.jsr168.api;
-import org.jboss.portal.test.framework.runner.ServerTestRunner;
+import org.jboss.portal.test.framework.runner.HTTPTestRunner;
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
* @version $Revision: 1.1 $
*/
-public class ActionRequestTestCase extends ServerTestRunner
+public class ActionRequestTestCase extends HTTPTestRunner
{
public ActionRequestTestCase()
{
Modified:
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/ActionResponseTestCase.java
===================================================================
---
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/ActionResponseTestCase.java 2007-04-20
20:59:43 UTC (rev 7016)
+++
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/ActionResponseTestCase.java 2007-04-21
12:07:46 UTC (rev 7017)
@@ -22,13 +22,13 @@
******************************************************************************/
package org.jboss.portal.test.portlet.jsr168.api;
-import org.jboss.portal.test.framework.runner.ServerTestRunner;
+import org.jboss.portal.test.framework.runner.HTTPTestRunner;
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
* @version $Revision: 1.1 $
*/
-public class ActionResponseTestCase extends ServerTestRunner
+public class ActionResponseTestCase extends HTTPTestRunner
{
public ActionResponseTestCase()
{
Modified:
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/PortalContextTestCase.java
===================================================================
---
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/PortalContextTestCase.java 2007-04-20
20:59:43 UTC (rev 7016)
+++
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/PortalContextTestCase.java 2007-04-21
12:07:46 UTC (rev 7017)
@@ -22,13 +22,13 @@
******************************************************************************/
package org.jboss.portal.test.portlet.jsr168.api;
-import org.jboss.portal.test.framework.runner.ServerTestRunner;
+import org.jboss.portal.test.framework.runner.HTTPTestRunner;
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
* @version $Revision: 1.1 $
*/
-public class PortalContextTestCase extends ServerTestRunner
+public class PortalContextTestCase extends HTTPTestRunner
{
public PortalContextTestCase()
{
Modified:
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/PortletConfigTestCase.java
===================================================================
---
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/PortletConfigTestCase.java 2007-04-20
20:59:43 UTC (rev 7016)
+++
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/PortletConfigTestCase.java 2007-04-21
12:07:46 UTC (rev 7017)
@@ -22,13 +22,13 @@
******************************************************************************/
package org.jboss.portal.test.portlet.jsr168.api;
-import org.jboss.portal.test.framework.runner.ServerTestRunner;
+import org.jboss.portal.test.framework.runner.HTTPTestRunner;
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
* @version $Revision: 1.1 $
*/
-public class PortletConfigTestCase extends ServerTestRunner
+public class PortletConfigTestCase extends HTTPTestRunner
{
public PortletConfigTestCase()
{
Modified:
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/PortletContextTestCase.java
===================================================================
---
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/PortletContextTestCase.java 2007-04-20
20:59:43 UTC (rev 7016)
+++
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/PortletContextTestCase.java 2007-04-21
12:07:46 UTC (rev 7017)
@@ -22,13 +22,13 @@
******************************************************************************/
package org.jboss.portal.test.portlet.jsr168.api;
-import org.jboss.portal.test.framework.runner.ServerTestRunner;
+import org.jboss.portal.test.framework.runner.HTTPTestRunner;
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
* @version $Revision: 1.1 $
*/
-public class PortletContextTestCase extends ServerTestRunner
+public class PortletContextTestCase extends HTTPTestRunner
{
public PortletContextTestCase()
{
Modified:
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/PortletModeTestCase.java
===================================================================
---
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/PortletModeTestCase.java 2007-04-20
20:59:43 UTC (rev 7016)
+++
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/PortletModeTestCase.java 2007-04-21
12:07:46 UTC (rev 7017)
@@ -22,13 +22,13 @@
******************************************************************************/
package org.jboss.portal.test.portlet.jsr168.api;
-import org.jboss.portal.test.framework.runner.ServerTestRunner;
+import org.jboss.portal.test.framework.runner.HTTPTestRunner;
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
* @version $Revision: 1.1 $
*/
-public class PortletModeTestCase extends ServerTestRunner
+public class PortletModeTestCase extends HTTPTestRunner
{
public PortletModeTestCase()
{
Modified:
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/PortletPreferencesTestCase.java
===================================================================
---
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/PortletPreferencesTestCase.java 2007-04-20
20:59:43 UTC (rev 7016)
+++
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/PortletPreferencesTestCase.java 2007-04-21
12:07:46 UTC (rev 7017)
@@ -22,13 +22,13 @@
******************************************************************************/
package org.jboss.portal.test.portlet.jsr168.api;
-import org.jboss.portal.test.framework.runner.ServerTestRunner;
+import org.jboss.portal.test.framework.runner.HTTPTestRunner;
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
* @version $Revision: 1.1 $
*/
-public class PortletPreferencesTestCase extends ServerTestRunner
+public class PortletPreferencesTestCase extends HTTPTestRunner
{
public PortletPreferencesTestCase()
{
Modified:
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/PortletSessionTestCase.java
===================================================================
---
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/PortletSessionTestCase.java 2007-04-20
20:59:43 UTC (rev 7016)
+++
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/PortletSessionTestCase.java 2007-04-21
12:07:46 UTC (rev 7017)
@@ -22,13 +22,13 @@
******************************************************************************/
package org.jboss.portal.test.portlet.jsr168.api;
-import org.jboss.portal.test.framework.runner.ServerTestRunner;
+import org.jboss.portal.test.framework.runner.HTTPTestRunner;
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
* @version $Revision: 1.1 $
*/
-public class PortletSessionTestCase extends ServerTestRunner
+public class PortletSessionTestCase extends HTTPTestRunner
{
public PortletSessionTestCase()
{
Modified:
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/PortletSessionUtilTestCase.java
===================================================================
---
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/PortletSessionUtilTestCase.java 2007-04-20
20:59:43 UTC (rev 7016)
+++
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/PortletSessionUtilTestCase.java 2007-04-21
12:07:46 UTC (rev 7017)
@@ -22,13 +22,13 @@
******************************************************************************/
package org.jboss.portal.test.portlet.jsr168.api;
-import org.jboss.portal.test.framework.runner.ServerTestRunner;
+import org.jboss.portal.test.framework.runner.HTTPTestRunner;
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
* @version $Revision: 1.1 $
*/
-public class PortletSessionUtilTestCase extends ServerTestRunner
+public class PortletSessionUtilTestCase extends HTTPTestRunner
{
public PortletSessionUtilTestCase()
{
Modified:
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/PortletURLTestCase.java
===================================================================
---
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/PortletURLTestCase.java 2007-04-20
20:59:43 UTC (rev 7016)
+++
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/PortletURLTestCase.java 2007-04-21
12:07:46 UTC (rev 7017)
@@ -22,13 +22,13 @@
******************************************************************************/
package org.jboss.portal.test.portlet.jsr168.api;
-import org.jboss.portal.test.framework.runner.ServerTestRunner;
+import org.jboss.portal.test.framework.runner.HTTPTestRunner;
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
* @version $Revision: 1.1 $
*/
-public class PortletURLTestCase extends ServerTestRunner
+public class PortletURLTestCase extends HTTPTestRunner
{
public PortletURLTestCase()
{
Modified:
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/RenderRequestTestCase.java
===================================================================
---
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/RenderRequestTestCase.java 2007-04-20
20:59:43 UTC (rev 7016)
+++
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/RenderRequestTestCase.java 2007-04-21
12:07:46 UTC (rev 7017)
@@ -22,13 +22,13 @@
******************************************************************************/
package org.jboss.portal.test.portlet.jsr168.api;
-import org.jboss.portal.test.framework.runner.ServerTestRunner;
+import org.jboss.portal.test.framework.runner.HTTPTestRunner;
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
* @version $Revision: 1.1 $
*/
-public class RenderRequestTestCase extends ServerTestRunner
+public class RenderRequestTestCase extends HTTPTestRunner
{
public RenderRequestTestCase()
{
Modified:
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/RenderResponseTestCase.java
===================================================================
---
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/RenderResponseTestCase.java 2007-04-20
20:59:43 UTC (rev 7016)
+++
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/RenderResponseTestCase.java 2007-04-21
12:07:46 UTC (rev 7017)
@@ -22,13 +22,13 @@
******************************************************************************/
package org.jboss.portal.test.portlet.jsr168.api;
-import org.jboss.portal.test.framework.runner.ServerTestRunner;
+import org.jboss.portal.test.framework.runner.HTTPTestRunner;
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
* @version $Revision: 1.1 $
*/
-public class RenderResponseTestCase extends ServerTestRunner
+public class RenderResponseTestCase extends HTTPTestRunner
{
public RenderResponseTestCase()
{
Modified:
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/WindowStateTestCase.java
===================================================================
---
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/WindowStateTestCase.java 2007-04-20
20:59:43 UTC (rev 7016)
+++
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/WindowStateTestCase.java 2007-04-21
12:07:46 UTC (rev 7017)
@@ -22,13 +22,13 @@
******************************************************************************/
package org.jboss.portal.test.portlet.jsr168.api;
-import org.jboss.portal.test.framework.runner.ServerTestRunner;
+import org.jboss.portal.test.framework.runner.HTTPTestRunner;
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
* @version $Revision: 1.1 $
*/
-public class WindowStateTestCase extends ServerTestRunner
+public class WindowStateTestCase extends HTTPTestRunner
{
public WindowStateTestCase()
{
Modified:
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/DispatcherTestCase.java
===================================================================
---
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/DispatcherTestCase.java 2007-04-20
20:59:43 UTC (rev 7016)
+++
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/DispatcherTestCase.java 2007-04-21
12:07:46 UTC (rev 7017)
@@ -22,13 +22,13 @@
******************************************************************************/
package org.jboss.portal.test.portlet.jsr168.ext;
-import org.jboss.portal.test.framework.runner.ServerTestRunner;
+import org.jboss.portal.test.framework.runner.HTTPTestRunner;
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
* @version $Revision: 1.1 $
*/
-public class DispatcherTestCase extends ServerTestRunner
+public class DispatcherTestCase extends HTTPTestRunner
{
public DispatcherTestCase()
{
Modified:
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/ExpiringCacheTestCase.java
===================================================================
---
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/ExpiringCacheTestCase.java 2007-04-20
20:59:43 UTC (rev 7016)
+++
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/ExpiringCacheTestCase.java 2007-04-21
12:07:46 UTC (rev 7017)
@@ -22,13 +22,13 @@
******************************************************************************/
package org.jboss.portal.test.portlet.jsr168.ext;
-import org.jboss.portal.test.framework.runner.ServerTestRunner;
+import org.jboss.portal.test.framework.runner.HTTPTestRunner;
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
* @version $Revision: 1.1 $
*/
-public class ExpiringCacheTestCase extends ServerTestRunner
+public class ExpiringCacheTestCase extends HTTPTestRunner
{
public ExpiringCacheTestCase()
{
Modified:
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/NeverExpiringCacheTestCase.java
===================================================================
---
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/NeverExpiringCacheTestCase.java 2007-04-20
20:59:43 UTC (rev 7016)
+++
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/NeverExpiringCacheTestCase.java 2007-04-21
12:07:46 UTC (rev 7017)
@@ -22,13 +22,13 @@
******************************************************************************/
package org.jboss.portal.test.portlet.jsr168.ext;
-import org.jboss.portal.test.framework.runner.ServerTestRunner;
+import org.jboss.portal.test.framework.runner.HTTPTestRunner;
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
* @version $Revision: 1.1 $
*/
-public class NeverExpiringCacheTestCase extends ServerTestRunner
+public class NeverExpiringCacheTestCase extends HTTPTestRunner
{
public NeverExpiringCacheTestCase()
{
Modified:
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/NoCacheTestCase.java
===================================================================
---
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/NoCacheTestCase.java 2007-04-20
20:59:43 UTC (rev 7016)
+++
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/NoCacheTestCase.java 2007-04-21
12:07:46 UTC (rev 7017)
@@ -22,13 +22,13 @@
******************************************************************************/
package org.jboss.portal.test.portlet.jsr168.ext;
-import org.jboss.portal.test.framework.runner.ServerTestRunner;
+import org.jboss.portal.test.framework.runner.HTTPTestRunner;
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
* @version $Revision: 1.1 $
*/
-public class NoCacheTestCase extends ServerTestRunner
+public class NoCacheTestCase extends HTTPTestRunner
{
public NoCacheTestCase()
{
Modified:
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/PortletConfigTestCase.java
===================================================================
---
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/PortletConfigTestCase.java 2007-04-20
20:59:43 UTC (rev 7016)
+++
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/PortletConfigTestCase.java 2007-04-21
12:07:46 UTC (rev 7017)
@@ -22,13 +22,13 @@
******************************************************************************/
package org.jboss.portal.test.portlet.jsr168.ext;
-import org.jboss.portal.test.framework.runner.ServerTestRunner;
+import org.jboss.portal.test.framework.runner.HTTPTestRunner;
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
* @version $Revision: 1.1 $
*/
-public class PortletConfigTestCase extends ServerTestRunner
+public class PortletConfigTestCase extends HTTPTestRunner
{
public PortletConfigTestCase()
{
Modified:
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/PortletModeTestCase.java
===================================================================
---
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/PortletModeTestCase.java 2007-04-20
20:59:43 UTC (rev 7016)
+++
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/PortletModeTestCase.java 2007-04-21
12:07:46 UTC (rev 7017)
@@ -22,13 +22,13 @@
******************************************************************************/
package org.jboss.portal.test.portlet.jsr168.ext;
-import org.jboss.portal.test.framework.runner.ServerTestRunner;
+import org.jboss.portal.test.framework.runner.HTTPTestRunner;
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
* @version $Revision: 1.1 $
*/
-public class PortletModeTestCase extends ServerTestRunner
+public class PortletModeTestCase extends HTTPTestRunner
{
public PortletModeTestCase()
{
Modified:
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/PortletRequestsTestCase.java
===================================================================
---
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/PortletRequestsTestCase.java 2007-04-20
20:59:43 UTC (rev 7016)
+++
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/PortletRequestsTestCase.java 2007-04-21
12:07:46 UTC (rev 7017)
@@ -22,13 +22,13 @@
******************************************************************************/
package org.jboss.portal.test.portlet.jsr168.ext;
-import org.jboss.portal.test.framework.runner.ServerTestRunner;
+import org.jboss.portal.test.framework.runner.HTTPTestRunner;
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
* @version $Revision: 1.1 $
*/
-public class PortletRequestsTestCase extends ServerTestRunner
+public class PortletRequestsTestCase extends HTTPTestRunner
{
public PortletRequestsTestCase()
{
Modified:
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/PortletResponsesTestCase.java
===================================================================
---
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/PortletResponsesTestCase.java 2007-04-20
20:59:43 UTC (rev 7016)
+++
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/PortletResponsesTestCase.java 2007-04-21
12:07:46 UTC (rev 7017)
@@ -22,13 +22,13 @@
******************************************************************************/
package org.jboss.portal.test.portlet.jsr168.ext;
-import org.jboss.portal.test.framework.runner.ServerTestRunner;
+import org.jboss.portal.test.framework.runner.HTTPTestRunner;
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
* @version $Revision: 1.1 $
*/
-public class PortletResponsesTestCase extends ServerTestRunner
+public class PortletResponsesTestCase extends HTTPTestRunner
{
public PortletResponsesTestCase()
{
Modified:
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/PreferencesTestCase.java
===================================================================
---
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/PreferencesTestCase.java 2007-04-20
20:59:43 UTC (rev 7016)
+++
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/PreferencesTestCase.java 2007-04-21
12:07:46 UTC (rev 7017)
@@ -22,13 +22,13 @@
******************************************************************************/
package org.jboss.portal.test.portlet.jsr168.ext;
-import org.jboss.portal.test.framework.runner.ServerTestRunner;
+import org.jboss.portal.test.framework.runner.HTTPTestRunner;
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
* @version $Revision: 1.1 $
*/
-public class PreferencesTestCase extends ServerTestRunner
+public class PreferencesTestCase extends HTTPTestRunner
{
public PreferencesTestCase()
{
Modified:
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/SessionTestCase.java
===================================================================
---
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/SessionTestCase.java 2007-04-20
20:59:43 UTC (rev 7016)
+++
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/SessionTestCase.java 2007-04-21
12:07:46 UTC (rev 7017)
@@ -22,13 +22,13 @@
******************************************************************************/
package org.jboss.portal.test.portlet.jsr168.ext;
-import org.jboss.portal.test.framework.runner.ServerTestRunner;
+import org.jboss.portal.test.framework.runner.HTTPTestRunner;
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
* @version $Revision: 1.1 $
*/
-public class SessionTestCase extends ServerTestRunner
+public class SessionTestCase extends HTTPTestRunner
{
public SessionTestCase()
{
Modified:
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/misc/Log4jTestCase.java
===================================================================
---
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/misc/Log4jTestCase.java 2007-04-20
20:59:43 UTC (rev 7016)
+++
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/misc/Log4jTestCase.java 2007-04-21
12:07:46 UTC (rev 7017)
@@ -22,13 +22,13 @@
******************************************************************************/
package org.jboss.portal.test.portlet.jsr168.misc;
-import org.jboss.portal.test.framework.runner.ServerTestRunner;
+import org.jboss.portal.test.framework.runner.HTTPTestRunner;
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
* @version $Revision: 1.1 $
*/
-public class Log4jTestCase extends ServerTestRunner
+public class Log4jTestCase extends HTTPTestRunner
{
public Log4jTestCase()
{
Modified:
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/DispatcherTestCase.java
===================================================================
---
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/DispatcherTestCase.java 2007-04-20
20:59:43 UTC (rev 7016)
+++
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/DispatcherTestCase.java 2007-04-21
12:07:46 UTC (rev 7017)
@@ -22,13 +22,13 @@
******************************************************************************/
package org.jboss.portal.test.portlet.jsr168.tck;
-import org.jboss.portal.test.framework.runner.ServerTestRunner;
+import org.jboss.portal.test.framework.runner.HTTPTestRunner;
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
* @version $Revision: 1.1 $
*/
-public class DispatcherTestCase extends ServerTestRunner
+public class DispatcherTestCase extends HTTPTestRunner
{
public DispatcherTestCase()
{
Modified:
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/PortletConfigTestCase.java
===================================================================
---
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/PortletConfigTestCase.java 2007-04-20
20:59:43 UTC (rev 7016)
+++
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/PortletConfigTestCase.java 2007-04-21
12:07:46 UTC (rev 7017)
@@ -22,13 +22,13 @@
******************************************************************************/
package org.jboss.portal.test.portlet.jsr168.tck;
-import org.jboss.portal.test.framework.runner.ServerTestRunner;
+import org.jboss.portal.test.framework.runner.HTTPTestRunner;
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
* @version $Revision: 1.1 $
*/
-public class PortletConfigTestCase extends ServerTestRunner
+public class PortletConfigTestCase extends HTTPTestRunner
{
public PortletConfigTestCase()
{
Modified:
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/PortletContextTestCase.java
===================================================================
---
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/PortletContextTestCase.java 2007-04-20
20:59:43 UTC (rev 7016)
+++
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/PortletContextTestCase.java 2007-04-21
12:07:46 UTC (rev 7017)
@@ -22,13 +22,13 @@
******************************************************************************/
package org.jboss.portal.test.portlet.jsr168.tck;
-import org.jboss.portal.test.framework.runner.ServerTestRunner;
+import org.jboss.portal.test.framework.runner.HTTPTestRunner;
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
* @version $Revision: 1.1 $
*/
-public class PortletContextTestCase extends ServerTestRunner
+public class PortletContextTestCase extends HTTPTestRunner
{
public PortletContextTestCase()
{
Modified:
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/PortletInterfaceTestCase.java
===================================================================
---
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/PortletInterfaceTestCase.java 2007-04-20
20:59:43 UTC (rev 7016)
+++
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/PortletInterfaceTestCase.java 2007-04-21
12:07:46 UTC (rev 7017)
@@ -22,13 +22,13 @@
******************************************************************************/
package org.jboss.portal.test.portlet.jsr168.tck;
-import org.jboss.portal.test.framework.runner.ServerTestRunner;
+import org.jboss.portal.test.framework.runner.HTTPTestRunner;
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
* @version $Revision: 1.1 $
*/
-public class PortletInterfaceTestCase extends ServerTestRunner
+public class PortletInterfaceTestCase extends HTTPTestRunner
{
public PortletInterfaceTestCase()
{
Modified:
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/PortletModeTestCase.java
===================================================================
---
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/PortletModeTestCase.java 2007-04-20
20:59:43 UTC (rev 7016)
+++
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/PortletModeTestCase.java 2007-04-21
12:07:46 UTC (rev 7017)
@@ -22,13 +22,13 @@
******************************************************************************/
package org.jboss.portal.test.portlet.jsr168.tck;
-import org.jboss.portal.test.framework.runner.ServerTestRunner;
+import org.jboss.portal.test.framework.runner.HTTPTestRunner;
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
* @version $Revision: 1.1 $
*/
-public class PortletModeTestCase extends ServerTestRunner
+public class PortletModeTestCase extends HTTPTestRunner
{
public PortletModeTestCase()
{
Modified:
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/PortletRequestsTestCase.java
===================================================================
---
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/PortletRequestsTestCase.java 2007-04-20
20:59:43 UTC (rev 7016)
+++
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/PortletRequestsTestCase.java 2007-04-21
12:07:46 UTC (rev 7017)
@@ -22,13 +22,13 @@
******************************************************************************/
package org.jboss.portal.test.portlet.jsr168.tck;
-import org.jboss.portal.test.framework.runner.ServerTestRunner;
+import org.jboss.portal.test.framework.runner.HTTPTestRunner;
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
* @version $Revision: 1.1 $
*/
-public class PortletRequestsTestCase extends ServerTestRunner
+public class PortletRequestsTestCase extends HTTPTestRunner
{
public PortletRequestsTestCase()
{
Modified:
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/PortletResponsesTestCase.java
===================================================================
---
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/PortletResponsesTestCase.java 2007-04-20
20:59:43 UTC (rev 7016)
+++
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/PortletResponsesTestCase.java 2007-04-21
12:07:46 UTC (rev 7017)
@@ -22,13 +22,13 @@
******************************************************************************/
package org.jboss.portal.test.portlet.jsr168.tck;
-import org.jboss.portal.test.framework.runner.ServerTestRunner;
+import org.jboss.portal.test.framework.runner.HTTPTestRunner;
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
* @version $Revision: 1.1 $
*/
-public class PortletResponsesTestCase extends ServerTestRunner
+public class PortletResponsesTestCase extends HTTPTestRunner
{
public PortletResponsesTestCase()
{
Modified:
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/PortletSessionTestCase.java
===================================================================
---
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/PortletSessionTestCase.java 2007-04-20
20:59:43 UTC (rev 7016)
+++
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/PortletSessionTestCase.java 2007-04-21
12:07:46 UTC (rev 7017)
@@ -22,13 +22,13 @@
******************************************************************************/
package org.jboss.portal.test.portlet.jsr168.tck;
-import org.jboss.portal.test.framework.runner.ServerTestRunner;
+import org.jboss.portal.test.framework.runner.HTTPTestRunner;
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
* @version $Revision: 1.1 $
*/
-public class PortletSessionTestCase extends ServerTestRunner
+public class PortletSessionTestCase extends HTTPTestRunner
{
public PortletSessionTestCase()
{
Modified:
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/PortletURLTestCase.java
===================================================================
---
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/PortletURLTestCase.java 2007-04-20
20:59:43 UTC (rev 7016)
+++
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/PortletURLTestCase.java 2007-04-21
12:07:46 UTC (rev 7017)
@@ -22,13 +22,13 @@
******************************************************************************/
package org.jboss.portal.test.portlet.jsr168.tck;
-import org.jboss.portal.test.framework.runner.ServerTestRunner;
+import org.jboss.portal.test.framework.runner.HTTPTestRunner;
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
* @version $Revision: 1.1 $
*/
-public class PortletURLTestCase extends ServerTestRunner
+public class PortletURLTestCase extends HTTPTestRunner
{
public PortletURLTestCase()
{
Modified:
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/PreferencesTestCase.java
===================================================================
---
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/PreferencesTestCase.java 2007-04-20
20:59:43 UTC (rev 7016)
+++
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/PreferencesTestCase.java 2007-04-21
12:07:46 UTC (rev 7017)
@@ -22,13 +22,13 @@
******************************************************************************/
package org.jboss.portal.test.portlet.jsr168.tck;
-import org.jboss.portal.test.framework.runner.ServerTestRunner;
+import org.jboss.portal.test.framework.runner.HTTPTestRunner;
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
* @version $Revision: 1.1 $
*/
-public class PreferencesTestCase extends ServerTestRunner
+public class PreferencesTestCase extends HTTPTestRunner
{
public PreferencesTestCase()
{
Modified:
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/WindowStatesTestCase.java
===================================================================
---
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/WindowStatesTestCase.java 2007-04-20
20:59:43 UTC (rev 7016)
+++
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/WindowStatesTestCase.java 2007-04-21
12:07:46 UTC (rev 7017)
@@ -22,13 +22,13 @@
******************************************************************************/
package org.jboss.portal.test.portlet.jsr168.tck;
-import org.jboss.portal.test.framework.runner.ServerTestRunner;
+import org.jboss.portal.test.framework.runner.HTTPTestRunner;
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
* @version $Revision: 1.1 $
*/
-public class WindowStatesTestCase extends ServerTestRunner
+public class WindowStatesTestCase extends HTTPTestRunner
{
public WindowStatesTestCase()
{
Modified:
trunk/portlet-server/src/resources/test/info/test-info-sar/META-INF/jboss-service.xml
===================================================================
---
trunk/portlet-server/src/resources/test/info/test-info-sar/META-INF/jboss-service.xml 2007-04-20
20:59:43 UTC (rev 7016)
+++
trunk/portlet-server/src/resources/test/info/test-info-sar/META-INF/jboss-service.xml 2007-04-21
12:07:46 UTC (rev 7017)
@@ -25,10 +25,10 @@
<mbean
code="org.jboss.invocation.jrmp.server.JRMPProxyFactory"
- name="portal.test:service=Invoker,name=HttpTestDriverServer">
+ name="portal.test:service=Invoker,name=TestDriverServer">
<depends
optional-attribute-name="InvokerName">jboss:service=invoker,type=jrmp</depends>
<depends
optional-attribute-name="TargetName">portal:controller=Request</depends>
- <attribute name="JndiName">HttpTestDriverServer</attribute>
+ <attribute name="JndiName">TestDriverServer</attribute>
<attribute
name="ExportedInterfaces">org.jboss.portal.test.framework.driver.http.HttpTestDriver</attribute>
</mbean>
Modified: trunk/portlet-server/src/resources/test-sar/META-INF/jboss-service.xml
===================================================================
--- trunk/portlet-server/src/resources/test-sar/META-INF/jboss-service.xml 2007-04-20
20:59:43 UTC (rev 7016)
+++ trunk/portlet-server/src/resources/test-sar/META-INF/jboss-service.xml 2007-04-21
12:07:46 UTC (rev 7017)
@@ -26,8 +26,8 @@
<!-- -->
<mbean
- code="org.jboss.portal.test.framework.driver.http.HttpTestDriverServer"
- name="portal.test:service=HttpTestDriverServer"
+
code="org.jboss.portal.test.framework.driver.remote.RemoteTestDriverServer"
+ name="portal.test:service=TestDriverServer"
xmbean-dd=""
xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
<xmbean/>
@@ -37,10 +37,10 @@
</mbean>
<mbean
code="org.jboss.invocation.jrmp.server.JRMPProxyFactory"
- name="portal.test:service=Invoker,name=HttpTestDriverServer">
+ name="portal.test:service=Invoker,name=TestDriverServer">
<depends
optional-attribute-name="InvokerName">jboss:service=invoker,type=jrmp</depends>
- <depends
optional-attribute-name="TargetName">portal.test:service=HttpTestDriverServer</depends>
- <attribute name="JndiName">HttpTestDriverServer</attribute>
+ <depends
optional-attribute-name="TargetName">portal.test:service=TestDriverServer</depends>
+ <attribute name="JndiName">TestDriverServer</attribute>
<attribute
name="ExportedInterfaces">org.jboss.portal.test.framework.driver.http.HttpTestDriver</attribute>
</mbean>
@@ -51,7 +51,7 @@
xmbean-dd=""
xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
<xmbean/>
- <depends optional-attribute-name="TestDriverRegistry"
proxy-type="attribute">portal.test:service=HttpTestDriverServer</depends>
+ <depends optional-attribute-name="TestDriverRegistry"
proxy-type="attribute">portal.test:service=TestDriverServer</depends>
</mbean>
<!-- Server stack -->
Modified:
trunk/server/src/main/org/jboss/portal/test/framework/server/driver/AbstractTest.java
===================================================================
---
trunk/server/src/main/org/jboss/portal/test/framework/server/driver/AbstractTest.java 2007-04-20
20:59:43 UTC (rev 7016)
+++
trunk/server/src/main/org/jboss/portal/test/framework/server/driver/AbstractTest.java 2007-04-21
12:07:46 UTC (rev 7017)
@@ -25,8 +25,8 @@
import org.jboss.portal.server.ServerInvocation;
import org.jboss.portal.common.test.driver.DriverResponse;
import org.jboss.portal.common.test.driver.response.ErrorResponse;
-import org.jboss.portal.test.framework.driver.http.HttpTestContext;
import org.jboss.portal.test.framework.driver.http.HttpTestCase;
+import org.jboss.portal.test.framework.driver.remote.TestContext;
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
@@ -60,7 +60,7 @@
/**
*
*/
- public DriverResponse execute(ServerInvocation invocation, HttpTestContext
testContext) throws Exception
+ public DriverResponse execute(ServerInvocation invocation, TestContext testContext)
throws Exception
{
return new ErrorResponse("No default implementation");
}
Modified: trunk/server/src/main/org/jboss/portal/test/server/CharsetTestCase.java
===================================================================
--- trunk/server/src/main/org/jboss/portal/test/server/CharsetTestCase.java 2007-04-20
20:59:43 UTC (rev 7016)
+++ trunk/server/src/main/org/jboss/portal/test/server/CharsetTestCase.java 2007-04-21
12:07:46 UTC (rev 7017)
@@ -22,13 +22,13 @@
******************************************************************************/
package org.jboss.portal.test.server;
-import org.jboss.portal.test.framework.runner.ServerTestRunner;
+import org.jboss.portal.test.framework.runner.HTTPTestRunner;
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
* @version $Revision: 1.1 $
*/
-public class CharsetTestCase extends ServerTestRunner
+public class CharsetTestCase extends HTTPTestRunner
{
public CharsetTestCase()
{
Modified: trunk/server/src/main/org/jboss/portal/test/server/ParametersTestCase.java
===================================================================
--- trunk/server/src/main/org/jboss/portal/test/server/ParametersTestCase.java 2007-04-20
20:59:43 UTC (rev 7016)
+++ trunk/server/src/main/org/jboss/portal/test/server/ParametersTestCase.java 2007-04-21
12:07:46 UTC (rev 7017)
@@ -22,13 +22,13 @@
******************************************************************************/
package org.jboss.portal.test.server;
-import org.jboss.portal.test.framework.runner.ServerTestRunner;
+import org.jboss.portal.test.framework.runner.HTTPTestRunner;
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
* @version $Revision: 1.1 $
*/
-public class ParametersTestCase extends ServerTestRunner
+public class ParametersTestCase extends HTTPTestRunner
{
public ParametersTestCase()
{
Modified: trunk/server/src/main/org/jboss/portal/test/server/ResponseTestCase.java
===================================================================
--- trunk/server/src/main/org/jboss/portal/test/server/ResponseTestCase.java 2007-04-20
20:59:43 UTC (rev 7016)
+++ trunk/server/src/main/org/jboss/portal/test/server/ResponseTestCase.java 2007-04-21
12:07:46 UTC (rev 7017)
@@ -22,13 +22,13 @@
******************************************************************************/
package org.jboss.portal.test.server;
-import org.jboss.portal.test.framework.runner.ServerTestRunner;
+import org.jboss.portal.test.framework.runner.HTTPTestRunner;
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
* @version $Revision: 1.1 $
*/
-public class ResponseTestCase extends ServerTestRunner
+public class ResponseTestCase extends HTTPTestRunner
{
public ResponseTestCase()
{
Modified: trunk/server/src/main/org/jboss/portal/test/server/ServletTestCase.java
===================================================================
--- trunk/server/src/main/org/jboss/portal/test/server/ServletTestCase.java 2007-04-20
20:59:43 UTC (rev 7016)
+++ trunk/server/src/main/org/jboss/portal/test/server/ServletTestCase.java 2007-04-21
12:07:46 UTC (rev 7017)
@@ -22,13 +22,13 @@
******************************************************************************/
package org.jboss.portal.test.server;
-import org.jboss.portal.test.framework.runner.ServerTestRunner;
+import org.jboss.portal.test.framework.runner.HTTPTestRunner;
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
* @version $Revision: 1.1 $
*/
-public class ServletTestCase extends ServerTestRunner
+public class ServletTestCase extends HTTPTestRunner
{
public ServletTestCase()
{
Modified: trunk/server/src/main/org/jboss/portal/test/server/TestRequestController.java
===================================================================
---
trunk/server/src/main/org/jboss/portal/test/server/TestRequestController.java 2007-04-20
20:59:43 UTC (rev 7016)
+++
trunk/server/src/main/org/jboss/portal/test/server/TestRequestController.java 2007-04-21
12:07:46 UTC (rev 7017)
@@ -29,14 +29,14 @@
import org.jboss.portal.common.test.driver.DriverCommand;
import org.jboss.portal.common.test.driver.TestDriverException;
import org.jboss.portal.common.test.driver.command.StartTestCommand;
-import org.jboss.portal.test.framework.driver.http.HttpTestDriverServer;
+import org.jboss.portal.test.framework.driver.remote.RemoteTestDriverServer;
import org.jboss.portal.test.framework.server.driver.AbstractTest;
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
* @version $Revision: 1.1 $
*/
-public class TestRequestController extends HttpTestDriverServer implements
RequestController
+public class TestRequestController extends RemoteTestDriverServer implements
RequestController
{
/** . */
Modified: trunk/server/src/main/org/jboss/portal/test/server/charset/GetTest.java
===================================================================
--- trunk/server/src/main/org/jboss/portal/test/server/charset/GetTest.java 2007-04-20
20:59:43 UTC (rev 7016)
+++ trunk/server/src/main/org/jboss/portal/test/server/charset/GetTest.java 2007-04-21
12:07:46 UTC (rev 7017)
@@ -25,9 +25,9 @@
import org.jboss.portal.server.AbstractServerURL;
import org.jboss.portal.server.ServerInvocation;
import org.jboss.portal.server.ServerInvocationContext;
-import org.jboss.portal.test.framework.driver.http.HttpTestContext;
import org.jboss.portal.common.test.driver.response.EndTestResponse;
import org.jboss.portal.test.framework.driver.http.response.InvokeGetResponse;
+import org.jboss.portal.test.framework.driver.remote.TestContext;
import org.jboss.portal.test.framework.server.driver.AbstractTest;
import org.jboss.portal.common.test.driver.DriverResponse;
import org.jboss.portal.common.junit.ExtendedAssert;
@@ -46,7 +46,7 @@
super("GetTest", "/test");
}
- public DriverResponse execute(final ServerInvocation invocation, HttpTestContext
testContext)
+ public DriverResponse execute(final ServerInvocation invocation, TestContext
testContext)
{
if (testContext.isRequestCount(0))
{
Modified:
trunk/server/src/main/org/jboss/portal/test/server/charset/PostMultipartFormDataNoCharsetTest.java
===================================================================
---
trunk/server/src/main/org/jboss/portal/test/server/charset/PostMultipartFormDataNoCharsetTest.java 2007-04-20
20:59:43 UTC (rev 7016)
+++
trunk/server/src/main/org/jboss/portal/test/server/charset/PostMultipartFormDataNoCharsetTest.java 2007-04-21
12:07:46 UTC (rev 7017)
@@ -26,8 +26,8 @@
import org.jboss.portal.server.PortalConstants;
import org.jboss.portal.server.ServerInvocation;
import org.jboss.portal.server.ServerInvocationContext;
-import org.jboss.portal.test.framework.driver.http.HttpTestContext;
import org.jboss.portal.test.framework.driver.http.response.InvokePostResponse;
+import org.jboss.portal.test.framework.driver.remote.TestContext;
import org.jboss.portal.test.framework.server.driver.AbstractTest;
import org.jboss.portal.common.test.driver.response.EndTestResponse;
import org.jboss.portal.common.test.driver.DriverResponse;
@@ -48,7 +48,7 @@
super("PostMultipartFormDataNoCharsetTest", "/test");
}
- public DriverResponse execute(final ServerInvocation invocation, HttpTestContext
testContext)
+ public DriverResponse execute(final ServerInvocation invocation, TestContext
testContext)
{
if (testContext.isRequestCount(0))
{
Modified:
trunk/server/src/main/org/jboss/portal/test/server/charset/PostMultipartFormDataUTF8Test.java
===================================================================
---
trunk/server/src/main/org/jboss/portal/test/server/charset/PostMultipartFormDataUTF8Test.java 2007-04-20
20:59:43 UTC (rev 7016)
+++
trunk/server/src/main/org/jboss/portal/test/server/charset/PostMultipartFormDataUTF8Test.java 2007-04-21
12:07:46 UTC (rev 7017)
@@ -26,9 +26,9 @@
import org.jboss.portal.server.PortalConstants;
import org.jboss.portal.server.ServerInvocation;
import org.jboss.portal.server.ServerInvocationContext;
-import org.jboss.portal.test.framework.driver.http.HttpTestContext;
import org.jboss.portal.common.test.driver.response.EndTestResponse;
import org.jboss.portal.test.framework.driver.http.response.InvokePostResponse;
+import org.jboss.portal.test.framework.driver.remote.TestContext;
import org.jboss.portal.common.test.driver.DriverResponse;
import org.jboss.portal.common.junit.ExtendedAssert;
import org.jboss.portal.common.http.HttpRequest;
@@ -48,7 +48,7 @@
super("PostMultipartFormDataUTF8Test", "/test");
}
- public DriverResponse execute(final ServerInvocation invocation, HttpTestContext
testContext)
+ public DriverResponse execute(final ServerInvocation invocation, TestContext
testContext)
{
if (testContext.isRequestCount(0))
{
Modified: trunk/server/src/main/org/jboss/portal/test/server/charset/PostTest.java
===================================================================
--- trunk/server/src/main/org/jboss/portal/test/server/charset/PostTest.java 2007-04-20
20:59:43 UTC (rev 7016)
+++ trunk/server/src/main/org/jboss/portal/test/server/charset/PostTest.java 2007-04-21
12:07:46 UTC (rev 7017)
@@ -25,12 +25,12 @@
import org.jboss.portal.server.AbstractServerURL;
import org.jboss.portal.server.ServerInvocation;
import org.jboss.portal.server.ServerInvocationContext;
-import org.jboss.portal.test.framework.driver.http.HttpTestContext;
import org.jboss.portal.common.test.driver.response.EndTestResponse;
import org.jboss.portal.common.test.driver.DriverResponse;
import org.jboss.portal.common.junit.ExtendedAssert;
import org.jboss.portal.common.http.HttpRequest;
import org.jboss.portal.test.framework.driver.http.response.InvokePostResponse;
+import org.jboss.portal.test.framework.driver.remote.TestContext;
import org.jboss.portal.test.framework.server.driver.AbstractTest;
import javax.servlet.http.HttpServletRequest;
@@ -47,7 +47,7 @@
super("PostTest", "/test");
}
- public DriverResponse execute(final ServerInvocation invocation, HttpTestContext
testContext)
+ public DriverResponse execute(final ServerInvocation invocation, TestContext
testContext)
{
if (testContext.isRequestCount(0))
{
Modified:
trunk/server/src/main/org/jboss/portal/test/server/charset/PostXWWWFormURLEncodedNoCharsetTest.java
===================================================================
---
trunk/server/src/main/org/jboss/portal/test/server/charset/PostXWWWFormURLEncodedNoCharsetTest.java 2007-04-20
20:59:43 UTC (rev 7016)
+++
trunk/server/src/main/org/jboss/portal/test/server/charset/PostXWWWFormURLEncodedNoCharsetTest.java 2007-04-21
12:07:46 UTC (rev 7017)
@@ -26,8 +26,8 @@
import org.jboss.portal.server.PortalConstants;
import org.jboss.portal.server.ServerInvocation;
import org.jboss.portal.server.ServerInvocationContext;
-import org.jboss.portal.test.framework.driver.http.HttpTestContext;
import org.jboss.portal.test.framework.driver.http.response.InvokePostResponse;
+import org.jboss.portal.test.framework.driver.remote.TestContext;
import org.jboss.portal.test.framework.server.driver.AbstractTest;
import org.jboss.portal.common.test.driver.response.EndTestResponse;
import org.jboss.portal.common.test.driver.DriverResponse;
@@ -49,7 +49,7 @@
super("PostXWWWFormURLEncodedNoCharsetTest", "/test");
}
- public DriverResponse execute(final ServerInvocation invocation, HttpTestContext
testContext)
+ public DriverResponse execute(final ServerInvocation invocation, TestContext
testContext)
{
if (testContext.isRequestCount(0))
{
Modified:
trunk/server/src/main/org/jboss/portal/test/server/charset/PostXWWWFormURLEncodedUTF8Test.java
===================================================================
---
trunk/server/src/main/org/jboss/portal/test/server/charset/PostXWWWFormURLEncodedUTF8Test.java 2007-04-20
20:59:43 UTC (rev 7016)
+++
trunk/server/src/main/org/jboss/portal/test/server/charset/PostXWWWFormURLEncodedUTF8Test.java 2007-04-21
12:07:46 UTC (rev 7017)
@@ -26,9 +26,9 @@
import org.jboss.portal.server.PortalConstants;
import org.jboss.portal.server.ServerInvocation;
import org.jboss.portal.server.ServerInvocationContext;
-import org.jboss.portal.test.framework.driver.http.HttpTestContext;
import org.jboss.portal.common.test.driver.response.EndTestResponse;
import org.jboss.portal.test.framework.driver.http.response.InvokePostResponse;
+import org.jboss.portal.test.framework.driver.remote.TestContext;
import org.jboss.portal.common.test.driver.DriverResponse;
import org.jboss.portal.common.junit.ExtendedAssert;
import org.jboss.portal.common.http.HttpRequest;
@@ -48,7 +48,7 @@
super("PostXWWWFormURLEncodedUTF8Test", "/test");
}
- public DriverResponse execute(final ServerInvocation invocation, HttpTestContext
testContext)
+ public DriverResponse execute(final ServerInvocation invocation, TestContext
testContext)
{
if (testContext.isRequestCount(0))
{
Modified: trunk/server/src/main/org/jboss/portal/test/server/parameters/GetTest.java
===================================================================
--- trunk/server/src/main/org/jboss/portal/test/server/parameters/GetTest.java 2007-04-20
20:59:43 UTC (rev 7016)
+++ trunk/server/src/main/org/jboss/portal/test/server/parameters/GetTest.java 2007-04-21
12:07:46 UTC (rev 7017)
@@ -25,9 +25,9 @@
import org.jboss.portal.server.AbstractServerURL;
import org.jboss.portal.server.ServerInvocation;
import org.jboss.portal.server.ServerInvocationContext;
-import org.jboss.portal.test.framework.driver.http.HttpTestContext;
import org.jboss.portal.common.test.driver.response.EndTestResponse;
import org.jboss.portal.test.framework.driver.http.response.InvokeGetResponse;
+import org.jboss.portal.test.framework.driver.remote.TestContext;
import org.jboss.portal.common.test.driver.DriverResponse;
import org.jboss.portal.common.junit.ExtendedAssert;
import org.jboss.portal.test.framework.server.driver.AbstractTest;
@@ -47,7 +47,7 @@
super("GetTest", "/test");
}
- public DriverResponse execute(final ServerInvocation invocation, HttpTestContext
testContext)
+ public DriverResponse execute(final ServerInvocation invocation, TestContext
testContext)
{
if (testContext.isRequestCount(0))
{
Modified:
trunk/server/src/main/org/jboss/portal/test/server/parameters/PostApplicationXWWWFormURLEncodedTest.java
===================================================================
---
trunk/server/src/main/org/jboss/portal/test/server/parameters/PostApplicationXWWWFormURLEncodedTest.java 2007-04-20
20:59:43 UTC (rev 7016)
+++
trunk/server/src/main/org/jboss/portal/test/server/parameters/PostApplicationXWWWFormURLEncodedTest.java 2007-04-21
12:07:46 UTC (rev 7017)
@@ -25,9 +25,9 @@
import org.jboss.portal.server.AbstractServerURL;
import org.jboss.portal.server.ServerInvocation;
import org.jboss.portal.server.ServerInvocationContext;
-import org.jboss.portal.test.framework.driver.http.HttpTestContext;
import org.jboss.portal.common.test.driver.response.EndTestResponse;
import org.jboss.portal.test.framework.driver.http.response.InvokePostResponse;
+import org.jboss.portal.test.framework.driver.remote.TestContext;
import org.jboss.portal.test.framework.server.driver.AbstractTest;
import org.jboss.portal.test.server.Utils;
import org.jboss.portal.common.test.driver.DriverResponse;
@@ -49,7 +49,7 @@
super("PostApplicationXWWWFormURLEncodedTest", "/test");
}
- public DriverResponse execute(final ServerInvocation invocation, HttpTestContext
testContext)
+ public DriverResponse execute(final ServerInvocation invocation, TestContext
testContext)
{
if (testContext.isRequestCount(0))
{
Modified:
trunk/server/src/main/org/jboss/portal/test/server/parameters/PostMultipartFormDataTest.java
===================================================================
---
trunk/server/src/main/org/jboss/portal/test/server/parameters/PostMultipartFormDataTest.java 2007-04-20
20:59:43 UTC (rev 7016)
+++
trunk/server/src/main/org/jboss/portal/test/server/parameters/PostMultipartFormDataTest.java 2007-04-21
12:07:46 UTC (rev 7017)
@@ -25,9 +25,9 @@
import org.jboss.portal.server.AbstractServerURL;
import org.jboss.portal.server.ServerInvocation;
import org.jboss.portal.server.ServerInvocationContext;
-import org.jboss.portal.test.framework.driver.http.HttpTestContext;
import org.jboss.portal.common.test.driver.DriverResponse;
import org.jboss.portal.test.framework.driver.http.response.InvokePostResponse;
+import org.jboss.portal.test.framework.driver.remote.TestContext;
import org.jboss.portal.test.framework.server.driver.AbstractTest;
import org.jboss.portal.common.test.driver.response.EndTestResponse;
import org.jboss.portal.common.junit.ExtendedAssert;
@@ -47,7 +47,7 @@
super("PostMultipartFormDataTest", "/test");
}
- public DriverResponse execute(final ServerInvocation invocation, HttpTestContext
testContext)
+ public DriverResponse execute(final ServerInvocation invocation, TestContext
testContext)
{
if (testContext.isRequestCount(0))
{
Modified:
trunk/server/src/main/org/jboss/portal/test/server/response/EncodeResponseTest.java
===================================================================
---
trunk/server/src/main/org/jboss/portal/test/server/response/EncodeResponseTest.java 2007-04-20
20:59:43 UTC (rev 7016)
+++
trunk/server/src/main/org/jboss/portal/test/server/response/EncodeResponseTest.java 2007-04-21
12:07:46 UTC (rev 7017)
@@ -23,9 +23,9 @@
package org.jboss.portal.test.server.response;
import org.jboss.portal.test.framework.server.driver.AbstractTest;
-import org.jboss.portal.test.framework.driver.http.HttpTestContext;
import org.jboss.portal.test.framework.driver.http.command.SendResponseCommand;
import org.jboss.portal.test.framework.driver.http.response.SendResponseResponse;
+import org.jboss.portal.test.framework.driver.remote.TestContext;
import org.jboss.portal.test.server.Utils;
import org.jboss.portal.common.test.driver.DriverResponse;
import org.jboss.portal.common.test.driver.DriverCommand;
@@ -54,7 +54,7 @@
super("EncodeResponseTest", "/test");
}
- public DriverResponse execute(ServerInvocation invocation, HttpTestContext
testContext) throws IOException
+ public DriverResponse execute(ServerInvocation invocation, TestContext testContext)
throws IOException
{
if (testContext.isRequestCount(0))
{
@@ -72,7 +72,7 @@
}
}
- public DriverResponse execute(DriverCommand driverCommand, HttpTestContext
testContext) throws UnsupportedEncodingException
+ public DriverResponse execute(DriverCommand driverCommand, TestContext testContext)
throws Exception
{
if (testContext.isRequestCount(1))
{
Modified:
trunk/server/src/main/org/jboss/portal/test/server/servlet/DefaultServletMappingTest.java
===================================================================
---
trunk/server/src/main/org/jboss/portal/test/server/servlet/DefaultServletMappingTest.java 2007-04-20
20:59:43 UTC (rev 7016)
+++
trunk/server/src/main/org/jboss/portal/test/server/servlet/DefaultServletMappingTest.java 2007-04-21
12:07:46 UTC (rev 7017)
@@ -24,10 +24,10 @@
import org.jboss.portal.server.ServerInvocation;
import org.jboss.portal.server.ServerInvocationContext;
-import org.jboss.portal.test.framework.driver.http.HttpTestContext;
import org.jboss.portal.common.test.driver.response.EndTestResponse;
import org.jboss.portal.common.test.driver.response.ErrorResponse;
import org.jboss.portal.test.framework.driver.http.response.InvokeGetResponse;
+import org.jboss.portal.test.framework.driver.remote.TestContext;
import org.jboss.portal.common.test.driver.DriverResponse;
import org.jboss.portal.common.junit.ExtendedAssert;
import org.jboss.portal.test.framework.server.driver.AbstractTest;
@@ -44,7 +44,7 @@
super("DefaultServletMappingTest",
"/test-servlet-defaultservletmapping");
}
- public DriverResponse execute(ServerInvocation invocation, HttpTestContext
testContext)
+ public DriverResponse execute(ServerInvocation invocation, TestContext testContext)
{
final ServerInvocationContext ctx = invocation.getServerContext();
switch (testContext.getRequestCount())
Modified: trunk/server/src/main/org/jboss/portal/test/server/servlet/PathMappingTest.java
===================================================================
---
trunk/server/src/main/org/jboss/portal/test/server/servlet/PathMappingTest.java 2007-04-20
20:59:43 UTC (rev 7016)
+++
trunk/server/src/main/org/jboss/portal/test/server/servlet/PathMappingTest.java 2007-04-21
12:07:46 UTC (rev 7017)
@@ -24,9 +24,9 @@
import org.jboss.portal.server.ServerInvocation;
import org.jboss.portal.server.ServerInvocationContext;
-import org.jboss.portal.test.framework.driver.http.HttpTestContext;
import org.jboss.portal.common.test.driver.DriverResponse;
import org.jboss.portal.test.framework.driver.http.response.InvokeGetResponse;
+import org.jboss.portal.test.framework.driver.remote.TestContext;
import org.jboss.portal.test.framework.server.driver.AbstractTest;
import org.jboss.portal.common.test.driver.response.ErrorResponse;
import org.jboss.portal.common.test.driver.response.EndTestResponse;
@@ -44,7 +44,7 @@
super("PathMappingTest", "/test-servlet-pathmapping/abc");
}
- public DriverResponse execute(ServerInvocation invocation, HttpTestContext
testContext)
+ public DriverResponse execute(ServerInvocation invocation, TestContext testContext)
{
final ServerInvocationContext ctx = invocation.getServerContext();
switch (testContext.getRequestCount())
Modified:
trunk/server/src/main/org/jboss/portal/test/server/servlet/RootPathMappingTest.java
===================================================================
---
trunk/server/src/main/org/jboss/portal/test/server/servlet/RootPathMappingTest.java 2007-04-20
20:59:43 UTC (rev 7016)
+++
trunk/server/src/main/org/jboss/portal/test/server/servlet/RootPathMappingTest.java 2007-04-21
12:07:46 UTC (rev 7017)
@@ -24,8 +24,8 @@
import org.jboss.portal.server.ServerInvocation;
import org.jboss.portal.server.ServerInvocationContext;
-import org.jboss.portal.test.framework.driver.http.HttpTestContext;
import org.jboss.portal.test.framework.driver.http.response.InvokeGetResponse;
+import org.jboss.portal.test.framework.driver.remote.TestContext;
import org.jboss.portal.common.test.driver.response.EndTestResponse;
import org.jboss.portal.common.test.driver.response.ErrorResponse;
import org.jboss.portal.common.test.driver.DriverResponse;
@@ -44,7 +44,7 @@
super("RootPathMappingTest", "/test-servlet-rootpathmapping");
}
- public DriverResponse execute(ServerInvocation invocation, HttpTestContext
testContext)
+ public DriverResponse execute(ServerInvocation invocation, TestContext testContext)
{
final ServerInvocationContext ctx = invocation.getServerContext();
switch (testContext.getRequestCount())
Modified: trunk/server/src/resources/test/test-charset-sar/META-INF/jboss-service.xml
===================================================================
--- trunk/server/src/resources/test/test-charset-sar/META-INF/jboss-service.xml 2007-04-20
20:59:43 UTC (rev 7016)
+++ trunk/server/src/resources/test/test-charset-sar/META-INF/jboss-service.xml 2007-04-21
12:07:46 UTC (rev 7017)
@@ -26,10 +26,10 @@
<!-- -->
<mbean
code="org.jboss.invocation.jrmp.server.JRMPProxyFactory"
- name="portal.test:service=Invoker,name=HttpTestDriverServer">
+ name="portal.test:service=Invoker,name=TestDriverServer">
<depends
optional-attribute-name="InvokerName">jboss:service=invoker,type=jrmp</depends>
<depends
optional-attribute-name="TargetName">portal:controller=Request</depends>
- <attribute name="JndiName">HttpTestDriverServer</attribute>
+ <attribute name="JndiName">TestDriverServer</attribute>
<attribute
name="ExportedInterfaces">org.jboss.portal.test.framework.driver.http.HttpTestDriver</attribute>
</mbean>
Modified: trunk/server/src/resources/test/test-parameters-sar/META-INF/jboss-service.xml
===================================================================
---
trunk/server/src/resources/test/test-parameters-sar/META-INF/jboss-service.xml 2007-04-20
20:59:43 UTC (rev 7016)
+++
trunk/server/src/resources/test/test-parameters-sar/META-INF/jboss-service.xml 2007-04-21
12:07:46 UTC (rev 7017)
@@ -26,10 +26,10 @@
<!-- -->
<mbean
code="org.jboss.invocation.jrmp.server.JRMPProxyFactory"
- name="portal.test:service=Invoker,name=HttpTestDriverServer">
+ name="portal.test:service=Invoker,name=TestDriverServer">
<depends
optional-attribute-name="InvokerName">jboss:service=invoker,type=jrmp</depends>
<depends
optional-attribute-name="TargetName">portal:controller=Request</depends>
- <attribute name="JndiName">HttpTestDriverServer</attribute>
+ <attribute name="JndiName">TestDriverServer</attribute>
<attribute
name="ExportedInterfaces">org.jboss.portal.test.framework.driver.http.HttpTestDriver</attribute>
</mbean>
Modified: trunk/server/src/resources/test/test-response-sar/META-INF/jboss-service.xml
===================================================================
---
trunk/server/src/resources/test/test-response-sar/META-INF/jboss-service.xml 2007-04-20
20:59:43 UTC (rev 7016)
+++
trunk/server/src/resources/test/test-response-sar/META-INF/jboss-service.xml 2007-04-21
12:07:46 UTC (rev 7017)
@@ -26,10 +26,10 @@
<!-- -->
<mbean
code="org.jboss.invocation.jrmp.server.JRMPProxyFactory"
- name="portal.test:service=Invoker,name=HttpTestDriverServer">
+ name="portal.test:service=Invoker,name=TestDriverServer">
<depends
optional-attribute-name="InvokerName">jboss:service=invoker,type=jrmp</depends>
<depends
optional-attribute-name="TargetName">portal:controller=Request</depends>
- <attribute name="JndiName">HttpTestDriverServer</attribute>
+ <attribute name="JndiName">TestDriverServer</attribute>
<attribute
name="ExportedInterfaces">org.jboss.portal.test.framework.driver.http.HttpTestDriver</attribute>
</mbean>
Modified: trunk/server/src/resources/test/test-servlet-sar/META-INF/jboss-service.xml
===================================================================
--- trunk/server/src/resources/test/test-servlet-sar/META-INF/jboss-service.xml 2007-04-20
20:59:43 UTC (rev 7016)
+++ trunk/server/src/resources/test/test-servlet-sar/META-INF/jboss-service.xml 2007-04-21
12:07:46 UTC (rev 7017)
@@ -26,10 +26,10 @@
<!-- -->
<mbean
code="org.jboss.invocation.jrmp.server.JRMPProxyFactory"
- name="portal.test:service=Invoker,name=HttpTestDriverServer">
+ name="portal.test:service=Invoker,name=TestDriverServer">
<depends
optional-attribute-name="InvokerName">jboss:service=invoker,type=jrmp</depends>
<depends
optional-attribute-name="TargetName">portal:controller=Request</depends>
- <attribute name="JndiName">HttpTestDriverServer</attribute>
+ <attribute name="JndiName">TestDriverServer</attribute>
<attribute
name="ExportedInterfaces">org.jboss.portal.test.framework.driver.http.HttpTestDriver</attribute>
</mbean>
Modified: trunk/test/build.xml
===================================================================
--- trunk/test/build.xml 2007-04-20 20:59:43 UTC (rev 7016)
+++ trunk/test/build.xml 2007-04-21 12:07:46 UTC (rev 7017)
@@ -82,7 +82,6 @@
<target name="configure" unless="configure.disable">
-
<!-- Configure thirdparty libraries -->
&libraries;
<path id="library.classpath">
@@ -97,6 +96,7 @@
<path refid="apache.logging.classpath"/>
<path refid="junit.junit.classpath"/>
<path refid="sun.servlet.classpath"/>
+ <path location="selenium-java-client-driver-backport.jar"/>
<!--<path refid="sun.opends.classpath"/>-->
</path>
@@ -132,11 +132,10 @@
<target name="compile"
description="Compile all source files."
- depends="generate-parsers,
- compile-classes,
- compile-classes15,
- _default:compile-etc,
- _default:compile-resources">
+ depends="compile-classes,
+ compile-classes15,
+ _default:compile-etc,
+ _default:compile-resources">
<!-- Add module specific elements here. -->
</target>
@@ -211,9 +210,6 @@
</javac>
</target>
- <target name="generate-parsers" depends="init">
- </target>
-
<!--+====================================================================+-->
<!--| Generate Output |-->
<!--| |-->
@@ -299,4 +295,55 @@
<require file="${jboss.home}/server/${portal.deploy.dir}"/>
<delete
file="${jboss.home}/server/${portal.deploy.dir}/portal-test.sar"/>
</target>
+
+ <!-- ============================= -->
+ <!-- Paths etc. for the retro task -->
+ <!-- ============================= -->
+
+
+ <!-- Run jbossretro on the classes -->
+ <target name="retro" depends="_default:most">
+
+ <!--<property name="build.lib.retro"
value="${module.output}/lib14"/>-->
+ <path id="jbossretro.classpath">
+ <path refid="apache.ant.classpath"/>
+ <path refid="jboss.jbossretro.classpath"/>
+ <path refid="jboss/backport.concurrent.classpath"/>
+ <path refid="javassist.classpath"/>
+ </path>
+
+ <taskdef name="retro"
classname="org.jboss.ant.tasks.retro.Retro"
classpathref="jbossretro.classpath"/>
+
+ <mkdir dir="selenium-java-client-driver"/>
+ <mkdir dir="selenium-java-client-driver-backport"/>
+ <unzip src="selenium-java-client-driver.jar"
dest="selenium-java-client-driver"/>
+ <retro compilerclasspathref="jbossretro.classpath"
destdir="selenium-java-client-driver-backport">
+ <classpath refid="jbossretro.classpath"/>
+ <classpath refid="library.classpath"/>
+ <classpath refid="dependentmodule.classpath"/>
+ <classpath>
+ <pathelement location="selenium-java-client-driver"/>
+ </classpath>
+ <src path="selenium-java-client-driver"/>
+ </retro>
+ <jar destfile="selenium-java-client-driver-backport.jar">
+ <fileset dir="selenium-java-client-driver-backport"/>
+ </jar>
+
+<!--
+ <mkdir dir="${build.lib.retro}"/>
+-->
+
+ <!-- Create the jdk14 compatible jar from the retrod classes -->
+<!--
+ <jar jarfile="${build.lib.retro}/${jar.prefix}14.jar"">
+ <fileset dir="${build.classes.retro}"/>
+ <fileset dir="${build.resources}">
+ <include name="schema/**"/>
+ </fileset>
+ </jar>
+-->
+
+ </target>
+
</project>
Added: trunk/test/selenium-java-client-driver-backport.jar
===================================================================
(Binary files differ)
Property changes on: trunk/test/selenium-java-client-driver-backport.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/test/selenium-java-client-driver.jar
===================================================================
(Binary files differ)
Property changes on: trunk/test/selenium-java-client-driver.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added:
trunk/test/src/main/org/jboss/portal/test/framework/driver/http/HTTPTestConversation.java
===================================================================
---
trunk/test/src/main/org/jboss/portal/test/framework/driver/http/HTTPTestConversation.java
(rev 0)
+++
trunk/test/src/main/org/jboss/portal/test/framework/driver/http/HTTPTestConversation.java 2007-04-21
12:07:46 UTC (rev 7017)
@@ -0,0 +1,386 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.test.framework.driver.http;
+
+import org.apache.commons.httpclient.HttpClient;
+import org.apache.commons.httpclient.SimpleHttpConnectionManager;
+import org.apache.commons.httpclient.UsernamePasswordCredentials;
+import org.apache.commons.httpclient.HttpMethod;
+import org.apache.commons.httpclient.Header;
+import org.apache.commons.httpclient.HeaderElement;
+import org.apache.commons.httpclient.NameValuePair;
+import org.apache.commons.httpclient.HostConfiguration;
+import org.apache.commons.httpclient.methods.PostMethod;
+import org.apache.commons.httpclient.methods.ByteArrayRequestEntity;
+import org.apache.commons.httpclient.methods.GetMethod;
+import org.apache.commons.httpclient.auth.AuthScope;
+import org.apache.commons.httpclient.params.HttpMethodParams;
+import org.apache.log4j.Logger;
+import org.jboss.portal.test.framework.server.Node;
+import org.jboss.portal.test.framework.driver.http.command.HttpDriverCommandContext;
+import org.jboss.portal.test.framework.driver.http.command.HttpDriverCommand;
+import org.jboss.portal.test.framework.driver.http.command.DoGetCommand;
+import org.jboss.portal.test.framework.driver.http.command.DoPostCommand;
+import org.jboss.portal.test.framework.driver.http.command.SendResponseCommand;
+import org.jboss.portal.test.framework.driver.http.response.HttpDriverResponseContext;
+import org.jboss.portal.test.framework.driver.http.response.HttpDriverResponse;
+import org.jboss.portal.test.framework.driver.http.response.InvokeGetResponse;
+import org.jboss.portal.test.framework.driver.http.response.InvokePostResponse;
+import org.jboss.portal.test.framework.driver.remote.TestConversation;
+import org.jboss.portal.test.framework.driver.remote.TestContext;
+import org.jboss.portal.test.framework.driver.remote.RemoteTestDriver;
+import
org.jboss.portal.test.framework.driver.remote.response.RemoteDriverResponseContext;
+import org.jboss.portal.test.framework.driver.remote.command.RemoteDriverCommandContext;
+import org.jboss.portal.common.test.TestParametrization;
+import org.jboss.portal.common.test.driver.DriverResponse;
+import org.jboss.portal.common.test.driver.DriverCommand;
+import org.jboss.portal.common.test.driver.response.ErrorResponse;
+import org.jboss.portal.common.test.driver.response.FailureResponse;
+import org.jboss.portal.common.test.driver.command.StartTestCommand;
+import org.jboss.portal.common.http.HttpRequest;
+import org.jboss.portal.common.http.HttpHeaders;
+import org.jboss.portal.common.http.HttpHeader;
+
+import java.util.Collection;
+import java.util.ArrayList;
+import java.util.Iterator;
+
+import junit.framework.AssertionFailedError;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class HTTPTestConversation extends TestConversation
+{
+
+ /** . */
+ private final Logger log = Logger.getLogger(getClass());
+
+ /** . */
+ private final HttpTestDriverClient driver;
+
+ /** The node to invoke. */
+ private Node node;
+
+ /** The request count for that session. */
+ private int requestCount;
+
+ /** . */
+ private HttpClient client;
+
+ /** The test parametrization. */
+ private TestParametrization parametrization;
+
+ public HTTPTestConversation(HttpTestDriverClient driver, String testId, Node node)
+ {
+ super(driver, testId);
+
+ //
+ this.driver = driver;
+ this.node = node;
+
+ //
+ this.client = new HttpClient(new SimpleHttpConnectionManager());
+ this.client.getParams().setParameter(HttpMethodParams.RETRY_HANDLER, null);
+ this.client.getState().setCredentials(AuthScope.ANY, new
UsernamePasswordCredentials("test", "test"));
+ }
+
+ protected RemoteDriverCommandContext createContext(DriverCommand command)
+ {
+ return new HttpDriverCommandContext(command);
+ }
+
+ protected DriverCommand createCommand(RemoteDriverResponseContext responseContext)
throws Exception
+ {
+ if (responseContext.getResponse() instanceof HttpDriverResponse)
+ {
+ return createHTTPCommand((HttpDriverResponseContext)responseContext);
+ }
+ else
+ {
+ return null;
+ }
+ }
+
+ protected RemoteDriverResponseContext invoke(RemoteDriverCommandContext
commandContext) throws Exception
+ {
+ DriverCommand command = commandContext.getCommand();
+ if (command instanceof DoPostCommand)
+ {
+ DoPostCommand doPostCmd = (DoPostCommand)command;
+ PostMethod post = null;
+ try
+ {
+ post = new PostMethod(doPostCmd.getURL());
+ post.setFollowRedirects(false);
+ HttpRequest.Body body = doPostCmd.getBody();
+ if (doPostCmd.getContentType() != null)
+ {
+ post.addRequestHeader("Content-Type",
doPostCmd.getContentType());
+ }
+ if (body instanceof HttpRequest.Raw)
+ {
+ HttpRequest.Raw rb = (HttpRequest.Raw)body;
+ ByteArrayRequestEntity entity = new
ByteArrayRequestEntity(rb.getBytes());
+ post.setRequestEntity(entity);
+ }
+ else if (body instanceof HttpRequest.Form)
+ {
+ HttpRequest.Form fb = (HttpRequest.Form)body;
+ Collection tmp = new ArrayList();
+ for (Iterator i = fb.getParameterNames().iterator(); i.hasNext();)
+ {
+ String name = (String)i.next();
+ String[] values = fb.getParameterValues(name);
+ for (int j = 0; j < values.length; j++)
+ {
+ String value = values[j];
+ NameValuePair nvp = new NameValuePair(name, value);
+ tmp.add(nvp);
+ }
+ }
+ NameValuePair[] nvps = (NameValuePair[])tmp.toArray(new
NameValuePair[tmp.size()]);
+ post.setRequestBody(nvps);
+ }
+ executeHTTPMethod(post);
+ return decodeHTTPResponse(post);
+ }
+ finally
+ {
+ if (post != null)
+ {
+ post.releaseConnection();
+ }
+ }
+ }
+ else if (command instanceof DoGetCommand)
+ {
+ DoGetCommand doGetCmd = (DoGetCommand)command;
+ GetMethod get = null;
+ try
+ {
+ get = new GetMethod(doGetCmd.getURL());
+ HttpHeaders headers = doGetCmd.getHeaders();
+ for (Iterator i = headers.headers();i.hasNext();)
+ {
+ HttpHeader header = (HttpHeader)i.next();
+ Header _header = new Header(header.getName(), header.getValue());
+ get.addRequestHeader(_header);
+ }
+ get.setFollowRedirects(false);
+ executeHTTPMethod(get);
+ return decodeHTTPResponse(get);
+ }
+ finally
+ {
+ if (get != null)
+ {
+ get.releaseConnection();
+ }
+ }
+ }
+ else if (command instanceof StartTestCommand)
+ {
+ requestCount = -1;
+ parametrization = ((StartTestCommand)command).getParametrization();
+ pushContext();
+ DriverResponse response = driver.getServer(node).invoke(testId, command);
+ requestCount = 0;
+ return new HttpDriverResponseContext(response);
+ }
+ else if (command instanceof SendResponseCommand)
+ {
+ pushContext();
+ DriverResponse response = driver.getServer(node).invoke(testId, command);
+ requestCount++;
+ return new HttpDriverResponseContext(response);
+ }
+ else
+ {
+ return new HttpDriverResponseContext(new ErrorResponse("Unexpected
response"));
+ }
+ }
+
+ /**
+ * Create an http command from an http response.
+ * @param responseContext
+ */
+ protected HttpDriverCommand createHTTPCommand(HttpDriverResponseContext
responseContext) throws Exception
+ {
+ DriverResponse resp = responseContext.getResponse();
+ if (resp instanceof InvokeGetResponse)
+ {
+ InvokeGetResponse igr = (InvokeGetResponse)resp;
+ return new DoGetCommand(igr.getURL(), igr.getHeaders());
+ }
+ else if (resp instanceof InvokePostResponse)
+ {
+ InvokePostResponse ipr = (InvokePostResponse)resp;
+ HttpRequest.Body dpcb = ipr.getBody();
+ return new DoPostCommand(ipr.getURL(), ipr.getContentType(), dpcb);
+ }
+ else
+ {
+ HttpMethod method = responseContext.getHttpMethod();
+ byte[] body = method.getResponseBody();
+ HttpHeaders _headers = new HttpHeaders();
+ Header[] headers = method.getResponseHeaders();
+ for (int i = 0;i < headers.length;i++)
+ {
+ Header header = headers[i];
+ HttpHeader _header = _headers.addHeader(header.getName());
+ HeaderElement[] elts = header.getElements();
+ if (elts != null)
+ {
+ for (int j = 0;j < elts.length;j++)
+ {
+ HeaderElement elt = elts[j];
+ HttpHeader.Element _elt = _header.addElement(elt.getName(),
elt.getValue());
+ NameValuePair[] params = elt.getParameters();
+ if (params != null)
+ {
+ for (int k = 0;k < params.length;k++)
+ {
+ NameValuePair param = params[k];
+ _elt.addParam(param.getName(), param.getValue());
+ }
+ }
+ }
+ }
+ }
+ return new SendResponseCommand(_headers, body);
+ }
+ }
+
+ private HttpDriverResponseContext decodeHTTPResponse(HttpMethod httpMethod) throws
Exception
+ {
+ TestContext ctx = popContext();
+ DriverResponse response = ctx.getResponse();
+ int status = httpMethod.getStatusCode();
+ switch (status)
+ {
+ case 200:
+ if (response == null)
+ {
+ throw new AssertionFailedError("No result for test " + testId +
" in the response");
+ }
+ else
+ {
+ log.info("# Received '200' code");
+ requestCount++;
+ return new HttpDriverResponseContext(httpMethod, response);
+ }
+ // Send redirect
+ case 302:
+ // If any result has been setup during the action it overrides the 302 code
+ if (response != null)
+ {
+ log.info("# Received Result object which overrides the 302");
+ requestCount++;
+ return new HttpDriverResponseContext(httpMethod, response);
+ }
+
+ // Otherwise satisfy the 302 code
+ Header locationHeader = httpMethod.getResponseHeader("location");
+ if (locationHeader != null)
+ {
+ String redirectLocation = locationHeader.getValue();
+ log.info("# Received '302' code --> " +
redirectLocation);
+ DoGetCommand cmd = new DoGetCommand(redirectLocation);
+
+ // For now we don't add any contextual payload as
+ // 302 is some kind of implicit redirect response
+ return (HttpDriverResponseContext)invoke(new
HttpDriverCommandContext(cmd));
+ }
+ else
+ {
+ // The response is invalid
+ return new HttpDriverResponseContext(httpMethod, new
FailureResponse("302 Code with corrupted data"));
+ }
+ case 500:
+ log.info("# Received '500' code");
+ return new HttpDriverResponseContext(httpMethod, new
FailureResponse("Received '500' code at " + httpMethod.getURI()));
+ case 404:
+ log.info("# Received '404' code");
+ return new HttpDriverResponseContext(httpMethod, new
FailureResponse("Received '404' code at " + httpMethod.getURI()));
+ default:
+ return new HttpDriverResponseContext(httpMethod, new
ErrorResponse("Unexpected http code " + status + " at " +
httpMethod.getURI()));
+ }
+ }
+
+ private int executeHTTPMethod(HttpMethod method) throws Exception
+ {
+ int port = method.getURI().getPort();
+ if (port != -1)
+ {
+ node = driver.getNode(port);
+ if (node == null)
+ {
+ throw new IllegalArgumentException("Wrong port " +
method.getURI().getPort());
+ }
+ }
+ else
+ {
+ port = driver.getPort(node);
+ }
+
+ //
+ String host = method.getURI().getHost();
+ if (host == null)
+ {
+ host = "localhost";
+ }
+
+ //
+ HostConfiguration cfg = new HostConfiguration();
+ cfg.setHost(host, port);
+
+ //
+ pushContext();
+
+ //
+ log.info("# Invoking test case over http " + cfg + " " +
method.getURI());
+ int status = client.executeMethod(cfg, method);
+
+ // Force to read the response body before we close the connection
+ // otherwise the content will be lost
+ method.getResponseBody();
+
+ return status;
+ }
+
+ private void pushContext()
+ {
+ HttpTestContext ctx = new HttpTestContext(requestCount, driver.getArchivePath(),
parametrization);
+ log.info("# Updating test case context of : " + node + " : " +
ctx);
+ RemoteTestDriver agent = driver.getServer(node);
+ agent.pushContext(testId, ctx);
+ }
+
+ private TestContext popContext()
+ {
+ RemoteTestDriver agent = driver.getServer(node);
+ return agent.popContext(testId);
+ }
+}
Deleted:
trunk/test/src/main/org/jboss/portal/test/framework/driver/http/HTTPTestSuite.java
===================================================================
---
trunk/test/src/main/org/jboss/portal/test/framework/driver/http/HTTPTestSuite.java 2007-04-20
20:59:43 UTC (rev 7016)
+++
trunk/test/src/main/org/jboss/portal/test/framework/driver/http/HTTPTestSuite.java 2007-04-21
12:07:46 UTC (rev 7017)
@@ -1,70 +0,0 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2006, Red Hat Middleware, LLC, and individual *
- * contributors as indicated by the @authors tag. See the *
- * copyright.txt in the distribution for a full listing of *
- * individual contributors. *
- * *
- * This is free software; you can redistribute it and/or modify it *
- * under the terms of the GNU Lesser General Public License as *
- * published by the Free Software Foundation; either version 2.1 of *
- * the License, or (at your option) any later version. *
- * *
- * This software is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
- * Lesser General Public License for more details. *
- * *
- * You should have received a copy of the GNU Lesser General Public *
- * License along with this software; if not, write to the Free *
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
- ******************************************************************************/
-package org.jboss.portal.test.framework.driver.http;
-
-import org.jboss.portal.common.test.driver.TestSuite;
-import org.jboss.portal.common.test.info.TestItemInfo;
-
-/**
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 1.1 $
- */
-public class HTTPTestSuite extends TestSuite implements HttpTestDriver
-{
-
- public HTTPTestSuite(String id)
- {
- super(id);
- }
-
- public void pushContext(String testId, HttpTestContext testContext)
- {
- TestItemInfo item = info.findItem(testId);
-
- // Get a driver
- HttpTestDriver httpDriver = (HttpTestDriver)getDriver(testId);
-
- // Get new relative id
- String newTestId = item.getId(httpDriver.getInfo());
-
- //
- HttpTestContext ctx2 = new HttpTestContext(newTestId, testContext);
-
- //
- httpDriver.pushContext(newTestId, ctx2);
- }
-
- public HttpTestContext popContext(String testId)
- {
- TestItemInfo item = info.findItem(testId);
-
- // Get a driver
- HttpTestDriver httpDriver = (HttpTestDriver)getDriver(testId);
-
- // Get new relative id
- String newTestId = item.getId(httpDriver.getInfo());
-
- //
- return httpDriver.popContext(newTestId);
- }
-}
Modified:
trunk/test/src/main/org/jboss/portal/test/framework/driver/http/HttpTestCase.java
===================================================================
---
trunk/test/src/main/org/jboss/portal/test/framework/driver/http/HttpTestCase.java 2007-04-20
20:59:43 UTC (rev 7016)
+++
trunk/test/src/main/org/jboss/portal/test/framework/driver/http/HttpTestCase.java 2007-04-21
12:07:46 UTC (rev 7017)
@@ -22,15 +22,14 @@
******************************************************************************/
package org.jboss.portal.test.framework.driver.http;
-import org.jboss.portal.common.test.driver.TestDriverContainer;
import org.jboss.portal.common.test.driver.DriverResponse;
import org.jboss.portal.common.test.driver.DriverCommand;
import org.jboss.portal.common.test.driver.TestDriverException;
import org.jboss.portal.common.test.driver.command.StartTestCommand;
import org.jboss.portal.common.test.driver.response.ErrorResponse;
-import org.jboss.portal.common.test.info.TestInfo;
-import org.jboss.portal.common.test.info.TestItemInfo;
import org.jboss.portal.test.framework.driver.http.response.InvokeGetResponse;
+import org.jboss.portal.test.framework.driver.remote.TestContext;
+import org.jboss.portal.test.framework.driver.remote.RemoteTestCase;
/**
* Defines an http test case working from the server side point of view.
@@ -38,88 +37,23 @@
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
* @version $Revision: 5636 $
*/
-public abstract class HttpTestCase implements HttpTestDriver
+public abstract class HttpTestCase extends RemoteTestCase
{
- /** The test id. */
- protected final String testCaseId;
-
/** The test path. */
protected final String path;
- /** The test info. */
- protected TestInfo testInfo;
-
- /** The test context. */
- protected HttpTestContext context;
-
- /** The driver registry, in the future we should remove that and use some kind of
external wiring mechanism. */
- protected TestDriverContainer testDriverContainer;
-
public HttpTestCase(String testCaseId, String path)
{
- if (testCaseId == null)
- {
- throw new IllegalArgumentException("No null test case id accepted");
- }
- if (path == null)
- {
- throw new IllegalArgumentException("No null test path accepted");
- }
+ super(testCaseId);
//
- this.testCaseId = testCaseId;
this.path = path;
- this.testInfo = new TestInfo(testCaseId);
}
- public TestItemInfo getInfo()
- {
- return testInfo;
- }
-
- public TestDriverContainer getTestDriverRegistry()
- {
- return testDriverContainer;
- }
-
- public void setTestDriverRegistry(TestDriverContainer testDriverContainer)
- {
- this.testDriverContainer = testDriverContainer;
- }
-
- public String getTestCaseId()
- {
- return testCaseId;
- }
-
- public String getPath()
- {
- return path;
- }
-
- public void create()
- {
- testDriverContainer.addDriver(this);
- }
-
- public void destroy()
- {
- testDriverContainer.removeDriver(this);
- }
-
- public void pushContext(String testId, HttpTestContext testContext)
- {
- this.context = testContext;
- }
-
- public HttpTestContext popContext(String testId)
- {
- return context;
- }
-
/**
- *
+ * The implementation will return an <code>InvokeGetResponse</code>
response in reaction to the <code>StartTestCommand</code>.
+ * All other commands will be delegated to the
<code>execute(DriverCommand,TestContext)</code>
*/
public DriverResponse invoke(String testId, DriverCommand cmd) throws
TestDriverException
{
@@ -140,10 +74,7 @@
}
}
- /**
- *
- */
- public DriverResponse execute(DriverCommand driverCommand, HttpTestContext
testContext) throws Exception
+ public DriverResponse execute(DriverCommand driverCommand, TestContext testContext)
throws Exception
{
return new ErrorResponse("No default implementation");
}
Modified:
trunk/test/src/main/org/jboss/portal/test/framework/driver/http/HttpTestContext.java
===================================================================
---
trunk/test/src/main/org/jboss/portal/test/framework/driver/http/HttpTestContext.java 2007-04-20
20:59:43 UTC (rev 7016)
+++
trunk/test/src/main/org/jboss/portal/test/framework/driver/http/HttpTestContext.java 2007-04-21
12:07:46 UTC (rev 7017)
@@ -24,6 +24,7 @@
import org.jboss.portal.test.framework.server.NodeId;
import org.jboss.portal.test.framework.agent.TestAgent;
+import org.jboss.portal.test.framework.driver.remote.TestContext;
import org.jboss.portal.common.test.driver.DriverResponse;
import org.jboss.portal.common.test.TestParametrization;
import org.jboss.deployment.DeploymentException;
@@ -40,7 +41,7 @@
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
* @version $Revision: 5498 $
*/
-public class HttpTestContext implements Serializable
+public class HttpTestContext extends TestContext
{
/**
@@ -74,206 +75,6 @@
throw new UnsupportedOperationException("Don't use this API");
}
- /** The test count. */
- private int requestCount;
-
- /** The test response. */
- private DriverResponse response;
-
- /** The path where archive we want to deploy are. */
- private String archivePath;
-
- /** The test parametrization. */
- private TestParametrization parametrization;
-
- /**
- * The test agent, normally only valid in the server side for now.
- * It is transient so it is not marshalled when the context is popped on the client
by
- * <code>HttpTestDriverServer.popContext()</code>
- * It is package protected so it can be set by the
<code>HttpTestDriverServer.pushContext(...)</code> method.
- */
- transient TestAgent testAgent;
-
- /**
- * Copy constructor.
- */
- public HttpTestContext(HttpTestContext that)
- {
- this.requestCount = that.requestCount;
- this.archivePath = that.archivePath;
- this.response = that.response;
- this.parametrization = that.parametrization;
- this.testAgent = that.testAgent;
- }
-
- /**
- * Normally used on the server side.
- */
- public HttpTestContext(
- String testName,
- HttpTestContext that)
- {
- this.requestCount = that.requestCount;
- this.archivePath = that.archivePath;
- this.response = that.response;
- this.parametrization = that.parametrization;
- this.testAgent = that.testAgent;
- }
-
- /**
- * Normally used on the client side.
- */
- public HttpTestContext(
- String testName,
- int requestCount,
- String archivePath,
- TestParametrization parametrization)
- {
- this.requestCount = requestCount;
- this.archivePath = archivePath;
- this.parametrization = parametrization;
- this.testAgent = null;
- }
-
- public TestParametrization getParametrization()
- {
- return parametrization;
- }
-
- public String getArchivePath()
- {
- return archivePath;
- }
-
- /**
- * Return the test count.
- *
- * @return the test count
- */
- public int getRequestCount()
- {
- return requestCount;
- }
-
- /**
- * Return true if the request count is equals to the specified value.
- *
- * @param count the expected count
- * @return true if the expected count is equals to the actual count
- * @throws IllegalStateException
- */
- public boolean isRequestCount(int count)
- {
- return requestCount == count;
- }
-
- /**
- * Return the response.
- *
- * @return the response of the test
- */
- public DriverResponse getResponse()
- {
- return response;
- }
-
- public void setResponse(DriverResponse response)
- {
- if (this.response != null)
- {
- throw new IllegalStateException("A response is already provided");
- }
- else
- {
- this.response = response;
- }
- }
-
- /**
- * @param url the url to rewrite
- * @param nodeId the node id
- * @return the rewritten url
- * @throws MalformedURLException
- * @throws IllegalArgumentException if the url is null or the node id not recognized
- */
- public String rewriteURLForNode(String url, NodeId nodeId) throws
MalformedURLException
- {
- if (url == null)
- {
- throw new IllegalArgumentException("No null URL accepted");
- }
- int port;
- if (NodeId.DEFAULT.equals(nodeId))
- {
- port = 8080;
- }
- else if (NodeId.PORTS_01.equals(nodeId))
- {
- port = 8180;
- }
- else if (NodeId.PORTS_02.equals(nodeId))
- {
- port = 8280;
- }
- else
- {
- throw new IllegalArgumentException("Unknown node");
- }
- URL tmp;
- if (url.startsWith("http://"))
- {
- tmp = new URL(url);
- tmp = new URL(tmp.getProtocol(), tmp.getHost(), port, tmp.getFile());
- }
- else
- {
- tmp = new URL("http", "localhost", port, url);
- }
- return tmp.toString();
- }
-
- public void deploy(String archiveId) throws MalformedURLException,
IllegalStateException, DeploymentException
- {
- if (testAgent == null)
- {
- throw new IllegalStateException("No test agent to perform deploy");
- }
-
- //
- File root = new File(archivePath);
- File f = new File(root, archiveId);
- URL url = f.toURL();
- testAgent.deploy(url);
- }
-
- public void undeploy(String archiveId) throws MalformedURLException,
IllegalStateException, DeploymentException
- {
- if (testAgent == null)
- {
- throw new IllegalStateException("No test agent to perform deploy");
- }
-
- //
- File root = new File(archivePath);
- File f = new File(root, archiveId);
- URL url = f.toURL();
- testAgent.undeploy(url);
- }
-
-// public static boolean isCurrentTestName(String testName) throws
IllegalStateException
-// {
-// if (testName == null)
-// {
-// throw new IllegalArgumentException();
-// }
-// return testName.equals(getCurrentContext().testName);
-// }
-
-// public static String getCurrentTestName() throws IllegalStateException
-// {
-// return getCurrentContext().testName;
-// }
-
public static boolean isCurrentRequestCount(int count) throws IllegalStateException
{
return getCurrentContext().requestCount == count;
@@ -303,8 +104,13 @@
ctx.setResponse(currentResponse);
}
- public String toString()
+ public HttpTestContext(TestContext that)
{
- return "TestCaseContext[" + requestCount + "]";
+ super(that);
}
+
+ public HttpTestContext(int requestCount, String archivePath, TestParametrization
parametrization)
+ {
+ super(requestCount, archivePath, parametrization);
+ }
}
Modified:
trunk/test/src/main/org/jboss/portal/test/framework/driver/http/HttpTestDriver.java
===================================================================
---
trunk/test/src/main/org/jboss/portal/test/framework/driver/http/HttpTestDriver.java 2007-04-20
20:59:43 UTC (rev 7016)
+++
trunk/test/src/main/org/jboss/portal/test/framework/driver/http/HttpTestDriver.java 2007-04-21
12:07:46 UTC (rev 7017)
@@ -22,25 +22,12 @@
******************************************************************************/
package org.jboss.portal.test.framework.driver.http;
-import org.jboss.portal.common.test.driver.TestDriver;
+import org.jboss.portal.test.framework.driver.remote.RemoteTestDriver;
/**
- * Extends the test driver interface in order to provide
- * testability of a server which interracts with a client over
- * the http protocol.
- *
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
* @version $Revision: 1.1 $
*/
-public interface HttpTestDriver extends TestDriver
+public interface HttpTestDriver extends RemoteTestDriver
{
- /**
- * A client side push of an http test context for a specific test.
- */
- void pushContext(String testId, HttpTestContext testContext);
-
- /**
- * A client pop of an http test context for a specific test.
- */
- HttpTestContext popContext(String testId);
}
Modified:
trunk/test/src/main/org/jboss/portal/test/framework/driver/http/HttpTestDriverClient.java
===================================================================
---
trunk/test/src/main/org/jboss/portal/test/framework/driver/http/HttpTestDriverClient.java 2007-04-20
20:59:43 UTC (rev 7016)
+++
trunk/test/src/main/org/jboss/portal/test/framework/driver/http/HttpTestDriverClient.java 2007-04-21
12:07:46 UTC (rev 7017)
@@ -22,491 +22,18 @@
******************************************************************************/
package org.jboss.portal.test.framework.driver.http;
-import org.jboss.portal.test.framework.driver.http.command.HttpDriverCommand;
-import org.jboss.portal.test.framework.driver.http.command.DoPostCommand;
-import org.jboss.portal.test.framework.driver.http.command.DoGetCommand;
-import org.jboss.portal.test.framework.driver.http.command.SendResponseCommand;
-import org.jboss.portal.test.framework.driver.http.command.HttpDriverCommandContext;
-import org.jboss.portal.test.framework.driver.http.response.HttpDriverResponse;
-import org.jboss.portal.test.framework.driver.http.response.InvokeGetResponse;
-import org.jboss.portal.test.framework.driver.http.response.InvokePostResponse;
-import org.jboss.portal.test.framework.driver.http.response.HttpDriverResponseContext;
-import org.jboss.portal.common.test.driver.command.StartTestCommand;
-import org.jboss.portal.common.test.driver.TestDriver;
-import org.jboss.portal.common.test.driver.DriverResponse;
-import org.jboss.portal.common.test.driver.DriverCommand;
-import org.jboss.portal.common.test.driver.TestDriverException;
-import org.jboss.portal.common.test.driver.response.ErrorResponse;
-import org.jboss.portal.common.test.driver.response.FailureResponse;
-import org.jboss.portal.common.test.info.TestItemInfo;
-import org.jboss.portal.common.test.TestParametrization;
-import org.jboss.portal.common.http.HttpHeader;
-import org.jboss.portal.common.http.HttpHeaders;
-import org.jboss.portal.common.http.HttpRequest;
+import org.jboss.portal.test.framework.driver.remote.RemoteTestDriverClient;
+import org.jboss.portal.test.framework.driver.remote.TestConversation;
import org.jboss.portal.test.framework.server.Node;
-import org.jboss.portal.test.framework.server.NodeId;
-import org.jboss.portal.test.framework.server.NodeManager;
-import org.jboss.portal.test.framework.ServiceLookup;
-import org.apache.commons.httpclient.methods.PostMethod;
-import org.apache.commons.httpclient.methods.ByteArrayRequestEntity;
-import org.apache.commons.httpclient.methods.GetMethod;
-import org.apache.commons.httpclient.NameValuePair;
-import org.apache.commons.httpclient.HttpMethod;
-import org.apache.commons.httpclient.Header;
-import org.apache.commons.httpclient.HostConfiguration;
-import org.apache.commons.httpclient.HttpClient;
-import org.apache.commons.httpclient.UsernamePasswordCredentials;
-import org.apache.commons.httpclient.SimpleHttpConnectionManager;
-import org.apache.commons.httpclient.HeaderElement;
-import org.apache.commons.httpclient.auth.AuthScope;
-import org.apache.commons.httpclient.params.HttpMethodParams;
-import org.apache.log4j.Logger;
-import java.util.Collection;
-import java.util.ArrayList;
-import java.util.Iterator;
-
-import junit.framework.AssertionFailedError;
-
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
* @version $Revision: 1.1 $
*/
-public class HttpTestDriverClient implements TestDriver
+public class HttpTestDriverClient extends RemoteTestDriverClient
{
-
- /** . */
- private final Logger log = Logger.getLogger(getClass());
-
- // Config
-
- /** . */
- private NodeId initialNodeId;
-
- /** . */
- private String archivePath;
-
- // Services
-
- /** . */
- private ServiceLookup serverLookup;
-
- /** . */
- private NodeManager nodeManager;
-
- public NodeId getInitialNodeId()
+ protected TestConversation createConversation(String testId, Node node)
{
- return initialNodeId;
+ return new HTTPTestConversation(this, testId, node);
}
-
- public void setInitialNodeId(NodeId initialNodeId)
- {
- this.initialNodeId = initialNodeId;
- }
-
- public String getArchivePath()
- {
- return archivePath;
- }
-
- public void setArchivePath(String archivePath)
- {
- this.archivePath = archivePath;
- }
-
- public NodeManager getNodeManager()
- {
- return nodeManager;
- }
-
- public void setNodeManager(NodeManager nodeManager)
- {
- this.nodeManager = nodeManager;
- }
-
- public ServiceLookup getServerLookup()
- {
- return serverLookup;
- }
-
- public void setServerLookup(ServiceLookup serverLookup)
- {
- this.serverLookup = serverLookup;
- }
-
- private HttpTestDriver getServer(Node node)
- {
- return (HttpTestDriver)serverLookup.getService(node);
- }
-
- public TestItemInfo getInfo()
- {
- Node node = nodeManager.getNode(initialNodeId);
- HttpTestDriver server = getServer(node);
- return server.getInfo();
- }
-
- public DriverResponse invoke(String testId, DriverCommand cmd) throws
TestDriverException
- {
- try
- {
- Node node = nodeManager.getNode(initialNodeId);
-
- // Create conversation
- TestConversation conversation = new TestConversation(testId, node);
-
- //
- return conversation.handleCommand(new HttpDriverCommandContext(cmd));
- }
- catch (Exception e)
- {
- throw new TestDriverException(e);
- }
- }
-
- /**
- * A test conversation
- */
- private class TestConversation
- {
-
- /** The test name. */
- final String testId;
-
- /** . */
- HttpClient client;
-
- /** The node to invoke. */
- Node node;
-
- /** The request count for that session. */
- int requestCount;
-
- /** The test parametrization. */
- TestParametrization parametrization;
-
- public TestConversation(String testId, Node node)
- {
- this.testId = testId;
- this.node = node;
-
- //
- client = new HttpClient(new SimpleHttpConnectionManager());
- client.getParams().setParameter(HttpMethodParams.RETRY_HANDLER, null);
- client.getState().setCredentials(AuthScope.ANY, new
UsernamePasswordCredentials("test", "test"));
- }
-
- private DriverResponse handleCommand(HttpDriverCommandContext cmdCtx) throws
Exception
- {
- HttpDriverResponseContext respCtx = invokeHttp(cmdCtx);
- if (respCtx.getResponse() instanceof HttpDriverResponse)
- {
- HttpDriverCommand httpCmdDriver = createHttpCommand(respCtx);
- return handleCommand(new HttpDriverCommandContext(respCtx, httpCmdDriver));
- }
- else
- {
- return respCtx.getResponse();
- }
- }
-
- /**
- * Create an http command from an http response.
- */
- private HttpDriverCommand createHttpCommand(HttpDriverResponseContext respCtx)
throws Exception
- {
- DriverResponse resp = respCtx.getResponse();
- if (resp instanceof InvokeGetResponse)
- {
- InvokeGetResponse igr = (InvokeGetResponse)resp;
- return new DoGetCommand(igr.getURL(), igr.getHeaders());
- }
- else if (resp instanceof InvokePostResponse)
- {
- InvokePostResponse ipr = (InvokePostResponse)resp;
- HttpRequest.Body dpcb = ipr.getBody();
- return new DoPostCommand(ipr.getURL(), ipr.getContentType(), dpcb);
- }
- else
- {
- HttpMethod method = respCtx.getHttpMethod();
- byte[] body = method.getResponseBody();
- HttpHeaders _headers = new HttpHeaders();
- Header[] headers = method.getResponseHeaders();
- for (int i = 0;i < headers.length;i++)
- {
- Header header = headers[i];
- HttpHeader _header = _headers.addHeader(header.getName());
- HeaderElement[] elts = header.getElements();
- if (elts != null)
- {
- for (int j = 0;j < elts.length;j++)
- {
- HeaderElement elt = elts[j];
- HttpHeader.Element _elt = _header.addElement(elt.getName(),
elt.getValue());
- NameValuePair[] params = elt.getParameters();
- if (params != null)
- {
- for (int k = 0;k < params.length;k++)
- {
- NameValuePair param = params[k];
- _elt.addParam(param.getName(), param.getValue());
- }
- }
- }
- }
- }
- return new SendResponseCommand(_headers, body);
- }
- }
-
- /**
- *
- */
- private HttpDriverResponseContext invokeHttp(HttpDriverCommandContext cmdCtx)
throws Exception
- {
- DriverCommand cmd = cmdCtx.getCommand();
- if (cmd instanceof DoPostCommand)
- {
- DoPostCommand doPostCmd = (DoPostCommand)cmd;
- PostMethod post = null;
- try
- {
- post = new PostMethod(doPostCmd.getURL());
- post.setFollowRedirects(false);
- HttpRequest.Body body = doPostCmd.getBody();
- if (doPostCmd.getContentType() != null)
- {
- post.addRequestHeader("Content-Type",
doPostCmd.getContentType());
- }
- if (body instanceof HttpRequest.Raw)
- {
- HttpRequest.Raw rb = (HttpRequest.Raw)body;
- ByteArrayRequestEntity entity = new
ByteArrayRequestEntity(rb.getBytes());
- post.setRequestEntity(entity);
- }
- else if (body instanceof HttpRequest.Form)
- {
- HttpRequest.Form fb = (HttpRequest.Form)body;
- Collection tmp = new ArrayList();
- for (Iterator i = fb.getParameterNames().iterator(); i.hasNext();)
- {
- String name = (String)i.next();
- String[] values = fb.getParameterValues(name);
- for (int j = 0; j < values.length; j++)
- {
- String value = values[j];
- NameValuePair nvp = new NameValuePair(name, value);
- tmp.add(nvp);
- }
- }
- NameValuePair[] nvps = (NameValuePair[])tmp.toArray(new
NameValuePair[tmp.size()]);
- post.setRequestBody(nvps);
- }
- executeMethod(post);
- return decodeHttpResponse(post);
- }
- finally
- {
- if (post != null)
- {
- post.releaseConnection();
- }
- }
- }
- else if (cmd instanceof DoGetCommand)
- {
- DoGetCommand doGetCmd = (DoGetCommand)cmd;
- GetMethod get = null;
- try
- {
- get = new GetMethod(doGetCmd.getURL());
- HttpHeaders headers = doGetCmd.getHeaders();
- for (Iterator i = headers.headers();i.hasNext();)
- {
- HttpHeader header = (HttpHeader)i.next();
- Header _header = new Header(header.getName(), header.getValue());
- get.addRequestHeader(_header);
- }
- get.setFollowRedirects(false);
- executeMethod(get);
- return decodeHttpResponse(get);
- }
- finally
- {
- if (get != null)
- {
- get.releaseConnection();
- }
- }
- }
- else if (cmd instanceof StartTestCommand)
- {
- requestCount = -1;
- parametrization = ((StartTestCommand)cmd).getParametrization();
- pushContext();
- DriverResponse response = getServer(node).invoke(testId, cmd);
- requestCount = 0;
- return new HttpDriverResponseContext(response);
- }
- else if (cmd instanceof SendResponseCommand)
- {
- pushContext();
- DriverResponse response = getServer(node).invoke(testId, cmd);
- requestCount++;
- return new HttpDriverResponseContext(response);
- }
- else
- {
- return new HttpDriverResponseContext(new ErrorResponse("Unexpected
response"));
- }
- }
-
- private HttpDriverResponseContext decodeHttpResponse(HttpMethod httpMethod) throws
Exception
- {
- HttpTestContext ctx = popContext();
- DriverResponse response = ctx.getResponse();
- int status = httpMethod.getStatusCode();
- switch (status)
- {
- case 200:
- if (response == null)
- {
- throw new AssertionFailedError("No result for test " + testId
+ " in the response");
- }
- else
- {
- log.info("# Received '200' code");
- requestCount++;
- return new HttpDriverResponseContext(httpMethod, response);
- }
- // Send redirect
- case 302:
- // If any result has been setup during the action it overrides the 302
code
- if (response != null)
- {
- log.info("# Received Result object which overrides the
302");
- requestCount++;
- return new HttpDriverResponseContext(httpMethod, response);
- }
-
- // Otherwise satisfy the 302 code
- Header locationHeader =
httpMethod.getResponseHeader("location");
- if (locationHeader != null)
- {
- String redirectLocation = locationHeader.getValue();
- log.info("# Received '302' code --> " +
redirectLocation);
- DoGetCommand cmd = new DoGetCommand(redirectLocation);
-
- // For now we don't add any contextual payload as
- // 302 is some kind of implicit redirect response
- return invokeHttp(new HttpDriverCommandContext(cmd));
- }
- else
- {
- // The response is invalid
- throw new AssertionFailedError("302 Code with corrupted
data");
- }
- case 500:
- log.info("# Received '500' code");
- return new HttpDriverResponseContext(httpMethod, new
FailureResponse("Received '500' code at " + httpMethod.getURI()));
- case 404:
- log.info("# Received '404' code");
- return new HttpDriverResponseContext(httpMethod, new
FailureResponse("Received '404' code at " + httpMethod.getURI()));
- default:
- return new HttpDriverResponseContext(httpMethod, new
ErrorResponse("Unexpected http code " + status + " at " +
httpMethod.getURI()));
- }
- }
-
- public int executeMethod(HttpMethod method) throws Exception
- {
- int port = method.getURI().getPort();
- if (port != -1)
- {
- node = getNode(port);
- if (node == null)
- {
- throw new IllegalArgumentException("Wrong port " +
method.getURI().getPort());
- }
- }
- else
- {
- port = getPort(node);
- }
-
- //
- String host = method.getURI().getHost();
- if (host == null)
- {
- host = "localhost";
- }
-
- //
- HostConfiguration cfg = new HostConfiguration();
- cfg.setHost(host, port);
-
- //
- pushContext();
-
- //
- log.info("# Invoking test case over http " + cfg + " " +
method.getURI());
- int status = client.executeMethod(cfg, method);
-
- // Force to read the response body before we close the connection
- // otherwise the content will be lost
- method.getResponseBody();
-
- return status;
- }
-
- private void pushContext()
- {
- HttpTestContext ctx = new HttpTestContext(testId, requestCount, archivePath,
parametrization);
- log.info("# Updating test case context of : " + node + " : "
+ ctx);
- HttpTestDriver agent = getServer(node);
- agent.pushContext(testId, ctx);
- }
-
- private HttpTestContext popContext()
- {
- HttpTestDriver agent = getServer(node);
- return agent.popContext(testId);
- }
-
- private Node getNode(int port)
- {
- NodeId nodeId = null;
- switch (port)
- {
- case 8080:
- nodeId = NodeId.DEFAULT;
- break;
- case 8180:
- nodeId = NodeId.PORTS_01;
- break;
- case 8280:
- nodeId = NodeId.PORTS_02;
- break;
- }
- return nodeManager.getNode(nodeId);
- }
-
- public int getPort(Node node)
- {
- NodeId nodeId = node.getId();
- if (NodeId.DEFAULT.equals(nodeId))
- {
- return 8080;
- }
- if (NodeId.PORTS_01.equals(nodeId))
- {
- return 8180;
- }
- if (NodeId.PORTS_02.equals(nodeId))
- {
- return 8280;
- }
- return -1;
- }
- }
}
Deleted:
trunk/test/src/main/org/jboss/portal/test/framework/driver/http/HttpTestDriverServer.java
===================================================================
---
trunk/test/src/main/org/jboss/portal/test/framework/driver/http/HttpTestDriverServer.java 2007-04-20
20:59:43 UTC (rev 7016)
+++
trunk/test/src/main/org/jboss/portal/test/framework/driver/http/HttpTestDriverServer.java 2007-04-21
12:07:46 UTC (rev 7017)
@@ -1,85 +0,0 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2006, Red Hat Middleware, LLC, and individual *
- * contributors as indicated by the @authors tag. See the *
- * copyright.txt in the distribution for a full listing of *
- * individual contributors. *
- * *
- * This is free software; you can redistribute it and/or modify it *
- * under the terms of the GNU Lesser General Public License as *
- * published by the Free Software Foundation; either version 2.1 of *
- * the License, or (at your option) any later version. *
- * *
- * This software is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
- * Lesser General Public License for more details. *
- * *
- * You should have received a copy of the GNU Lesser General Public *
- * License along with this software; if not, write to the Free *
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
- ******************************************************************************/
-package org.jboss.portal.test.framework.driver.http;
-
-import org.jboss.portal.common.test.driver.DriverResponse;
-import org.jboss.portal.common.test.driver.TestDriverException;
-import org.jboss.portal.common.test.driver.TestDriver;
-import org.jboss.portal.common.test.driver.DriverCommand;
-import org.jboss.portal.common.test.driver.TestDriverContainer;
-import org.jboss.portal.common.test.info.TestItemInfo;
-import org.jboss.portal.test.framework.driver.AbstractTestDriverServer;
-
-/**
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 5636 $
- */
-public class HttpTestDriverServer extends AbstractTestDriverServer implements
HttpTestDriver, TestDriverContainer
-{
-
- /** . */
- protected final HTTPTestSuite suite;
-
- public HttpTestDriverServer()
- {
- suite = new HTTPTestSuite("Main");
- }
-
- public void pushContext(String testId, HttpTestContext testContext)
- {
- testContext.testAgent = getAgent();
-
- //
- suite.pushContext(testId, testContext);
- }
-
- public HttpTestContext popContext(String testId)
- {
- return suite.popContext(testId);
- }
-
- public synchronized void addDriver(TestDriver driver)
- {
- suite.addDriver(driver);
- }
-
- public synchronized void removeDriver(TestDriver driver)
- {
- suite.removeDriver(driver);
- }
-
- public TestDriver getDriver(String testId)
- {
- return suite.getDriver(testId);
- }
-
- public DriverResponse invoke(String testId, DriverCommand cmd) throws
TestDriverException
- {
- return suite.invoke(testId, cmd);
- }
-
- public TestItemInfo getInfo()
- {
- return suite.getInfo();
- }
-}
Modified:
trunk/test/src/main/org/jboss/portal/test/framework/driver/http/command/HttpDriverCommandContext.java
===================================================================
---
trunk/test/src/main/org/jboss/portal/test/framework/driver/http/command/HttpDriverCommandContext.java 2007-04-20
20:59:43 UTC (rev 7016)
+++
trunk/test/src/main/org/jboss/portal/test/framework/driver/http/command/HttpDriverCommandContext.java 2007-04-21
12:07:46 UTC (rev 7017)
@@ -23,7 +23,8 @@
package org.jboss.portal.test.framework.driver.http.command;
import org.jboss.portal.common.test.driver.DriverCommand;
-import org.jboss.portal.test.framework.driver.http.response.HttpDriverResponseContext;
+import org.jboss.portal.test.framework.driver.remote.command.RemoteDriverCommandContext;
+import
org.jboss.portal.test.framework.driver.remote.response.RemoteDriverResponseContext;
/**
* The context of the command invoked by the client.
@@ -31,33 +32,15 @@
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
* @version $Revision: 1.1 $
*/
-public class HttpDriverCommandContext
+public class HttpDriverCommandContext extends RemoteDriverCommandContext
{
-
- /** The previous response if not null. */
- private HttpDriverResponseContext responseContext;
-
- /** The command to invoke. */
- private DriverCommand command;
-
- public HttpDriverCommandContext(HttpDriverResponseContext responseContext,
DriverCommand command)
+ public HttpDriverCommandContext(RemoteDriverResponseContext responseContext,
DriverCommand command)
{
- this.responseContext = responseContext;
- this.command = command;
+ super(responseContext, command);
}
public HttpDriverCommandContext(DriverCommand command)
{
- this.command = command;
+ super(command);
}
-
- public HttpDriverResponseContext getResponseContext()
- {
- return responseContext;
- }
-
- public DriverCommand getCommand()
- {
- return command;
- }
}
Modified:
trunk/test/src/main/org/jboss/portal/test/framework/driver/http/response/HttpDriverResponseContext.java
===================================================================
---
trunk/test/src/main/org/jboss/portal/test/framework/driver/http/response/HttpDriverResponseContext.java 2007-04-20
20:59:43 UTC (rev 7016)
+++
trunk/test/src/main/org/jboss/portal/test/framework/driver/http/response/HttpDriverResponseContext.java 2007-04-21
12:07:46 UTC (rev 7017)
@@ -24,6 +24,7 @@
import org.apache.commons.httpclient.HttpMethod;
import org.jboss.portal.common.test.driver.DriverResponse;
+import
org.jboss.portal.test.framework.driver.remote.response.RemoteDriverResponseContext;
/**
* The context of the response received by the client.
@@ -31,20 +32,18 @@
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
* @version $Revision: 1.1 $
*/
-public class HttpDriverResponseContext
+public class HttpDriverResponseContext extends RemoteDriverResponseContext
{
/** The http method if not null. */
private HttpMethod httpMethod;
- /** . */
- private DriverResponse response;
-
-
public HttpDriverResponseContext(HttpMethod httpMethod, DriverResponse response)
{
+ super(response);
+
+ //
this.httpMethod = httpMethod;
- this.response = response;
}
public HttpDriverResponseContext(DriverResponse response)
@@ -56,9 +55,4 @@
{
return httpMethod;
}
-
- public DriverResponse getResponse()
- {
- return response;
- }
}
Added:
trunk/test/src/main/org/jboss/portal/test/framework/driver/remote/RemoteTestCase.java
===================================================================
--- trunk/test/src/main/org/jboss/portal/test/framework/driver/remote/RemoteTestCase.java
(rev 0)
+++
trunk/test/src/main/org/jboss/portal/test/framework/driver/remote/RemoteTestCase.java 2007-04-21
12:07:46 UTC (rev 7017)
@@ -0,0 +1,101 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.test.framework.driver.remote;
+
+import org.jboss.portal.common.test.info.TestInfo;
+import org.jboss.portal.common.test.info.TestItemInfo;
+import org.jboss.portal.common.test.driver.TestDriverContainer;
+
+/**
+ * Defines an http test case working from the server side point of view.
+ *
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 5636 $
+ */
+public abstract class RemoteTestCase implements RemoteTestDriver
+{
+
+ /** The test id. */
+ protected final String testCaseId;
+
+ /** The test info. */
+ protected TestInfo testInfo;
+
+ /** The test context. */
+ protected TestContext context;
+
+ /** The driver registry, in the future we should remove that and use some kind of
external wiring mechanism. */
+ protected TestDriverContainer testDriverContainer;
+
+ public RemoteTestCase(String testCaseId)
+ {
+ if (testCaseId == null)
+ {
+ throw new IllegalArgumentException("No null test case id accepted");
+ }
+
+ //
+ this.testCaseId = testCaseId;
+ this.testInfo = new TestInfo(testCaseId);
+ }
+
+ public TestItemInfo getInfo()
+ {
+ return testInfo;
+ }
+
+ public TestDriverContainer getTestDriverRegistry()
+ {
+ return testDriverContainer;
+ }
+
+ public void setTestDriverRegistry(TestDriverContainer testDriverContainer)
+ {
+ this.testDriverContainer = testDriverContainer;
+ }
+
+ public String getTestCaseId()
+ {
+ return testCaseId;
+ }
+
+ public void create()
+ {
+ testDriverContainer.addDriver(this);
+ }
+
+ public void destroy()
+ {
+ testDriverContainer.removeDriver(this);
+ }
+
+ public void pushContext(String testId, TestContext testContext)
+ {
+ this.context = testContext;
+ }
+
+ public TestContext popContext(String testId)
+ {
+ return context;
+ }
+}
Added:
trunk/test/src/main/org/jboss/portal/test/framework/driver/remote/RemoteTestDriver.java
===================================================================
---
trunk/test/src/main/org/jboss/portal/test/framework/driver/remote/RemoteTestDriver.java
(rev 0)
+++
trunk/test/src/main/org/jboss/portal/test/framework/driver/remote/RemoteTestDriver.java 2007-04-21
12:07:46 UTC (rev 7017)
@@ -0,0 +1,42 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.test.framework.driver.remote;
+
+import org.jboss.portal.common.test.driver.TestDriver;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public interface RemoteTestDriver extends TestDriver
+{
+ /**
+ * A client side push of an http test context for a specific test.
+ */
+ void pushContext(String testId, TestContext testContext);
+
+ /**
+ * A client pop of an http test context for a specific test.
+ */
+ TestContext popContext(String testId);
+}
Added:
trunk/test/src/main/org/jboss/portal/test/framework/driver/remote/RemoteTestDriverClient.java
===================================================================
---
trunk/test/src/main/org/jboss/portal/test/framework/driver/remote/RemoteTestDriverClient.java
(rev 0)
+++
trunk/test/src/main/org/jboss/portal/test/framework/driver/remote/RemoteTestDriverClient.java 2007-04-21
12:07:46 UTC (rev 7017)
@@ -0,0 +1,165 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.test.framework.driver.remote;
+
+import org.jboss.portal.test.framework.server.NodeId;
+import org.jboss.portal.test.framework.server.NodeManager;
+import org.jboss.portal.test.framework.server.Node;
+import org.jboss.portal.test.framework.ServiceLookup;
+import org.jboss.portal.common.test.info.TestItemInfo;
+import org.jboss.portal.common.test.driver.DriverResponse;
+import org.jboss.portal.common.test.driver.DriverCommand;
+import org.jboss.portal.common.test.driver.TestDriverException;
+import org.jboss.portal.common.test.driver.TestDriver;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public abstract class RemoteTestDriverClient implements TestDriver
+{
+
+ // Config
+
+ /** . */
+ private NodeId initialNodeId;
+
+ /** . */
+ private String archivePath;
+
+ // Services
+
+ /** . */
+ private ServiceLookup serverLookup;
+
+ /** . */
+ private NodeManager nodeManager;
+
+ public NodeId getInitialNodeId()
+ {
+ return initialNodeId;
+ }
+
+ public void setInitialNodeId(NodeId initialNodeId)
+ {
+ this.initialNodeId = initialNodeId;
+ }
+
+ public String getArchivePath()
+ {
+ return archivePath;
+ }
+
+ public void setArchivePath(String archivePath)
+ {
+ this.archivePath = archivePath;
+ }
+
+ public NodeManager getNodeManager()
+ {
+ return nodeManager;
+ }
+
+ public void setNodeManager(NodeManager nodeManager)
+ {
+ this.nodeManager = nodeManager;
+ }
+
+ public ServiceLookup getServerLookup()
+ {
+ return serverLookup;
+ }
+
+ public void setServerLookup(ServiceLookup serverLookup)
+ {
+ this.serverLookup = serverLookup;
+ }
+
+ public RemoteTestDriver getServer(Node node)
+ {
+ return (RemoteTestDriver)serverLookup.getService(node);
+ }
+
+ public TestItemInfo getInfo()
+ {
+ Node node = nodeManager.getNode(initialNodeId);
+ TestDriver server = getServer(node);
+ return server.getInfo();
+ }
+
+ public DriverResponse invoke(String testId, DriverCommand command) throws
TestDriverException
+ {
+ try
+ {
+ Node node = nodeManager.getNode(initialNodeId);
+
+ // Create conversation
+ TestConversation conversation = createConversation(testId, node);
+
+ //
+ return conversation.handleCommand(command);
+ }
+ catch (Exception e)
+ {
+ throw new TestDriverException(e);
+ }
+ }
+
+ protected abstract TestConversation createConversation(String testId, Node node);
+
+ public Node getNode(int port)
+ {
+ NodeId nodeId = null;
+ switch (port)
+ {
+ case 8080:
+ nodeId = NodeId.DEFAULT;
+ break;
+ case 8180:
+ nodeId = NodeId.PORTS_01;
+ break;
+ case 8280:
+ nodeId = NodeId.PORTS_02;
+ break;
+ }
+ return nodeManager.getNode(nodeId);
+ }
+
+ public int getPort(Node node)
+ {
+ NodeId nodeId = node.getId();
+ if (NodeId.DEFAULT.equals(nodeId))
+ {
+ return 8080;
+ }
+ if (NodeId.PORTS_01.equals(nodeId))
+ {
+ return 8180;
+ }
+ if (NodeId.PORTS_02.equals(nodeId))
+ {
+ return 8280;
+ }
+ return -1;
+ }
+}
Added:
trunk/test/src/main/org/jboss/portal/test/framework/driver/remote/RemoteTestDriverServer.java
===================================================================
---
trunk/test/src/main/org/jboss/portal/test/framework/driver/remote/RemoteTestDriverServer.java
(rev 0)
+++
trunk/test/src/main/org/jboss/portal/test/framework/driver/remote/RemoteTestDriverServer.java 2007-04-21
12:07:46 UTC (rev 7017)
@@ -0,0 +1,85 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.test.framework.driver.remote;
+
+import org.jboss.portal.common.test.driver.DriverResponse;
+import org.jboss.portal.common.test.driver.TestDriverException;
+import org.jboss.portal.common.test.driver.TestDriver;
+import org.jboss.portal.common.test.driver.DriverCommand;
+import org.jboss.portal.common.test.driver.TestDriverContainer;
+import org.jboss.portal.common.test.info.TestItemInfo;
+import org.jboss.portal.test.framework.driver.AbstractTestDriverServer;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 5636 $
+ */
+public class RemoteTestDriverServer extends AbstractTestDriverServer implements
RemoteTestDriver, TestDriverContainer
+{
+
+ /** . */
+ protected final RemoteTestSuite suite;
+
+ public RemoteTestDriverServer()
+ {
+ suite = new RemoteTestSuite("Main");
+ }
+
+ public void pushContext(String testId, TestContext testContext)
+ {
+ testContext.testAgent = getAgent();
+
+ //
+ suite.pushContext(testId, testContext);
+ }
+
+ public TestContext popContext(String testId)
+ {
+ return suite.popContext(testId);
+ }
+
+ public synchronized void addDriver(TestDriver driver)
+ {
+ suite.addDriver(driver);
+ }
+
+ public synchronized void removeDriver(TestDriver driver)
+ {
+ suite.removeDriver(driver);
+ }
+
+ public TestDriver getDriver(String testId)
+ {
+ return suite.getDriver(testId);
+ }
+
+ public DriverResponse invoke(String testId, DriverCommand cmd) throws
TestDriverException
+ {
+ return suite.invoke(testId, cmd);
+ }
+
+ public TestItemInfo getInfo()
+ {
+ return suite.getInfo();
+ }
+}
Property changes on:
trunk/test/src/main/org/jboss/portal/test/framework/driver/remote/RemoteTestDriverServer.java
___________________________________________________________________
Name: svn:executable
+ *
Added:
trunk/test/src/main/org/jboss/portal/test/framework/driver/remote/RemoteTestSuite.java
===================================================================
---
trunk/test/src/main/org/jboss/portal/test/framework/driver/remote/RemoteTestSuite.java
(rev 0)
+++
trunk/test/src/main/org/jboss/portal/test/framework/driver/remote/RemoteTestSuite.java 2007-04-21
12:07:46 UTC (rev 7017)
@@ -0,0 +1,67 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.test.framework.driver.remote;
+
+import org.jboss.portal.common.test.driver.TestSuite;
+import org.jboss.portal.common.test.info.TestItemInfo;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class RemoteTestSuite extends TestSuite implements RemoteTestDriver
+{
+
+ public RemoteTestSuite(String id)
+ {
+ super(id);
+ }
+
+ public void pushContext(String testId, TestContext testContext)
+ {
+ TestItemInfo item = info.findItem(testId);
+
+ // Get a driver
+ RemoteTestDriver remoteDriver = (RemoteTestDriver)getDriver(testId);
+
+ // Get new relative id
+ String newTestId = item.getId(remoteDriver.getInfo());
+
+ //
+ remoteDriver.pushContext(newTestId, testContext);
+ }
+
+ public TestContext popContext(String testId)
+ {
+ TestItemInfo item = info.findItem(testId);
+
+ // Get a driver
+ RemoteTestDriver remoteDriver = (RemoteTestDriver)getDriver(testId);
+
+ // Get new relative id
+ String newTestId = item.getId(remoteDriver.getInfo());
+
+ //
+ return remoteDriver.popContext(newTestId);
+ }
+}
Added: trunk/test/src/main/org/jboss/portal/test/framework/driver/remote/TestContext.java
===================================================================
--- trunk/test/src/main/org/jboss/portal/test/framework/driver/remote/TestContext.java
(rev 0)
+++
trunk/test/src/main/org/jboss/portal/test/framework/driver/remote/TestContext.java 2007-04-21
12:07:46 UTC (rev 7017)
@@ -0,0 +1,215 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.test.framework.driver.remote;
+
+import org.jboss.portal.common.test.driver.DriverResponse;
+import org.jboss.portal.common.test.TestParametrization;
+import org.jboss.portal.test.framework.agent.TestAgent;
+import org.jboss.portal.test.framework.server.NodeId;
+import org.jboss.deployment.DeploymentException;
+
+import java.io.Serializable;
+import java.io.File;
+import java.net.MalformedURLException;
+import java.net.URL;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class TestContext implements Serializable
+{
+
+ /** The test count. */
+ protected int requestCount;
+
+ /** The test response. */
+ protected DriverResponse response;
+
+ /** The path where archive we want to deploy are. */
+ protected String archivePath;
+
+ /** The test parametrization. */
+ protected TestParametrization parametrization;
+
+ /**
+ * The test agent, normally only valid in the server side for now.
+ * It is transient so it is not marshalled when the context is popped on the client
by
+ * <code>TestDriverServer.popContext()</code>
+ * It is package protected so it can be set by the
<code>TestDriverServer.pushContext(...)</code> method.
+ */
+ public transient TestAgent testAgent;
+
+ /**
+ * Copy constructor.
+ */
+ public TestContext(TestContext that)
+ {
+ this.requestCount = that.requestCount;
+ this.archivePath = that.archivePath;
+ this.response = that.response;
+ this.parametrization = that.parametrization;
+ this.testAgent = that.testAgent;
+ }
+
+ /**
+ * Normally used on the client side.
+ */
+ public TestContext(int requestCount, String archivePath, TestParametrization
parametrization)
+ {
+ this.requestCount = requestCount;
+ this.archivePath = archivePath;
+ this.parametrization = parametrization;
+ this.testAgent = null;
+ }
+
+ public TestParametrization getParametrization()
+ {
+ return parametrization;
+ }
+
+ public String getArchivePath()
+ {
+ return archivePath;
+ }
+
+ /**
+ * Return the test count.
+ *
+ * @return the test count
+ */
+ public int getRequestCount()
+ {
+ return requestCount;
+ }
+
+ /**
+ * Return true if the request count is equals to the specified value.
+ *
+ * @param count the expected count
+ * @return true if the expected count is equals to the actual count
+ * @throws IllegalStateException
+ */
+ public boolean isRequestCount(int count)
+ {
+ return requestCount == count;
+ }
+
+ /**
+ * Return the response.
+ *
+ * @return the response of the test
+ */
+ public DriverResponse getResponse()
+ {
+ return response;
+ }
+
+ public void setResponse(DriverResponse response)
+ {
+ if (this.response != null)
+ {
+ throw new IllegalStateException("A response is already provided");
+ }
+ else
+ {
+ this.response = response;
+ }
+ }
+
+ /**
+ * @param url the url to rewrite
+ * @param nodeId the node id
+ * @return the rewritten url
+ * @throws java.net.MalformedURLException
+ * @throws IllegalArgumentException if the url is null or the node id not recognized
+ */
+ public String rewriteURLForNode(String url, NodeId nodeId) throws
MalformedURLException
+ {
+ if (url == null)
+ {
+ throw new IllegalArgumentException("No null URL accepted");
+ }
+ int port;
+ if (NodeId.DEFAULT.equals(nodeId))
+ {
+ port = 8080;
+ }
+ else if (NodeId.PORTS_01.equals(nodeId))
+ {
+ port = 8180;
+ }
+ else if (NodeId.PORTS_02.equals(nodeId))
+ {
+ port = 8280;
+ }
+ else
+ {
+ throw new IllegalArgumentException("Unknown node");
+ }
+ URL tmp;
+ if (url.startsWith("http://"))
+ {
+ tmp = new URL(url);
+ tmp = new URL(tmp.getProtocol(), tmp.getHost(), port, tmp.getFile());
+ }
+ else
+ {
+ tmp = new URL("http", "localhost", port, url);
+ }
+ return tmp.toString();
+ }
+
+ public void deploy(String archiveId) throws MalformedURLException,
IllegalStateException, DeploymentException
+ {
+ if (testAgent == null)
+ {
+ throw new IllegalStateException("No test agent to perform deploy");
+ }
+
+ //
+ File root = new File(archivePath);
+ File f = new File(root, archiveId);
+ URL url = f.toURL();
+ testAgent.deploy(url);
+ }
+
+ public void undeploy(String archiveId) throws MalformedURLException,
IllegalStateException, DeploymentException
+ {
+ if (testAgent == null)
+ {
+ throw new IllegalStateException("No test agent to perform deploy");
+ }
+
+ //
+ File root = new File(archivePath);
+ File f = new File(root, archiveId);
+ URL url = f.toURL();
+ testAgent.undeploy(url);
+ }
+
+ public String toString()
+ {
+ return "TestContext[" + requestCount + "]";
+ }
+}
Added:
trunk/test/src/main/org/jboss/portal/test/framework/driver/remote/TestConversation.java
===================================================================
---
trunk/test/src/main/org/jboss/portal/test/framework/driver/remote/TestConversation.java
(rev 0)
+++
trunk/test/src/main/org/jboss/portal/test/framework/driver/remote/TestConversation.java 2007-04-21
12:07:46 UTC (rev 7017)
@@ -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.framework.driver.remote;
+
+import org.jboss.portal.common.test.driver.DriverResponse;
+import org.jboss.portal.common.test.driver.DriverCommand;
+import org.jboss.portal.test.framework.driver.remote.command.RemoteDriverCommandContext;
+import
org.jboss.portal.test.framework.driver.remote.response.RemoteDriverResponseContext;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public abstract class TestConversation
+{
+
+ /** The test name. */
+ protected final String testId;
+
+ /** . */
+ protected final RemoteTestDriverClient driver;
+
+ protected TestConversation(RemoteTestDriverClient driver, String testId)
+ {
+ this.driver = driver;
+ this.testId = testId;
+ }
+
+ public final DriverResponse handleCommand(DriverCommand command) throws Exception
+ {
+ RemoteDriverCommandContext commandContext = createContext(command);
+
+ //
+ return handleCommand(commandContext);
+ }
+
+ /**
+ * Trigger an interaction with the server here.
+ *
+ * @param commandContext the command context
+ * @return the driver response
+ * @throws Exception for now any exception
+ */
+ public final DriverResponse handleCommand(RemoteDriverCommandContext commandContext)
throws Exception
+ {
+ RemoteDriverResponseContext respCtx = invoke(commandContext);
+
+ //
+ DriverCommand command = createCommand(respCtx);
+
+ //
+ if (command != null)
+ {
+ return handleCommand(command);
+ }
+ else
+ {
+ return respCtx.getResponse();
+ }
+ }
+
+ protected abstract RemoteDriverCommandContext createContext(DriverCommand command);
+
+ protected abstract RemoteDriverResponseContext invoke(RemoteDriverCommandContext
commandContext) throws Exception;
+
+ protected abstract DriverCommand createCommand(RemoteDriverResponseContext
responseContext) throws Exception;
+
+}
Added:
trunk/test/src/main/org/jboss/portal/test/framework/driver/remote/command/RemoteDriverCommandContext.java
===================================================================
---
trunk/test/src/main/org/jboss/portal/test/framework/driver/remote/command/RemoteDriverCommandContext.java
(rev 0)
+++
trunk/test/src/main/org/jboss/portal/test/framework/driver/remote/command/RemoteDriverCommandContext.java 2007-04-21
12:07:46 UTC (rev 7017)
@@ -0,0 +1,61 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.test.framework.driver.remote.command;
+
+import org.jboss.portal.common.test.driver.DriverCommand;
+import
org.jboss.portal.test.framework.driver.remote.response.RemoteDriverResponseContext;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class RemoteDriverCommandContext
+{
+
+ /** The previous response if not null. */
+ private RemoteDriverResponseContext responseContext;
+
+ /** The command to invoke. */
+ private DriverCommand command;
+
+ public RemoteDriverCommandContext(RemoteDriverResponseContext responseContext,
DriverCommand command)
+ {
+ this.responseContext = responseContext;
+ this.command = command;
+ }
+
+ public RemoteDriverCommandContext(DriverCommand command)
+ {
+ this.command = command;
+ }
+
+ public RemoteDriverResponseContext getResponseContext()
+ {
+ return responseContext;
+ }
+
+ public DriverCommand getCommand()
+ {
+ return command;
+ }
+}
Added:
trunk/test/src/main/org/jboss/portal/test/framework/driver/remote/response/RemoteDriverResponseContext.java
===================================================================
---
trunk/test/src/main/org/jboss/portal/test/framework/driver/remote/response/RemoteDriverResponseContext.java
(rev 0)
+++
trunk/test/src/main/org/jboss/portal/test/framework/driver/remote/response/RemoteDriverResponseContext.java 2007-04-21
12:07:46 UTC (rev 7017)
@@ -0,0 +1,46 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.test.framework.driver.remote.response;
+
+import org.jboss.portal.common.test.driver.DriverResponse;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class RemoteDriverResponseContext
+{
+
+ /** . */
+ private DriverResponse response;
+
+ public RemoteDriverResponseContext(DriverResponse response)
+ {
+ this.response = response;
+ }
+
+ public DriverResponse getResponse()
+ {
+ return response;
+ }
+}
Added: trunk/test/src/main/org/jboss/portal/test/framework/driver/web/WebTestCase.java
===================================================================
--- trunk/test/src/main/org/jboss/portal/test/framework/driver/web/WebTestCase.java
(rev 0)
+++
trunk/test/src/main/org/jboss/portal/test/framework/driver/web/WebTestCase.java 2007-04-21
12:07:46 UTC (rev 7017)
@@ -0,0 +1,81 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.test.framework.driver.web;
+
+import org.jboss.portal.test.framework.driver.remote.RemoteTestCase;
+import org.jboss.portal.test.framework.driver.remote.TestContext;
+import org.jboss.portal.test.framework.driver.web.response.GetPageResponse;
+import org.jboss.portal.common.test.driver.DriverResponse;
+import org.jboss.portal.common.test.driver.DriverCommand;
+import org.jboss.portal.common.test.driver.TestDriverException;
+import org.jboss.portal.common.test.driver.response.ErrorResponse;
+import org.jboss.portal.common.test.driver.command.StartTestCommand;
+
+/**
+ * Defines an http test case working from the server side point of view.
+ *
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 5636 $
+ */
+public abstract class WebTestCase extends RemoteTestCase
+{
+
+ /** The test path. */
+ protected final String path;
+
+ public WebTestCase(String testCaseId, String path)
+ {
+ super(testCaseId);
+
+ //
+ this.path = path;
+ }
+
+ /**
+ * The implementation will return an <code>GetPageResponse</code> response
in reaction to the <code>StartTestCommand</code>.
+ * All other commands will be delegated to the
<code>execute(DriverCommand,TestContext)</code>
+ */
+ public DriverResponse invoke(String testId, DriverCommand cmd) throws
TestDriverException
+ {
+ if (cmd instanceof StartTestCommand)
+ {
+ return new GetPageResponse(path);
+ }
+ else
+ {
+ try
+ {
+ return execute(cmd, context);
+ }
+ catch (Exception e)
+ {
+ return new ErrorResponse(e);
+ }
+ }
+ }
+
+ public DriverResponse execute(DriverCommand driverCommand, TestContext testContext)
throws Exception
+ {
+ return new ErrorResponse("No default implementation");
+ }
+}
Added:
trunk/test/src/main/org/jboss/portal/test/framework/driver/web/WebTestConversation.java
===================================================================
---
trunk/test/src/main/org/jboss/portal/test/framework/driver/web/WebTestConversation.java
(rev 0)
+++
trunk/test/src/main/org/jboss/portal/test/framework/driver/web/WebTestConversation.java 2007-04-21
12:07:46 UTC (rev 7017)
@@ -0,0 +1,166 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.test.framework.driver.web;
+
+import org.jboss.portal.test.framework.driver.remote.TestConversation;
+import org.jboss.portal.test.framework.driver.remote.TestContext;
+import org.jboss.portal.test.framework.driver.remote.RemoteTestDriver;
+import
org.jboss.portal.test.framework.driver.remote.response.RemoteDriverResponseContext;
+import org.jboss.portal.test.framework.driver.remote.command.RemoteDriverCommandContext;
+import org.jboss.portal.test.framework.driver.web.response.PerformClickResponse;
+import org.jboss.portal.test.framework.driver.web.response.WebDriverResponseContext;
+import org.jboss.portal.test.framework.driver.web.response.GetPageResponse;
+import org.jboss.portal.test.framework.driver.web.command.PerformClickCommand;
+import org.jboss.portal.test.framework.driver.web.command.WebDriverCommandContext;
+import org.jboss.portal.test.framework.driver.web.command.GetPageCommand;
+import org.jboss.portal.test.framework.server.Node;
+import org.jboss.portal.common.test.driver.DriverCommand;
+import org.jboss.portal.common.test.driver.DriverResponse;
+import org.jboss.portal.common.test.driver.command.StartTestCommand;
+import org.apache.log4j.Logger;
+import com.thoughtworks.selenium.Selenium;
+import com.thoughtworks.selenium.DefaultSelenium;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class WebTestConversation extends TestConversation
+{
+
+ /** . */
+ private final Logger log = Logger.getLogger(getClass());
+
+ /** . */
+ private final WebTestDriverClient driver;
+
+ /** The node to invoke. */
+ private Node node;
+
+ /** The request count for that session. */
+ private int requestCount;
+
+ /** . */
+ private Selenium selenium;
+
+ public WebTestConversation(WebTestDriverClient driver, String testId, Node node)
+ {
+ super(driver, testId);
+
+ //
+ this.node = node;
+ this.driver = driver;
+ }
+
+ protected RemoteDriverCommandContext createContext(DriverCommand command)
+ {
+ return new WebDriverCommandContext(command);
+ }
+
+ protected RemoteDriverResponseContext invoke(RemoteDriverCommandContext
commandContext) throws Exception
+ {
+ DriverCommand command = commandContext.getCommand();
+
+ //
+ if (command instanceof StartTestCommand)
+ {
+ requestCount = -1;
+ pushContext();
+ DriverResponse response = driver.getServer(node).invoke(testId, command);
+ return new WebDriverResponseContext(response);
+ }
+ else
+ {
+ if (command instanceof PerformClickCommand)
+ {
+ PerformClickCommand performClick = (PerformClickCommand)command;
+ String id = performClick.getId();
+ log.info("# Clicking element : " + node + " : " + id);
+ requestCount++;
+ pushContext();
+ selenium.click(id);
+ }
+ else if (command instanceof GetPageCommand)
+ {
+ GetPageCommand getPage = (GetPageCommand)command;
+ String uri = getPage.getURI();
+ log.info("# Getting page : " + node + " : " + uri);
+ requestCount++;
+ pushContext();
+ open(uri);
+ }
+
+ //
+ TestContext ctx = popContext();
+ DriverResponse response = ctx.getResponse();
+ return new WebDriverResponseContext(response);
+ }
+ }
+
+ protected DriverCommand createCommand(RemoteDriverResponseContext responseContext)
throws Exception
+ {
+ DriverResponse response = responseContext.getResponse();
+
+ //
+ if (response instanceof PerformClickResponse)
+ {
+ PerformClickResponse performClick = (PerformClickResponse)response;
+ return new PerformClickCommand(performClick.getId());
+ }
+ else if (response instanceof GetPageResponse)
+ {
+ GetPageResponse getPage = (GetPageResponse)response;
+ return new GetPageCommand(getPage.getURI());
+ }
+ else
+ {
+ return null;
+ }
+ }
+
+ private void open(String url)
+ {
+ if (selenium == null)
+ {
+ selenium = new DefaultSelenium("localhost", 12345,
"*firefox", url);
+ selenium.start();
+ }
+
+ //
+ selenium.open(url);
+ }
+
+ private void pushContext()
+ {
+ TestContext ctx = new TestContext(requestCount, driver.getArchivePath(), null);
+ log.info("# Updating test case context of : " + node + " : " +
ctx);
+ RemoteTestDriver agent = driver.getServer(node);
+ agent.pushContext(testId, ctx);
+ }
+
+ private TestContext popContext()
+ {
+ RemoteTestDriver agent = driver.getServer(node);
+ return agent.popContext(testId);
+ }
+}
Added:
trunk/test/src/main/org/jboss/portal/test/framework/driver/web/WebTestDriverClient.java
===================================================================
---
trunk/test/src/main/org/jboss/portal/test/framework/driver/web/WebTestDriverClient.java
(rev 0)
+++
trunk/test/src/main/org/jboss/portal/test/framework/driver/web/WebTestDriverClient.java 2007-04-21
12:07:46 UTC (rev 7017)
@@ -0,0 +1,39 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.test.framework.driver.web;
+
+import org.jboss.portal.test.framework.driver.remote.RemoteTestDriverClient;
+import org.jboss.portal.test.framework.driver.remote.TestConversation;
+import org.jboss.portal.test.framework.server.Node;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class WebTestDriverClient extends RemoteTestDriverClient
+{
+ protected TestConversation createConversation(String testId, Node node)
+ {
+ return new WebTestConversation(this, testId, node);
+ }
+}
Added:
trunk/test/src/main/org/jboss/portal/test/framework/driver/web/command/GetPageCommand.java
===================================================================
---
trunk/test/src/main/org/jboss/portal/test/framework/driver/web/command/GetPageCommand.java
(rev 0)
+++
trunk/test/src/main/org/jboss/portal/test/framework/driver/web/command/GetPageCommand.java 2007-04-21
12:07:46 UTC (rev 7017)
@@ -0,0 +1,44 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.test.framework.driver.web.command;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class GetPageCommand extends WebDriverCommand
+{
+
+ /** . */
+ private final String uri;
+
+ public GetPageCommand(String uri)
+ {
+ this.uri = uri;
+ }
+
+ public String getURI()
+ {
+ return uri;
+ }
+}
Added:
trunk/test/src/main/org/jboss/portal/test/framework/driver/web/command/PerformClickCommand.java
===================================================================
---
trunk/test/src/main/org/jboss/portal/test/framework/driver/web/command/PerformClickCommand.java
(rev 0)
+++
trunk/test/src/main/org/jboss/portal/test/framework/driver/web/command/PerformClickCommand.java 2007-04-21
12:07:46 UTC (rev 7017)
@@ -0,0 +1,46 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.test.framework.driver.web.command;
+
+import org.jboss.portal.common.test.driver.DriverCommand;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class PerformClickCommand extends DriverCommand
+{
+
+ /** . */
+ private final String id;
+
+ public PerformClickCommand(String id)
+ {
+ this.id = id;
+ }
+
+ public String getId()
+ {
+ return id;
+ }
+}
Added:
trunk/test/src/main/org/jboss/portal/test/framework/driver/web/command/WebDriverCommand.java
===================================================================
---
trunk/test/src/main/org/jboss/portal/test/framework/driver/web/command/WebDriverCommand.java
(rev 0)
+++
trunk/test/src/main/org/jboss/portal/test/framework/driver/web/command/WebDriverCommand.java 2007-04-21
12:07:46 UTC (rev 7017)
@@ -0,0 +1,33 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.test.framework.driver.web.command;
+
+import org.jboss.portal.common.test.driver.DriverCommand;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class WebDriverCommand extends DriverCommand
+{
+}
Added:
trunk/test/src/main/org/jboss/portal/test/framework/driver/web/command/WebDriverCommandContext.java
===================================================================
---
trunk/test/src/main/org/jboss/portal/test/framework/driver/web/command/WebDriverCommandContext.java
(rev 0)
+++
trunk/test/src/main/org/jboss/portal/test/framework/driver/web/command/WebDriverCommandContext.java 2007-04-21
12:07:46 UTC (rev 7017)
@@ -0,0 +1,44 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.test.framework.driver.web.command;
+
+import org.jboss.portal.test.framework.driver.remote.command.RemoteDriverCommandContext;
+import
org.jboss.portal.test.framework.driver.remote.response.RemoteDriverResponseContext;
+import org.jboss.portal.common.test.driver.DriverCommand;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class WebDriverCommandContext extends RemoteDriverCommandContext
+{
+ public WebDriverCommandContext(RemoteDriverResponseContext responseContext,
DriverCommand command)
+ {
+ super(responseContext, command);
+ }
+
+ public WebDriverCommandContext(DriverCommand command)
+ {
+ super(command);
+ }
+}
Added:
trunk/test/src/main/org/jboss/portal/test/framework/driver/web/response/GetPageResponse.java
===================================================================
---
trunk/test/src/main/org/jboss/portal/test/framework/driver/web/response/GetPageResponse.java
(rev 0)
+++
trunk/test/src/main/org/jboss/portal/test/framework/driver/web/response/GetPageResponse.java 2007-04-21
12:07:46 UTC (rev 7017)
@@ -0,0 +1,44 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.test.framework.driver.web.response;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class GetPageResponse extends WebDriverResponse
+{
+
+ /** . */
+ private final String uri;
+
+ public GetPageResponse(String uri)
+ {
+ this.uri = uri;
+ }
+
+ public String getURI()
+ {
+ return uri;
+ }
+}
Added:
trunk/test/src/main/org/jboss/portal/test/framework/driver/web/response/PerformClickResponse.java
===================================================================
---
trunk/test/src/main/org/jboss/portal/test/framework/driver/web/response/PerformClickResponse.java
(rev 0)
+++
trunk/test/src/main/org/jboss/portal/test/framework/driver/web/response/PerformClickResponse.java 2007-04-21
12:07:46 UTC (rev 7017)
@@ -0,0 +1,46 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.test.framework.driver.web.response;
+
+import org.jboss.portal.common.test.driver.DriverResponse;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class PerformClickResponse extends DriverResponse
+{
+
+ /** . */
+ private final String id;
+
+ public PerformClickResponse(String id)
+ {
+ this.id = id;
+ }
+
+ public String getId()
+ {
+ return id;
+ }
+}
Added:
trunk/test/src/main/org/jboss/portal/test/framework/driver/web/response/WebDriverResponse.java
===================================================================
---
trunk/test/src/main/org/jboss/portal/test/framework/driver/web/response/WebDriverResponse.java
(rev 0)
+++
trunk/test/src/main/org/jboss/portal/test/framework/driver/web/response/WebDriverResponse.java 2007-04-21
12:07:46 UTC (rev 7017)
@@ -0,0 +1,33 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.test.framework.driver.web.response;
+
+import org.jboss.portal.common.test.driver.DriverResponse;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class WebDriverResponse extends DriverResponse
+{
+}
Added:
trunk/test/src/main/org/jboss/portal/test/framework/driver/web/response/WebDriverResponseContext.java
===================================================================
---
trunk/test/src/main/org/jboss/portal/test/framework/driver/web/response/WebDriverResponseContext.java
(rev 0)
+++
trunk/test/src/main/org/jboss/portal/test/framework/driver/web/response/WebDriverResponseContext.java 2007-04-21
12:07:46 UTC (rev 7017)
@@ -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. *
+ ******************************************************************************/
+package org.jboss.portal.test.framework.driver.web.response;
+
+import
org.jboss.portal.test.framework.driver.remote.response.RemoteDriverResponseContext;
+import org.jboss.portal.common.test.driver.DriverResponse;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class WebDriverResponseContext extends RemoteDriverResponseContext
+{
+ public WebDriverResponseContext(DriverResponse response)
+ {
+ super(response);
+ }
+}
Modified: trunk/test/src/main/org/jboss/portal/test/framework/runner/BaseRunner.java
===================================================================
--- trunk/test/src/main/org/jboss/portal/test/framework/runner/BaseRunner.java 2007-04-20
20:59:43 UTC (rev 7016)
+++ trunk/test/src/main/org/jboss/portal/test/framework/runner/BaseRunner.java 2007-04-21
12:07:46 UTC (rev 7017)
@@ -27,7 +27,7 @@
import org.jboss.portal.test.framework.server.NodeId;
import org.jboss.portal.test.framework.TestRuntimeContext;
import org.jboss.portal.test.framework.ServiceLookup;
-import org.jboss.portal.test.framework.driver.http.HttpTestDriverClient;
+import org.jboss.portal.test.framework.driver.remote.RemoteTestDriverClient;
import org.jboss.portal.common.test.junit.JUnitAdapter;
import org.jboss.portal.common.test.TestParametrization;
import org.apache.log4j.Logger;
@@ -81,14 +81,36 @@
private Integer testCaseCount;
/** . */
- private ServiceLookup httpTestDriverServerLookup;
+ private ServiceLookup testDriverServerLookup;
/** . */
private ServiceLookup testAgentLookup;
+ /** . */
+ private RemoteTestDriverClient testDriverClient;
+
/** The node id list used for this test suite. */
private NodeId[] nodeIds;
+ public BaseRunner(String beansDescriptorLocation)
+ {
+ this(beansDescriptorLocation, new NodeId[]{NodeId.DEFAULT});
+ }
+
+ public BaseRunner(String beansDescriptorLocation, NodeId[] nodeIds)
+ {
+ this.runtimeContext = new TestRuntimeContext(beansDescriptorLocation);
+ this.runtimeContext.addBean("TestBean", this);
+ this.archivePath = System.getProperty("test.root");
+ this.state = STOPPED;
+ this.nodeIds = nodeIds;
+ }
+
+ public String getArchivePath()
+ {
+ return archivePath;
+ }
+
public Deployer getDeployer()
{
return deployer;
@@ -119,45 +141,26 @@
this.testAgentLookup = testAgentLookup;
}
- public ServiceLookup getHttpTestDriverServerLookup()
+ public ServiceLookup getTestDriverServerLookup()
{
- return httpTestDriverServerLookup;
+ return testDriverServerLookup;
}
- public void setHttpTestDriverServerLookup(ServiceLookup httpTestDriverServerLookup)
+ public void setTestDriverServerLookup(ServiceLookup testDriverServerLookup)
{
- this.httpTestDriverServerLookup = httpTestDriverServerLookup;
+ this.testDriverServerLookup = testDriverServerLookup;
}
- public BaseRunner()
+ public RemoteTestDriverClient getTestDriverClient()
{
- this("org/jboss/portal/test/framework/container/jboss-beans.xml", new
NodeId[]{NodeId.DEFAULT});
+ return testDriverClient;
}
- public BaseRunner(String beansDescriptorLocation)
+ public void setTestDriverClient(RemoteTestDriverClient testDriverClient)
{
- this(beansDescriptorLocation, new NodeId[]{NodeId.DEFAULT});
+ this.testDriverClient = testDriverClient;
}
- public BaseRunner(NodeId[] nodeIds)
- {
- this("org/jboss/portal/test/framework/container/jboss-beans.xml",
nodeIds);
- }
-
- public BaseRunner(String beansDescriptorLocation, NodeId[] nodeIds)
- {
- this.runtimeContext = new TestRuntimeContext(beansDescriptorLocation);
- this.runtimeContext.addBean("TestBean", this);
- this.archivePath = System.getProperty("test.root");
- this.state = STOPPED;
- this.nodeIds = nodeIds;
- }
-
- public String getArchivePath()
- {
- return archivePath;
- }
-
private void startContext() throws Exception
{
runtimeContext.start();
@@ -176,18 +179,17 @@
{
startContext();
- // Create driver
- HttpTestDriverClient driver = new HttpTestDriverClient();
- driver.setInitialNodeId(nodeIds[0]);
- driver.setArchivePath(archivePath);
- driver.setNodeManager(nodeManager);
- driver.setServerLookup(httpTestDriverServerLookup);
+ // Configure driver further more (todo find a way to do that int the bean
assembly)
+ testDriverClient.setInitialNodeId(nodeIds[0]);
+ testDriverClient.setArchivePath(archivePath);
+ testDriverClient.setNodeManager(nodeManager);
+ testDriverClient.setServerLookup(testDriverServerLookup);
// Get optional parametrization
TestParametrization parametrization = JUnitAdapter.getParametrization();
//
- adapter = new JUnitAdapter(driver, parametrization);
+ adapter = new JUnitAdapter(testDriverClient, parametrization);
state = STARTED;
}
finally
Copied: trunk/test/src/main/org/jboss/portal/test/framework/runner/HTTPTestRunner.java
(from rev 7009,
trunk/test/src/main/org/jboss/portal/test/framework/runner/ServerTestRunner.java)
===================================================================
--- trunk/test/src/main/org/jboss/portal/test/framework/runner/HTTPTestRunner.java
(rev 0)
+++
trunk/test/src/main/org/jboss/portal/test/framework/runner/HTTPTestRunner.java 2007-04-21
12:07:46 UTC (rev 7017)
@@ -0,0 +1,116 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.test.framework.runner;
+
+import org.jboss.portal.test.framework.server.NodeId;
+import org.jboss.portal.common.test.TestParametrization;
+import org.jboss.portal.common.test.junit.JUnitAdapter;
+import junit.framework.AssertionFailedError;
+
+import java.io.File;
+import java.net.MalformedURLException;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class HTTPTestRunner extends BaseRunner
+{
+
+ /** . */
+ public static final String JBOSS_BEANS_LOCATION =
"org/jboss/portal/test/framework/container/http-runner-beans.xml";
+
+ /** . */
+ private String archiveName;
+
+ public HTTPTestRunner()
+ {
+ super(JBOSS_BEANS_LOCATION);
+
+ //
+ init(null);
+ }
+
+ public HTTPTestRunner(NodeId[] nodeIds)
+ {
+ super(JBOSS_BEANS_LOCATION, nodeIds);
+
+ //
+ init(null);
+ }
+
+ public HTTPTestRunner(String archiveName)
+ {
+ super(JBOSS_BEANS_LOCATION);
+
+ //
+ init(archiveName);
+ }
+
+ public HTTPTestRunner(String archiveName, NodeId[] nodeIds)
+ {
+ super(JBOSS_BEANS_LOCATION, nodeIds);
+
+ //
+ init(archiveName);
+ }
+
+ private void init(String archiveName)
+ {
+ if (archiveName == null)
+ {
+ TestParametrization abc = JUnitAdapter.getParametrization();
+ this.archiveName = (String)abc.getParameterValue("archive").get();
+ }
+ else
+ {
+ this.archiveName = archiveName;
+ }
+ }
+
+ public void startRunner() throws Exception
+ {
+ File root = new File(getArchivePath());
+ File f = new File(root, archiveName);
+ deploy(f.toURL());
+ }
+
+ public void stopRunner()
+ {
+ try
+ {
+ File root = new File(getArchivePath());
+ File f = new File(root, archiveName);
+ undeploy(f.toURL());
+ }
+ catch (MalformedURLException e)
+ {
+ e.printStackTrace();
+ }
+ }
+
+ public void testDummy()
+ {
+ throw new AssertionFailedError("Test dummy should not be called, it's a
place holder so that running it from ant does not fail");
+ }
+}
Deleted: trunk/test/src/main/org/jboss/portal/test/framework/runner/ServerTestRunner.java
===================================================================
---
trunk/test/src/main/org/jboss/portal/test/framework/runner/ServerTestRunner.java 2007-04-20
20:59:43 UTC (rev 7016)
+++
trunk/test/src/main/org/jboss/portal/test/framework/runner/ServerTestRunner.java 2007-04-21
12:07:46 UTC (rev 7017)
@@ -1,103 +0,0 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2006, Red Hat Middleware, LLC, and individual *
- * contributors as indicated by the @authors tag. See the *
- * copyright.txt in the distribution for a full listing of *
- * individual contributors. *
- * *
- * This is free software; you can redistribute it and/or modify it *
- * under the terms of the GNU Lesser General Public License as *
- * published by the Free Software Foundation; either version 2.1 of *
- * the License, or (at your option) any later version. *
- * *
- * This software is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
- * Lesser General Public License for more details. *
- * *
- * You should have received a copy of the GNU Lesser General Public *
- * License along with this software; if not, write to the Free *
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
- ******************************************************************************/
-package org.jboss.portal.test.framework.runner;
-
-import org.jboss.portal.test.framework.server.NodeId;
-import org.jboss.portal.common.test.TestParametrization;
-import org.jboss.portal.common.test.junit.JUnitAdapter;
-import junit.framework.AssertionFailedError;
-
-import java.io.File;
-import java.net.MalformedURLException;
-
-/**
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 1.1 $
- */
-public class ServerTestRunner extends BaseRunner
-{
-
- /** . */
- private String archiveName;
-
- public ServerTestRunner()
- {
- init(null);
- }
-
- public ServerTestRunner(NodeId[] nodeIds)
- {
- super(nodeIds);
- init(null);
- }
-
- public ServerTestRunner(String archiveName)
- {
- init(archiveName);
- }
-
- public ServerTestRunner(String archiveName, NodeId[] nodeIds)
- {
- super(nodeIds);
- init(archiveName);
- }
-
- private void init(String archiveName)
- {
- if (archiveName == null)
- {
- TestParametrization abc = JUnitAdapter.getParametrization();
- this.archiveName = (String)abc.getParameterValue("archive").get();
- }
- else
- {
- this.archiveName = archiveName;
- }
- }
-
- public void startRunner() throws Exception
- {
- File root = new File(getArchivePath());
- File f = new File(root, archiveName);
- deploy(f.toURL());
- }
-
- public void stopRunner()
- {
- try
- {
- File root = new File(getArchivePath());
- File f = new File(root, archiveName);
- undeploy(f.toURL());
- }
- catch (MalformedURLException e)
- {
- e.printStackTrace();
- }
- }
-
- public void testDummy()
- {
- throw new AssertionFailedError("Test dummy should not be called, it's a
place holder so that running it from ant does not fail");
- }
-}
Added: trunk/test/src/main/org/jboss/portal/test/framework/runner/WebTestRunner.java
===================================================================
--- trunk/test/src/main/org/jboss/portal/test/framework/runner/WebTestRunner.java
(rev 0)
+++
trunk/test/src/main/org/jboss/portal/test/framework/runner/WebTestRunner.java 2007-04-21
12:07:46 UTC (rev 7017)
@@ -0,0 +1,117 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.test.framework.runner;
+
+import org.jboss.portal.test.framework.server.NodeId;
+import org.jboss.portal.common.test.TestParametrization;
+import org.jboss.portal.common.test.junit.JUnitAdapter;
+
+import java.io.File;
+import java.net.MalformedURLException;
+
+import junit.framework.AssertionFailedError;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class WebTestRunner extends BaseRunner
+{
+
+ /** . */
+ public static final String JBOSS_BEANS_LOCATION =
"org/jboss/portal/test/framework/container/web-runner-beans.xml";
+
+ /** . */
+ private String archiveName;
+
+ public WebTestRunner()
+ {
+ super(JBOSS_BEANS_LOCATION);
+
+ //
+ init(null);
+ }
+
+ public WebTestRunner(NodeId[] nodeIds)
+ {
+ super(JBOSS_BEANS_LOCATION, nodeIds);
+
+ //
+ init(null);
+ }
+
+ public WebTestRunner(String archiveName)
+ {
+ super(JBOSS_BEANS_LOCATION);
+
+ //
+ init(archiveName);
+ }
+
+ public WebTestRunner(String archiveName, NodeId[] nodeIds)
+ {
+ super(JBOSS_BEANS_LOCATION, nodeIds);
+
+ //
+ init(archiveName);
+ }
+
+ private void init(String archiveName)
+ {
+ if (archiveName == null)
+ {
+ TestParametrization abc = JUnitAdapter.getParametrization();
+ this.archiveName = (String)abc.getParameterValue("archive").get();
+ }
+ else
+ {
+ this.archiveName = archiveName;
+ }
+ }
+
+ public void startRunner() throws Exception
+ {
+ File root = new File(getArchivePath());
+ File f = new File(root, archiveName);
+ deploy(f.toURL());
+ }
+
+ public void stopRunner()
+ {
+ try
+ {
+ File root = new File(getArchivePath());
+ File f = new File(root, archiveName);
+ undeploy(f.toURL());
+ }
+ catch (MalformedURLException e)
+ {
+ e.printStackTrace();
+ }
+ }
+
+ public void testDummy()
+ {
+ throw new AssertionFailedError("Test dummy should not be called, it's a
place holder so that running it from ant does not fail");
+ }
+}
Added:
trunk/test/src/resources/portal-test-jar/org/jboss/portal/test/framework/container/http-runner-beans.xml
===================================================================
---
trunk/test/src/resources/portal-test-jar/org/jboss/portal/test/framework/container/http-runner-beans.xml
(rev 0)
+++
trunk/test/src/resources/portal-test-jar/org/jboss/portal/test/framework/container/http-runner-beans.xml 2007-04-21
12:07:46 UTC (rev 7017)
@@ -0,0 +1,200 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~ JBoss, a division of Red Hat ~
+ ~ Copyright 2006, Red Hat Middleware, LLC, and individual ~
+ ~ contributors as indicated by the @authors tag. See the ~
+ ~ copyright.txt in the distribution for a full listing of ~
+ ~ individual contributors. ~
+ ~ ~
+ ~ This is free software; you can redistribute it and/or modify it ~
+ ~ under the terms of the GNU Lesser General Public License as ~
+ ~ published by the Free Software Foundation; either version 2.1 of ~
+ ~ the License, or (at your option) any later version. ~
+ ~ ~
+ ~ This software is distributed in the hope that it will be useful, ~
+ ~ but WITHOUT ANY WARRANTY; without even the implied warranty of ~
+ ~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ~
+ ~ Lesser General Public License for more details. ~
+ ~ ~
+ ~ You should have received a copy of the GNU Lesser General Public ~
+ ~ License along with this software; if not, write to the Free ~
+ ~ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA ~
+ ~ 02110-1301 USA, or see the FSF site:
http://www.fsf.org. ~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+
+<deployment
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="urn:jboss:bean-deployer bean-deployer_1_0.xsd"
+ xmlns="urn:jboss:bean-deployer">
+
+ <bean name="MBeanServerFactory0"
class="org.jboss.portal.test.framework.jmx.MBeanServerFactory">
+ <property name="env">
+ <map class="java.util.Properties"
keyClass="java.lang.String" valueClass="java.lang.String">
+ <entry>
+ <key>java.naming.factory.initial</key>
+ <value>org.jnp.interfaces.NamingContextFactory</value>
+ </entry>
+ <entry>
+ <key>java.naming.provider.url</key>
+ <value>jnp://localhost:1099</value>
+ </entry>
+ <entry>
+ <key>java.naming.factory.url.pkgs</key>
+ <value>org.jboss.naming</value>
+ </entry>
+ </map>
+ </property>
+ </bean>
+
+ <bean name="MBeanServerFactory1"
class="org.jboss.portal.test.framework.jmx.MBeanServerFactory">
+ <property name="env">
+ <map class="java.util.Properties"
keyClass="java.lang.String" valueClass="java.lang.String">
+ <entry>
+ <key>java.naming.factory.initial</key>
+ <value>org.jnp.interfaces.NamingContextFactory</value>
+ </entry>
+ <entry>
+ <key>java.naming.provider.url</key>
+ <value>jnp://localhost:1199</value>
+ </entry>
+ <entry>
+ <key>java.naming.factory.url.pkgs</key>
+ <value>org.jboss.naming</value>
+ </entry>
+ </map>
+ </property>
+ </bean>
+
+ <bean name="MBeanServerFactory2"
class="org.jboss.portal.test.framework.jmx.MBeanServerFactory">
+ <property name="env">
+ <map class="java.util.Properties"
keyClass="java.lang.String" valueClass="java.lang.String">
+ <entry>
+ <key>java.naming.factory.initial</key>
+ <value>org.jnp.interfaces.NamingContextFactory</value>
+ </entry>
+ <entry>
+ <key>java.naming.provider.url</key>
+ <value>jnp://localhost:1299</value>
+ </entry>
+ <entry>
+ <key>java.naming.factory.url.pkgs</key>
+ <value>org.jboss.naming</value>
+ </entry>
+ </map>
+ </property>
+ </bean>
+
+ <bean name="Node0"
class="org.jboss.portal.test.framework.server.Node">
+ <constructor>
+ <parameter><value>default</value></parameter>
+ <parameter><inject bean="MBeanServerFactory0"
property="server"/></parameter>
+ <parameter name="jndiEnv">
+ <map class="java.util.Properties"
keyClass="java.lang.String" valueClass="java.lang.String">
+ <entry>
+ <key>java.naming.factory.initial</key>
+ <value>org.jnp.interfaces.NamingContextFactory</value>
+ </entry>
+ <entry>
+ <key>java.naming.provider.url</key>
+ <value>jnp://localhost:1099</value>
+ </entry>
+ <entry>
+ <key>java.naming.factory.url.pkgs</key>
+ <value>org.jboss.naming</value>
+ </entry>
+ </map>
+ </parameter>
+ </constructor>
+ </bean>
+
+ <bean name="Node1"
class="org.jboss.portal.test.framework.server.Node">
+ <constructor>
+ <parameter><value>ports-01</value></parameter>
+ <parameter><inject bean="MBeanServerFactory1"
property="server"/></parameter>
+ <parameter name="jndiEnv">
+ <map class="java.util.Properties"
keyClass="java.lang.String" valueClass="java.lang.String">
+ <entry>
+ <key>java.naming.factory.initial</key>
+ <value>org.jnp.interfaces.NamingContextFactory</value>
+ </entry>
+ <entry>
+ <key>java.naming.provider.url</key>
+ <value>jnp://localhost:1199</value>
+ </entry>
+ <entry>
+ <key>java.naming.factory.url.pkgs</key>
+ <value>org.jboss.naming</value>
+ </entry>
+ </map>
+ </parameter>
+ </constructor>
+ </bean>
+
+ <bean name="Node2"
class="org.jboss.portal.test.framework.server.Node">
+ <constructor>
+ <parameter><value>ports-02</value></parameter>
+ <parameter><inject bean="MBeanServerFactory2"
property="server"/></parameter>
+ <parameter name="jndiEnv">
+ <map class="java.util.Properties"
keyClass="java.lang.String" valueClass="java.lang.String">
+ <entry>
+ <key>java.naming.factory.initial</key>
+ <value>org.jnp.interfaces.NamingContextFactory</value>
+ </entry>
+ <entry>
+ <key>java.naming.provider.url</key>
+ <value>jnp://localhost:1299</value>
+ </entry>
+ <entry>
+ <key>java.naming.factory.url.pkgs</key>
+ <value>org.jboss.naming</value>
+ </entry>
+ </map>
+ </parameter>
+ </constructor>
+ </bean>
+
+ <bean name="TestDriverClient"
class="org.jboss.portal.test.framework.driver.http.HttpTestDriverClient">
+ <constructor>
+ </constructor>
+ </bean>
+
+ <bean name="TestDriverServerLookup"
class="org.jboss.portal.test.framework.JNDIServiceLookup">
+ <constructor>
+ <parameter><value>TestDriverServer</value></parameter>
+ </constructor>
+ </bean>
+
+ <bean name="TestAgentLookup"
class="org.jboss.portal.test.framework.JNDIServiceLookup">
+ <constructor>
+ <parameter><value>TestAgent</value></parameter>
+ </constructor>
+ </bean>
+
+ <bean name="NodeManager"
class="org.jboss.portal.test.framework.server.NodeManager">
+ <constructor>
+ <parameter>
+ <list>
+ <inject bean="Node0"/>
+ <inject bean="Node1"/>
+ <inject bean="Node2"/>
+ </list>
+ </parameter>
+ </constructor>
+ </bean>
+
+ <bean name="Deployer"
class="org.jboss.portal.test.framework.deployment.Deployer">
+ <property name="testAgentLookup"><inject
bean="TestAgentLookup"/></property>
+ </bean>
+
+ <bean name="TestBean"
class="org.jboss.portal.test.framework.runner.BaseRunner">
+ <constructor factoryMethod="getBean">
+ <factory bean="BeanFactory"/>
+ <parameter>TestBean</parameter>
+ </constructor>
+ <property name="deployer"><inject
bean="Deployer"/></property>
+ <property name="nodeManager"><inject
bean="NodeManager"/></property>
+ <property name="testAgentLookup"><inject
bean="TestAgentLookup"/></property>
+ <property name="testDriverServerLookup"><inject
bean="TestDriverServerLookup"/></property>
+ <property name="testDriverClient"><inject
bean="TestDriverClient"/></property>
+ </bean>
+</deployment>
Deleted:
trunk/test/src/resources/portal-test-jar/org/jboss/portal/test/framework/container/jboss-beans.xml
===================================================================
---
trunk/test/src/resources/portal-test-jar/org/jboss/portal/test/framework/container/jboss-beans.xml 2007-04-20
20:59:43 UTC (rev 7016)
+++
trunk/test/src/resources/portal-test-jar/org/jboss/portal/test/framework/container/jboss-beans.xml 2007-04-21
12:07:46 UTC (rev 7017)
@@ -1,194 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- ~ JBoss, a division of Red Hat ~
- ~ Copyright 2006, Red Hat Middleware, LLC, and individual ~
- ~ contributors as indicated by the @authors tag. See the ~
- ~ copyright.txt in the distribution for a full listing of ~
- ~ individual contributors. ~
- ~ ~
- ~ This is free software; you can redistribute it and/or modify it ~
- ~ under the terms of the GNU Lesser General Public License as ~
- ~ published by the Free Software Foundation; either version 2.1 of ~
- ~ the License, or (at your option) any later version. ~
- ~ ~
- ~ This software is distributed in the hope that it will be useful, ~
- ~ but WITHOUT ANY WARRANTY; without even the implied warranty of ~
- ~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ~
- ~ Lesser General Public License for more details. ~
- ~ ~
- ~ You should have received a copy of the GNU Lesser General Public ~
- ~ License along with this software; if not, write to the Free ~
- ~ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA ~
- ~ 02110-1301 USA, or see the FSF site:
http://www.fsf.org. ~
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
-
-<deployment
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="urn:jboss:bean-deployer bean-deployer_1_0.xsd"
- xmlns="urn:jboss:bean-deployer">
-
- <bean name="MBeanServerFactory0"
class="org.jboss.portal.test.framework.jmx.MBeanServerFactory">
- <property name="env">
- <map class="java.util.Properties"
keyClass="java.lang.String" valueClass="java.lang.String">
- <entry>
- <key>java.naming.factory.initial</key>
- <value>org.jnp.interfaces.NamingContextFactory</value>
- </entry>
- <entry>
- <key>java.naming.provider.url</key>
- <value>jnp://localhost:1099</value>
- </entry>
- <entry>
- <key>java.naming.factory.url.pkgs</key>
- <value>org.jboss.naming</value>
- </entry>
- </map>
- </property>
- </bean>
-
- <bean name="MBeanServerFactory1"
class="org.jboss.portal.test.framework.jmx.MBeanServerFactory">
- <property name="env">
- <map class="java.util.Properties"
keyClass="java.lang.String" valueClass="java.lang.String">
- <entry>
- <key>java.naming.factory.initial</key>
- <value>org.jnp.interfaces.NamingContextFactory</value>
- </entry>
- <entry>
- <key>java.naming.provider.url</key>
- <value>jnp://localhost:1199</value>
- </entry>
- <entry>
- <key>java.naming.factory.url.pkgs</key>
- <value>org.jboss.naming</value>
- </entry>
- </map>
- </property>
- </bean>
-
- <bean name="MBeanServerFactory2"
class="org.jboss.portal.test.framework.jmx.MBeanServerFactory">
- <property name="env">
- <map class="java.util.Properties"
keyClass="java.lang.String" valueClass="java.lang.String">
- <entry>
- <key>java.naming.factory.initial</key>
- <value>org.jnp.interfaces.NamingContextFactory</value>
- </entry>
- <entry>
- <key>java.naming.provider.url</key>
- <value>jnp://localhost:1299</value>
- </entry>
- <entry>
- <key>java.naming.factory.url.pkgs</key>
- <value>org.jboss.naming</value>
- </entry>
- </map>
- </property>
- </bean>
-
- <bean name="Node0"
class="org.jboss.portal.test.framework.server.Node">
- <constructor>
- <parameter><value>default</value></parameter>
- <parameter><inject bean="MBeanServerFactory0"
property="server"/></parameter>
- <parameter name="jndiEnv">
- <map class="java.util.Properties"
keyClass="java.lang.String" valueClass="java.lang.String">
- <entry>
- <key>java.naming.factory.initial</key>
- <value>org.jnp.interfaces.NamingContextFactory</value>
- </entry>
- <entry>
- <key>java.naming.provider.url</key>
- <value>jnp://localhost:1099</value>
- </entry>
- <entry>
- <key>java.naming.factory.url.pkgs</key>
- <value>org.jboss.naming</value>
- </entry>
- </map>
- </parameter>
- </constructor>
- </bean>
-
- <bean name="Node1"
class="org.jboss.portal.test.framework.server.Node">
- <constructor>
- <parameter><value>ports-01</value></parameter>
- <parameter><inject bean="MBeanServerFactory1"
property="server"/></parameter>
- <parameter name="jndiEnv">
- <map class="java.util.Properties"
keyClass="java.lang.String" valueClass="java.lang.String">
- <entry>
- <key>java.naming.factory.initial</key>
- <value>org.jnp.interfaces.NamingContextFactory</value>
- </entry>
- <entry>
- <key>java.naming.provider.url</key>
- <value>jnp://localhost:1199</value>
- </entry>
- <entry>
- <key>java.naming.factory.url.pkgs</key>
- <value>org.jboss.naming</value>
- </entry>
- </map>
- </parameter>
- </constructor>
- </bean>
-
- <bean name="Node2"
class="org.jboss.portal.test.framework.server.Node">
- <constructor>
- <parameter><value>ports-02</value></parameter>
- <parameter><inject bean="MBeanServerFactory2"
property="server"/></parameter>
- <parameter name="jndiEnv">
- <map class="java.util.Properties"
keyClass="java.lang.String" valueClass="java.lang.String">
- <entry>
- <key>java.naming.factory.initial</key>
- <value>org.jnp.interfaces.NamingContextFactory</value>
- </entry>
- <entry>
- <key>java.naming.provider.url</key>
- <value>jnp://localhost:1299</value>
- </entry>
- <entry>
- <key>java.naming.factory.url.pkgs</key>
- <value>org.jboss.naming</value>
- </entry>
- </map>
- </parameter>
- </constructor>
- </bean>
-
- <bean name="HttpTestDriverServerLookup"
class="org.jboss.portal.test.framework.JNDIServiceLookup">
- <constructor>
-
<parameter><value>HttpTestDriverServer</value></parameter>
- </constructor>
- </bean>
-
- <bean name="TestAgentLookup"
class="org.jboss.portal.test.framework.JNDIServiceLookup">
- <constructor>
- <parameter><value>TestAgent</value></parameter>
- </constructor>
- </bean>
-
- <bean name="NodeManager"
class="org.jboss.portal.test.framework.server.NodeManager">
- <constructor>
- <parameter>
- <list>
- <inject bean="Node0"/>
- <inject bean="Node1"/>
- <inject bean="Node2"/>
- </list>
- </parameter>
- </constructor>
- </bean>
-
- <bean name="Deployer"
class="org.jboss.portal.test.framework.deployment.Deployer">
- <property name="testAgentLookup"><inject
bean="TestAgentLookup"/></property>
- </bean>
-
- <bean name="TestBean"
class="org.jboss.portal.test.framework.runner.BaseRunner">
- <constructor factoryMethod="getBean">
- <factory bean="BeanFactory"/>
- <parameter>TestBean</parameter>
- </constructor>
- <property name="deployer"><inject
bean="Deployer"/></property>
- <property name="nodeManager"><inject
bean="NodeManager"/></property>
- <property name="testAgentLookup"><inject
bean="TestAgentLookup"/></property>
- <property name="httpTestDriverServerLookup"><inject
bean="HttpTestDriverServerLookup"/></property>
- </bean>
-</deployment>
Added:
trunk/test/src/resources/portal-test-jar/org/jboss/portal/test/framework/container/web-runner-beans.xml
===================================================================
---
trunk/test/src/resources/portal-test-jar/org/jboss/portal/test/framework/container/web-runner-beans.xml
(rev 0)
+++
trunk/test/src/resources/portal-test-jar/org/jboss/portal/test/framework/container/web-runner-beans.xml 2007-04-21
12:07:46 UTC (rev 7017)
@@ -0,0 +1,200 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~ JBoss, a division of Red Hat ~
+ ~ Copyright 2006, Red Hat Middleware, LLC, and individual ~
+ ~ contributors as indicated by the @authors tag. See the ~
+ ~ copyright.txt in the distribution for a full listing of ~
+ ~ individual contributors. ~
+ ~ ~
+ ~ This is free software; you can redistribute it and/or modify it ~
+ ~ under the terms of the GNU Lesser General Public License as ~
+ ~ published by the Free Software Foundation; either version 2.1 of ~
+ ~ the License, or (at your option) any later version. ~
+ ~ ~
+ ~ This software is distributed in the hope that it will be useful, ~
+ ~ but WITHOUT ANY WARRANTY; without even the implied warranty of ~
+ ~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ~
+ ~ Lesser General Public License for more details. ~
+ ~ ~
+ ~ You should have received a copy of the GNU Lesser General Public ~
+ ~ License along with this software; if not, write to the Free ~
+ ~ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA ~
+ ~ 02110-1301 USA, or see the FSF site:
http://www.fsf.org. ~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+
+<deployment
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="urn:jboss:bean-deployer bean-deployer_1_0.xsd"
+ xmlns="urn:jboss:bean-deployer">
+
+ <bean name="MBeanServerFactory0"
class="org.jboss.portal.test.framework.jmx.MBeanServerFactory">
+ <property name="env">
+ <map class="java.util.Properties"
keyClass="java.lang.String" valueClass="java.lang.String">
+ <entry>
+ <key>java.naming.factory.initial</key>
+ <value>org.jnp.interfaces.NamingContextFactory</value>
+ </entry>
+ <entry>
+ <key>java.naming.provider.url</key>
+ <value>jnp://localhost:1099</value>
+ </entry>
+ <entry>
+ <key>java.naming.factory.url.pkgs</key>
+ <value>org.jboss.naming</value>
+ </entry>
+ </map>
+ </property>
+ </bean>
+
+ <bean name="MBeanServerFactory1"
class="org.jboss.portal.test.framework.jmx.MBeanServerFactory">
+ <property name="env">
+ <map class="java.util.Properties"
keyClass="java.lang.String" valueClass="java.lang.String">
+ <entry>
+ <key>java.naming.factory.initial</key>
+ <value>org.jnp.interfaces.NamingContextFactory</value>
+ </entry>
+ <entry>
+ <key>java.naming.provider.url</key>
+ <value>jnp://localhost:1199</value>
+ </entry>
+ <entry>
+ <key>java.naming.factory.url.pkgs</key>
+ <value>org.jboss.naming</value>
+ </entry>
+ </map>
+ </property>
+ </bean>
+
+ <bean name="MBeanServerFactory2"
class="org.jboss.portal.test.framework.jmx.MBeanServerFactory">
+ <property name="env">
+ <map class="java.util.Properties"
keyClass="java.lang.String" valueClass="java.lang.String">
+ <entry>
+ <key>java.naming.factory.initial</key>
+ <value>org.jnp.interfaces.NamingContextFactory</value>
+ </entry>
+ <entry>
+ <key>java.naming.provider.url</key>
+ <value>jnp://localhost:1299</value>
+ </entry>
+ <entry>
+ <key>java.naming.factory.url.pkgs</key>
+ <value>org.jboss.naming</value>
+ </entry>
+ </map>
+ </property>
+ </bean>
+
+ <bean name="Node0"
class="org.jboss.portal.test.framework.server.Node">
+ <constructor>
+ <parameter><value>default</value></parameter>
+ <parameter><inject bean="MBeanServerFactory0"
property="server"/></parameter>
+ <parameter name="jndiEnv">
+ <map class="java.util.Properties"
keyClass="java.lang.String" valueClass="java.lang.String">
+ <entry>
+ <key>java.naming.factory.initial</key>
+ <value>org.jnp.interfaces.NamingContextFactory</value>
+ </entry>
+ <entry>
+ <key>java.naming.provider.url</key>
+ <value>jnp://localhost:1099</value>
+ </entry>
+ <entry>
+ <key>java.naming.factory.url.pkgs</key>
+ <value>org.jboss.naming</value>
+ </entry>
+ </map>
+ </parameter>
+ </constructor>
+ </bean>
+
+ <bean name="Node1"
class="org.jboss.portal.test.framework.server.Node">
+ <constructor>
+ <parameter><value>ports-01</value></parameter>
+ <parameter><inject bean="MBeanServerFactory1"
property="server"/></parameter>
+ <parameter name="jndiEnv">
+ <map class="java.util.Properties"
keyClass="java.lang.String" valueClass="java.lang.String">
+ <entry>
+ <key>java.naming.factory.initial</key>
+ <value>org.jnp.interfaces.NamingContextFactory</value>
+ </entry>
+ <entry>
+ <key>java.naming.provider.url</key>
+ <value>jnp://localhost:1199</value>
+ </entry>
+ <entry>
+ <key>java.naming.factory.url.pkgs</key>
+ <value>org.jboss.naming</value>
+ </entry>
+ </map>
+ </parameter>
+ </constructor>
+ </bean>
+
+ <bean name="Node2"
class="org.jboss.portal.test.framework.server.Node">
+ <constructor>
+ <parameter><value>ports-02</value></parameter>
+ <parameter><inject bean="MBeanServerFactory2"
property="server"/></parameter>
+ <parameter name="jndiEnv">
+ <map class="java.util.Properties"
keyClass="java.lang.String" valueClass="java.lang.String">
+ <entry>
+ <key>java.naming.factory.initial</key>
+ <value>org.jnp.interfaces.NamingContextFactory</value>
+ </entry>
+ <entry>
+ <key>java.naming.provider.url</key>
+ <value>jnp://localhost:1299</value>
+ </entry>
+ <entry>
+ <key>java.naming.factory.url.pkgs</key>
+ <value>org.jboss.naming</value>
+ </entry>
+ </map>
+ </parameter>
+ </constructor>
+ </bean>
+
+ <bean name="TestDriverClient"
class="org.jboss.portal.test.framework.driver.web.WebTestDriverClient">
+ <constructor>
+ </constructor>
+ </bean>
+
+ <bean name="TestDriverServerLookup"
class="org.jboss.portal.test.framework.JNDIServiceLookup">
+ <constructor>
+ <parameter><value>TestDriverServer</value></parameter>
+ </constructor>
+ </bean>
+
+ <bean name="TestAgentLookup"
class="org.jboss.portal.test.framework.JNDIServiceLookup">
+ <constructor>
+ <parameter><value>TestAgent</value></parameter>
+ </constructor>
+ </bean>
+
+ <bean name="NodeManager"
class="org.jboss.portal.test.framework.server.NodeManager">
+ <constructor>
+ <parameter>
+ <list>
+ <inject bean="Node0"/>
+ <inject bean="Node1"/>
+ <inject bean="Node2"/>
+ </list>
+ </parameter>
+ </constructor>
+ </bean>
+
+ <bean name="Deployer"
class="org.jboss.portal.test.framework.deployment.Deployer">
+ <property name="testAgentLookup"><inject
bean="TestAgentLookup"/></property>
+ </bean>
+
+ <bean name="TestBean"
class="org.jboss.portal.test.framework.runner.BaseRunner">
+ <constructor factoryMethod="getBean">
+ <factory bean="BeanFactory"/>
+ <parameter>TestBean</parameter>
+ </constructor>
+ <property name="deployer"><inject
bean="Deployer"/></property>
+ <property name="nodeManager"><inject
bean="NodeManager"/></property>
+ <property name="testAgentLookup"><inject
bean="TestAgentLookup"/></property>
+ <property name="testDriverServerLookup"><inject
bean="TestDriverServerLookup"/></property>
+ <property name="testDriverClient"><inject
bean="TestDriverClient"/></property>
+ </bean>
+</deployment>
Modified: trunk/theme/build.xml
===================================================================
--- trunk/theme/build.xml 2007-04-20 20:59:43 UTC (rev 7016)
+++ trunk/theme/build.xml 2007-04-21 12:07:46 UTC (rev 7017)
@@ -113,6 +113,7 @@
<path refid="jboss.portal-jems.classpath"/>
<path refid="jboss.portal-server.classpath"/>
<path refid="jboss.portal-portlet.classpath"/>
+ <path refid="jboss.portal-test.classpath"/>
</path>
<!--+=======================================+-->
@@ -236,6 +237,8 @@
<fileset dir="${jboss.portal-web.root}/lib"
includes="portal-web-lib.jar"/>
<fileset dir="${jboss.portlet-api.root}/lib"
includes="portal-api-lib.jar"/>
<fileset dir="${jboss.portal-theme.root}/lib"
includes="portal-theme-lib.jar"/>
+ <fileset dir="${jboss.portal-test.root}/lib"
includes="portal-test-lib.jar"/>
+ <fileset dir="${jboss.portal-test.root}/lib/../.."
includes="selenium-java-client-driver-backport.jar"/>
<fileset dir="${build.lib}"
includes="portal-theme-test-lib.jar"/>
<fileset dir="${junit.junit.lib}"
includes="junit.jar"/>
</jar>
@@ -293,4 +296,50 @@
-->
</target>
+ <target name="test" depends="init">
+ <property name="build.testlog"
value="${module.output}/log"/>
+ <execute-tests>
+ <x-sysproperty>
+ <sysproperty key="test.root"
value="${build.lib}"/>
+<!--
+ <jvmarg value="-Xdebug"/>
+ <jvmarg
value="-Xrunjdwp:transport=dt_socket,address=7878,server=y,suspend=y"/>
+-->
+ </x-sysproperty>
+ <x-test>
+ <test todir="${test.reports}"
name="org.jboss.portal.test.theme.ThemeTestRunner"/>
+ </x-test>
+ <x-classpath>
+ <path refid="jboss/jbossretro.rt.classpath"/>
+ <path refid="jboss.serialization.classpath"/>
+ <path refid="jboss.remoting.classpath"/>
+ <path refid="jboss.microcontainer.classpath"/>
+ <path refid="oswego.concurrent.classpath"/>
+ <path refid="jboss.jbossxb.classpath"/>
+ <path refid="apache.xerces.classpath"/>
+ <path refid="jbossas/core.libs.classpath"/>
+ <path refid="apache.ant.classpath"/>
+ <path refid="apache.log4j.classpath"/>
+ <path refid="apache.httpclient.classpath"/>
+ <path refid="apache.logging.classpath"/>
+ <path refid="junit.junit.classpath"/>
+ <path refid="jsunit.jsunit.classpath"/>
+ <path refid="jetty.jetty.classpath"/>
+ <path refid="sun.servlet.classpath"/>
+ <path refid="sun.jaf.classpath"/>
+ <path refid="jboss.portal-common.classpath"/>
+ <path refid="jboss.portal-server.classpath"/>
+ <path refid="jboss.portal-jems.classpath"/>
+ <path refid="jboss.portal-test.classpath"/>
+ <path refid="jboss.portal-theme.classpath"/>
+ <path refid="jboss.portlet-api.classpath"/>
+ <pathelement location="${build.resources}/test"/>
+ <pathelement location="${build.resources}/hibernate"/>
+ <pathelement location="${jboss.portal-test.root}/etc"/>
+ <pathelement
location="${build.lib}/portal-theme-test-lib.jar"/>
+ <pathelement
location="${jboss.portal-test.root}/lib/../../selenium-java-client-driver-backport.jar"/>
+ </x-classpath>
+ </execute-tests>
+ </target>
+
</project>
Modified: trunk/theme/src/main/org/jboss/portal/test/theme/DynaTest.java
===================================================================
--- trunk/theme/src/main/org/jboss/portal/test/theme/DynaTest.java 2007-04-20 20:59:43 UTC
(rev 7016)
+++ trunk/theme/src/main/org/jboss/portal/test/theme/DynaTest.java 2007-04-21 12:07:46 UTC
(rev 7017)
@@ -23,6 +23,8 @@
package org.jboss.portal.test.theme;
import org.jboss.portal.common.junit.ExtendedAssert;
+import org.jboss.portal.common.test.driver.DriverResponse;
+import org.jboss.portal.common.test.driver.response.EndTestResponse;
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
@@ -31,6 +33,7 @@
public class DynaTest extends ExtendedAssert
{
+ /** . */
private final String id;
public DynaTest(String id)
@@ -43,12 +46,13 @@
return id;
}
- public void init(TestContext testContext)
+ public void init(DynaTestContext dynaTestContext)
{
}
- public void invoke(RequestContext requestContext)
+ public DriverResponse invoke(RequestContext requestContext)
{
+ return new EndTestResponse();
}
public void destroy()
Copied: trunk/theme/src/main/org/jboss/portal/test/theme/DynaTestContext.java (from rev
7009, trunk/theme/src/main/org/jboss/portal/test/theme/TestContext.java)
===================================================================
--- trunk/theme/src/main/org/jboss/portal/test/theme/DynaTestContext.java
(rev 0)
+++ trunk/theme/src/main/org/jboss/portal/test/theme/DynaTestContext.java 2007-04-21
12:07:46 UTC (rev 7017)
@@ -0,0 +1,393 @@
+/******************************************************************************
+ * 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.theme;
+
+import org.jboss.portal.theme.page.WindowResult;
+import org.jboss.portal.theme.page.PageResult;
+import org.jboss.portal.theme.page.WindowContext;
+import org.jboss.portal.theme.page.Region;
+import org.jboss.portal.theme.render.ThemeContext;
+import org.jboss.portal.theme.render.RendererContext;
+import org.jboss.portal.theme.render.RenderException;
+import org.jboss.portal.theme.render.renderer.PageRendererContext;
+import org.jboss.portal.theme.render.renderer.RegionRendererContext;
+import org.jboss.portal.theme.render.renderer.WindowRendererContext;
+import org.jboss.portal.theme.impl.render.dynamic.DynaConstants;
+import org.jboss.portal.theme.impl.render.dynamic.JSONMarshaller;
+import org.jboss.portal.theme.impl.render.dynamic.response.UpdatePageStateResponse;
+import org.jboss.portal.theme.ThemeConstants;
+import org.jboss.portal.theme.LayoutService;
+import org.jboss.portal.theme.ThemeService;
+import org.jboss.portal.theme.PortalRenderSet;
+import org.jboss.portal.theme.PortalLayout;
+import org.jboss.portal.theme.PortalTheme;
+import org.jboss.portal.test.theme.model.WindowObject;
+import org.jboss.portal.test.theme.model.PageObject;
+import org.jboss.portal.test.theme.model.RenderedObjectContextFactory;
+import org.jboss.portal.test.theme.model.RenderedObjectContext;
+import org.jboss.portal.test.theme.model.RenderedObject;
+import org.jboss.portal.test.theme.model.ObjectChange;
+import org.jboss.portal.test.framework.driver.web.WebTestCase;
+import org.jboss.portal.common.util.MarkupInfo;
+import org.jboss.portal.common.util.MediaType;
+import org.jboss.portal.common.util.IteratorStatus;
+import org.jboss.portal.common.test.driver.DriverResponse;
+import org.jboss.portal.common.test.driver.DriverCommand;
+import org.jboss.portal.common.test.driver.TestDriverException;
+import org.jboss.portal.common.test.driver.response.FailureResponse;
+import org.jboss.portal.common.test.driver.command.StartTestCommand;
+import org.jboss.portal.web.ServletContextDispatcher;
+import org.jboss.portal.web.spi.ServletContainerContext;
+import org.jboss.mx.util.MBeanServerLocator;
+import org.jboss.mx.util.MBeanProxy;
+import org.jboss.mx.util.MBeanProxyCreationException;
+
+import javax.management.MBeanServer;
+import javax.management.ObjectName;
+import javax.management.MalformedObjectNameException;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.ArrayList;
+import java.io.StringWriter;
+import java.io.IOException;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class DynaTestContext extends WebTestCase
+{
+
+ private final RenderedObjectContextFactory contextFactory = new
RenderedObjectContextFactory()
+ {
+ public RenderedObjectContext createContext(final RenderedObject object)
+ {
+ return new RenderedObjectContext()
+ {
+ public void addChange(ObjectChange change)
+ {
+ records.add(new ChangeRecord(object, change));
+ }
+ };
+ }
+ };
+
+ /** . */
+ private PageObject page;
+
+ /** The changes. */
+ private final List records = new ArrayList();
+
+ /** . */
+ final DynaTest test;
+
+ /** . */
+ private final TestServlet servlet;
+
+ /** . */
+ ServletContainerContext servletContainerContext;
+
+ /** . */
+ LayoutService layoutService;
+
+ /** . */
+ ThemeService themeService;
+
+ /** . */
+ PortalRenderSet renderSet;
+
+ /** . */
+ PortalLayout layout;
+
+ /** . */
+ PortalTheme theme;
+
+ public DynaTestContext(TestServlet servlet, DynaTest test, String path)
+ {
+ super(test.getId(), path);
+
+ //
+ this.servlet = servlet;
+ this.test = test;
+ }
+
+ public DriverResponse invoke(String testId, DriverCommand cmd) throws
TestDriverException
+ {
+ if (cmd instanceof StartTestCommand)
+ {
+ // Setup on servlet
+ servlet.testContext = this;
+
+ // Init services
+ try
+ {
+ MBeanServer mbeanServer = MBeanServerLocator.locateJBoss();
+ servletContainerContext =
(ServletContainerContext)MBeanProxy.get(ServletContainerContext.class, new
ObjectName("portal:service=ServletContainerContext"), mbeanServer);
+ layoutService = (LayoutService)MBeanProxy.get(LayoutService.class, new
ObjectName("portal:service=LayoutService"), mbeanServer);
+ themeService = (ThemeService)MBeanProxy.get(ThemeService.class, new
ObjectName("portal:service=ThemeService"), mbeanServer);
+ renderSet = layoutService.getRenderSet("testRenderer",
MediaType.HTML);
+ layout = layoutService.getLayout("generic", true);
+ theme = themeService.getTheme("testTheme", true);
+
+ //
+ page = new PageObject(contextFactory);
+ page.setProperty(ThemeConstants.PORTAL_PROP_THEME,
theme.getThemeInfo().getName());
+ page.setProperty(ThemeConstants.PORTAL_PROP_RENDERSET, renderSet.getName());
+ page.setProperty(ThemeConstants.PORTAL_PROP_LAYOUT,
layout.getLayoutInfo().getName());
+
+ //
+ test.init(this);
+ }
+ catch (Exception e)
+ {
+ return new FailureResponse(e);
+ }
+ }
+
+ //
+ return super.invoke(testId, cmd);
+ }
+
+ public PageObject getPage()
+ {
+ return page;
+ }
+
+ void invoke(RequestContext requestContext) throws RenderException, IOException
+ {
+ // Invoke
+ DriverResponse response = test.invoke(requestContext);
+
+ // Set response on context
+ if (response != null)
+ {
+ context.setResponse(response);
+ }
+
+ //
+ if (requestContext.getPhase().getLifeCycle() == TestPhase.RENDER_LIFE_CYCLE)
+ {
+ if (requestContext.isAsync())
+ {
+ handleAsync(requestContext);
+ }
+ else
+ {
+ renderPage(requestContext);
+ }
+
+ // Clear changes now
+ records.clear();
+ }
+ else
+ {
+ // Nothing special to do for now
+ }
+ }
+
+ int getRequestCount()
+ {
+ return context.getRequestCount();
+ }
+
+ private void handleAsync(RequestContext requestContext) throws RenderException,
IOException
+ {
+ MarkupInfo markupInfo = new MarkupInfo(MediaType.HTML, "UTF-8");
+ ServletContextDispatcher dispatcher = new
ServletContextDispatcher(requestContext.request, requestContext.response,
servletContainerContext);
+ ThemeContext themeContext = new ThemeContext(theme, themeService);
+
+ //
+ UpdatePageStateResponse resp = new UpdatePageStateResponse(null);
+
+ //
+ page.setProperty(DynaConstants.RESOURCE_BASE_URL,
requestContext.request.getContextPath() + "/dyna");
+ page.setProperty(DynaConstants.SERVER_BASE_URL,
requestContext.request.getContextPath() + requestContext.request.getServletPath());
+
+ //
+ for (int i = 0;i < records.size();i++)
+ {
+ ChangeRecord record = (ChangeRecord)records.get(i);
+
+ // For now only that use case exist, so it's ok...
+ WindowObject window = (WindowObject)record.source;
+
+ //
+ StringWriter buffer = new StringWriter();
+ RendererContext rendererCtx = layout.getRenderContext(themeContext, markupInfo,
dispatcher, buffer);
+ rendererCtx.pushObjectRenderContext(page.getRendererContext());
+ rendererCtx.pushObjectRenderContext(window.getRegion().getRendererContext());
+ rendererCtx.render(window.getRendererContext());
+
+ //
+ resp.addFragment(window.getId(), buffer.toString());
+ }
+
+ //
+ JSONMarshaller marshaller = new JSONMarshaller();
+ requestContext.response.setContentType("text/xml");
+ marshaller.write(resp, requestContext.response.getWriter());
+ }
+
+ /**
+ * Renders the page fully in the resposne provided by the request context.
+ */
+ private void renderPage(RequestContext requestContext) throws RenderException
+ {
+ requestContext.response.setContentType("text/html");
+
+ MarkupInfo markupInfo = new MarkupInfo(MediaType.HTML, "UTF-8");
+ ServletContextDispatcher dispatcher = new
ServletContextDispatcher(requestContext.request, requestContext.response,
servletContainerContext);
+ ThemeContext themeContext = new ThemeContext(theme, themeService);
+
+ // Build a page structure
+ PageResult pageRenderCtx = createResult(page.getRendererContext());
+
+ //
+ pageRenderCtx.getPageProperties().put(DynaConstants.RESOURCE_BASE_URL,
requestContext.request.getContextPath() + "/dyna");
+ pageRenderCtx.getPageProperties().put(DynaConstants.SERVER_BASE_URL,
requestContext.request.getContextPath() + requestContext.request.getServletPath());
+
+ //
+ RendererContext rendererCtx = layout.getRenderContext(themeContext, markupInfo,
dispatcher);
+ rendererCtx.render(pageRenderCtx);
+ }
+
+ /**
+ * Necessary for now, until the JSPLayout does not cast the page render context to
page result.
+ */
+ private PageResult createResult(PageRendererContext prc)
+ {
+ PageResult result = new PageResult("page");
+
+ //
+ result.getPageProperties().putAll(prc.getProperties());
+
+ //
+ for (Iterator i = prc.getRegions().iterator();i.hasNext();)
+ {
+ RegionRendererContext rrc = (RegionRendererContext)i.next();
+
+ //
+ for (IteratorStatus j = new
IteratorStatus(rrc.getWindows().iterator());j.hasNext();)
+ {
+ WindowRendererContext wrc = (WindowRendererContext)j.next();
+
+ //
+ WindowResult wr = new WindowResult(
+ wrc.getDecoration().getTitle(),
+ wrc.getPortlet().getMarkup(),
+ new HashMap(),
+ wrc.getProperties(),
+ "",
+ wrc.getWindowState(),
+ wrc.getMode());
+ WindowContext wc = new WindowContext(wrc.getId(), rrc.getId(), j.getIndex(),
wr);
+ result.addWindowContext(wc);
+ }
+
+ //
+ Region region = result.getRegion2(rrc.getId());
+ if (region != null)
+ {
+ region.getProperties().putAll(rrc.getProperties());
+ }
+ }
+
+ //
+ result.setLayoutState(null);
+
+ //
+ return result;
+ }
+
+ private class ChangeRecord
+ {
+
+ /** . */
+ private RenderedObject source;
+
+ /** . */
+ private ObjectChange change;
+
+ public ChangeRecord(RenderedObject source, ObjectChange change)
+ {
+ this.source = source;
+ this.change = change;
+ }
+ }
+
+
+// /** . */
+// private HttpServletRequest request;
+//
+// /** . */
+// private String serverBaseURL;
+//
+// public TestContext(HttpServletRequest request)
+// {
+// this.request = request;
+// this.serverBaseURL = request.getContextPath() + "/test";
+// }
+//
+// public String getServerBaseURL()
+// {
+// return serverBaseURL;
+// }
+//
+// public Counter getCounter(WindowId windowId)
+// {
+// HttpSession session = request.getSession();
+//
+// //
+// Counter counter = (Counter)session.getAttribute(windowId.toString());
+// if (counter == null)
+// {
+// counter = new Counter(0);
+// session.setAttribute(windowId.toString(), counter);
+// }
+// return counter;
+// }
+//
+// public WindowResult renderWindow(WindowId windowId)
+// {
+// Counter counter = getCounter(windowId);
+// String link = serverBaseURL + "?windowId=" + windowId +
"&action=increment";
+// return createWindowMarkup("Window Title",
+// "Counter value is " + counter.getValue() + ", <a
href=\"" + link + "\">Increment counter</a><br/>"
+
+// "Link to a resource <a href=\"" + request.getContextPath() +
"/file.txt\">Resource</a><br/>" +
+// "Inline javascript <a href=\"javascript:alert('The
Alert');\">Resource</a><br/>");
+// }
+//
+// private WindowResult createWindowMarkup(String title, String content)
+// {
+// return new WindowResult(
+// title,
+// content,
+// Collections.EMPTY_MAP,
+// new HashMap(),
+// null,
+// null,
+// null);
+// }
+
+}
Modified: trunk/theme/src/main/org/jboss/portal/test/theme/MyTest.java
===================================================================
--- trunk/theme/src/main/org/jboss/portal/test/theme/MyTest.java 2007-04-20 20:59:43 UTC
(rev 7016)
+++ trunk/theme/src/main/org/jboss/portal/test/theme/MyTest.java 2007-04-21 12:07:46 UTC
(rev 7017)
@@ -26,8 +26,8 @@
import org.jboss.portal.test.theme.model.RegionObject;
import org.jboss.portal.test.theme.model.WindowObject;
import org.jboss.portal.test.theme.model.RenderedObject;
-import org.jboss.portal.test.theme.command.ClickCommand;
import org.jboss.portal.theme.impl.render.dynamic.DynaRenderOptions;
+import org.jboss.portal.common.test.driver.DriverResponse;
import java.util.Collections;
@@ -39,16 +39,16 @@
{
/** . */
- private TestContext testContext;
+ private DynaTestContext dynaTestContext;
public MyTest(String id)
{
super(id);
}
- public void init(TestContext testContext)
+ public void init(DynaTestContext dynaTestContext)
{
- PageObject page = testContext.getPage();
+ PageObject page = dynaTestContext.getPage();
//
RegionObject regionA = page.createRegion("RegionA");
@@ -77,13 +77,10 @@
regionD.addWindow("7");
//
- testContext.addUserAgentCommand(new ClickCommand("bilto"));
-
- //
- this.testContext = testContext;
+ this.dynaTestContext = dynaTestContext;
}
- public void invoke(RequestContext requestContext)
+ public DriverResponse invoke(RequestContext requestContext)
{
TestPhase phase = requestContext.getPhase();
if (phase.getLifeCycle() == TestPhase.RENDER_LIFE_CYCLE)
@@ -91,14 +88,14 @@
switch(phase.getCount())
{
case 0:
- WindowObject window = testContext.getPage().getWindow("7");
+ WindowObject window = dynaTestContext.getPage().getWindow("7");
ObjectURL url = requestContext.createURL(window);
url.setParameter("abc", "def");
String markup = "<a id=\"bilto\" href=\"" +
url + "\">Click Me</a>";
window.setMarkup(markup);
break;
case 1:
- window = testContext.getPage().getWindow("7");
+ window = dynaTestContext.getPage().getWindow("7");
url = requestContext.createURL(window);
url.setParameter("abc", "ghi");
markup = "<a id=\"bilto\" href=\"" + url +
"\">Click Me</a>";
@@ -136,5 +133,8 @@
fail();
}
}
+
+ //
+ return null;
}
}
Modified: trunk/theme/src/main/org/jboss/portal/test/theme/RequestContext.java
===================================================================
--- trunk/theme/src/main/org/jboss/portal/test/theme/RequestContext.java 2007-04-20
20:59:43 UTC (rev 7016)
+++ trunk/theme/src/main/org/jboss/portal/test/theme/RequestContext.java 2007-04-21
12:07:46 UTC (rev 7017)
@@ -117,8 +117,15 @@
{
}
- public ObjectURL createURL(RenderedObject obj)
+ /**
+ * @throws IllegalArgumentException if the provided object is null
+ */
+ public ObjectURL createURL(RenderedObject obj) throws IllegalArgumentException
{
+ if (obj == null)
+ {
+ throw new IllegalArgumentException("No object provided");
+ }
return new ObjectURL(obj, this);
}
}
Deleted: trunk/theme/src/main/org/jboss/portal/test/theme/TestContext.java
===================================================================
--- trunk/theme/src/main/org/jboss/portal/test/theme/TestContext.java 2007-04-20 20:59:43
UTC (rev 7016)
+++ trunk/theme/src/main/org/jboss/portal/test/theme/TestContext.java 2007-04-21 12:07:46
UTC (rev 7017)
@@ -1,406 +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.theme;
-
-import org.jboss.portal.theme.page.WindowResult;
-import org.jboss.portal.theme.page.PageResult;
-import org.jboss.portal.theme.page.WindowContext;
-import org.jboss.portal.theme.page.Region;
-import org.jboss.portal.theme.render.ThemeContext;
-import org.jboss.portal.theme.render.RendererContext;
-import org.jboss.portal.theme.render.RenderException;
-import org.jboss.portal.theme.render.renderer.PageRendererContext;
-import org.jboss.portal.theme.render.renderer.RegionRendererContext;
-import org.jboss.portal.theme.render.renderer.WindowRendererContext;
-import org.jboss.portal.theme.impl.render.dynamic.DynaConstants;
-import org.jboss.portal.theme.impl.render.dynamic.JSONMarshaller;
-import org.jboss.portal.theme.impl.render.dynamic.response.UpdatePageStateResponse;
-import org.jboss.portal.theme.ThemeConstants;
-import org.jboss.portal.theme.LayoutService;
-import org.jboss.portal.theme.ThemeService;
-import org.jboss.portal.theme.PortalRenderSet;
-import org.jboss.portal.theme.PortalLayout;
-import org.jboss.portal.theme.PortalTheme;
-import org.jboss.portal.test.theme.model.WindowObject;
-import org.jboss.portal.test.theme.model.PageObject;
-import org.jboss.portal.test.theme.model.RenderedObjectContextFactory;
-import org.jboss.portal.test.theme.model.RenderedObjectContext;
-import org.jboss.portal.test.theme.model.RenderedObject;
-import org.jboss.portal.test.theme.model.ObjectChange;
-import org.jboss.portal.test.theme.command.UserAgentCommand;
-import org.jboss.portal.common.util.MarkupInfo;
-import org.jboss.portal.common.util.MediaType;
-import org.jboss.portal.common.util.IteratorStatus;
-import org.jboss.portal.web.ServletContextDispatcher;
-import org.jboss.portal.web.spi.ServletContainerContext;
-import org.jboss.mx.util.MBeanServerLocator;
-import org.jboss.mx.util.MBeanProxy;
-import org.jboss.mx.util.MBeanProxyCreationException;
-
-import javax.management.MBeanServer;
-import javax.management.ObjectName;
-import javax.management.MalformedObjectNameException;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.ArrayList;
-import java.io.StringWriter;
-import java.io.IOException;
-
-/**
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 1.1 $
- */
-public class TestContext
-{
-
- /** . */
- public static final int NO_STATUS = 0;
-
- /** . */
- public static final int INIT_STATUS = 1;
-
- /** . */
- public static final int INVOKE_STATUS = 2;
-
- /** . */
- public static final int DESTROY_STATUS = 3;
-
- private final RenderedObjectContextFactory contextFactory = new
RenderedObjectContextFactory()
- {
- public RenderedObjectContext createContext(final RenderedObject object)
- {
- return new RenderedObjectContext()
- {
- public void addChange(ObjectChange change)
- {
- records.add(new ChangeRecord(object, change));
- }
- };
- }
- };
-
- /** . */
- private final PageObject page = new PageObject(contextFactory);
-
- /** The changes. */
- private final List records = new ArrayList();
-
- /** . */
- List userAgentCommands;
-
- /** . */
- int count;
-
- /** . */
- DynaTest test;
-
- /** . */
- ServletContainerContext servletContainerContext;
-
- /** . */
- LayoutService layoutService;
-
- /** . */
- ThemeService themeService;
-
- /** . */
- PortalRenderSet renderSet;
-
- /** . */
- PortalLayout layout;
-
- /** . */
- PortalTheme theme;
-
- /** . */
- private int status;
-
- public TestContext(DynaTest test) throws MBeanProxyCreationException,
MalformedObjectNameException
- {
- this.test = test;
- this.count = 0;
- this.status = NO_STATUS;
- this.userAgentCommands = new ArrayList();
-
- // Init services
- MBeanServer mbeanServer = MBeanServerLocator.locateJBoss();
- this.servletContainerContext =
(ServletContainerContext)MBeanProxy.get(ServletContainerContext.class, new
ObjectName("portal:service=ServletContainerContext"), mbeanServer);
- this.layoutService = (LayoutService)MBeanProxy.get(LayoutService.class, new
ObjectName("portal:service=LayoutService"), mbeanServer);
- this.themeService = (ThemeService)MBeanProxy.get(ThemeService.class, new
ObjectName("portal:service=ThemeService"), mbeanServer);
- this.renderSet = layoutService.getRenderSet("testRenderer",
MediaType.HTML);
- this.layout = layoutService.getLayout("generic", true);
- this.theme = themeService.getTheme("testTheme", true);
-
- //
- page.setProperty(ThemeConstants.PORTAL_PROP_THEME,
theme.getThemeInfo().getName());
- page.setProperty(ThemeConstants.PORTAL_PROP_RENDERSET, renderSet.getName());
- page.setProperty(ThemeConstants.PORTAL_PROP_LAYOUT,
layout.getLayoutInfo().getName());
- }
-
- public PageObject getPage()
- {
- return page;
- }
-
- public void addUserAgentCommand(UserAgentCommand cmd)
- {
- if (status != INIT_STATUS)
- {
- throw new IllegalStateException("Adding user agent command is only possible
during init");
- }
-
- //
- userAgentCommands.add(cmd);
- }
-
- void init()
- {
- status = INIT_STATUS;
- test.init(this);
- status = INVOKE_STATUS;
- }
-
- void destroy()
- {
- status = DESTROY_STATUS;
- test.destroy();
- status = NO_STATUS;
- }
-
- void invoke(RequestContext requestContext) throws RenderException, IOException
- {
- // Invoke
- test.invoke(requestContext);
-
- //
- if (requestContext.getPhase().getLifeCycle() == TestPhase.RENDER_LIFE_CYCLE)
- {
- //
- count++;
-
- //
- if (requestContext.isAsync())
- {
- handleAsync(requestContext);
- }
- else
- {
- renderPage(requestContext);
- }
-
- // Clear changes now
- records.clear();
- }
- else
- {
- // Nothing special to do for now
- }
- }
-
- int getCount()
- {
- return count;
- }
-
- private void handleAsync(RequestContext requestContext) throws RenderException,
IOException
- {
- MarkupInfo markupInfo = new MarkupInfo(MediaType.HTML, "UTF-8");
- ServletContextDispatcher dispatcher = new
ServletContextDispatcher(requestContext.request, requestContext.response,
servletContainerContext);
- ThemeContext themeContext = new ThemeContext(theme, themeService);
-
- //
- UpdatePageStateResponse resp = new UpdatePageStateResponse(null);
-
- //
- page.setProperty(DynaConstants.RESOURCE_BASE_URL,
requestContext.request.getContextPath() + "/dyna");
- page.setProperty(DynaConstants.SERVER_BASE_URL,
requestContext.request.getContextPath() + requestContext.request.getServletPath());
-
- //
- for (int i = 0;i < records.size();i++)
- {
- ChangeRecord record = (ChangeRecord)records.get(i);
-
- // For now only that use case exist, so it's ok...
- WindowObject window = (WindowObject)record.source;
-
- //
- StringWriter buffer = new StringWriter();
- RendererContext rendererCtx = layout.getRenderContext(themeContext, markupInfo,
dispatcher, buffer);
- rendererCtx.pushObjectRenderContext(page.getRendererContext());
- rendererCtx.pushObjectRenderContext(window.getRegion().getRendererContext());
- rendererCtx.render(window.getRendererContext());
-
- //
- resp.addFragment(window.getId(), buffer.toString());
- }
-
- //
- JSONMarshaller marshaller = new JSONMarshaller();
- requestContext.response.setContentType("text/xml");
- marshaller.write(resp, requestContext.response.getWriter());
- }
-
- /**
- * Renders the page fully in the resposne provided by the request context.
- */
- private void renderPage(RequestContext requestContext) throws RenderException
- {
- requestContext.response.setContentType("text/html");
-
- MarkupInfo markupInfo = new MarkupInfo(MediaType.HTML, "UTF-8");
- ServletContextDispatcher dispatcher = new
ServletContextDispatcher(requestContext.request, requestContext.response,
servletContainerContext);
- ThemeContext themeContext = new ThemeContext(theme, themeService);
-
- // Build a page structure
- PageResult pageRenderCtx = createResult(page.getRendererContext());
-
- //
- pageRenderCtx.getPageProperties().put(DynaConstants.RESOURCE_BASE_URL,
requestContext.request.getContextPath() + "/dyna");
- pageRenderCtx.getPageProperties().put(DynaConstants.SERVER_BASE_URL,
requestContext.request.getContextPath() + requestContext.request.getServletPath());
-
- //
- RendererContext rendererCtx = layout.getRenderContext(themeContext, markupInfo,
dispatcher);
- rendererCtx.render(pageRenderCtx);
- }
-
- /**
- * Necessary for now, until the JSPLayout does not cast the page render context to
page result.
- */
- private PageResult createResult(PageRendererContext prc)
- {
- PageResult result = new PageResult("page");
-
- //
- result.getPageProperties().putAll(prc.getProperties());
-
- //
- for (Iterator i = prc.getRegions().iterator();i.hasNext();)
- {
- RegionRendererContext rrc = (RegionRendererContext)i.next();
-
- //
- for (IteratorStatus j = new
IteratorStatus(rrc.getWindows().iterator());j.hasNext();)
- {
- WindowRendererContext wrc = (WindowRendererContext)j.next();
-
- //
- WindowResult wr = new WindowResult(
- wrc.getDecoration().getTitle(),
- wrc.getPortlet().getMarkup(),
- new HashMap(),
- wrc.getProperties(),
- "",
- wrc.getWindowState(),
- wrc.getMode());
- WindowContext wc = new WindowContext(wrc.getId(), rrc.getId(), j.getIndex(),
wr);
- result.addWindowContext(wc);
- }
-
- //
- Region region = result.getRegion2(rrc.getId());
- if (region != null)
- {
- region.getProperties().putAll(rrc.getProperties());
- }
- }
-
- //
- result.setLayoutState(null);
-
- //
- return result;
- }
-
- private class ChangeRecord
- {
-
- /** . */
- private RenderedObject source;
-
- /** . */
- private ObjectChange change;
-
- public ChangeRecord(RenderedObject source, ObjectChange change)
- {
- this.source = source;
- this.change = change;
- }
- }
-
-
-// /** . */
-// private HttpServletRequest request;
-//
-// /** . */
-// private String serverBaseURL;
-//
-// public TestContext(HttpServletRequest request)
-// {
-// this.request = request;
-// this.serverBaseURL = request.getContextPath() + "/test";
-// }
-//
-// public String getServerBaseURL()
-// {
-// return serverBaseURL;
-// }
-//
-// public Counter getCounter(WindowId windowId)
-// {
-// HttpSession session = request.getSession();
-//
-// //
-// Counter counter = (Counter)session.getAttribute(windowId.toString());
-// if (counter == null)
-// {
-// counter = new Counter(0);
-// session.setAttribute(windowId.toString(), counter);
-// }
-// return counter;
-// }
-//
-// public WindowResult renderWindow(WindowId windowId)
-// {
-// Counter counter = getCounter(windowId);
-// String link = serverBaseURL + "?windowId=" + windowId +
"&action=increment";
-// return createWindowMarkup("Window Title",
-// "Counter value is " + counter.getValue() + ", <a
href=\"" + link + "\">Increment counter</a><br/>"
+
-// "Link to a resource <a href=\"" + request.getContextPath() +
"/file.txt\">Resource</a><br/>" +
-// "Inline javascript <a href=\"javascript:alert('The
Alert');\">Resource</a><br/>");
-// }
-//
-// private WindowResult createWindowMarkup(String title, String content)
-// {
-// return new WindowResult(
-// title,
-// content,
-// Collections.EMPTY_MAP,
-// new HashMap(),
-// null,
-// null,
-// null);
-// }
-
-
-}
Modified: trunk/theme/src/main/org/jboss/portal/test/theme/TestInfoServlet.java
===================================================================
--- trunk/theme/src/main/org/jboss/portal/test/theme/TestInfoServlet.java 2007-04-20
20:59:43 UTC (rev 7016)
+++ trunk/theme/src/main/org/jboss/portal/test/theme/TestInfoServlet.java 2007-04-21
12:07:46 UTC (rev 7017)
@@ -22,20 +22,11 @@
******************************************************************************/
package org.jboss.portal.test.theme;
-import org.jboss.portal.common.text.FastURLEncoder;
-import org.jboss.portal.test.theme.command.UserAgentCommand;
-import org.jboss.portal.test.theme.command.ClickCommand;
-
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.ServletException;
-import javax.servlet.ServletConfig;
import java.io.IOException;
-import java.io.PrintWriter;
-import java.util.Iterator;
-import java.util.Map;
-import java.util.LinkedHashMap;
/** @author <a href="mailto:roy@jboss.org">Roy Russo</a> */
@@ -43,30 +34,11 @@
{
/** . */
- private Map suite;
-
- /** . */
private boolean selenium;
- public TestInfoServlet()
- {
- suite = new LinkedHashMap();
-
- //
- suite.put("ABC", new MyTest("ABC"));
- suite.put("DEF", new MyTest("DEF"));
- suite.put("GHI", new MyTest("GHI"));
- }
-
-
- public void init() throws ServletException
- {
- ServletConfig cfg = getServletConfig();
- selenium = "true".equals(cfg.getInitParameter("selenium"));
- }
-
protected void service(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException
{
+// selenium = "true".equals(cfg.getInitParameter("selenium"));
try
{
proceed(request, response);
@@ -79,84 +51,73 @@
public void proceed(HttpServletRequest request, HttpServletResponse response) throws
Exception
{
- String pathInfo = request.getPathInfo();
-
- //
- if (pathInfo.startsWith("/testsuite"))
- {
- // Get services
- response.setContentType("text/html");
- PrintWriter writer = response.getWriter();
-
- writer.println("<html>");
- writer.println("<body>");
- writer.println("<table id=\"suiteTable\"
cellpadding=\"1\" cellspacing=\"1\"
border=\"1\">");
- writer.println("<tbody>");
- writer.println("<tr><td><b>Test Suite </b>
</td> </tr>");
-
- //
- for (Iterator i = suite.keySet().iterator();i.hasNext();)
- {
- String testId = (String)i.next();
- String url = request.getContextPath() + request.getServletPath() +
"/init/" + FastURLEncoder.DEFAULT_ENCODER.encode(testId);
- writer.println("<tr><td><a href=\"" + url +
"\">Test " + testId + "</a></td></tr>");
- }
-
- writer.println("</tbody>");
- writer.println("</table>");
- writer.println("</body>");
- writer.println("</html>");
- }
- else if (pathInfo.startsWith("/init"))
- {
- String testId = pathInfo.substring("/init/".length());
- DynaTest test = (DynaTest)suite.get(testId);
-
- //
- TestContext testContext = new TestContext(test);
- testContext.init();
-
- //
- getServletContext().setAttribute("TestContext", testContext);
-
- //
- if (selenium)
- {
- response.setContentType("text/html");
- PrintWriter writer = response.getWriter();
- writer.println("<html>");
- writer.println("<body>");
-
- writer.println("<table cellpadding=\"1\"
cellspacing=\"1\" border=\"1\">");
- writer.println("<tbody>");
- writer.println("<tr><td colspan=\"3\">" +
testId + "</td></tr>");
-
- writer.println("<tr><td>open</td><td>" +
request.getContextPath() + request.getServletPath() + "/invoke" +
"</td><td> </td></tr>");
-
- for (Iterator i = testContext.userAgentCommands.iterator();i.hasNext();)
- {
- UserAgentCommand uac = (UserAgentCommand)i.next();
- if (uac instanceof ClickCommand)
- {
- ClickCommand cc = (ClickCommand)uac;
-
writer.println("<tr><td>click</td><td>id=" + cc.getId()
+ "</td><td> </td></tr>");
-//
writer.println("<tr><td>mouseDown</td><td>id=" +
cc.getId() + "</td><td> </td></tr>");
-//
writer.println("<tr><td>mouseUp</td><td>id=" +
cc.getId() + "</td><td> </td></tr>");
- }
- }
-
- writer.println("</tbody>");
- writer.println("</table>");
-
- writer.println("</body>");
- writer.println("</html>");
- // testContext.userAgentCommands
- }
- else
- {
- String url = response.encodeRedirectURL(request.getContextPath() +
request.getServletPath() + "/invoke");
- response.sendRedirect(url);
- }
- }
+// String pathInfo = request.getPathInfo();
+//
+// //
+// if (pathInfo.startsWith("/testsuite"))
+// {
+// // Get services
+// response.setContentType("text/html");
+// PrintWriter writer = response.getWriter();
+//
+// writer.println("<html>");
+// writer.println("<body>");
+// writer.println("<table id=\"suiteTable\"
cellpadding=\"1\" cellspacing=\"1\"
border=\"1\">");
+// writer.println("<tbody>");
+// writer.println("<tr><td><b>Test Suite </b>
</td> </tr>");
+//
+// //
+// for (Iterator i = suite.keySet().iterator();i.hasNext();)
+// {
+// String testId = (String)i.next();
+// String url = request.getContextPath() + request.getServletPath() +
"/init/" + FastURLEncoder.DEFAULT_ENCODER.encode(testId);
+// writer.println("<tr><td><a href=\"" + url +
"\">Test " + testId + "</a></td></tr>");
+// }
+//
+// writer.println("</tbody>");
+// writer.println("</table>");
+// writer.println("</body>");
+// writer.println("</html>");
+// }
+// else if (pathInfo.startsWith("/init"))
+// {
+// String testId = pathInfo.substring("/init/".length());
+// DynaTest test = (DynaTest)suite.get(testId);
+//
+// //
+// TestContext testContext = new TestContext(test);
+// testContext.init();
+//
+// //
+// getServletContext().setAttribute("TestContext", testContext);
+//
+// //
+// if (selenium)
+// {
+// response.setContentType("text/html");
+// PrintWriter writer = response.getWriter();
+// writer.println("<html>");
+// writer.println("<body>");
+//
+// writer.println("<table cellpadding=\"1\"
cellspacing=\"1\" border=\"1\">");
+// writer.println("<tbody>");
+// writer.println("<tr><td colspan=\"3\">" +
testId + "</td></tr>");
+//
+// writer.println("<tr><td>open</td><td>" +
request.getContextPath() + request.getServletPath() + "/invoke" +
"</td><td> </td></tr>");
+//
+//
+// writer.println("</tbody>");
+// writer.println("</table>");
+//
+// writer.println("</body>");
+// writer.println("</html>");
+// // testContext.userAgentCommands
+// }
+// else
+// {
+// String url = response.encodeRedirectURL(request.getContextPath() +
request.getServletPath() + "/invoke");
+// response.sendRedirect(url);
+// }
+// }
}
}
Modified: trunk/theme/src/main/org/jboss/portal/test/theme/TestServlet.java
===================================================================
--- trunk/theme/src/main/org/jboss/portal/test/theme/TestServlet.java 2007-04-20 20:59:43
UTC (rev 7016)
+++ trunk/theme/src/main/org/jboss/portal/test/theme/TestServlet.java 2007-04-21 12:07:46
UTC (rev 7017)
@@ -24,28 +24,9 @@
import org.jboss.mx.util.MBeanServerLocator;
import org.jboss.mx.util.MBeanProxy;
-import org.jboss.portal.theme.LayoutService;
-import org.jboss.portal.theme.ThemeService;
-import org.jboss.portal.theme.PortalLayout;
-import org.jboss.portal.theme.PortalTheme;
-import org.jboss.portal.theme.page.PageResult;
-import org.jboss.portal.theme.page.WindowContext;
-import org.jboss.portal.theme.page.WindowResult;
-import org.jboss.portal.theme.page.Region;
-import org.jboss.portal.theme.impl.render.dynamic.DynaConstants;
-import org.jboss.portal.theme.PortalRenderSet;
-import org.jboss.portal.theme.ThemeConstants;
-import org.jboss.portal.theme.render.renderer.PageRendererContext;
-import org.jboss.portal.theme.render.renderer.RegionRendererContext;
-import org.jboss.portal.theme.render.renderer.WindowRendererContext;
-import org.jboss.portal.theme.render.RendererContext;
-import org.jboss.portal.theme.render.ThemeContext;
-import org.jboss.portal.common.util.MediaType;
-import org.jboss.portal.common.util.IteratorStatus;
-import org.jboss.portal.common.util.MarkupInfo;
-import org.jboss.portal.web.spi.ServletContainerContext;
-import org.jboss.portal.web.ServletContextDispatcher;
+import org.jboss.portal.common.test.driver.TestDriverContainer;
import org.jboss.portal.test.theme.model.WindowObject;
+import org.jboss.portal.test.theme.dyna.tests.LinkTest;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
@@ -54,18 +35,37 @@
import javax.management.MBeanServer;
import javax.management.ObjectName;
import java.io.IOException;
-import java.util.Iterator;
-import java.util.HashMap;
/** @author <a href="mailto:roy@jboss.org">Roy Russo</a> */
public class TestServlet extends HttpServlet
{
- public TestServlet()
+ /** . */
+ private TestDriverContainer testServer;
+
+ /** . */
+ DynaTestContext testContext;
+
+ public void init() throws ServletException
{
+ try
+ {
+ MBeanServer mbeanServer = MBeanServerLocator.locateJBoss();
+ testServer = (TestDriverContainer)MBeanProxy.get(TestDriverContainer.class, new
ObjectName("portal.test:service=TestDriverServer"), mbeanServer);
+
+ addTest(new LinkTest("ABC"));
+ }
+ catch (Exception e)
+ {
+ throw new ServletException(e);
+ }
}
+ private void addTest(DynaTest dynaTest) throws Exception
+ {
+ testServer.addDriver(new DynaTestContext(this, dynaTest,
"http://localhost:8080/theme-test/selenium/invoke/"));
+ }
/**
* Generates a portal page with windows, using the theme api.
@@ -84,9 +84,6 @@
public void proceed(HttpServletRequest request, HttpServletResponse response) throws
Exception
{
- TestContext testContext =
(TestContext)getServletContext().getAttribute("TestContext");
-
- //
String pathInfo = request.getPathInfo();
if (pathInfo != null)
{
@@ -94,58 +91,15 @@
{
String windowId = pathInfo.substring("/window/".length());
WindowObject window = testContext.getPage().getWindow(windowId);
- TestPhase phase = TestPhase.createAction(testContext.getCount());
+ TestPhase phase = TestPhase.createAction(testContext.getRequestCount());
RequestContext requestContext = new RequestContext(window, phase, request,
response);
testContext.invoke(requestContext);
}
}
//
- TestPhase phase = TestPhase.createRender(testContext.getCount());
+ TestPhase phase = TestPhase.createRender(testContext.getRequestCount());
RequestContext requestContext = new RequestContext(null, phase, request,
response);
testContext.invoke(requestContext);
-
-
-
-// //
-// TestContext testContext = new TestContext(request);
-//
-// // Handle action here
-// WindowId windowId = request.getParameter("windowId") != null ? new
WindowId(request.getParameter("windowId")) : null;
-// String action = request.getParameter("action");
-// if ("increment".equals(action))
-// {
-// Counter counter = testContext.getCounter(windowId);
-// counter.increment();
-// }
-//
-// //
-// boolean ajax = "true".equals(request.getHeader("ajax"));
-
-
-// //
-// for (Iterator i = page.entrySet().iterator();i.hasNext();)
-// {
-// Map.Entry entry = (Map.Entry)i.next();
-// WindowId _windowId = (WindowId)entry.getKey();
-// RegionObject region = (RegionObject)entry.getValue();
-// WindowResult window = testContext.renderWindow(_windowId);
-// pageRenderCtx.addWindow(region.getId(), _windowId.toString(),
window.toString(), window);
-// }
-//
-// //
-// for (Iterator i = new HashSet(page.values()).iterator();i.hasNext();)
-// {
-// RegionObject region = (RegionObject)i.next();
-//
region.getRenderOptions().setOptions(pageRenderCtx.getRegion2(region.getId()).getProperties());
-// }
-//
-// //
-// if (ajax)
-// {
-// }
-// else
-// {
-// }
}
}
Added: trunk/theme/src/main/org/jboss/portal/test/theme/ThemeTestRunner.java
===================================================================
--- trunk/theme/src/main/org/jboss/portal/test/theme/ThemeTestRunner.java
(rev 0)
+++ trunk/theme/src/main/org/jboss/portal/test/theme/ThemeTestRunner.java 2007-04-21
12:07:46 UTC (rev 7017)
@@ -0,0 +1,37 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.test.theme;
+
+import org.jboss.portal.test.framework.runner.WebTestRunner;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class ThemeTestRunner extends WebTestRunner
+{
+ public ThemeTestRunner()
+ {
+ super("theme-test.sar");
+ }
+}
Added: trunk/theme/src/main/org/jboss/portal/test/theme/dyna/tests/LinkTest.java
===================================================================
--- trunk/theme/src/main/org/jboss/portal/test/theme/dyna/tests/LinkTest.java
(rev 0)
+++ trunk/theme/src/main/org/jboss/portal/test/theme/dyna/tests/LinkTest.java 2007-04-21
12:07:46 UTC (rev 7017)
@@ -0,0 +1,129 @@
+/******************************************************************************
+ * 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.theme.dyna.tests;
+
+import org.jboss.portal.test.theme.DynaTest;
+import org.jboss.portal.test.theme.DynaTestContext;
+import org.jboss.portal.test.theme.RequestContext;
+import org.jboss.portal.test.theme.TestPhase;
+import org.jboss.portal.test.theme.ObjectURL;
+import org.jboss.portal.test.theme.model.PageObject;
+import org.jboss.portal.test.theme.model.RegionObject;
+import org.jboss.portal.test.theme.model.WindowObject;
+import org.jboss.portal.test.theme.model.RenderedObject;
+import org.jboss.portal.test.framework.driver.web.response.PerformClickResponse;
+import org.jboss.portal.theme.impl.render.dynamic.DynaRenderOptions;
+import org.jboss.portal.common.test.driver.DriverResponse;
+import org.jboss.portal.common.test.driver.response.EndTestResponse;
+
+import java.util.Collections;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class LinkTest extends DynaTest
+{
+
+ /** . */
+ private DynaTestContext dynaTestContext;
+
+ public LinkTest(String id)
+ {
+ super(id);
+ }
+
+ public void init(DynaTestContext dynaTestContext)
+ {
+ PageObject page = dynaTestContext.getPage();
+
+ //
+ RegionObject regionA = page.createRegion("RegionA");
+ regionA.setRenderOptions(DynaRenderOptions.getOptions(null, Boolean.TRUE));
+
+ //
+ WindowObject window0 = regionA.addWindow("0");
+ window0.setRenderOptions(DynaRenderOptions.getOptions(null, Boolean.TRUE));
+
+ //
+ this.dynaTestContext = dynaTestContext;
+ }
+
+ public DriverResponse invoke(RequestContext requestContext)
+ {
+ TestPhase phase = requestContext.getPhase();
+ if (phase.getLifeCycle() == TestPhase.RENDER_LIFE_CYCLE)
+ {
+ switch(phase.getCount())
+ {
+ case 0:
+ WindowObject window = dynaTestContext.getPage().getWindow("0");
+ ObjectURL url = requestContext.createURL(window);
+ url.setParameter("abc", "def");
+ String markup = "<a id=\"link\" href=\"" + url
+ "\">Click Me</a>";
+ window.setMarkup(markup);
+ return new PerformClickResponse("link");
+ case 1:
+ window = dynaTestContext.getPage().getWindow("0");
+ url = requestContext.createURL(window);
+ url.setParameter("abc", "ghi");
+ markup = "<a id=\"link\" href=\"" + url +
"\">Click Me</a>";
+ window.setMarkup(markup);
+ return new PerformClickResponse("link");
+ case 2:
+ return new EndTestResponse();
+ default:
+ fail();
+ }
+ }
+ else
+ {
+ switch(phase.getCount())
+ {
+ case 1:
+ RenderedObject target = requestContext.getTarget();
+ assertNotNull(target);
+ assertTrue(target instanceof WindowObject);
+ WindowObject window = (WindowObject)target;
+ assertEquals("0", window.getId());
+ assertTrue(requestContext.isAsync());
+ assertEquals(Collections.singletonMap("abc", "def"),
requestContext.getParameterMap());
+ return null;
+ case 2:
+ target = requestContext.getTarget();
+ assertNotNull(target);
+ assertTrue(target instanceof WindowObject);
+ window = (WindowObject)target;
+ assertEquals("0", window.getId());
+ assertTrue(requestContext.isAsync());
+ assertEquals(Collections.singletonMap("abc", "ghi"),
requestContext.getParameterMap());
+ return null;
+ default:
+ fail();
+ }
+ }
+
+ //
+ return new EndTestResponse();
+ }
+}
Modified:
trunk/theme/src/main/org/jboss/portal/theme/impl/render/dynamic/DynaWindowRenderer.java
===================================================================
---
trunk/theme/src/main/org/jboss/portal/theme/impl/render/dynamic/DynaWindowRenderer.java 2007-04-20
20:59:43 UTC (rev 7016)
+++
trunk/theme/src/main/org/jboss/portal/theme/impl/render/dynamic/DynaWindowRenderer.java 2007-04-21
12:07:46 UTC (rev 7017)
@@ -84,7 +84,7 @@
{
if (windowOptions.isPartialRefreshEnabled())
{
- out.print("\" class=\"portal-window\">\n");
+ out.print("\"
class=\"partial-refresh-window\">\n");
}
else
{
Modified: trunk/theme/src/resources/test/theme-test-sar/META-INF/jboss-service.xml
===================================================================
--- trunk/theme/src/resources/test/theme-test-sar/META-INF/jboss-service.xml 2007-04-20
20:59:43 UTC (rev 7016)
+++ trunk/theme/src/resources/test/theme-test-sar/META-INF/jboss-service.xml 2007-04-21
12:07:46 UTC (rev 7017)
@@ -23,6 +23,26 @@
<server>
+ <!-- -->
+ <mbean
+ code="org.jboss.invocation.jrmp.server.JRMPProxyFactory"
+ name="portal.test:service=Invoker,name=TestDriverServer">
+ <depends
optional-attribute-name="InvokerName">jboss:service=invoker,type=jrmp</depends>
+ <depends
optional-attribute-name="TargetName">portal.test:service=TestDriverServer</depends>
+ <attribute name="JndiName">TestDriverServer</attribute>
+ <attribute
name="ExportedInterfaces">org.jboss.portal.test.framework.driver.remote.RemoteTestDriver</attribute>
+ </mbean>
+ <mbean
+
code="org.jboss.portal.test.framework.driver.remote.RemoteTestDriverServer"
+ name="portal.test:service=TestDriverServer"
+ xmbean-dd=""
+ xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
+ <xmbean/>
+ <depends
+ optional-attribute-name="Agent"
+ proxy-type="attribute">portal.test:service=Agent</depends>
+ </mbean>
+
<!-- Theme and layout services -->
<mbean
code="org.jboss.portal.theme.impl.ThemeServiceImpl"
Modified: trunk/wsrp/src/main/org/jboss/portal/test/wsrp/WSRPBaseTest.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/test/wsrp/WSRPBaseTest.java 2007-04-20 20:59:43
UTC (rev 7016)
+++ trunk/wsrp/src/main/org/jboss/portal/test/wsrp/WSRPBaseTest.java 2007-04-21 12:07:46
UTC (rev 7017)
@@ -37,8 +37,8 @@
import org.jboss.portal.common.test.info.TestItemInfo;
import org.jboss.portal.common.test.junit.POJOJUnitTest;
import org.jboss.portal.jems.as.system.AbstractJBossService;
-import org.jboss.portal.test.framework.driver.http.HttpTestContext;
import org.jboss.portal.test.framework.driver.http.HttpTestDriver;
+import org.jboss.portal.test.framework.driver.remote.TestContext;
/**
* Base Class for all WSRP Test Cases
@@ -60,7 +60,7 @@
private TestDriverContainer testDriverContainer;
/** . */
- private HttpTestContext context;
+ private TestContext context;
protected WSRPBaseTest(String name) throws Exception
{
@@ -128,12 +128,12 @@
return test.invoke(testId, command);
}
- public void pushContext(String testId, HttpTestContext testContext)
+ public void pushContext(String testId, TestContext testContext)
{
this.context = testContext;
}
- public HttpTestContext popContext(String testId)
+ public TestContext popContext(String testId)
{
return context;
}
Modified:
trunk/wsrp/src/main/org/jboss/portal/test/wsrp/v1/consumer/ConsumerTestCase.java
===================================================================
---
trunk/wsrp/src/main/org/jboss/portal/test/wsrp/v1/consumer/ConsumerTestCase.java 2007-04-20
20:59:43 UTC (rev 7016)
+++
trunk/wsrp/src/main/org/jboss/portal/test/wsrp/v1/consumer/ConsumerTestCase.java 2007-04-21
12:07:46 UTC (rev 7017)
@@ -22,13 +22,13 @@
******************************************************************************/
package org.jboss.portal.test.wsrp.v1.consumer;
-import org.jboss.portal.test.framework.runner.ServerTestRunner;
+import org.jboss.portal.test.framework.runner.HTTPTestRunner;
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
* @version $Revision$
*/
-public class ConsumerTestCase extends ServerTestRunner
+public class ConsumerTestCase extends HTTPTestRunner
{
public ConsumerTestCase()
{
Modified:
trunk/wsrp/src/main/org/jboss/portal/test/wsrp/v1/consumer/MarkupTestRunner.java
===================================================================
---
trunk/wsrp/src/main/org/jboss/portal/test/wsrp/v1/consumer/MarkupTestRunner.java 2007-04-20
20:59:43 UTC (rev 7016)
+++
trunk/wsrp/src/main/org/jboss/portal/test/wsrp/v1/consumer/MarkupTestRunner.java 2007-04-21
12:07:46 UTC (rev 7017)
@@ -22,13 +22,13 @@
******************************************************************************/
package org.jboss.portal.test.wsrp.v1.consumer;
-import org.jboss.portal.test.framework.runner.ServerTestRunner;
+import org.jboss.portal.test.framework.runner.HTTPTestRunner;
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
* @version $Revision$
*/
-public class MarkupTestRunner extends ServerTestRunner
+public class MarkupTestRunner extends HTTPTestRunner
{
public MarkupTestRunner()
{
Modified:
trunk/wsrp/src/main/org/jboss/portal/test/wsrp/v1/consumer/PortletManagementTestRunner.java
===================================================================
---
trunk/wsrp/src/main/org/jboss/portal/test/wsrp/v1/consumer/PortletManagementTestRunner.java 2007-04-20
20:59:43 UTC (rev 7016)
+++
trunk/wsrp/src/main/org/jboss/portal/test/wsrp/v1/consumer/PortletManagementTestRunner.java 2007-04-21
12:07:46 UTC (rev 7017)
@@ -23,14 +23,14 @@
package org.jboss.portal.test.wsrp.v1.consumer;
-import org.jboss.portal.test.framework.runner.ServerTestRunner;
+import org.jboss.portal.test.framework.runner.HTTPTestRunner;
/**
* @author <a href="mailto:chris.laprun@jboss.com">Chris
Laprun</a>
* @version $Revision$
* @since 2.6
*/
-public class PortletManagementTestRunner extends ServerTestRunner
+public class PortletManagementTestRunner extends HTTPTestRunner
{
public PortletManagementTestRunner()
{
Modified:
trunk/wsrp/src/main/org/jboss/portal/test/wsrp/v1/consumer/ServiceDescriptionTestRunner.java
===================================================================
---
trunk/wsrp/src/main/org/jboss/portal/test/wsrp/v1/consumer/ServiceDescriptionTestRunner.java 2007-04-20
20:59:43 UTC (rev 7016)
+++
trunk/wsrp/src/main/org/jboss/portal/test/wsrp/v1/consumer/ServiceDescriptionTestRunner.java 2007-04-21
12:07:46 UTC (rev 7017)
@@ -22,13 +22,13 @@
******************************************************************************/
package org.jboss.portal.test.wsrp.v1.consumer;
-import org.jboss.portal.test.framework.runner.ServerTestRunner;
+import org.jboss.portal.test.framework.runner.HTTPTestRunner;
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
* @version $Revision$
*/
-public class ServiceDescriptionTestRunner extends ServerTestRunner
+public class ServiceDescriptionTestRunner extends HTTPTestRunner
{
public ServiceDescriptionTestRunner()
{
Modified:
trunk/wsrp/src/main/org/jboss/portal/test/wsrp/v1/producer/MarkupTestRunner.java
===================================================================
---
trunk/wsrp/src/main/org/jboss/portal/test/wsrp/v1/producer/MarkupTestRunner.java 2007-04-20
20:59:43 UTC (rev 7016)
+++
trunk/wsrp/src/main/org/jboss/portal/test/wsrp/v1/producer/MarkupTestRunner.java 2007-04-21
12:07:46 UTC (rev 7017)
@@ -22,13 +22,13 @@
******************************************************************************/
package org.jboss.portal.test.wsrp.v1.producer;
-import org.jboss.portal.test.framework.runner.ServerTestRunner;
+import org.jboss.portal.test.framework.runner.HTTPTestRunner;
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
* @version $Revision$
*/
-public class MarkupTestRunner extends ServerTestRunner
+public class MarkupTestRunner extends HTTPTestRunner
{
public MarkupTestRunner()
{
Modified:
trunk/wsrp/src/main/org/jboss/portal/test/wsrp/v1/producer/PortletManagementTestRunner.java
===================================================================
---
trunk/wsrp/src/main/org/jboss/portal/test/wsrp/v1/producer/PortletManagementTestRunner.java 2007-04-20
20:59:43 UTC (rev 7016)
+++
trunk/wsrp/src/main/org/jboss/portal/test/wsrp/v1/producer/PortletManagementTestRunner.java 2007-04-21
12:07:46 UTC (rev 7017)
@@ -22,13 +22,13 @@
******************************************************************************/
package org.jboss.portal.test.wsrp.v1.producer;
-import org.jboss.portal.test.framework.runner.ServerTestRunner;
+import org.jboss.portal.test.framework.runner.HTTPTestRunner;
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
* @version $Revision$
*/
-public class PortletManagementTestRunner extends ServerTestRunner
+public class PortletManagementTestRunner extends HTTPTestRunner
{
public PortletManagementTestRunner()
{
Modified:
trunk/wsrp/src/main/org/jboss/portal/test/wsrp/v1/producer/ProducerTestCase.java
===================================================================
---
trunk/wsrp/src/main/org/jboss/portal/test/wsrp/v1/producer/ProducerTestCase.java 2007-04-20
20:59:43 UTC (rev 7016)
+++
trunk/wsrp/src/main/org/jboss/portal/test/wsrp/v1/producer/ProducerTestCase.java 2007-04-21
12:07:46 UTC (rev 7017)
@@ -22,13 +22,13 @@
******************************************************************************/
package org.jboss.portal.test.wsrp.v1.producer;
-import org.jboss.portal.test.framework.runner.ServerTestRunner;
+import org.jboss.portal.test.framework.runner.HTTPTestRunner;
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
* @version $Revision$
*/
-public class ProducerTestCase extends ServerTestRunner
+public class ProducerTestCase extends HTTPTestRunner
{
public ProducerTestCase()
{
Modified:
trunk/wsrp/src/main/org/jboss/portal/test/wsrp/v1/producer/RegistrationTestRunner.java
===================================================================
---
trunk/wsrp/src/main/org/jboss/portal/test/wsrp/v1/producer/RegistrationTestRunner.java 2007-04-20
20:59:43 UTC (rev 7016)
+++
trunk/wsrp/src/main/org/jboss/portal/test/wsrp/v1/producer/RegistrationTestRunner.java 2007-04-21
12:07:46 UTC (rev 7017)
@@ -22,13 +22,13 @@
******************************************************************************/
package org.jboss.portal.test.wsrp.v1.producer;
-import org.jboss.portal.test.framework.runner.ServerTestRunner;
+import org.jboss.portal.test.framework.runner.HTTPTestRunner;
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
* @version $Revision$
*/
-public class RegistrationTestRunner extends ServerTestRunner
+public class RegistrationTestRunner extends HTTPTestRunner
{
public RegistrationTestRunner()
{
Modified:
trunk/wsrp/src/main/org/jboss/portal/test/wsrp/v1/producer/ServiceDescriptionTestRunner.java
===================================================================
---
trunk/wsrp/src/main/org/jboss/portal/test/wsrp/v1/producer/ServiceDescriptionTestRunner.java 2007-04-20
20:59:43 UTC (rev 7016)
+++
trunk/wsrp/src/main/org/jboss/portal/test/wsrp/v1/producer/ServiceDescriptionTestRunner.java 2007-04-21
12:07:46 UTC (rev 7017)
@@ -22,13 +22,13 @@
******************************************************************************/
package org.jboss.portal.test.wsrp.v1.producer;
-import org.jboss.portal.test.framework.runner.ServerTestRunner;
+import org.jboss.portal.test.framework.runner.HTTPTestRunner;
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
* @version $Revision$
*/
-public class ServiceDescriptionTestRunner extends ServerTestRunner
+public class ServiceDescriptionTestRunner extends HTTPTestRunner
{
public ServiceDescriptionTestRunner()
{
Modified:
trunk/wsrp/src/resources/tests/test-wsrp-consumer-markup-sar/META-INF/jboss-service.xml
===================================================================
---
trunk/wsrp/src/resources/tests/test-wsrp-consumer-markup-sar/META-INF/jboss-service.xml 2007-04-20
20:59:43 UTC (rev 7016)
+++
trunk/wsrp/src/resources/tests/test-wsrp-consumer-markup-sar/META-INF/jboss-service.xml 2007-04-21
12:07:46 UTC (rev 7017)
@@ -29,7 +29,7 @@
xmbean-dd=""
xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
<xmbean/>
- <depends optional-attribute-name="TestDriverRegistry"
proxy-type="attribute">portal.test:service=HttpTestDriverServer</depends>
+ <depends optional-attribute-name="TestDriverRegistry"
proxy-type="attribute">portal.test:service=TestDriverServer</depends>
<depends optional-attribute-name="Consumer"
proxy-type="attribute">portal.wsrp:service=WSRPConsumer</depends>
<depends optional-attribute-name="Producer"
proxy-type="attribute">portal.wsrp:service=WSRPProducer</depends>
</mbean>
Modified:
trunk/wsrp/src/resources/tests/test-wsrp-consumer-portletmanagement-sar/META-INF/jboss-service.xml
===================================================================
---
trunk/wsrp/src/resources/tests/test-wsrp-consumer-portletmanagement-sar/META-INF/jboss-service.xml 2007-04-20
20:59:43 UTC (rev 7016)
+++
trunk/wsrp/src/resources/tests/test-wsrp-consumer-portletmanagement-sar/META-INF/jboss-service.xml 2007-04-21
12:07:46 UTC (rev 7017)
@@ -29,7 +29,7 @@
xmbean-dd=""
xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
<xmbean/>
- <depends optional-attribute-name="TestDriverRegistry"
proxy-type="attribute">portal.test:service=HttpTestDriverServer</depends>
+ <depends optional-attribute-name="TestDriverRegistry"
proxy-type="attribute">portal.test:service=TestDriverServer</depends>
<depends optional-attribute-name="Consumer"
proxy-type="attribute">portal.wsrp:service=WSRPConsumer</depends>
<depends optional-attribute-name="Producer"
proxy-type="attribute">portal.wsrp:service=WSRPProducer</depends>
</mbean>
Modified:
trunk/wsrp/src/resources/tests/test-wsrp-consumer-sar/META-INF/jboss-service.xml
===================================================================
---
trunk/wsrp/src/resources/tests/test-wsrp-consumer-sar/META-INF/jboss-service.xml 2007-04-20
20:59:43 UTC (rev 7016)
+++
trunk/wsrp/src/resources/tests/test-wsrp-consumer-sar/META-INF/jboss-service.xml 2007-04-21
12:07:46 UTC (rev 7017)
@@ -26,8 +26,8 @@
<!-- -->
<mbean
- code="org.jboss.portal.test.framework.driver.http.HttpTestDriverServer"
- name="portal.test:service=HttpTestDriverServer"
+
code="org.jboss.portal.test.framework.driver.remote.RemoteTestDriverServer"
+ name="portal.test:service=TestDriverServer"
xmbean-dd=""
xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
<xmbean/>
@@ -37,10 +37,10 @@
</mbean>
<mbean
code="org.jboss.invocation.jrmp.server.JRMPProxyFactory"
- name="portal.test:service=Invoker,name=HttpTestDriverServer">
+ name="portal.test:service=Invoker,name=TestDriverServer">
<depends
optional-attribute-name="InvokerName">jboss:service=invoker,type=jrmp</depends>
- <depends
optional-attribute-name="TargetName">portal.test:service=HttpTestDriverServer</depends>
- <attribute name="JndiName">HttpTestDriverServer</attribute>
+ <depends
optional-attribute-name="TargetName">portal.test:service=TestDriverServer</depends>
+ <attribute name="JndiName">TestDriverServer</attribute>
<attribute
name="ExportedInterfaces">org.jboss.portal.test.framework.driver.http.HttpTestDriver</attribute>
</mbean>
Modified:
trunk/wsrp/src/resources/tests/test-wsrp-consumer-servicedescription-sar/META-INF/jboss-service.xml
===================================================================
---
trunk/wsrp/src/resources/tests/test-wsrp-consumer-servicedescription-sar/META-INF/jboss-service.xml 2007-04-20
20:59:43 UTC (rev 7016)
+++
trunk/wsrp/src/resources/tests/test-wsrp-consumer-servicedescription-sar/META-INF/jboss-service.xml 2007-04-21
12:07:46 UTC (rev 7017)
@@ -29,7 +29,7 @@
xmbean-dd=""
xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
<xmbean/>
- <depends optional-attribute-name="TestDriverRegistry"
proxy-type="attribute">portal.test:service=HttpTestDriverServer</depends>
+ <depends optional-attribute-name="TestDriverRegistry"
proxy-type="attribute">portal.test:service=TestDriverServer</depends>
<depends optional-attribute-name="Consumer"
proxy-type="attribute">portal.wsrp:service=WSRPConsumer</depends>
<depends optional-attribute-name="Producer"
proxy-type="attribute">portal.wsrp:service=WSRPProducer</depends>
</mbean>
Modified:
trunk/wsrp/src/resources/tests/test-wsrp-producer-markup-sar/META-INF/jboss-service.xml
===================================================================
---
trunk/wsrp/src/resources/tests/test-wsrp-producer-markup-sar/META-INF/jboss-service.xml 2007-04-20
20:59:43 UTC (rev 7016)
+++
trunk/wsrp/src/resources/tests/test-wsrp-producer-markup-sar/META-INF/jboss-service.xml 2007-04-21
12:07:46 UTC (rev 7017)
@@ -29,7 +29,7 @@
xmbean-dd=""
xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
<xmbean/>
- <depends optional-attribute-name="TestDriverRegistry"
proxy-type="attribute">portal.test:service=HttpTestDriverServer</depends>
+ <depends optional-attribute-name="TestDriverRegistry"
proxy-type="attribute">portal.test:service=TestDriverServer</depends>
<depends optional-attribute-name="ServiceFactory"
proxy-type="attribute">portal.wsrp:service=CachingServiceFactory</depends>
<depends optional-attribute-name="Producer"
proxy-type="attribute">portal.wsrp:service=WSRPProducer</depends>
@@ -40,7 +40,7 @@
xmbean-dd=""
xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
<xmbean/>
- <depends optional-attribute-name="TestDriverRegistry"
proxy-type="attribute">portal.test:service=HttpTestDriverServer</depends>
+ <depends optional-attribute-name="TestDriverRegistry"
proxy-type="attribute">portal.test:service=TestDriverServer</depends>
<depends optional-attribute-name="ServiceFactory"
proxy-type="attribute">portal.wsrp:service=CachingServiceFactory</depends>
<depends optional-attribute-name="Producer"
proxy-type="attribute">portal.wsrp:service=WSRPProducer</depends>
Modified:
trunk/wsrp/src/resources/tests/test-wsrp-producer-portletmanagement-sar/META-INF/jboss-service.xml
===================================================================
---
trunk/wsrp/src/resources/tests/test-wsrp-producer-portletmanagement-sar/META-INF/jboss-service.xml 2007-04-20
20:59:43 UTC (rev 7016)
+++
trunk/wsrp/src/resources/tests/test-wsrp-producer-portletmanagement-sar/META-INF/jboss-service.xml 2007-04-21
12:07:46 UTC (rev 7017)
@@ -29,7 +29,7 @@
xmbean-dd=""
xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
<xmbean/>
- <depends optional-attribute-name="TestDriverRegistry"
proxy-type="attribute">portal.test:service=HttpTestDriverServer</depends>
+ <depends optional-attribute-name="TestDriverRegistry"
proxy-type="attribute">portal.test:service=TestDriverServer</depends>
<depends optional-attribute-name="ServiceFactory"
proxy-type="attribute">portal.wsrp:service=CachingServiceFactory</depends>
<depends optional-attribute-name="Producer"
proxy-type="attribute">portal.wsrp:service=WSRPProducer</depends>
</mbean>
Modified:
trunk/wsrp/src/resources/tests/test-wsrp-producer-registration-sar/META-INF/jboss-service.xml
===================================================================
---
trunk/wsrp/src/resources/tests/test-wsrp-producer-registration-sar/META-INF/jboss-service.xml 2007-04-20
20:59:43 UTC (rev 7016)
+++
trunk/wsrp/src/resources/tests/test-wsrp-producer-registration-sar/META-INF/jboss-service.xml 2007-04-21
12:07:46 UTC (rev 7017)
@@ -29,7 +29,7 @@
xmbean-dd=""
xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
<xmbean/>
- <depends optional-attribute-name="TestDriverRegistry"
proxy-type="attribute">portal.test:service=HttpTestDriverServer</depends>
+ <depends optional-attribute-name="TestDriverRegistry"
proxy-type="attribute">portal.test:service=TestDriverServer</depends>
<depends optional-attribute-name="ServiceFactory"
proxy-type="attribute">portal.wsrp:service=CachingServiceFactory</depends>
<depends optional-attribute-name="Producer"
proxy-type="attribute">portal.wsrp:service=WSRPProducer</depends>
</mbean>
Modified:
trunk/wsrp/src/resources/tests/test-wsrp-producer-sar/META-INF/jboss-service.xml
===================================================================
---
trunk/wsrp/src/resources/tests/test-wsrp-producer-sar/META-INF/jboss-service.xml 2007-04-20
20:59:43 UTC (rev 7016)
+++
trunk/wsrp/src/resources/tests/test-wsrp-producer-sar/META-INF/jboss-service.xml 2007-04-21
12:07:46 UTC (rev 7017)
@@ -26,8 +26,8 @@
<!-- -->
<mbean
- code="org.jboss.portal.test.framework.driver.http.HttpTestDriverServer"
- name="portal.test:service=HttpTestDriverServer"
+
code="org.jboss.portal.test.framework.driver.remote.RemoteTestDriverServer"
+ name="portal.test:service=TestDriverServer"
xmbean-dd=""
xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
<xmbean/>
@@ -37,10 +37,10 @@
</mbean>
<mbean
code="org.jboss.invocation.jrmp.server.JRMPProxyFactory"
- name="portal.test:service=Invoker,name=HttpTestDriverServer">
+ name="portal.test:service=Invoker,name=TestDriverServer">
<depends
optional-attribute-name="InvokerName">jboss:service=invoker,type=jrmp</depends>
- <depends
optional-attribute-name="TargetName">portal.test:service=HttpTestDriverServer</depends>
- <attribute name="JndiName">HttpTestDriverServer</attribute>
+ <depends
optional-attribute-name="TargetName">portal.test:service=TestDriverServer</depends>
+ <attribute name="JndiName">TestDriverServer</attribute>
<attribute
name="ExportedInterfaces">org.jboss.portal.test.framework.driver.http.HttpTestDriver</attribute>
</mbean>
Modified:
trunk/wsrp/src/resources/tests/test-wsrp-producer-servicedescription-sar/META-INF/jboss-service.xml
===================================================================
---
trunk/wsrp/src/resources/tests/test-wsrp-producer-servicedescription-sar/META-INF/jboss-service.xml 2007-04-20
20:59:43 UTC (rev 7016)
+++
trunk/wsrp/src/resources/tests/test-wsrp-producer-servicedescription-sar/META-INF/jboss-service.xml 2007-04-21
12:07:46 UTC (rev 7017)
@@ -29,7 +29,7 @@
xmbean-dd=""
xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
<xmbean/>
- <depends optional-attribute-name="TestDriverRegistry"
proxy-type="attribute">portal.test:service=HttpTestDriverServer</depends>
+ <depends optional-attribute-name="TestDriverRegistry"
proxy-type="attribute">portal.test:service=TestDriverServer</depends>
<depends optional-attribute-name="ServiceFactory"
proxy-type="attribute">portal.wsrp:service=CachingServiceFactory</depends>
<depends optional-attribute-name="Producer"
proxy-type="attribute">portal.wsrp:service=WSRPProducer</depends>
</mbean>