net.liftweb.http.testing.TestKit

trait TestKit

trait TestKit

 extends ClientBuilder with GetPoster with GetPosterHelper


Mix this trait into your test so you can make HTTP requests on a target


Source: TestFramework.scala(450)

Direct Known Subclasses

TestFramework,

Nested Classes

TestHandler,

 Fields

baseUrl.. abstract def baseUrl
The base URL for all GET and POST requests
String
buildNoAuthClient.. def buildNoAuthClient
Create a new HTTP client that does not do any form of AUTH
HttpClient ClientBuilder
theHttpClient.. def theHttpClient
Create the HTTP client for a new get/post request
HttpClient ClientBuilder

 Methods

!=.. final def !=(arg0 : Object) Boolean AnyRef
!=.. final def !=(arg0 : Any) Boolean Any
==.. final def ==(arg0 : Any) Boolean Any
==.. final def ==(arg0 : Object) Boolean AnyRef
asInstanceOf.. final def asInstanceOf[T0] T0 Any
buildBasicAuthClient.. def buildBasicAuthClient(name : String, pwd : String)
Create a new HTTP client that does BASIC AUTH with username/pwd
HttpClient ClientBuilder
clone.. protected def clone Object AnyRef
delete.. def delete(url : String, httpClient : HttpClient, headers : List[(String, String)], faux_params : (String, Any)*)(implicit capture : (String, HttpClient, HttpMethodBase) => ResponseType)
Perform an HTTP DELETE [details]
param
headers - - any additional headers to include with the request
faux_params - - the request parameters to include with the request
url - - the URL to append to the baseUrl
ResponseType BaseGetPoster
delete.. def delete(url : String, params : (String, Any)*)(implicit capture : (String, HttpClient, HttpMethodBase) => ResponseType)
Perform an HTTP DELETE with a newly minted httpClient [details]
param
params - the parameters to pass
url - the URL to make the request on
ResponseType GetPosterHelper
eq.. final def eq(arg0 : Object) Boolean AnyRef
equals.. def equals(arg0 : Any) Boolean AnyRef
finalize.. protected def finalize Unit AnyRef
get.. def get(url : String, params : (String, Any)*)(implicit capture : (String, HttpClient, HttpMethodBase) => ResponseType)
Perform an HTTP GET with a newly minted httpClient [details]
param
params - the parameters to pass
url - the URL to make the request on
ResponseType GetPosterHelper
get.. def get(url : String, httpClient : HttpClient, headers : List[(String, String)], faux_params : (String, Any)*)(implicit capture : (String, HttpClient, HttpMethodBase) => ResponseType)
Perform an HTTP GET [details]
param
headers - - any additional headers to include with the request
faux_params - - the request parameters to include with the request
url - - the URL to append to the baseUrl
ResponseType BaseGetPoster
getClass.. final def getClass Class[Any] AnyRef
hashCode.. def hashCode Int AnyRef
isInstanceOf.. final def isInstanceOf[T0] Boolean Any
jsonToRequestEntity.. implicit def jsonToRequestEntity(body : JValue) RequestEntity BaseGetPoster
ne.. final def ne(arg0 : Object) Boolean AnyRef
notify.. final def notify Unit AnyRef
notifyAll.. final def notifyAll Unit AnyRef
post.. def post[RT](url : String, httpClient : HttpClient, headers : List[(String, String)], body : RT)(implicit capture : (String, HttpClient, HttpMethodBase) => ResponseType, implicit bodyToRequestEntity : (RT) => RequestEntity)
Perform an HTTP POST with an XML body [details]
param
headers - - any additional headers to include with the request
body - - the xml to post
url - - the URL to append to the baseUrl
ResponseType BaseGetPoster
post.. def post(url : String, params : (String, Any)*)(implicit capture : (String, HttpClient, HttpMethodBase) => ResponseType)
Perform an HTTP POST with a newly minted httpClient [details]
param
params - the parameters to pass
url - the URL to make the request on
ResponseType GetPosterHelper
post.. def post(url : String, body : Array[Byte], contentType : String)(implicit capture : (String, HttpClient, HttpMethodBase) => ResponseType)
Perform an HTTP POST with a newly minted httpClient [details]
param
body - the bytes to POST to the server
contentType - the content type of the message
url - the URL to make the request on
ResponseType GetPosterHelper
post.. def post(url : String, httpClient : HttpClient, headers : List[(String, String)], faux_params : (String, Any)*)(implicit capture : (String, HttpClient, HttpMethodBase) => ResponseType)
Perform an HTTP POST [details]
param
headers - - any additional headers to include with the request
faux_params - - the request parameters to include with the request
url - - the URL to append to the baseUrl
ResponseType BaseGetPoster
post.. def post[RT](url : String, xml : RT)(implicit capture : (String, HttpClient, HttpMethodBase) => ResponseType, implicit bodyToRequestEntity : (RT) => RequestEntity)
Perform an HTTP POST with a newly minted httpClient [details]
param
xml - the XML to POST to the server
url - the URL to make the request on
ResponseType GetPosterHelper
post.. def post(url : String, httpClient : HttpClient, headers : List[(String, String)], body : Array[Byte], contentType : String)(implicit capture : (String, HttpClient, HttpMethodBase) => ResponseType)
Perform an HTTP POST with a pile of bytes in the body [details]
param
contentType - - the content type of the pile of bytes
headers - - any additional headers to include with the request
body - - the pile of bytes to POST to the target server
url - - the URL to append to the baseUrl
ResponseType BaseGetPoster
put.. def put(url : String, body : Array[Byte], contentType : String)(implicit capture : (String, HttpClient, HttpMethodBase) => ResponseType)
Perform an HTTP POST with a newly minted httpClient [details]
param
body - the bytes to POST to the server
contentType - the content type of the message
url - the URL to make the request on
ResponseType GetPosterHelper
put.. def put(url : String, httpClient : HttpClient, headers : List[(String, String)], body : Array[Byte], contentType : String)(implicit capture : (String, HttpClient, HttpMethodBase) => ResponseType)
Perform an HTTP PUT with a pile of bytes in the body [details]
param
contentType - - the content type of the pile of bytes
headers - - any additional headers to include with the request
body - - the pile of bytes to POST to the target server
url - - the URL to append to the baseUrl
ResponseType BaseGetPoster
put.. def put(url : String, httpClient : HttpClient, headers : List[(String, String)])(implicit capture : (String, HttpClient, HttpMethodBase) => ResponseType)
Perform an HTTP PUT [details]
param
headers - - any additional headers to include with the request
url - - the URL to append to the baseUrl
ResponseType BaseGetPoster
put.. def put[RT](url : String, xml : RT)(implicit capture : (String, HttpClient, HttpMethodBase) => ResponseType, implicit bodyToRequestEntity : (RT) => RequestEntity)
Perform an HTTP PUT with a newly minted httpClient [details]
param
xml - the XML to PUT to the server
url - the URL to make the request on
ResponseType GetPosterHelper
put.. def put[RT](url : String, httpClient : HttpClient, headers : List[(String, String)], body : RT)(implicit capture : (String, HttpClient, HttpMethodBase) => ResponseType, implicit bodyToRequestEntity : (RT) => RequestEntity)
Perform an HTTP PUT with an XML body [details]
param
headers - - any additional headers to include with the request
body - - the xml to post
url - - the URL to append to the baseUrl
ResponseType BaseGetPoster
reqToHander.. implicit def reqToHander(in : TestResponse) TestHandler
responseCapture.. implicit def responseCapture(fullUrl : String, httpClient : HttpClient, getter : HttpMethodBase) TestResponse ToResponse
slurpApacheHeaders.. protected def slurpApacheHeaders(in : Array[Header]) Map[String, List[String]] BaseGetPoster
synchronized.. final def synchronized[T0](arg0 : T0) T0 AnyRef
toString.. def toString String AnyRef
wait.. final def wait(arg0 : Long, arg1 : Int) Unit AnyRef
wait.. final def wait Unit AnyRef
wait.. final def wait(arg0 : Long) Unit AnyRef
xmlToRequestEntity.. implicit def xmlToRequestEntity(body : NodeSeq) RequestEntity BaseGetPoster
Copyright (c) 2006-2010 WorldWide Conferencing, LLC. All Rights Reserved.