|
||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.eclipsesource.restfuse.Destination
public class Destination
A Destination
marks a requirement for http tests. Before you can use the
annotation you need to instantiate a HttpTest
Destination
in
your TestCase. This rule does manage the
and the
HttpTest
annotations of your test methods.Callback
A Destination
needs an url during instantiation. This url will be used within a
TestCase to send requests to. If the url is not valid an IllegalArgumentException
will be thrown.
A simple test looks like this:
@RunWith( HttpJUnitRunner.class ) public class Example { @Rule public Destination destination = new Destination( "http://localhost" ); @Context private Response response; @HttpTest( method = Method.GET, path = "/test" ) public void testMethod() { com.eclipsesource.restfuse.Assert.assertAccepted( response ); } }
HttpTest
,
Callback
Constructor Summary | |
---|---|
Destination(java.lang.String baseUrl)
Constructs a new Destination object. |
|
Destination(java.lang.String baseUrl,
java.lang.String proxyHost,
int proxyPort)
Constructs a new Destination object and sets some proxy properties which will
be used when sending the HTTP request. |
Method Summary | |
---|---|
org.junit.runners.model.Statement |
apply(org.junit.runners.model.Statement base,
org.junit.runners.model.FrameworkMethod method,
java.lang.Object target)
|
RequestContext |
getRequestContext()
Access to context to define additional request properties at runtime |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Destination(java.lang.String baseUrl)
Constructs a new Destination
object. An url is needed as parameter which will
be used in the whole test to send requests to.
baseUrl
- The url to send requests to.
java.lang.IllegalArgumentException
- Will be thrown when the baseUrl
is null or
not a valid url.public Destination(java.lang.String baseUrl, java.lang.String proxyHost, int proxyPort)
Constructs a new Destination
object and sets some proxy properties which will
be used when sending the HTTP request. An url is needed as parameter which will
be used in the whole test to send requests to. The passed proxy properties has to conform with
the proxy properties described here
http://docs.oracle.com/javase/1.5.0/docs/guide/net/properties.html
baseUrl
- The url to send requests to.proxyHost
- The value of the http.proxyHost property.proxyPort
- The value of the http.proxyPort property.
java.lang.IllegalArgumentException
- Will be thrown when the baseUrl
is null or
not a valid url.Method Detail |
---|
public org.junit.runners.model.Statement apply(org.junit.runners.model.Statement base, org.junit.runners.model.FrameworkMethod method, java.lang.Object target)
apply
in interface org.junit.rules.MethodRule
public RequestContext getRequestContext()
|
||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |