|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.sun.jersey.test.framework.JerseyTest
com.silverpeas.web.RESTWebServiceTest<T>
T
- the test resources wrapper in use in the test cases.public abstract class RESTWebServiceTest<T extends TestResources>
The base class for testing REST web services in Silverpeas. This base class wraps all of the mechanismes required to prepare the environment for testing web services with Jersey and Spring in the context of Silverpeas.
Field Summary | |
---|---|
protected static String |
CONTEXT_NAME
|
Constructor Summary | |
---|---|
RESTWebServiceTest(String webServicePackage,
String springContext)
Constructs a new test case on the REST web service testing. |
Method Summary | |
---|---|
void |
addComponentInstance(String componentId)
Adds the specified component instance among the existing ones and that will be used in tests. |
void |
addTool(String toolId)
|
UserDetailWithProfiles |
aUser()
Gets a user to use in the test case. |
String |
authenticate(UserDetail theUser)
Authenticates the user to use in the tests. |
protected javax.ws.rs.core.MultivaluedMap<String,String> |
buildQueryParametersFrom(String query)
|
void |
denieAuthorizationToUsers()
Denies the access to the silverpeas resources to all users. |
void |
denieSpaceAuthorizationToUsers()
Denies the access to the silverpeas spaces to all users. |
protected AccessControllerMock |
getAccessControllerMock()
|
abstract String[] |
getExistingComponentInstances()
Gets the component instances to take into account in tests. |
String[] |
getExistingTools()
Gets tools to take into account in tests. |
protected SpaceAccessControllerMock |
getMockedSpaceAccessController()
|
protected OrganisationController |
getOrganizationControllerMock()
|
protected PersonalizationService |
getPersonalizationServiceMock()
|
T |
getTestResources()
Gets the resources in use in the current test case. |
void |
prepareMockedResources()
|
com.sun.jersey.api.client.WebResource |
resource()
|
void |
setComponentAccessibilityToUser(String componentId,
String userId)
|
Methods inherited from class com.sun.jersey.test.framework.JerseyTest |
---|
client, configure, getBaseURI, getClient, getClientFactory, getPort, getTestContainerFactory, setClientFactory, setTestContainerFactory, setUp, tearDown |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static final String CONTEXT_NAME
Constructor Detail |
---|
public RESTWebServiceTest(String webServicePackage, String springContext)
webServicePackage
- the Java package in which is defined the web service to test.springContext
- the Spring context configuration file that accompanies the web service to
test.Method Detail |
---|
public abstract String[] getExistingComponentInstances()
public String[] getExistingTools()
public com.sun.jersey.api.client.WebResource resource()
resource
in class com.sun.jersey.test.framework.JerseyTest
public void prepareMockedResources()
public String authenticate(UserDetail theUser)
theUser
- the user to authenticate.
public UserDetailWithProfiles aUser()
public void denieAuthorizationToUsers()
public void denieSpaceAuthorizationToUsers()
public T getTestResources()
public void addComponentInstance(String componentId)
componentId
- the unique identifier of the component instance to use in tests.public void addTool(String toolId)
public void setComponentAccessibilityToUser(String componentId, String userId)
protected OrganisationController getOrganizationControllerMock()
protected AccessControllerMock getAccessControllerMock()
protected SpaceAccessControllerMock getMockedSpaceAccessController()
protected PersonalizationService getPersonalizationServiceMock()
protected javax.ws.rs.core.MultivaluedMap<String,String> buildQueryParametersFrom(String query)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |