站内搜索: 请输入搜索关键词
当前页面: 在线文档首页 > JBOSS Portal 2.6 API 英文版文档

TestCaseContext - JBOSS Portal 2.6 API 英文版文档


org.jboss.portal.test.framework
Class TestCaseContext

java.lang.Object
  extended byorg.jboss.portal.test.framework.TestCaseContext
All Implemented Interfaces:
java.io.Serializable

public class TestCaseContext
extends java.lang.Object
implements java.io.Serializable

The test context seen from the server side.

Version:
$Revision: 5498 $
Author:
Julien Viet
See Also:
Serialized Form

Field Summary
private  java.lang.String archivePath
          The path where archive we want to deploy are.
private static TestCaseContext currentContext
          The current context.
private  int requestCount
          The test count.
private  Result result
          The test result.
private  TestAgent testAgent
          The test agent, normally only valid in the server side for now.
private  java.lang.String testCaseId
          The test id.
 
Constructor Summary
TestCaseContext(java.lang.String testCaseId, int requestCount, java.lang.String archivePath)
           
TestCaseContext(TestCaseContext that)
          Copy constructor.
 
Method Summary
 void deploy(java.lang.String archiveId)
           
static TestCaseContext getCurrentContext()
          Return the current test case context.
static int getCurrentRequestCount()
           
static Result getCurrentResult()
           
static java.lang.String getCurrentTestCaseId()
           
 int getRequestCount()
          Return the test count.
 Result getResult()
          Return the result.
 TestAgent getTestAgent()
          Should not be exposed, but for now, well.
 java.lang.String getTestCaseId()
          Return the test id.
static boolean isCurrentCaseTestId(java.lang.String id)
           
static boolean isCurrentRequestCount(int count)
           
static TestCaseContext peekCurrentContext()
          Return the current test case context or null if none exist.
 java.lang.String rewriteURLForNode(java.lang.String url, NodeId nodeId)
           
static void setCurrentContext(TestCaseContext newContext)
          Set the current context.
static void setCurrentResult(Result currentResult)
           
 void setResult(Result result)
           
 void setTestAgent(TestAgent testAgent)
          Should not be exposed, but for now, well.
 java.lang.String toString()
           
 void undeploy(java.lang.String archiveId)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

currentContext

private static TestCaseContext currentContext
The current context.


testCaseId

private final java.lang.String testCaseId
The test id.


requestCount

private int requestCount
The test count.


result

private Result result
The test result.


archivePath

private java.lang.String archivePath
The path where archive we want to deploy are.


testAgent

private TestAgent testAgent
The test agent, normally only valid in the server side for now.

Constructor Detail

TestCaseContext

public TestCaseContext(TestCaseContext that)
Copy constructor.


TestCaseContext

public TestCaseContext(java.lang.String testCaseId,
                       int requestCount,
                       java.lang.String archivePath)
Method Detail

getCurrentContext

public static TestCaseContext getCurrentContext()
                                         throws java.lang.IllegalStateException
Return the current test case context.

Returns:
the current test context
Throws:
java.lang.IllegalStateException - if there is no current context

peekCurrentContext

public static TestCaseContext peekCurrentContext()
Return the current test case context or null if none exist.

Returns:
the current test context

setCurrentContext

public static void setCurrentContext(TestCaseContext newContext)
Set the current context.

Parameters:
newContext - the test case context

getTestAgent

public TestAgent getTestAgent()
Should not be exposed, but for now, well.


setTestAgent

public void setTestAgent(TestAgent testAgent)
Should not be exposed, but for now, well.


getTestCaseId

public java.lang.String getTestCaseId()
Return the test id.

Returns:
the test id

getRequestCount

public int getRequestCount()
Return the test count.

Returns:
the test count

getResult

public Result getResult()
Return the result.

Returns:
the result of the test

setResult

public void setResult(Result result)

rewriteURLForNode

public java.lang.String rewriteURLForNode(java.lang.String url,
                                          NodeId nodeId)
                                   throws java.net.MalformedURLException
Parameters:
url - the url to rewrite
nodeId - the node id
Returns:
the rewritten url
Throws:
java.net.MalformedURLException
java.lang.IllegalArgumentException - if the url is null or the node id not recognized

deploy

public void deploy(java.lang.String archiveId)
            throws java.net.MalformedURLException,
                   java.lang.IllegalStateException,
                   org.jboss.deployment.DeploymentException
Throws:
java.net.MalformedURLException
java.lang.IllegalStateException
org.jboss.deployment.DeploymentException

undeploy

public void undeploy(java.lang.String archiveId)
              throws java.net.MalformedURLException,
                     java.lang.IllegalStateException,
                     org.jboss.deployment.DeploymentException
Throws:
java.net.MalformedURLException
java.lang.IllegalStateException
org.jboss.deployment.DeploymentException

isCurrentCaseTestId

public static boolean isCurrentCaseTestId(java.lang.String id)
                                   throws java.lang.IllegalStateException
Throws:
java.lang.IllegalStateException

getCurrentTestCaseId

public static java.lang.String getCurrentTestCaseId()
                                             throws java.lang.IllegalStateException
Throws:
java.lang.IllegalStateException

isCurrentRequestCount

public static boolean isCurrentRequestCount(int count)
                                     throws java.lang.IllegalStateException
Throws:
java.lang.IllegalStateException

getCurrentRequestCount

public static int getCurrentRequestCount()
                                  throws java.lang.IllegalStateException
Throws:
java.lang.IllegalStateException

getCurrentResult

public static Result getCurrentResult()
                               throws java.lang.IllegalStateException
Throws:
java.lang.IllegalStateException

setCurrentResult

public static void setCurrentResult(Result currentResult)
                             throws java.lang.IllegalStateException
Throws:
java.lang.IllegalStateException

toString

public java.lang.String toString()