Author: julien(a)jboss.com
Date: 2007-04-17 17:17:25 -0400 (Tue, 17 Apr 2007)
New Revision: 6990
Modified:
trunk/portlet-server/src/resources/test/info/test-info-sar/META-INF/jboss-service.xml
trunk/test/src/main/org/jboss/portal/test/framework/driver/http/HTTPTestSuite.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/HttpTestDriverServer.java
Log:
fix test framework
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-17
19:27:20 UTC (rev 6989)
+++
trunk/portlet-server/src/resources/test/info/test-info-sar/META-INF/jboss-service.xml 2007-04-17
21:17:25 UTC (rev 6990)
@@ -23,22 +23,11 @@
<server>
- <!-- -->
<mbean
- code="org.jboss.portal.test.framework.driver.http.HttpTestDriverServer"
- name="portal.test:service=HttpTestDriverServer"
- 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>
- <mbean
code="org.jboss.invocation.jrmp.server.JRMPProxyFactory"
name="portal.test:service=Invoker,name=HttpTestDriverServer">
<depends
optional-attribute-name="InvokerName">jboss:service=invoker,type=jrmp</depends>
- <depends
optional-attribute-name="TargetName">portal.test:service=HttpTestDriverServer</depends>
+ <depends
optional-attribute-name="TargetName">portal:controller=Request</depends>
<attribute name="JndiName">HttpTestDriverServer</attribute>
<attribute
name="ExportedInterfaces">org.jboss.portal.test.framework.driver.http.HttpTestDriver</attribute>
</mbean>
@@ -109,7 +98,9 @@
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="Agent"
+ proxy-type="attribute">portal.test:service=Agent</depends>
</mbean>
<!-- The controller factory -->
Modified:
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-17
19:27:20 UTC (rev 6989)
+++
trunk/test/src/main/org/jboss/portal/test/framework/driver/http/HTTPTestSuite.java 2007-04-17
21:17:25 UTC (rev 6990)
@@ -48,7 +48,7 @@
String newTestId = item.getId(httpDriver.getInfo());
//
- HttpTestContext ctx2 = new HttpTestContext(newTestId,
testContext.getRequestCount(), testContext.getArchivePath(),
testContext.getParametrization());
+ HttpTestContext ctx2 = new HttpTestContext(newTestId, testContext);
//
httpDriver.pushContext(newTestId, ctx2);
@@ -65,11 +65,6 @@
String newTestId = item.getId(httpDriver.getInfo());
//
- HttpTestContext context = httpDriver.popContext(newTestId);
- context = new HttpTestContext(context);
- context.setTestAgent(null);
-
- //
- return context;
+ return httpDriver.popContext(newTestId);
}
}
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-17
19:27:20 UTC (rev 6989)
+++
trunk/test/src/main/org/jboss/portal/test/framework/driver/http/HttpTestContext.java 2007-04-17
21:17:25 UTC (rev 6990)
@@ -35,6 +35,7 @@
/**
* The test context seen from the server side.
+ * @todo make a client side context and a server side context, basically (server side
context == client side context + services)
*
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
* @version $Revision: 5498 $
@@ -85,8 +86,13 @@
/** The path where archive we want to deploy are. */
private String archivePath;
- /** The test agent, normally only valid in the server side for now. */
- private TestAgent testAgent;
+ /**
+ * 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;
/** The test parametrization. */
private TestParametrization parametrization;
@@ -100,14 +106,37 @@
this.requestCount = that.requestCount;
this.archivePath = that.archivePath;
this.response = that.response;
+ this.testAgent = that.testAgent;
}
- public HttpTestContext(String testName, int requestCount, String archivePath,
TestParametrization parametrization)
+ /**
+ * Normally used on the server side.
+ */
+ public HttpTestContext(
+ String testName,
+ HttpTestContext that)
{
this.testName = testName;
+ this.requestCount = that.requestCount;
+ this.archivePath = that.archivePath;
+ this.response = that.response;
+ this.testAgent = that.testAgent;
+ }
+
+ /**
+ * Normally used on the client side.
+ */
+ public HttpTestContext(
+ String testName,
+ int requestCount,
+ String archivePath,
+ TestParametrization parametrization)
+ {
+ this.testName = testName;
this.requestCount = requestCount;
this.archivePath = archivePath;
this.parametrization = parametrization;
+ this.testAgent = null;
}
public TestParametrization getParametrization()
@@ -121,22 +150,6 @@
}
/**
- * Should not be exposed, but for now, well.
- */
- public TestAgent getTestAgent()
- {
- return testAgent;
- }
-
- /**
- * Should not be exposed, but for now, well.
- */
- public void setTestAgent(TestAgent testAgent)
- {
- this.testAgent = testAgent;
- }
-
- /**
* Return the test id.
*
* @return the test id
Modified:
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-17
19:27:20 UTC (rev 6989)
+++
trunk/test/src/main/org/jboss/portal/test/framework/driver/http/HttpTestDriverServer.java 2007-04-17
21:17:25 UTC (rev 6990)
@@ -47,7 +47,7 @@
public void pushContext(String testId, HttpTestContext testContext)
{
- testContext.setTestAgent(getAgent());
+ testContext.testAgent = getAgent();
//
suite.pushContext(testId, testContext);
@@ -55,12 +55,7 @@
public HttpTestContext popContext(String testId)
{
- HttpTestContext context = suite.popContext(testId);
-
- //
- context = new HttpTestContext(context);
- context.setTestAgent(null);
- return context;
+ return suite.popContext(testId);
}
public synchronized void addDriver(TestDriver driver)