[jboss-svn-commits] JBoss Portal SVN: r5526 - in trunk: portlet/src/main/org/jboss/portal/test/framework/portlet/components server/src/main/org/jboss/portal/test/server test/src/main/org/jboss/portal/test/framework/driver/http
jboss-svn-commits at lists.jboss.org
jboss-svn-commits at lists.jboss.org
Tue Oct 31 09:00:29 EST 2006
Author: julien at jboss.com
Date: 2006-10-31 09:00:18 -0500 (Tue, 31 Oct 2006)
New Revision: 5526
Modified:
trunk/portlet/src/main/org/jboss/portal/test/framework/portlet/components/AbstractTestGenericPortlet.java
trunk/portlet/src/main/org/jboss/portal/test/framework/portlet/components/AbstractTestPortlet.java
trunk/portlet/src/main/org/jboss/portal/test/framework/portlet/components/AbstractUniversalTestPortlet.java
trunk/portlet/src/main/org/jboss/portal/test/framework/portlet/components/AbstractUniversalTestServlet.java
trunk/server/src/main/org/jboss/portal/test/server/TestRequestController.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/HttpTestDriverClient.java
Log:
- minor renames of members in HttpTestContext
Modified: trunk/portlet/src/main/org/jboss/portal/test/framework/portlet/components/AbstractTestGenericPortlet.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/test/framework/portlet/components/AbstractTestGenericPortlet.java 2006-10-31 13:54:54 UTC (rev 5525)
+++ trunk/portlet/src/main/org/jboss/portal/test/framework/portlet/components/AbstractTestGenericPortlet.java 2006-10-31 14:00:18 UTC (rev 5526)
@@ -60,7 +60,7 @@
public void processAction(ActionRequest req, ActionResponse resp) throws PortletException, PortletSecurityException, IOException
{
- if (HttpTestContext.isCurrentCaseTestId(testCaseId))
+ if (HttpTestContext.isCurrentTestName(testCaseId))
{
doProcessAction(req, resp);
}
@@ -68,7 +68,7 @@
final public void render(RenderRequest request, RenderResponse response) throws PortletException, PortletSecurityException, IOException
{
- if (HttpTestContext.isCurrentCaseTestId(testCaseId))
+ if (HttpTestContext.isCurrentTestName(testCaseId))
{
preRender(request, response);
super.render(request, response);
Modified: trunk/portlet/src/main/org/jboss/portal/test/framework/portlet/components/AbstractTestPortlet.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/test/framework/portlet/components/AbstractTestPortlet.java 2006-10-31 13:54:54 UTC (rev 5525)
+++ trunk/portlet/src/main/org/jboss/portal/test/framework/portlet/components/AbstractTestPortlet.java 2006-10-31 14:00:18 UTC (rev 5526)
@@ -104,7 +104,7 @@
public final void processAction(ActionRequest req, ActionResponse resp) throws PortletException, PortletSecurityException, IOException
{
- if (HttpTestContext.isCurrentCaseTestId(testCaseId))
+ if (HttpTestContext.isCurrentTestName(testCaseId))
{
doProcessAction(req, resp);
}
@@ -112,7 +112,7 @@
public final void render(RenderRequest req, RenderResponse resp) throws PortletException, PortletSecurityException, IOException
{
- if (HttpTestContext.isCurrentCaseTestId(testCaseId))
+ if (HttpTestContext.isCurrentTestName(testCaseId))
{
doRender(req, resp);
}
@@ -165,6 +165,6 @@
public static void marshall(DriverResponse response)
{
- HttpTestContext.setCurrentResult(response);
+ HttpTestContext.setCurrentResponse(response);
}
}
Modified: trunk/portlet/src/main/org/jboss/portal/test/framework/portlet/components/AbstractUniversalTestPortlet.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/test/framework/portlet/components/AbstractUniversalTestPortlet.java 2006-10-31 13:54:54 UTC (rev 5525)
+++ trunk/portlet/src/main/org/jboss/portal/test/framework/portlet/components/AbstractUniversalTestPortlet.java 2006-10-31 14:00:18 UTC (rev 5526)
@@ -139,7 +139,7 @@
//
log.debug("Component '" + getComponentId() + "' processAction() method invoked for '"
- + ctx.getTestCaseId() + "' testId and '" +
+ + ctx.getTestName() + "' testId and '" +
+ctx.getRequestCount() + "' request count");
//
@@ -154,11 +154,11 @@
//
if (action == null)
{
- ctx.setResult(new FailureResponse("No action for " + ctx.getRequestCount() + " " + NodeId.locate() + " " + actionJoinpoint));
+ ctx.setResponse(new FailureResponse("No action for " + ctx.getRequestCount() + " " + NodeId.locate() + " " + actionJoinpoint));
}
else if (action instanceof PortletActionTestAction == false)
{
- ctx.setResult(new FailureResponse("Action for " + ctx.getRequestCount() + " " + NodeId.locate() + " " + actionJoinpoint + " is not an instance of " + PortletActionTestAction.class.getName() + " but is " + action.getClass().getName()));
+ ctx.setResponse(new FailureResponse("Action for " + ctx.getRequestCount() + " " + NodeId.locate() + " " + actionJoinpoint + " is not an instance of " + PortletActionTestAction.class.getName() + " but is " + action.getClass().getName()));
}
else
{
@@ -168,7 +168,7 @@
DriverResponse response = ((PortletActionTestAction)action).execute(this, req, resp);
//
- ctx.setResult(response);
+ ctx.setResponse(response);
}
}
}
@@ -189,7 +189,7 @@
//
log.debug("Component '" + getComponentId() + "' render() method invoked for '"
- + ctx.getTestCaseId() + "' testId and '" +
+ + ctx.getTestName() + "' testId and '" +
+ctx.getRequestCount() + "' request count");
// Reset AssertResult at begining of test
@@ -217,7 +217,7 @@
// If we have one result it is meant to be returned to the client
if (sr != null)
{
- ctx.setResult(sr);
+ ctx.setResponse(sr);
}
}
}
@@ -264,7 +264,7 @@
log.error("No SequenceRegistry object found in current context");
throw new PortletException("No SequenceRegistry object found in context");
}
- return registry.getSequence(HttpTestContext.getCurrentTestCaseId());
+ return registry.getSequence(HttpTestContext.getCurrentTestName());
}
protected String getComponentId()
Modified: trunk/portlet/src/main/org/jboss/portal/test/framework/portlet/components/AbstractUniversalTestServlet.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/test/framework/portlet/components/AbstractUniversalTestServlet.java 2006-10-31 13:54:54 UTC (rev 5525)
+++ trunk/portlet/src/main/org/jboss/portal/test/framework/portlet/components/AbstractUniversalTestServlet.java 2006-10-31 14:00:18 UTC (rev 5526)
@@ -101,7 +101,7 @@
//
log.info("Component '" + getComponentId() + "' service() method invoked for '"
- + ctx.getTestCaseId() + "' testId and '" +
+ + ctx.getTestName() + "' testId and '" +
+ctx.getRequestCount() + "' request count");
// Reset instance state
@@ -120,7 +120,7 @@
DriverResponse dr = ((ServletServiceTestAction)action).execute(this, request, response);
if (dr != null)
{
- ctx.setResult(dr);
+ ctx.setResponse(dr);
}
}
@@ -167,7 +167,7 @@
throw new ServletException("No SequenceRegistry object found in context");
}
HttpTestContext ctx = HttpTestContext.getCurrentContext();
- return registry.getSequence(ctx.getTestCaseId());
+ return registry.getSequence(ctx.getTestName());
}
protected String getComponentId()
Modified: trunk/server/src/main/org/jboss/portal/test/server/TestRequestController.java
===================================================================
--- trunk/server/src/main/org/jboss/portal/test/server/TestRequestController.java 2006-10-31 13:54:54 UTC (rev 5525)
+++ trunk/server/src/main/org/jboss/portal/test/server/TestRequestController.java 2006-10-31 14:00:18 UTC (rev 5526)
@@ -54,20 +54,20 @@
public void handle(ServerInvocation invocation) throws ServerException
{
- String testName = HttpTestContext.getCurrentTestCaseId();
+ String testName = HttpTestContext.getCurrentTestName();
AbstractTest test = (AbstractTest)registry.getDriver(testName);
try
{
DriverResponse response = test.execute(invocation);
- HttpTestContext.setCurrentResult(response);
+ HttpTestContext.setCurrentResponse(response);
}
catch (AssertionFailedError e)
{
- HttpTestContext.setCurrentResult(new FailureResponse(e));
+ HttpTestContext.setCurrentResponse(new FailureResponse(e));
}
catch (Exception e)
{
- HttpTestContext.setCurrentResult(new ErrorResponse(e));
+ HttpTestContext.setCurrentResponse(new ErrorResponse(e));
}
}
}
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 2006-10-31 13:54:54 UTC (rev 5525)
+++ trunk/test/src/main/org/jboss/portal/test/framework/driver/http/HttpTestContext.java 2006-10-31 14:00:18 UTC (rev 5526)
@@ -79,14 +79,14 @@
currentContext = newContext;
}
- /** The test id. */
- private final String testCaseId;
+ /** The test name. */
+ private final String testName;
/** The test count. */
private int requestCount;
- /** The test result. */
- private DriverResponse result;
+ /** The test response. */
+ private DriverResponse response;
/** The path where archive we want to deploy are. */
private String archivePath;
@@ -99,15 +99,15 @@
*/
public HttpTestContext(HttpTestContext that)
{
- this.testCaseId = that.testCaseId;
+ this.testName = that.testName;
this.requestCount = that.requestCount;
this.archivePath = that.archivePath;
- this.result = that.result;
+ this.response = that.response;
}
- public HttpTestContext(String testCaseId, int requestCount, String archivePath)
+ public HttpTestContext(String testName, int requestCount, String archivePath)
{
- this.testCaseId = testCaseId;
+ this.testName = testName;
this.requestCount = requestCount;
this.archivePath = archivePath;
}
@@ -133,9 +133,9 @@
*
* @return the test id
*/
- public String getTestCaseId()
+ public String getTestName()
{
- return testCaseId;
+ return testName;
}
/**
@@ -149,24 +149,24 @@
}
/**
- * Return the result.
+ * Return the response.
*
- * @return the result of the test
+ * @return the response of the test
*/
- public DriverResponse getResult()
+ public DriverResponse getResponse()
{
- return result;
+ return response;
}
- public void setResult(DriverResponse result)
+ public void setResponse(DriverResponse response)
{
- if (this.result != null)
+ if (this.response != null)
{
- throw new IllegalStateException("A result is already provided");
+ throw new IllegalStateException("A response is already provided");
}
else
{
- this.result = result;
+ this.response = response;
}
}
@@ -241,18 +241,18 @@
testAgent.undeploy(url);
}
- public static boolean isCurrentCaseTestId(String id) throws IllegalStateException
+ public static boolean isCurrentTestName(String testName) throws IllegalStateException
{
- if (id == null)
+ if (testName == null)
{
throw new IllegalArgumentException();
}
- return id.equals(getCurrentContext().testCaseId);
+ return testName.equals(getCurrentContext().testName);
}
- public static String getCurrentTestCaseId() throws IllegalStateException
+ public static String getCurrentTestName() throws IllegalStateException
{
- return getCurrentContext().testCaseId;
+ return getCurrentContext().testName;
}
public static boolean isCurrentRequestCount(int count) throws IllegalStateException
@@ -265,12 +265,12 @@
return getCurrentContext().requestCount;
}
- public static DriverResponse getCurrentResult() throws IllegalStateException
+ public static DriverResponse getCurrentResponse() throws IllegalStateException
{
HttpTestContext ctx = getCurrentContext();
if (ctx != null)
{
- return ctx.result;
+ return ctx.response;
}
else
{
@@ -278,14 +278,14 @@
}
}
- public static void setCurrentResult(DriverResponse currentResult) throws IllegalStateException
+ public static void setCurrentResponse(DriverResponse currentResponse) throws IllegalStateException
{
HttpTestContext ctx = getCurrentContext();
- ctx.setResult(currentResult);
+ ctx.setResponse(currentResponse);
}
public String toString()
{
- return "TestCaseContext[" + testCaseId + "," + requestCount + "]";
+ return "TestCaseContext[" + testName + "," + requestCount + "]";
}
}
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 2006-10-31 13:54:54 UTC (rev 5525)
+++ trunk/test/src/main/org/jboss/portal/test/framework/driver/http/HttpTestDriverClient.java 2006-10-31 14:00:18 UTC (rev 5526)
@@ -317,7 +317,7 @@
//
HttpTestDriverServer agent = getServer();
HttpTestContext ctx = agent.retrieveContext();
- DriverResponse response = ctx.getResult();
+ DriverResponse response = ctx.getResponse();
int status = hm.getStatusCode();
switch (status)
{
More information about the jboss-svn-commits
mailing list