示例#1
0
 public static Result route(Application app, FakeRequest fakeRequest, byte[] body, long timeout) {
   return wrapScalaResult(
       Scala.orNull(
           play.api.test.Helpers.jRoute(
               app.getWrappedApplication(), fakeRequest.getWrappedRequest(), body)),
       timeout);
 }
示例#2
0
 @SuppressWarnings("unchecked")
 public static Result route(Application app, RequestBuilder requestBuilder, long timeout) {
   final scala.Option<scala.concurrent.Future<play.api.mvc.Result>> opt =
       play.api.test.Helpers.jRoute(
           app.getWrappedApplication(),
           requestBuilder.build()._underlyingRequest(),
           requestBuilder.body());
   return wrapScalaResult(Scala.orNull(opt), timeout);
 }
示例#3
0
 /**
  * Creates a new Test server listening on port defined by configuration setting "testserver.port"
  * (defaults to 19001) and using the given FakeApplication.
  */
 public static TestServer testServer(FakeApplication app) {
   return testServer(play.api.test.Helpers.testServerPort(), app);
 }
示例#4
0
 /**
  * Creates a new Test server listening on port defined by configuration setting "testserver.port"
  * (defaults to 19001).
  */
 public static TestServer testServer() {
   return testServer(play.api.test.Helpers.testServerPort());
 }
示例#5
0
 public static Result route(Application app, FakeRequest fakeRequest, long timeout) {
   final scala.Option<scala.concurrent.Future<play.api.mvc.Result>> opt =
       play.api.test.Helpers.jRoute(app.getWrappedApplication(), fakeRequest.fake);
   return wrapScalaResult(Scala.orNull(opt), timeout);
 }
示例#6
0
 /** Constructs a in-memory (h2) database configuration to add to a FakeApplication. */
 public static Map<String, String> inMemoryDatabase(String name, Map<String, String> options) {
   return Scala.asJava(play.api.test.Helpers.inMemoryDatabase(name, Scala.asScala(options)));
 }