/** * Override this method to setup the port to use. * * @return The TCP port used by the server */ protected int providePort() { return play.api.test.Helpers.testServerPort(); }
@Deprecated public static Result route(Application app, RequestBuilder requestBuilder, byte[] body, long timeout) { return wrapScalaResult(Scala.orNull(play.api.test.Helpers.jRoute(app.getWrappedApplication(), requestBuilder.build()._underlyingRequest(), body)), timeout); }
/** * 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))); }
@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.bodyAsAnyContent()); return wrapScalaResult(Scala.orNull(opt), timeout); }
/** * Constructs a in-memory (h2) database configuration to add to a fake application. * * @param name the database name. * @param options the database options. * @return a map of String containing database config info. */ public static Map<String, String> inMemoryDatabase(String name, Map<String, String> options) { return Scala.asJava(play.api.test.Helpers.inMemoryDatabase(name, Scala.asScala(options))); }
/** * Route the request considering the given timeout. * * @param app The application used while routing and executing the request * @param requestBuilder the request builder * @param timeout the amount of time, in milliseconds, to wait for the body to be produced. * @return the result */ @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.asScala(), requestBuilder.build().asScala(), requestBuilder.body() ); return wrapScalaResult(Scala.orNull(opt), timeout); }
/** * Override this method to setup the port to use. * * @return The TCP port used by the server */ protected int providePort() { return play.api.test.Helpers.testServerPort(); }
/** * Constructs a in-memory (h2) database configuration to add to a fake application. * * @param name the database name. * @param options the database options. * @return a map of String containing database config info. */ public static Map<String, String> inMemoryDatabase(String name, Map<String, String> options) { return Scala.asJava(play.api.test.Helpers.inMemoryDatabase(name, Scala.asScala(options))); }
/** * Route the request considering the given timeout. * * @param app The application used while routing and executing the request * @param requestBuilder the request builder * @param timeout the amount of time, in milliseconds, to wait for the body to be produced. * @return the result */ @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.asScala(), requestBuilder.build().asScala(), requestBuilder.body() ); return wrapScalaResult(Scala.orNull(opt), timeout); }
/** * Override this method to setup the port to use. * * @return The TCP port used by the server */ protected int providePort() { return play.api.test.Helpers.testServerPort(); }
/** * 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))); }
public static Result route(Application app, FakeRequest fakeRequest) { final scala.Option<play.api.mvc.Result> opt = play.api.test.Helpers.jRoute(app.getWrappedApplication(), fakeRequest.fake); final play.api.mvc.Result r = opt.getOrElse(null); if(r != null){ return new Result() { public play.api.mvc.Result getWrappedResult(){ return r; } }; } return null; }
/** * 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(Application app) { return testServer(play.api.test.Helpers.testServerPort(), app); }
public static <T> Result route(Application app, FakeRequest fakeRequest, byte[] body) { final play.api.mvc.Result r = play.api.test.Helpers.jRoute(app.getWrappedApplication(), fakeRequest.getWrappedRequest(), body).getOrElse(null); if(r != null){ return new Result() { public play.api.mvc.Result getWrappedResult(){ return r; } }; } return null; }
/** * Creates a new Test server listening on port defined by configuration setting "testserver.port" (defaults to 19001). * * @return the test server. */ public static TestServer testServer() { return testServer(play.api.test.Helpers.testServerPort()); }
/** * Creates a new Test server listening on port defined by configuration setting "testserver.port" (defaults to 19001) and using the given Application. * * @param app the application. * @return the test server. */ public static TestServer testServer(Application app) { return testServer(play.api.test.Helpers.testServerPort(), app); }
/** * Creates a new Test server listening on port defined by configuration setting "testserver.port" (defaults to 19001). * * @return the test server. */ public static TestServer testServer() { return testServer(play.api.test.Helpers.testServerPort()); }
/** * 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()); }
/** * Creates a new Test server listening on port defined by configuration setting "testserver.port" (defaults to 19001) and using the given Application. * * @param app the application. * @return the test server. */ public static TestServer testServer(Application app) { return testServer(play.api.test.Helpers.testServerPort(), app); }