|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object junit.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 |
GROUPS_RESOURCE
|
protected static String |
REST_SERVICE_NAME
|
protected static String |
SESSION_RESOURCE
|
protected static String |
USERS_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 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. |
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 |
---|
countTestCases, createResult, getName, run, run, runBare, runTest, setName, toString |
Methods inherited from class junit.framework.Assert |
---|
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, fail, fail, failNotEquals, failNotSame, failSame, format |
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 REST_SERVICE_NAME
Constructor Detail |
---|
protected RestCrowdServiceAcceptanceTestCase(String name)
name
- the test nameprotected RestCrowdServiceAcceptanceTestCase(String name, RestServer restServer)
name
- the test namerestServer
- the RestServerMethod Detail |
---|
public void setUp() throws Exception
setUp
in class junit.framework.TestCase
Exception
public void tearDown() throws Exception
tearDown
in class junit.framework.TestCase
Exception
public final void setRestServer(RestServer restServer)
restServer
- a RestServerprotected javax.ws.rs.core.UriBuilder getBaseUriBuilder()
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 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 |