trait ScalatraTests extends EmbeddedJettyContainer with HttpComponentsClient
Provides a framework-agnostic way to test your Scalatra app. You probably want to extend this with
either org.scalatra.test.scalatest.ScalatraSuite
or
org.scalatra.test.specs.ScalatraSpecification
.
Cookies are crudely supported within session blocks. No attempt is made to match domains, paths, or max-ages; the request sends a Cookie header to match whatever Set-Cookie call it received on the previous response.
- Alphabetic
- By Inheritance
- ScalatraTests
- HttpComponentsClient
- Client
- ImplicitConversions
- EmbeddedJettyContainer
- JettyContainer
- Container
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
addFilter(filter: Class[_ <: Filter], path: String, dispatches: EnumSet[DispatcherType]): FilterHolder
- Definition Classes
- JettyContainer
-
def
addFilter(filter: Class[_ <: Filter], path: String): FilterHolder
- Definition Classes
- JettyContainer
-
def
addFilter(filter: Filter, path: String, dispatches: EnumSet[DispatcherType] = DefaultDispatcherTypes): FilterHolder
- Definition Classes
- JettyContainer
-
def
addServlet(servlet: Class[_ <: HttpServlet], path: String): ServletHolder
- Definition Classes
- JettyContainer
-
def
addServlet(servlet: HttpServlet, path: String, name: String): Unit
- Definition Classes
- JettyContainer
-
def
addServlet(servlet: HttpServlet, path: String): Unit
- Definition Classes
- JettyContainer
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
baseUrl: String
- Definition Classes
- EmbeddedJettyContainer
-
def
body: String
- Definition Classes
- Client
-
def
bodyBytes: Array[Byte]
- Definition Classes
- Client
-
def
clone(): AnyRef
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
def
connect[A](uri: String, params: Iterable[(String, String)] = Seq.empty, headers: Iterable[(String, String)] = Seq.empty)(f: ⇒ A): A
- Definition Classes
- Client
-
def
contextPath: String
- Definition Classes
- EmbeddedJettyContainer
-
def
createBody(name: String, content: Any): UploadableBody
- Definition Classes
- HttpComponentsClient
-
def
createClient: CloseableHttpClient
- Attributes
- protected
- Definition Classes
- HttpComponentsClient
-
def
delete[A](uri: String, params: Iterable[(String, String)] = Seq.empty, headers: Iterable[(String, String)] = Seq.empty)(f: ⇒ A): A
- Definition Classes
- Client
-
def
ensureSessionIsSerializable(): Unit
- Attributes
- protected
- Definition Classes
- JettyContainer → Container
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
finalize(): Unit
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
def
get[A](uri: String, params: Iterable[(String, String)] = Seq.empty, headers: Iterable[(String, String)] = Seq.empty)(f: ⇒ A): A
- Definition Classes
- Client
-
def
get[A](uri: String, params: (String, String)*)(f: ⇒ A): A
- Definition Classes
- Client
-
def
get[A](uri: String)(f: ⇒ A): A
- Definition Classes
- Client
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
-
def
head[A](uri: String, params: Iterable[(String, String)] = Seq.empty, headers: Iterable[(String, String)] = Seq.empty)(f: ⇒ A): A
- Definition Classes
- Client
-
def
head[A](uri: String, params: (String, String)*)(f: ⇒ A): A
- Definition Classes
- Client
-
def
head[A](uri: String)(f: ⇒ A): A
- Definition Classes
- Client
-
def
header: DefaultMap[String, String]
- Definition Classes
- Client
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
def
localPort: Option[Int]
The port of the currently running Jetty.
The port of the currently running Jetty. May differ from port if port is 0.
- returns
Some port if Jetty is currently listening, or None if it is not.
- Definition Classes
- EmbeddedJettyContainer
-
def
mount(app: Filter, path: String, dispatches: EnumSet[DispatcherType] = DefaultDispatcherTypes): FilterHolder
- Definition Classes
- JettyContainer
-
def
mount(servlet: HttpServlet, path: String, name: String): Unit
- Definition Classes
- JettyContainer
-
def
mount(servlet: HttpServlet, path: String): Unit
- Definition Classes
- JettyContainer
-
def
mount(klass: Class[_], path: String): Holder[_ >: Servlet with Filter <: AnyRef]
- Definition Classes
- JettyContainer
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
-
def
options[A](uri: String, params: Iterable[(String, String)] = Seq.empty, headers: Iterable[(String, String)] = Seq.empty)(f: ⇒ A): A
- Definition Classes
- Client
-
def
patch[A](uri: String, body: Array[Byte] = Array(), headers: Iterable[(String, String)] = Seq.empty)(f: ⇒ A): A
- Definition Classes
- Client
-
def
patch[A](uri: String, params: Iterable[(String, String)], headers: Iterable[(String, String)])(f: ⇒ A): A
- Definition Classes
- Client
-
def
patch[A](uri: String, params: Iterable[(String, String)])(f: ⇒ A): A
- Definition Classes
- Client
-
def
patch[A](uri: String, params: (String, String)*)(f: ⇒ A): A
- Definition Classes
- Client
-
def
port: Int
Sets the port to listen on.
Sets the port to listen on. 0 means listen on any available port.
- Definition Classes
- EmbeddedJettyContainer
-
def
post[A](uri: String, params: Iterable[(String, String)], files: Iterable[(String, Any)], headers: Iterable[(String, String)])(f: ⇒ A): A
- Definition Classes
- Client
-
def
post[A](uri: String, params: Iterable[(String, String)], files: Iterable[(String, Any)])(f: ⇒ A): A
- Definition Classes
- Client
-
def
post[A](uri: String, body: Array[Byte] = Array(), headers: Iterable[(String, String)] = Seq.empty)(f: ⇒ A): A
- Definition Classes
- Client
-
def
post[A](uri: String, params: Iterable[(String, String)], headers: Map[String, String])(f: ⇒ A): A
- Definition Classes
- Client
-
def
post[A](uri: String, params: Iterable[(String, String)])(f: ⇒ A): A
- Definition Classes
- Client
-
def
post[A](uri: String, params: (String, String)*)(f: ⇒ A): A
- Definition Classes
- Client
-
def
put[A](uri: String, params: Iterable[(String, String)], files: Iterable[(String, Any)], headers: Iterable[(String, String)])(f: ⇒ A): A
- Definition Classes
- Client
-
def
put[A](uri: String, params: Iterable[(String, String)], files: Iterable[(String, Any)])(f: ⇒ A): A
- Definition Classes
- Client
-
def
put[A](uri: String, body: Array[Byte] = Array(), headers: Iterable[(String, String)] = Seq.empty)(f: ⇒ A): A
- Definition Classes
- Client
-
def
put[A](uri: String, params: Iterable[(String, String)], headers: Map[String, String])(f: ⇒ A): A
- Definition Classes
- Client
-
def
put[A](uri: String, params: Iterable[(String, String)])(f: ⇒ A): A
- Definition Classes
- Client
-
def
put[A](uri: String, params: (String, String)*)(f: ⇒ A): A
- Definition Classes
- Client
-
val
resourceBasePath: String
- Definition Classes
- Container
-
def
response: ClientResponse
Returns the current response within the scope of the submit method.
Returns the current response within the scope of the submit method.
- Definition Classes
- Client
-
lazy val
server: Server
- Definition Classes
- EmbeddedJettyContainer
-
lazy val
servletContextHandler: ServletContextHandler
- Definition Classes
- EmbeddedJettyContainer → JettyContainer
-
def
session[A](f: ⇒ A): A
- Definition Classes
- HttpComponentsClient → Client
-
def
skipDefaultServlet: Boolean
- Definition Classes
- JettyContainer
-
def
start(): Unit
- Definition Classes
- EmbeddedJettyContainer → Container
-
def
status: Int
- Definition Classes
- Client
-
def
stop(): Unit
- Definition Classes
- EmbeddedJettyContainer → Container
-
implicit
def
stringToByteArray(str: String): Array[Byte]
- Definition Classes
- ImplicitConversions
-
def
submit[A](method: String, path: String, queryParams: Iterable[(String, String)] = Map.empty, headers: Iterable[(String, String)] = Seq.empty, body: Array[Byte] = null)(f: ⇒ A): A
- Definition Classes
- HttpComponentsClient → Client
-
def
submitMultipart[A](method: String, path: String, params: Iterable[(String, String)], headers: Iterable[(String, String)], files: Iterable[(String, Any)])(f: ⇒ A): A
- Attributes
- protected
- Definition Classes
- HttpComponentsClient → Client
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
def
trace[A](uri: String, params: Iterable[(String, String)] = Seq.empty, headers: Iterable[(String, String)] = Seq.empty)(f: ⇒ A): A
- Definition Classes
- Client
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
def
withResponse[A](res: ClientResponse)(f: ⇒ A): A
- Attributes
- protected
- Definition Classes
- Client