|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.junit.Assert
play.test.BaseTest
play.test.FunctionalTest
public abstract class FunctionalTest
Application tests support
| Nested Class Summary | |
|---|---|
static class |
FunctionalTest.FakeInvocation
|
| Constructor Summary | |
|---|---|
FunctionalTest()
|
|
| Method Summary | |
|---|---|
void |
after()
|
static void |
assertCharset(java.lang.String charset,
Http.Response response)
Verify response charset encoding, as returned by the server in the Content-Type header. |
static void |
assertContentEquals(java.lang.String content,
Http.Response response)
Exact equality assertion on response body |
static void |
assertContentMatch(java.lang.String pattern,
Http.Response response)
Asserts response body matched a pattern or contains some text. |
static void |
assertContentType(java.lang.String contentType,
Http.Response response)
Verify the response content-type |
static void |
assertHeaderEquals(java.lang.String headerName,
java.lang.String value,
Http.Response response)
Exact equality assertion on a response header value |
static void |
assertIsNotFound(Http.Response response)
Asserts a 404 (not found) response |
static void |
assertIsOk(Http.Response response)
Asserts a 2OO Success response |
static void |
assertStatus(int status,
Http.Response response)
Asserts response status code |
void |
before()
|
static Http.Response |
DELETE(java.lang.String url)
Sends a DELETE request to the application under tests. |
static Http.Response |
GET(java.lang.String url)
sends a GET request to the application under tests. |
static java.lang.String |
getContent(Http.Response response)
obtains the response body as a string |
static void |
makeRequest(Http.Request request,
Http.Response response)
|
static Http.Request |
newRequest()
|
static Http.Response |
newResponse()
|
static Http.Response |
POST(java.lang.String url)
|
static Http.Response |
POST(java.lang.String url,
java.lang.String contenttype,
java.lang.String body)
Sends a POST request to the application under tests. |
static Http.Response |
PUT(java.lang.String url,
java.lang.String contenttype,
java.lang.String body)
Sends a PUT request to the application under tests. |
void |
sleep(int seconds)
pause execution |
| Methods inherited from class play.test.BaseTest |
|---|
clearJPASession, pause |
| Methods inherited from class org.junit.Assert |
|---|
assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertThat, assertThat, assertTrue, assertTrue, fail, fail |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public FunctionalTest()
| Method Detail |
|---|
public void before()
public void after()
public static Http.Response GET(java.lang.String url)
url - relative url such as "/products/1234"
public static Http.Response POST(java.lang.String url)
public static Http.Response POST(java.lang.String url,
java.lang.String contenttype,
java.lang.String body)
url - relative url such as "/products/1234"contenttype - content-type of the requestbody - posted data
public static Http.Response PUT(java.lang.String url,
java.lang.String contenttype,
java.lang.String body)
url - relative url such as "/products/1234"contenttype - content-type of the requestbody - data to send
public static Http.Response DELETE(java.lang.String url)
url - relative url eg. "/products/1234"
public static void makeRequest(Http.Request request,
Http.Response response)
public static Http.Response newResponse()
public static Http.Request newRequest()
public static void assertIsOk(Http.Response response)
response - server responsepublic static void assertIsNotFound(Http.Response response)
response - server response
public static void assertStatus(int status,
Http.Response response)
status - expected HTTP response coderesponse - server response
public static void assertContentEquals(java.lang.String content,
Http.Response response)
content - expected body contentresponse - server response
public static void assertContentMatch(java.lang.String pattern,
Http.Response response)
pattern - a regular expression pattern or a regular text, ( which must be escaped using Pattern.quote)response - server response
public static void assertCharset(java.lang.String charset,
Http.Response response)
charset - expected charset encoding such as "utf-8" or "iso8859-1".response - server response
public static void assertContentType(java.lang.String contentType,
Http.Response response)
contentType - expected content-type without any charset extension, such as "text/html"response - server response
public static void assertHeaderEquals(java.lang.String headerName,
java.lang.String value,
Http.Response response)
headerName - header to verify. case-insensitivevalue - expected header valueresponse - server responsepublic static java.lang.String getContent(Http.Response response)
response - server response
public void sleep(int seconds)
seconds - seconds to sleep
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||