|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.silverpeas.web.TestResources
public abstract class TestResources
It is a wrapper of the resources required in the RESTWebServiceTest test cases. It defines also some default parameters to use in tests such as the language of the user or the unique identifier of the user. The life-cycle of test resources is managed by the IoC container in which are bootstrapped the test cases. The class is dedicated to be extending by the test classes in order to set additional resources required by the test cases they represent. All data or behaviour to prepare for the tests have their place in a TestResources instance.
Field Summary | |
---|---|
static String |
DEFAULT_DOMAIN
The default domain the default user belongs to. |
static String |
DEFAULT_LANGUAGE
Default language to use in the unit tests on the REST-based web services. |
static String |
TEST_RESOURCES_NAME
The name under which a test resources must be deployed. |
static String |
USER_ID_IN_TEST
Identifier of the default user to use in the unit tests on the REST-based web services. |
Constructor Summary | |
---|---|
TestResources()
Constructs the resouces for testing. |
Method Summary | |
---|---|
UserDetailWithProfiles |
aUser()
Gets a user to use in the tests as the one in the current HTTP session. |
UserDetailWithProfiles |
aUserNamed(String firstName,
String lastName)
Computes a user named with the specified first and last name. |
AccessControllerMock |
getAccessControllerMock()
Gets a mock of the AccessController. |
org.springframework.context.ApplicationContext |
getApplicationContext()
Gets the application context within which the current test case is actually running. |
OrganisationController |
getOrganizationControllerMock()
Gets the OrganizationController mock used in the tests. |
PersonalizationService |
getPersonalizationServiceMock()
Gets a mock of the personalization service. |
SessionManagerMock |
getSessionManagerMock()
Gets a mock of the session management service. |
SpaceAccessControllerMock |
getSpaceAccessControllerMock()
Gets a mock of the SpaceAccessController. |
static TestResources |
getTestResources()
Gets a TestResources instance managed by the IoC container within which is running the test case. |
PersistentResourceTokenService |
getTokenServiceMock()
Gets a mock of the token service. |
UserDetail |
registerUser(UserDetail user)
Registers the specified user among the organization controller so that when it is asked it is returned by the controller. |
void |
setApplicationContext(org.springframework.context.ApplicationContext applicationContext)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String TEST_RESOURCES_NAME
public static final String USER_ID_IN_TEST
public static final String DEFAULT_LANGUAGE
public static final String DEFAULT_DOMAIN
Constructor Detail |
---|
public TestResources()
Method Detail |
---|
public static TestResources getTestResources()
public org.springframework.context.ApplicationContext getApplicationContext()
public AccessControllerMock getAccessControllerMock()
public SpaceAccessControllerMock getSpaceAccessControllerMock()
public OrganisationController getOrganizationControllerMock()
public PersonalizationService getPersonalizationServiceMock()
public PersistentResourceTokenService getTokenServiceMock()
public SessionManagerMock getSessionManagerMock()
public UserDetailWithProfiles aUser()
public UserDetailWithProfiles aUserNamed(String firstName, String lastName)
firstName
- the user first name.lastName
- the user last name.
public UserDetail registerUser(UserDetail user)
user
- the user to registers in the test context.
public void setApplicationContext(org.springframework.context.ApplicationContext applicationContext) throws org.springframework.beans.BeansException
setApplicationContext
in interface org.springframework.context.ApplicationContextAware
org.springframework.beans.BeansException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |