Author: julien(a)jboss.com
Date: 2007-04-18 09:28:32 -0400 (Wed, 18 Apr 2007)
New Revision: 7005
Modified:
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/test/src/main/org/jboss/portal/test/framework/driver/http/HttpTestContext.java
Log:
slight improvement of HTTPTestContext
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-18
13:22:03 UTC (rev 7004)
+++
trunk/portlet/src/main/org/jboss/portal/test/framework/portlet/PortletTestContext.java 2007-04-18
13:28:32 UTC (rev 7005)
@@ -36,21 +36,24 @@
public class PortletTestContext
{
+ final String testName;
+
/** . */
final HttpTestContext httpTestContext;
- public PortletTestContext(HttpTestContext httpTestContext)
+ public PortletTestContext(String testName, HttpTestContext httpTestContext)
{
if (httpTestContext == null)
{
throw new IllegalArgumentException("No http test context to wrap");
}
+ this.testName = testName;
this.httpTestContext = httpTestContext;
}
public String getTestName()
{
- return httpTestContext.getTestName();
+ return testName;
}
public void setResponse(DriverResponse response)
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-18
13:22:03 UTC (rev 7004)
+++
trunk/portlet/src/main/org/jboss/portal/test/framework/portlet/PortletTestDriver.java 2007-04-18
13:28:32 UTC (rev 7005)
@@ -123,7 +123,7 @@
public void pushContext(String testId, HttpTestContext testContext)
{
- context = new PortletTestContext(testContext);
+ context = new PortletTestContext(testId, testContext);
}
public HttpTestContext popContext(String testId)
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-18
13:22:03 UTC (rev 7004)
+++
trunk/test/src/main/org/jboss/portal/test/framework/driver/http/HttpTestContext.java 2007-04-18
13:28:32 UTC (rev 7005)
@@ -74,9 +74,6 @@
throw new UnsupportedOperationException("Don't use this API");
}
- /** The test name. */
- private final String testName;
-
/** The test count. */
private int requestCount;
@@ -102,7 +99,6 @@
*/
public HttpTestContext(HttpTestContext that)
{
- this.testName = that.testName;
this.requestCount = that.requestCount;
this.archivePath = that.archivePath;
this.response = that.response;
@@ -117,7 +113,6 @@
String testName,
HttpTestContext that)
{
- this.testName = testName;
this.requestCount = that.requestCount;
this.archivePath = that.archivePath;
this.response = that.response;
@@ -134,7 +129,6 @@
String archivePath,
TestParametrization parametrization)
{
- this.testName = testName;
this.requestCount = requestCount;
this.archivePath = archivePath;
this.parametrization = parametrization;
@@ -152,16 +146,6 @@
}
/**
- * Return the test id.
- *
- * @return the test id
- */
- public String getTestName()
- {
- return testName;
- }
-
- /**
* Return the test count.
*
* @return the test count
@@ -276,19 +260,19 @@
testAgent.undeploy(url);
}
- public static boolean isCurrentTestName(String testName) throws IllegalStateException
- {
- if (testName == null)
- {
- throw new IllegalArgumentException();
- }
- return testName.equals(getCurrentContext().testName);
- }
+// 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 String getCurrentTestName() throws IllegalStateException
+// {
+// return getCurrentContext().testName;
+// }
public static boolean isCurrentRequestCount(int count) throws IllegalStateException
{
@@ -321,6 +305,6 @@
public String toString()
{
- return "TestCaseContext[" + testName + "," + requestCount +
"]";
+ return "TestCaseContext[" + requestCount + "]";
}
}