|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object play.test.Helpers
public class Helpers
Helper functions to run tests.
Field Summary | |
---|---|
static java.lang.String |
DELETE
|
static java.lang.Class<? extends org.openqa.selenium.WebDriver> |
FIREFOX
|
static java.lang.String |
GET
|
static java.lang.String |
HEAD
|
static java.lang.Class<? extends org.openqa.selenium.WebDriver> |
HTMLUNIT
|
static java.lang.String |
POST
|
static java.lang.String |
PUT
|
Fields inherited from interface play.mvc.Http.HeaderNames |
---|
ACCEPT, ACCEPT_CHARSET, ACCEPT_ENCODING, ACCEPT_LANGUAGE, ACCEPT_RANGES, AGE, ALLOW, AUTHORIZATION, CACHE_CONTROL, CONNECTION, CONTENT_ENCODING, CONTENT_LANGUAGE, CONTENT_LENGTH, CONTENT_LOCATION, CONTENT_MD5, CONTENT_RANGE, CONTENT_TRANSFER_ENCODING, CONTENT_TYPE, COOKIE, DATE, ETAG, EXPECT, EXPIRES, FROM, HOST, IF_MATCH, IF_MODIFIED_SINCE, IF_NONE_MATCH, IF_RANGE, IF_UNMODIFIED_SINCE, LAST_MODIFIED, LOCATION, MAX_FORWARDS, PRAGMA, PROXY_AUTHENTICATE, PROXY_AUTHORIZATION, RANGE, REFERER, RETRY_AFTER, SERVER, SET_COOKIE, SET_COOKIE2, TE, TRAILER, TRANSFER_ENCODING, UPGRADE, USER_AGENT, VARY, VIA, WARNING, WWW_AUTHENTICATE |
Constructor Summary | |
---|---|
Helpers()
|
Method Summary | |
---|---|
static Result |
callAction(HandlerRef actionReference)
Call an action method while decorating it with the right @With interceptors. |
static Result |
callAction(HandlerRef actionReference,
FakeRequest fakeRequest)
Call an action method while decorating it with the right @With interceptors. |
static java.lang.String |
charset(Result result)
Extracts the Charset of this Result value. |
static byte[] |
contentAsBytes(Content content)
Extracts the content as bytes. |
static byte[] |
contentAsBytes(Result result)
Extracts the content as bytes. |
static java.lang.String |
contentAsString(Content content)
Extracts the content as String. |
static java.lang.String |
contentAsString(Result result)
Extracts the content as String. |
static java.lang.String |
contentType(Content content)
Extracts the Content-Type of this Content value. |
static java.lang.String |
contentType(Result result)
Extracts the Content-Type of this Result value. |
static FakeApplication |
fakeApplication()
Build a new fake application. |
static FakeApplication |
fakeApplication(java.util.Map<java.lang.String,java.lang.String> additionalConfiguration)
Build a new fake application. |
static FakeApplication |
fakeApplication(java.util.Map<java.lang.String,java.lang.String> additionalConfiguration,
java.util.List<java.lang.String> additionalPlugin)
Build a new fake application. |
static FakeRequest |
fakeRequest()
Build a new GET / fake request. |
static FakeRequest |
fakeRequest(java.lang.String method,
java.lang.String uri)
Build a new fake request. |
static Http.Flash |
flash(Result result)
Extracts the Flash values of this Result value. |
static java.lang.String |
header(java.lang.String header,
Result result)
Extracts an Header value of this Result value. |
static java.util.Map<java.lang.String,java.lang.String> |
headers(Result result)
Extracts all Headers of this Result value. |
static java.util.Map<java.lang.String,java.lang.String> |
inMemoryDatabase()
Constructs a in-memory (h2) database configuration to add to a FakeApplication. |
static java.util.Map<java.lang.String,java.lang.String> |
inMemoryDatabase(java.lang.String name)
Constructs a in-memory (h2) database configuration to add to a FakeApplication. |
static java.lang.String |
redirectLocation(Result result)
Extracts the Location header of this Result value if this Result is a Redirect. |
static Result |
routeAndCall(java.lang.Class<? extends play.core.Router.Routes> router,
FakeRequest fakeRequest)
Use the Router to determine the Action to call for this request and executes it. |
static Result |
routeAndCall(FakeRequest fakeRequest)
Use the Router to determine the Action to call for this request and executes it. |
static void |
running(FakeApplication fakeApplication,
java.lang.Runnable block)
Executes a block of code in a running application. |
static void |
running(TestServer server,
java.lang.Class<? extends org.openqa.selenium.WebDriver> webDriver,
F.Callback<TestBrowser> block)
Executes a block of code in a running server, with a test browser. |
static void |
running(TestServer server,
java.lang.Runnable block)
Executes a block of code in a running server. |
static void |
start(FakeApplication fakeApplication)
Starts a new application. |
static void |
start(TestServer server)
Starts a Test server. |
static int |
status(Result result)
Extracts the Status code of this Result value. |
static void |
stop(FakeApplication fakeApplication)
Stops an application. |
static void |
stop(TestServer server)
Stops a Test server. |
static TestBrowser |
testBrowser()
Creates a Test Browser. |
static TestBrowser |
testBrowser(java.lang.Class<? extends org.openqa.selenium.WebDriver> webDriver)
Creates a Test Browser. |
static TestBrowser |
testBrowser(org.openqa.selenium.WebDriver of)
Creates a Test Browser. |
static TestServer |
testServer(int port)
Creates a new Test server. |
static TestServer |
testServer(int port,
FakeApplication app)
Creates a new Test server. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static java.lang.String GET
public static java.lang.String POST
public static java.lang.String PUT
public static java.lang.String DELETE
public static java.lang.String HEAD
public static java.lang.Class<? extends org.openqa.selenium.WebDriver> HTMLUNIT
public static java.lang.Class<? extends org.openqa.selenium.WebDriver> FIREFOX
Constructor Detail |
---|
public Helpers()
Method Detail |
---|
public static Result callAction(HandlerRef actionReference)
public static Result callAction(HandlerRef actionReference, FakeRequest fakeRequest)
public static FakeRequest fakeRequest()
public static FakeRequest fakeRequest(java.lang.String method, java.lang.String uri)
public static FakeApplication fakeApplication()
public static java.util.Map<java.lang.String,java.lang.String> inMemoryDatabase()
public static java.util.Map<java.lang.String,java.lang.String> inMemoryDatabase(java.lang.String name)
public static FakeApplication fakeApplication(java.util.Map<java.lang.String,java.lang.String> additionalConfiguration)
public static FakeApplication fakeApplication(java.util.Map<java.lang.String,java.lang.String> additionalConfiguration, java.util.List<java.lang.String> additionalPlugin)
public static int status(Result result)
public static java.lang.String redirectLocation(Result result)
public static Http.Flash flash(Result result)
public static java.lang.String header(java.lang.String header, Result result)
public static java.util.Map<java.lang.String,java.lang.String> headers(Result result)
public static java.lang.String contentType(Content content)
public static java.lang.String contentType(Result result)
public static java.lang.String charset(Result result)
public static byte[] contentAsBytes(Result result)
public static byte[] contentAsBytes(Content content)
public static java.lang.String contentAsString(Content content)
public static java.lang.String contentAsString(Result result)
public static Result routeAndCall(FakeRequest fakeRequest)
public static Result routeAndCall(java.lang.Class<? extends play.core.Router.Routes> router, FakeRequest fakeRequest)
public static void start(FakeApplication fakeApplication)
public static void stop(FakeApplication fakeApplication)
public static void running(FakeApplication fakeApplication, java.lang.Runnable block)
public static TestServer testServer(int port)
public static TestServer testServer(int port, FakeApplication app)
public static void start(TestServer server)
public static void stop(TestServer server)
public static void running(TestServer server, java.lang.Runnable block)
public static void running(TestServer server, java.lang.Class<? extends org.openqa.selenium.WebDriver> webDriver, F.Callback<TestBrowser> block)
public static TestBrowser testBrowser()
public static TestBrowser testBrowser(java.lang.Class<? extends org.openqa.selenium.WebDriver> webDriver)
public static TestBrowser testBrowser(org.openqa.selenium.WebDriver of)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |