|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjunit.framework.Assert
junit.framework.TestCase
com.atlassian.crowd.acceptance.tests.rest.service.RestCrowdServiceAcceptanceTestCase
public abstract class RestCrowdServiceAcceptanceTestCase
All REST acceptance tests should subclass this class.
| Field Summary | |
|---|---|
protected static String |
APPLICATION_NAME
|
protected static String |
APPLICATION_PASSWORD
|
protected static String |
ATTRIBUTES_RESOURCE
|
protected static String |
AUTHENTICATION_RESOURCE
|
protected static String |
EVENTS_RESOURCE
|
protected static String |
GROUPS_RESOURCE
|
protected static javax.ws.rs.core.MediaType |
MT
Specify this type for any entities being sent to the server. |
protected static String |
REST_SERVICE_NAME
|
protected static String |
SESSION_RESOURCE
|
protected static String |
USERS_RESOURCE
|
protected static String |
WEBHOOKS_RESOURCE
|
| Constructor Summary | |
|---|---|
protected |
RestCrowdServiceAcceptanceTestCase(String name)
Constructs a test case with the given name. |
protected |
RestCrowdServiceAcceptanceTestCase(String name,
RestServer restServer)
Constructs a test case with the given name, using the given RestServer. |
| Method Summary | |
|---|---|
protected UserEntity |
authenticateUser(String username,
String password)
Authenticate a user with the specified username and password. |
protected javax.ws.rs.core.UriBuilder |
getBaseUriBuilder()
Returns the base URI of the REST service. |
protected javax.ws.rs.core.UriBuilder |
getBaseUriBuilder(String serviceName)
|
protected javax.ws.rs.core.UriBuilder |
getBaseUriBuilder(String serviceName,
String version)
|
protected com.sun.jersey.api.client.WebResource |
getRootWebResource(String applicationName,
String password)
Returns the "root" WebResource. |
protected com.sun.jersey.api.client.WebResource |
getWebResource(String applicationName,
String password,
URI uri)
Returns the WebResource with the specified URI. |
protected com.sun.jersey.api.client.WebResource |
getWebResource(URI uri)
Returns the WebResource with the specified URI, retrieved anonymously. |
void |
setRestServer(RestServer restServer)
Sets the RestServer instance to test against. |
void |
setUp()
|
protected static String |
statusToString(javax.ws.rs.core.Response.Status status)
Nicely formats a Status. |
void |
tearDown()
|
| Methods inherited from class junit.framework.TestCase |
|---|
assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, countTestCases, createResult, fail, fail, failNotEquals, failNotSame, failSame, format, getName, run, run, runBare, runTest, setName, toString |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected static final String APPLICATION_NAME
protected static final String APPLICATION_PASSWORD
protected static final String GROUPS_RESOURCE
protected static final String ATTRIBUTES_RESOURCE
protected static final String USERS_RESOURCE
protected static final String AUTHENTICATION_RESOURCE
protected static final String SESSION_RESOURCE
protected static final String WEBHOOKS_RESOURCE
protected static final String EVENTS_RESOURCE
protected static final javax.ws.rs.core.MediaType MT
protected static final String REST_SERVICE_NAME
| Constructor Detail |
|---|
protected RestCrowdServiceAcceptanceTestCase(String name)
name - the test name
protected RestCrowdServiceAcceptanceTestCase(String name,
RestServer restServer)
name - the test namerestServer - the RestServer| Method Detail |
|---|
public void setUp()
throws Exception
setUp in class junit.framework.TestCaseException
public void tearDown()
throws Exception
tearDown in class junit.framework.TestCaseExceptionpublic final void setRestServer(RestServer restServer)
restServer - a RestServerprotected javax.ws.rs.core.UriBuilder getBaseUriBuilder()
protected javax.ws.rs.core.UriBuilder getBaseUriBuilder(String serviceName)
protected javax.ws.rs.core.UriBuilder getBaseUriBuilder(String serviceName,
String version)
protected com.sun.jersey.api.client.WebResource getRootWebResource(String applicationName,
String password)
applicationName - name of the applicationpassword - password of the application
protected com.sun.jersey.api.client.WebResource getWebResource(String applicationName,
String password,
URI uri)
applicationName - name of the applicationpassword - password of the applicationuri - URI of the resource
protected com.sun.jersey.api.client.WebResource getWebResource(URI uri)
applicationName - name of the application
protected static String statusToString(javax.ws.rs.core.Response.Status status)
status - Status
protected UserEntity authenticateUser(String username,
String password)
username - usernamepassword - password
com.sun.jersey.api.client.UniformInterfaceException - if the status of the HTTP response is greater than or equal to 300.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||