play.api.test

Helpers

Related Doc: package test

object Helpers extends PlayRunners with HeaderNames with Status with HttpProtocol with DefaultAwaitTimeout with ResultExtractors with Writeables with EssentialActionCaller with RouteInvokers with FutureAwaits

Source
Helpers.scala
Linear Supertypes
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. Helpers
  2. FutureAwaits
  3. RouteInvokers
  4. EssentialActionCaller
  5. Writeables
  6. ResultExtractors
  7. DefaultAwaitTimeout
  8. HttpProtocol
  9. Status
  10. HeaderNames
  11. PlayRunners
  12. HttpVerbs
  13. AnyRef
  14. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Type Members

  1. case class NegativeTimeout(t: Timeout) extends Product with Serializable

    How long we should wait for something that we expect *not* to happen, e.g.

    How long we should wait for something that we expect *not* to happen, e.g. waiting to make sure that a channel is *not* closed by some concurrent process.

    NegativeTimeout is a separate type to a normal Timeout because we'll want to set it to a lower value. This is because in normal usage we'll need to wait for the full length of time to show that nothing has happened in that time. If the value is too high then we'll spend a lot of time waiting during normal usage. If it is too low, however, we may miss events that occur after the timeout has finished. This is a necessary tradeoff.

    Where possible, tests should avoid using a NegativeTimeout. Tests will often know exactly when an event should occur. In this case they can perform a check for the event immediately rather than using using NegativeTimeout.

    Definition Classes
    DefaultAwaitTimeout

Value Members

  1. final def !=(arg0: Any): Boolean

    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Definition Classes
    AnyRef → Any
  4. val ACCEPT: String

    Definition Classes
    HeaderNames
  5. val ACCEPTED: Int

    Definition Classes
    Status
  6. val ACCEPT_CHARSET: String

    Definition Classes
    HeaderNames
  7. val ACCEPT_ENCODING: String

    Definition Classes
    HeaderNames
  8. val ACCEPT_LANGUAGE: String

    Definition Classes
    HeaderNames
  9. val ACCEPT_RANGES: String

    Definition Classes
    HeaderNames
  10. val ACCESS_CONTROL_ALLOW_CREDENTIALS: String

    Definition Classes
    HeaderNames
  11. val ACCESS_CONTROL_ALLOW_HEADERS: String

    Definition Classes
    HeaderNames
  12. val ACCESS_CONTROL_ALLOW_METHODS: String

    Definition Classes
    HeaderNames
  13. val ACCESS_CONTROL_ALLOW_ORIGIN: String

    Definition Classes
    HeaderNames
  14. val ACCESS_CONTROL_EXPOSE_HEADERS: String

    Definition Classes
    HeaderNames
  15. val ACCESS_CONTROL_MAX_AGE: String

    Definition Classes
    HeaderNames
  16. val ACCESS_CONTROL_REQUEST_HEADERS: String

    Definition Classes
    HeaderNames
  17. val ACCESS_CONTROL_REQUEST_METHOD: String

    Definition Classes
    HeaderNames
  18. val AGE: String

    Definition Classes
    HeaderNames
  19. val ALLOW: String

    Definition Classes
    HeaderNames
  20. val AUTHORIZATION: String

    Definition Classes
    HeaderNames
  21. val BAD_GATEWAY: Int

    Definition Classes
    Status
  22. val BAD_REQUEST: Int

    Definition Classes
    Status
  23. val CACHE_CONTROL: String

    Definition Classes
    HeaderNames
  24. val CHUNKED: String

    Definition Classes
    HttpProtocol
  25. val CONFLICT: Int

    Definition Classes
    Status
  26. val CONNECTION: String

    Definition Classes
    HeaderNames
  27. val CONTENT_DISPOSITION: String

    Definition Classes
    HeaderNames
  28. val CONTENT_ENCODING: String

    Definition Classes
    HeaderNames
  29. val CONTENT_LANGUAGE: String

    Definition Classes
    HeaderNames
  30. val CONTENT_LENGTH: String

    Definition Classes
    HeaderNames
  31. val CONTENT_LOCATION: String

    Definition Classes
    HeaderNames
  32. val CONTENT_MD5: String

    Definition Classes
    HeaderNames
  33. val CONTENT_RANGE: String

    Definition Classes
    HeaderNames
  34. val CONTENT_TRANSFER_ENCODING: String

    Definition Classes
    HeaderNames
  35. val CONTENT_TYPE: String

    Definition Classes
    HeaderNames
  36. val CONTINUE: Int

    Definition Classes
    Status
  37. val COOKIE: String

    Definition Classes
    HeaderNames
  38. val CREATED: Int

    Definition Classes
    Status
  39. val DATE: String

    Definition Classes
    HeaderNames
  40. val DELETE: String

    Definition Classes
    HttpVerbs
  41. val ETAG: String

    Definition Classes
    HeaderNames
  42. val EXPECT: String

    Definition Classes
    HeaderNames
  43. val EXPECTATION_FAILED: Int

    Definition Classes
    Status
  44. val EXPIRES: String

    Definition Classes
    HeaderNames
  45. val FAILED_DEPENDENCY: Int

    Definition Classes
    Status
  46. val FIREFOX: Class[FirefoxDriver]

    Definition Classes
    PlayRunners
  47. val FORBIDDEN: Int

    Definition Classes
    Status
  48. val FORWARDED: String

    Definition Classes
    HeaderNames
  49. val FOUND: Int

    Definition Classes
    Status
  50. val FROM: String

    Definition Classes
    HeaderNames
  51. val GATEWAY_TIMEOUT: Int

    Definition Classes
    Status
  52. val GET: String

    Definition Classes
    HttpVerbs
  53. val GONE: Int

    Definition Classes
    Status
  54. val HEAD: String

    Definition Classes
    HttpVerbs
  55. val HOST: String

    Definition Classes
    HeaderNames
  56. val HTMLUNIT: Class[HtmlUnitDriver]

    Definition Classes
    PlayRunners
  57. val HTTP_1_0: String

    Definition Classes
    HttpProtocol
  58. val HTTP_1_1: String

    Definition Classes
    HttpProtocol
  59. val HTTP_VERSION_NOT_SUPPORTED: Int

    Definition Classes
    Status
  60. val IF_MATCH: String

    Definition Classes
    HeaderNames
  61. val IF_MODIFIED_SINCE: String

    Definition Classes
    HeaderNames
  62. val IF_NONE_MATCH: String

    Definition Classes
    HeaderNames
  63. val IF_RANGE: String

    Definition Classes
    HeaderNames
  64. val IF_UNMODIFIED_SINCE: String

    Definition Classes
    HeaderNames
  65. val INSUFFICIENT_STORAGE: Int

    Definition Classes
    Status
  66. val INTERNAL_SERVER_ERROR: Int

    Definition Classes
    Status
  67. val LAST_MODIFIED: String

    Definition Classes
    HeaderNames
  68. val LENGTH_REQUIRED: Int

    Definition Classes
    Status
  69. val LOCATION: String

    Definition Classes
    HeaderNames
  70. val LOCKED: Int

    Definition Classes
    Status
  71. val MAX_FORWARDS: String

    Definition Classes
    HeaderNames
  72. val METHOD_NOT_ALLOWED: Int

    Definition Classes
    Status
  73. val MOVED_PERMANENTLY: Int

    Definition Classes
    Status
  74. val MULTIPLE_CHOICES: Int

    Definition Classes
    Status
  75. val MULTI_STATUS: Int

    Definition Classes
    Status
  76. val NON_AUTHORITATIVE_INFORMATION: Int

    Definition Classes
    Status
  77. val NOT_ACCEPTABLE: Int

    Definition Classes
    Status
  78. val NOT_FOUND: Int

    Definition Classes
    Status
  79. val NOT_IMPLEMENTED: Int

    Definition Classes
    Status
  80. val NOT_MODIFIED: Int

    Definition Classes
    Status
  81. val NO_CONTENT: Int

    Definition Classes
    Status
  82. val OK: Int

    Definition Classes
    Status
  83. val OPTIONS: String

    Definition Classes
    HttpVerbs
  84. val ORIGIN: String

    Definition Classes
    HeaderNames
  85. val PARTIAL_CONTENT: Int

    Definition Classes
    Status
  86. val PATCH: String

    Definition Classes
    HttpVerbs
  87. val PAYMENT_REQUIRED: Int

    Definition Classes
    Status
  88. val POST: String

    Definition Classes
    HttpVerbs
  89. val PRAGMA: String

    Definition Classes
    HeaderNames
  90. val PRECONDITION_FAILED: Int

    Definition Classes
    Status
  91. val PROXY_AUTHENTICATE: String

    Definition Classes
    HeaderNames
  92. val PROXY_AUTHENTICATION_REQUIRED: Int

    Definition Classes
    Status
  93. val PROXY_AUTHORIZATION: String

    Definition Classes
    HeaderNames
  94. val PUT: String

    Definition Classes
    HttpVerbs
  95. val RANGE: String

    Definition Classes
    HeaderNames
  96. val REFERER: String

    Definition Classes
    HeaderNames
  97. val REQUESTED_RANGE_NOT_SATISFIABLE: Int

    Definition Classes
    Status
  98. val REQUEST_ENTITY_TOO_LARGE: Int

    Definition Classes
    Status
  99. val REQUEST_TIMEOUT: Int

    Definition Classes
    Status
  100. val REQUEST_URI_TOO_LONG: Int

    Definition Classes
    Status
  101. val RESET_CONTENT: Int

    Definition Classes
    Status
  102. val RETRY_AFTER: String

    Definition Classes
    HeaderNames
  103. val SEE_OTHER: Int

    Definition Classes
    Status
  104. val SERVER: String

    Definition Classes
    HeaderNames
  105. val SERVICE_UNAVAILABLE: Int

    Definition Classes
    Status
  106. val SET_COOKIE: String

    Definition Classes
    HeaderNames
  107. val SET_COOKIE2: String

    Definition Classes
    HeaderNames
  108. val SWITCHING_PROTOCOLS: Int

    Definition Classes
    Status
  109. val TE: String

    Definition Classes
    HeaderNames
  110. val TEMPORARY_REDIRECT: Int

    Definition Classes
    Status
  111. val TOO_MANY_REQUEST: Int

    Definition Classes
    Status
  112. val TRAILER: String

    Definition Classes
    HeaderNames
  113. val TRANSFER_ENCODING: String

    Definition Classes
    HeaderNames
  114. val UNAUTHORIZED: Int

    Definition Classes
    Status
  115. val UNPROCESSABLE_ENTITY: Int

    Definition Classes
    Status
  116. val UNSUPPORTED_MEDIA_TYPE: Int

    Definition Classes
    Status
  117. val UPGRADE: String

    Definition Classes
    HeaderNames
  118. val USER_AGENT: String

    Definition Classes
    HeaderNames
  119. val USE_PROXY: Int

    Definition Classes
    Status
  120. val VARY: String

    Definition Classes
    HeaderNames
  121. val VIA: String

    Definition Classes
    HeaderNames
  122. val WARNING: String

    Definition Classes
    HeaderNames
  123. val WWW_AUTHENTICATE: String

    Definition Classes
    HeaderNames
  124. val X_FORWARDED_FOR: String

    Definition Classes
    HeaderNames
  125. val X_FORWARDED_HOST: String

    Definition Classes
    HeaderNames
  126. val X_FORWARDED_PORT: String

    Definition Classes
    HeaderNames
  127. val X_FORWARDED_PROTO: String

    Definition Classes
    HeaderNames
  128. val X_REQUESTED_WITH: String

    Definition Classes
    HeaderNames
  129. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  130. def await[T](future: Future[T], timeout: Long, unit: TimeUnit): T

    Block until a Promise is redeemed with the specified timeout.

    Block until a Promise is redeemed with the specified timeout.

    Definition Classes
    FutureAwaits
  131. def await[T](future: Future[T])(implicit timeout: Timeout): T

    Block until a Promise is redeemed.

    Block until a Promise is redeemed.

    Definition Classes
    FutureAwaits
  132. def call[T](action: EssentialAction, rh: RequestHeader, body: T)(implicit w: Writeable[T]): Future[Result]

    Execute an play.api.mvc.EssentialAction.

    Execute an play.api.mvc.EssentialAction.

    The body is serialised using the implicit writable, so that the action body parser can deserialise it.

    Definition Classes
    EssentialActionCaller
  133. def call[T](action: EssentialAction, req: Request[T])(implicit w: Writeable[T]): Future[Result]

    Execute an play.api.mvc.EssentialAction.

    Execute an play.api.mvc.EssentialAction.

    The body is serialised using the implicit writable, so that the action body parser can deserialise it.

    Definition Classes
    EssentialActionCaller
  134. def charset(of: Future[Result])(implicit timeout: Timeout): Option[String]

    Extracts the Charset of this Result value.

    Extracts the Charset of this Result value.

    Definition Classes
    ResultExtractors
  135. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  136. def contentAsBytes(of: Future[Result])(implicit timeout: Timeout): Array[Byte]

    Extracts the content as bytes.

    Extracts the content as bytes.

    Definition Classes
    ResultExtractors
  137. def contentAsBytes(of: Content)(implicit timeout: Timeout): Array[Byte]

    Extracts the content as bytes.

    Extracts the content as bytes.

    Definition Classes
    ResultExtractors
  138. def contentAsJson(of: Future[Result])(implicit timeout: Timeout): JsValue

    Extracts the content as Json.

    Extracts the content as Json.

    Definition Classes
    ResultExtractors
  139. def contentAsJson(of: Content)(implicit timeout: Timeout): JsValue

    Extracts the content as Json.

    Extracts the content as Json.

    Definition Classes
    ResultExtractors
  140. def contentAsString(of: Future[Result])(implicit timeout: Timeout): String

    Extracts the content as String.

    Extracts the content as String.

    Definition Classes
    ResultExtractors
  141. def contentAsString(of: Content)(implicit timeout: Timeout): String

    Extracts the content as String.

    Extracts the content as String.

    Definition Classes
    ResultExtractors
  142. def contentType(of: Future[Result])(implicit timeout: Timeout): Option[String]

    Extracts the Content-Type of this Result value.

    Extracts the Content-Type of this Result value.

    Definition Classes
    ResultExtractors
  143. def contentType(of: Content)(implicit timeout: Timeout): String

    Extracts the Content-Type of this Content value.

    Extracts the Content-Type of this Content value.

    Definition Classes
    ResultExtractors
  144. def cookies(of: Future[Result])(implicit timeout: Timeout): Cookies

    Extracts the Cookies of this Result value.

    Extracts the Cookies of this Result value.

    Definition Classes
    ResultExtractors
  145. implicit def defaultAwaitTimeout: Timeout

    The default await timeout.

    The default await timeout. Override this to change it.

    Definition Classes
    DefaultAwaitTimeout
  146. implicit val defaultNegativeTimeout: NegativeTimeout

    Definition Classes
    DefaultAwaitTimeout
  147. final def eq(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  148. def equals(arg0: Any): Boolean

    Definition Classes
    AnyRef → Any
  149. def finalize(): Unit

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  150. def flash(of: Future[Result])(implicit timeout: Timeout): Flash

    Extracts the Flash values of this Result value.

    Extracts the Flash values of this Result value.

    Definition Classes
    ResultExtractors
  151. final def getClass(): Class[_]

    Definition Classes
    AnyRef → Any
  152. def hashCode(): Int

    Definition Classes
    AnyRef → Any
  153. def header(header: String, of: Future[Result])(implicit timeout: Timeout): Option[String]

    Extracts an Header value of this Result value.

    Extracts an Header value of this Result value.

    Definition Classes
    ResultExtractors
  154. def headers(of: Future[Result])(implicit timeout: Timeout): Map[String, String]

    Extracts all Headers of this Result value.

    Extracts all Headers of this Result value.

    Definition Classes
    ResultExtractors
  155. def inMemoryDatabase(name: String = "default", options: Map[String, String] = Map.empty[String, String]): Map[String, String]

    Constructs a in-memory (h2) database configuration to add to a FakeApplication.

    Constructs a in-memory (h2) database configuration to add to a FakeApplication.

    Definition Classes
    PlayRunners
  156. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  157. def jRoute[T](app: Application, r: RequestHeader, body: T): Option[Future[Result]]

    Definition Classes
    RouteInvokers
  158. final def ne(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  159. final def notify(): Unit

    Definition Classes
    AnyRef
  160. final def notifyAll(): Unit

    Definition Classes
    AnyRef
  161. def redirectLocation(of: Future[Result])(implicit timeout: Timeout): Option[String]

    Extracts the Location header of this Result value if this Result is a Redirect.

    Extracts the Location header of this Result value if this Result is a Redirect.

    Definition Classes
    ResultExtractors
  162. def route[T](req: Request[T])(implicit w: Writeable[T]): Option[Future[Result]]

    Use the HttpRequestHandler to determine the Action to call for this request and execute it.

    Use the HttpRequestHandler to determine the Action to call for this request and execute it.

    The body is serialised using the implicit writable, so that the action body parser can deserialise it.

    Definition Classes
    RouteInvokers
  163. def route[T](app: Application, req: Request[T])(implicit w: Writeable[T]): Option[Future[Result]]

    Use the HttpRequestHandler to determine the Action to call for this request and execute it.

    Use the HttpRequestHandler to determine the Action to call for this request and execute it.

    The body is serialised using the implicit writable, so that the action body parser can deserialise it.

    Definition Classes
    RouteInvokers
  164. def route[T](rh: RequestHeader, body: T)(implicit w: Writeable[T]): Option[Future[Result]]

    Use the HttpRequestHandler to determine the Action to call for this request and execute it.

    Use the HttpRequestHandler to determine the Action to call for this request and execute it.

    The body is serialised using the implicit writable, so that the action body parser can deserialise it.

    Definition Classes
    RouteInvokers
  165. def route[T](app: Application, rh: RequestHeader, body: T)(implicit w: Writeable[T]): Option[Future[Result]]

    Use the HttpRequestHandler to determine the Action to call for this request and execute it.

    Use the HttpRequestHandler to determine the Action to call for this request and execute it.

    The body is serialised using the implicit writable, so that the action body parser can deserialise it.

    Definition Classes
    RouteInvokers
  166. def running[T](testServer: TestServer, webDriver: WebDriver)(block: (TestBrowser) ⇒ T): T

    Executes a block of code in a running server, with a test browser.

    Executes a block of code in a running server, with a test browser.

    Definition Classes
    PlayRunners
  167. def running[T, WEBDRIVER <: WebDriver](testServer: TestServer, webDriver: Class[WEBDRIVER])(block: (TestBrowser) ⇒ T): T

    Executes a block of code in a running server, with a test browser.

    Executes a block of code in a running server, with a test browser.

    Definition Classes
    PlayRunners
  168. def running[T](testServer: TestServer)(block: ⇒ T): T

    Executes a block of code in a running server.

    Executes a block of code in a running server.

    Definition Classes
    PlayRunners
  169. def running[T](app: Application)(block: ⇒ T): T

    Executes a block of code in a running application.

    Executes a block of code in a running application.

    Definition Classes
    PlayRunners
  170. def session(of: Future[Result])(implicit timeout: Timeout): Session

    Extracts the Session of this Result value.

    Extracts the Session of this Result value. Extracts the Session from this Result value.

    Definition Classes
    ResultExtractors
  171. def status(of: Future[Result])(implicit timeout: Timeout): Int

    Extracts the Status code of this Result value.

    Extracts the Status code of this Result value.

    Definition Classes
    ResultExtractors
  172. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  173. lazy val testServerPort: Int

    The port to use for a test server.

    The port to use for a test server. Defaults to 19001. May be configured using the system property testserver.port

    Definition Classes
    PlayRunners
  174. def toString(): String

    Definition Classes
    AnyRef → Any
  175. final def wait(): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  176. final def wait(arg0: Long, arg1: Int): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  177. final def wait(arg0: Long): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  178. implicit def writeableOf_AnyContentAsEmpty(implicit code: Codec): Writeable[AnyContentAsEmpty.type]

    Definition Classes
    Writeables
  179. implicit def writeableOf_AnyContentAsFormUrlEncoded(implicit code: Codec): Writeable[AnyContentAsFormUrlEncoded]

    Definition Classes
    Writeables
  180. implicit def writeableOf_AnyContentAsJson(implicit codec: Codec): Writeable[AnyContentAsJson]

    Definition Classes
    Writeables
  181. implicit def writeableOf_AnyContentAsRaw: Writeable[AnyContentAsRaw]

    Definition Classes
    Writeables
  182. implicit def writeableOf_AnyContentAsText(implicit code: Codec): Writeable[AnyContentAsText]

    Definition Classes
    Writeables
  183. implicit def writeableOf_AnyContentAsXml(implicit codec: Codec): Writeable[AnyContentAsXml]

    Definition Classes
    Writeables

Inherited from FutureAwaits

Inherited from RouteInvokers

Inherited from EssentialActionCaller

Inherited from Writeables

Inherited from ResultExtractors

Inherited from DefaultAwaitTimeout

Inherited from HttpProtocol

Inherited from Status

Inherited from HeaderNames

Inherited from PlayRunners

Inherited from HttpVerbs

Inherited from AnyRef

Inherited from Any

Ungrouped