public abstract class BaseWebScriptTest
extends junit.framework.TestCase
Modifier and Type | Class and Description |
---|---|
static class |
BaseWebScriptTest.BaseWebScriptTestListener
Default Test Listener
|
static class |
BaseWebScriptTest.HttpMethodResponse
HttpMethod wrapped as Web Script Test Response
|
static class |
BaseWebScriptTest.PatchMethod
PATCH method
|
static class |
BaseWebScriptTest.RemoteServer
Remote Context
|
static interface |
BaseWebScriptTest.WebScriptTestListener
Web Script Test Listener
|
Constructor and Description |
---|
BaseWebScriptTest() |
Modifier and Type | Method and Description |
---|---|
org.springframework.extensions.webscripts.servlet.ServletAuthenticatorFactory |
getCustomAuthenticatorFactory()
Returns the custom
ServletAuthenticatorFactory which is injected into
an TestWebScriptServer instances that are returned, if any. |
java.lang.String |
getDefaultRunAs()
Get Default Local Run As User
|
BaseWebScriptTest.RemoteServer |
getRemoteServer()
Gets Remote Server
|
protected org.springframework.extensions.webscripts.TestWebScriptServer |
getServer()
Get the server for the previously-supplied
custom context |
protected boolean |
isLogEnabled()
Is Log Enabled?
|
protected void |
log(java.lang.String log)
Log Message to Test Listener
|
protected org.springframework.extensions.webscripts.TestWebScriptServer.Response |
sendLocalRequest(org.springframework.extensions.webscripts.TestWebScriptServer.Request req,
int expectedStatus,
java.lang.String asUser)
Send Local Request to Test Web Script Server
|
protected org.springframework.extensions.webscripts.TestWebScriptServer.Response |
sendRemoteRequest(org.springframework.extensions.webscripts.TestWebScriptServer.Request req,
int expectedStatus)
Send Remote Request to stand-alone Web Script Server
|
protected org.springframework.extensions.webscripts.TestWebScriptServer.Response |
sendRequest(org.springframework.extensions.webscripts.TestWebScriptServer.Request req,
int expectedStatus)
Send Request to Test Web Script Server (as admin)
|
protected org.springframework.extensions.webscripts.TestWebScriptServer.Response |
sendRequest(org.springframework.extensions.webscripts.TestWebScriptServer.Request req,
int expectedStatus,
java.lang.String asUser)
Send Request
|
void |
setCustomAuthenticatorFactory(org.springframework.extensions.webscripts.servlet.ServletAuthenticatorFactory customAuthenticatorFactory)
Sets that a custom
ServletAuthenticatorFactory should be injected into
instances of TestWebScriptServer returned from BaseWebScriptTest.getServer() |
protected void |
setCustomContext(java.lang.String customContext)
Sets custom context for Test Web Script Server (in-process only)
|
void |
setDefaultRunAs(java.lang.String localRunAs)
Set Default Local Run As User
|
void |
setListener(BaseWebScriptTest.WebScriptTestListener listener)
Sets Test Listener
|
void |
setRemoteServer(BaseWebScriptTest.RemoteServer server)
Set Remote Server context
|
void |
setTraceReqRes(boolean traceReqRes)
Sets whether to trace request / response bodies
|
protected void |
setUp() |
countTestCases, createResult, getName, run, run, runBare, runTest, setName, tearDown, toString
assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, fail, fail, failNotEquals, failNotSame, failSame, format
protected void setCustomContext(java.lang.String customContext)
customContext
- public void setListener(BaseWebScriptTest.WebScriptTestListener listener)
resultPrinter
- public void setTraceReqRes(boolean traceReqRes)
traceReqRes
- public void setRemoteServer(BaseWebScriptTest.RemoteServer server)
server
- remote serverpublic BaseWebScriptTest.RemoteServer getRemoteServer()
public void setDefaultRunAs(java.lang.String localRunAs)
localRunAs
- public java.lang.String getDefaultRunAs()
public org.springframework.extensions.webscripts.servlet.ServletAuthenticatorFactory getCustomAuthenticatorFactory()
ServletAuthenticatorFactory
which is injected into
an TestWebScriptServer
instances that are returned, if any.
Default is not to alter the ServletAuthenticatorFactory
public void setCustomAuthenticatorFactory(org.springframework.extensions.webscripts.servlet.ServletAuthenticatorFactory customAuthenticatorFactory)
ServletAuthenticatorFactory
should be injected into
instances of TestWebScriptServer
returned from BaseWebScriptTest.getServer()
protected void setUp() throws java.lang.Exception
setUp
in class junit.framework.TestCase
java.lang.Exception
protected org.springframework.extensions.webscripts.TestWebScriptServer getServer()
custom context
protected boolean isLogEnabled()
protected void log(java.lang.String log)
log
- protected org.springframework.extensions.webscripts.TestWebScriptServer.Response sendRequest(org.springframework.extensions.webscripts.TestWebScriptServer.Request req, int expectedStatus) throws java.io.IOException
req
- expectedStatus
- java.io.IOException
protected org.springframework.extensions.webscripts.TestWebScriptServer.Response sendRequest(org.springframework.extensions.webscripts.TestWebScriptServer.Request req, int expectedStatus, java.lang.String asUser) throws java.io.IOException
req
- expectedStatus
- asUser
- java.io.IOException
protected org.springframework.extensions.webscripts.TestWebScriptServer.Response sendLocalRequest(org.springframework.extensions.webscripts.TestWebScriptServer.Request req, int expectedStatus, java.lang.String asUser) throws java.io.IOException
req
- expectedStatus
- asUser
- java.io.IOException
protected org.springframework.extensions.webscripts.TestWebScriptServer.Response sendRemoteRequest(org.springframework.extensions.webscripts.TestWebScriptServer.Request req, int expectedStatus) throws java.io.IOException
req
- expectedStatus
- asUser
- java.io.IOException
Copyright © 2005 - 2010 Alfresco Software, Inc. All Rights Reserved.