|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.springframework.extensions.webscripts.TestWebScriptServer
public class TestWebScriptServer
Stand-alone Web Script Test Server
Nested Class Summary | |
---|---|
static class |
TestWebScriptServer.DeleteRequest
Test DELETE Request |
static class |
TestWebScriptServer.GetRequest
Test GET Request |
static class |
TestWebScriptServer.MockHttpServletResponseResponse
Test Response wrapping a MockHttpServletResponse |
static class |
TestWebScriptServer.PatchRequest
Test PATCH Request |
static class |
TestWebScriptServer.PostRequest
Test POST Request |
static class |
TestWebScriptServer.PutRequest
Test PUT Request |
static class |
TestWebScriptServer.Request
A Web Script Test Request |
static interface |
TestWebScriptServer.Response
A Web Script Test Response |
Field Summary | |
---|---|
protected org.springframework.context.ApplicationContext |
applicationContext
The application context |
protected ServletAuthenticatorFactory |
authenticatorFactory
|
protected ConfigService |
configService
|
protected RuntimeContainer |
container
|
protected BufferedReader |
fIn
The reader for interaction. |
protected Map<String,String> |
headers
Current headers |
protected String |
lastCommand
Last command issued |
protected org.springframework.context.MessageSource |
m_messages
I18N Messages |
protected ServerProperties |
serverProperties
Server Configuration |
protected String |
username
Current user |
Constructor Summary | |
---|---|
TestWebScriptServer()
|
Method Summary | |
---|---|
void |
afterPropertiesSet()
|
protected String |
executeCommand(String line)
Execute a single command using the BufferedReader passed in for any data needed. |
org.springframework.context.ApplicationContext |
getApplicationContext()
Gets the application context |
protected String |
getDefaultUserName()
Get default user name |
ServerProperties |
getServerProperties()
Gets the server properties |
static TestWebScriptServer |
getTestServer()
Retrieve an instance of the TestWebScriptServer |
protected String |
interpretCommand(String line)
Interpret a single command using the BufferedReader passed in for any data needed. |
static void |
main(String[] args)
Main entry point. |
void |
rep()
A Read-Eval-Print loop. |
void |
setApplicationContext(org.springframework.context.ApplicationContext applicationContext)
Sets the application context |
void |
setConfigService(ConfigService configService)
|
void |
setContainer(RuntimeContainer container)
Sets the Web Script Runtime Context |
void |
setMessages(org.springframework.context.MessageSource messages)
Sets the Messages resource bundle |
void |
setServletAuthenticatorFactory(ServletAuthenticatorFactory authenticatorFactory)
|
TestWebScriptServer.Response |
submitRequest(String method,
String uri,
Map<String,String> headers,
byte[] body,
String encoding,
String contentType)
Submit a Web Script Request. |
TestWebScriptServer.Response |
submitRequest(TestWebScriptServer.Request req)
Submit a Web Script Request. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected org.springframework.context.ApplicationContext applicationContext
protected ConfigService configService
protected RuntimeContainer container
protected ServletAuthenticatorFactory authenticatorFactory
protected ServerProperties serverProperties
protected BufferedReader fIn
protected String lastCommand
protected String username
protected Map<String,String> headers
protected org.springframework.context.MessageSource m_messages
Constructor Detail |
---|
public TestWebScriptServer()
Method Detail |
---|
public void setConfigService(ConfigService configService)
configService
- public void setContainer(RuntimeContainer container)
container
- public void setServletAuthenticatorFactory(ServletAuthenticatorFactory authenticatorFactory)
authenticatoFactory
- public void setMessages(org.springframework.context.MessageSource messages) throws IOException
messages
-
IOException
public void setApplicationContext(org.springframework.context.ApplicationContext applicationContext) throws org.springframework.beans.BeansException
setApplicationContext
in interface org.springframework.context.ApplicationContextAware
applicationContext
- the application context
org.springframework.beans.BeansException
public void afterPropertiesSet() throws Exception
afterPropertiesSet
in interface org.springframework.beans.factory.InitializingBean
Exception
protected String getDefaultUserName()
public ServerProperties getServerProperties()
Exception
public org.springframework.context.ApplicationContext getApplicationContext()
public static void main(String[] args)
public static TestWebScriptServer getTestServer()
public TestWebScriptServer.Response submitRequest(TestWebScriptServer.Request req) throws IOException
req
- request
IOException
public TestWebScriptServer.Response submitRequest(String method, String uri, Map<String,String> headers, byte[] body, String encoding, String contentType) throws IOException
Can specifiy content and content type
method
- http methoduri
- web script (relative to /alfresco/service)headers
- headersbody
- body of request content (can be null)contentType
- content type (eg "multipart/form-data") (can be null)
IOException
public void rep()
protected String interpretCommand(String line) throws IOException
line
- The unparsed command
IOException
protected String executeCommand(String line) throws IOException
line
- The unparsed command
IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |