com.silverpeas.web.mock
Class OrganizationControllerMockWrapper

java.lang.Object
  extended by com.silverpeas.web.mock.OrganizationControllerMockWrapper
All Implemented Interfaces:
Serializable, OrganisationController

@Named(value="organizationController")
public class OrganizationControllerMockWrapper
extends Object
implements OrganisationController

A wrapper around an OrganizationController mock for testing purpose. It is managed by the IoC container and it plays the role of an OrganizationController instance for the business objects involved in a test. For doing, it delegates the invoked methods to the wrapped mock. You can get the wrapped mock for registering some behaviours an OrganizationController instance should have in the tests.

See Also:
Serialized Form

Constructor Summary
OrganizationControllerMockWrapper()
           
 
Method Summary
 String[] getAdministratorUserIds(String fromUserId)
           
 String[] getAllComponentIds(String sSpaceId)
           
 String[] getAllComponentIdsRecur(String sSpaceId)
           
 String[] getAllComponentIdsRecur(String sSpaceId, String sUserId, String sComponentRootName, boolean inCurrentSpace, boolean inAllSpaces)
           
 Map<String,WAComponent> getAllComponents()
           
 Map<String,String> getAllComponentsNames()
           
 Domain[] getAllDomains()
           
 String[] getAllGroupIdsOfUser(String userId)
           
 Group[] getAllGroups()
           
 String[] getAllowedComponentIds(String userId)
           
 String[] getAllowedSubSpaceIds(String userId, String spaceFatherId)
           
 Group[] getAllRootGroups()
           
 Group[] getAllRootGroupsInDomain(String domainId)
           
 String[] getAllRootSpaceIds()
           
 String[] getAllRootSpaceIds(String sUserId)
           
 String[] getAllSpaceIds()
           
 String[] getAllSpaceIds(String sUserId)
           
 Group[] getAllSubGroups(String parentGroupId)
           
 String[] getAllSubSpaceIds(String sSpaceId)
           
 String[] getAllSubSpaceIds(String sSpaceId, String sUserId)
           
 int getAllSubUsersNumber(String sGroupId)
           
 UserDetail[] getAllUsers()
           
 UserDetail[] getAllUsers(String componentId)
           
 UserDetail[] getAllUsers(String sPrefixTableName, String sComponentName)
           
 List<UserDetail> getAllUsersFromNewestToOldest()
           
 String[] getAllUsersIds()
           
 UserDetail[] getAllUsersInDomain(String domainId)
           
 UserDetail[] getAllUsersOfGroup(String groupId)
           
 String[] getAvailCompoIds(String sUserId)
           
 String[] getAvailCompoIds(String sClientSpaceId, String sUserId)
           
 String[] getAvailCompoIdsAtRoot(String sClientSpaceId, String sUserId)
           
 List<ComponentInstLight> getAvailComponentInstLights(String userId, String componentName)
           
 String[] getAvailDriverCompoIds(String sClientSpaceId, String sUserId)
           
 CompoSpace[] getCompoForUser(String sUserId, String sCompoName)
           
 String[] getCompoId(String sCompoName)
           
 String[] getComponentIdsForUser(String sUserId, String sCompoName)
           
 ComponentInst getComponentInst(String sComponentId)
           
 ComponentInstLight getComponentInstLight(String sComponentId)
           
 String getComponentParameterValue(String sComponentId, String parameterName)
           
 String[] getDirectGroupIdsOfUser(String userId)
           
 Domain getDomain(String domainId)
           
 UserDetail[] getFiltredDirectUsers(String sGroupId, String sUserLastNameFilter)
           
 String getGeneralSpaceId()
           
 Group getGroup(String sGroupId)
           
 Group[] getGroups(String[] groupsId)
           
 OrganisationController getOrganizationControllerMock()
          Gets the mock of the OrganizationController class wrapped by this instance.
 List<String> getPathToGroup(String groupId)
           
 SpaceInstLight getRootSpace(String spaceId)
           
 List<SpaceInstLight> getRootSpacesContainingComponent(String userId, String componentName)
           
 List<String> getSearchableComponentsByCriteria(ComponentSearchCriteria criteria)
           
 SpaceInst getSpaceInstById(String sSpaceId)
           
 SpaceInstLight getSpaceInstLightById(String spaceId)
           
 String[] getSpaceNames(String[] asSpaceIds)
           
 List<SpaceInst> getSpacePath(String spaceId)
           
 List<SpaceInst> getSpacePathToComponent(String componentId)
           
 List<SpaceInstLight> getSpaceTreeview(String userId)
           
 List<SpaceInstLight> getSubSpacesContainingComponent(String spaceId, String userId, String componentName)
           
 int getUserDBId(String sUserId)
           
 UserDetail getUserDetail(String sUserId)
           
 String getUserDetailByDBId(int id)
           
 UserDetail[] getUserDetails(String[] asUserIds)
           
 UserFull getUserFull(String sUserId)
           
 String[] getUserManageableSpaceIds(String sUserId)
           
 Map<Integer,List<String>> getUserObjectProfiles(String userId, String componentId, ObjectType objectType)
           
 ProfileInst getUserProfile(String profileId)
           
 String[] getUserProfiles(String userId, String componentId)
           
 String[] getUserProfiles(String userId, String componentId, int objectId, ObjectType objectType)
           
 List<ProfileInst> getUserProfiles(String componentId, String objectId, String objectType)
           
 UserDetail[] getUsers(String sPrefixTableName, String sComponentName, String sProfile)
           
 String[] getUsersIdsByRoleNames(String componentId, List<String> profileNames)
           
 String[] getUsersIdsByRoleNames(String componentId, String objectId, ObjectType objectType, List<String> profileNames)
           
 List<UserDetail> getUsersOfDomains(List<String> domainIds)
           
 List<UserDetail> getUsersOfDomainsFromNewestToOldest(List<String> domainIds)
           
 boolean isAdminTool(String toolId)
           
 boolean isAnonymousAccessActivated()
           
 boolean isComponentAvailable(String componentId, String userId)
           
 boolean isComponentExist(String componentId)
           
 boolean isComponentManageable(String componentId, String userId)
           
 boolean isObjectAvailable(int objectId, ObjectType objectType, String componentId, String userId)
           
 boolean isSpaceAvailable(String spaceId, String userId)
           
 boolean isToolAvailable(String toolId)
           
 void reloadAdminCache()
           
 Group[] searchGroups(Group modelGroup, boolean isAnd)
           
 ListSlice<Group> searchGroups(GroupsSearchCriteria criteria)
           
 String[] searchGroupsIds(boolean isRootGroup, String componentId, String[] profileId, Group modelGroup)
           
 UserDetail[] searchUsers(UserDetail modelUser, boolean isAnd)
           
 ListSlice<UserDetail> searchUsers(UserDetailsSearchCriteria criteria)
           
 String[] searchUsersIds(String groupId, String componentId, String[] profileId, UserDetail filterUser)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OrganizationControllerMockWrapper

public OrganizationControllerMockWrapper()
Method Detail

getOrganizationControllerMock

public OrganisationController getOrganizationControllerMock()
Gets the mock of the OrganizationController class wrapped by this instance.

Returns:
an OrganizationController mock.

searchUsersIds

public String[] searchUsersIds(String groupId,
                               String componentId,
                               String[] profileId,
                               UserDetail filterUser)
Specified by:
searchUsersIds in interface OrganisationController

searchUsers

public UserDetail[] searchUsers(UserDetail modelUser,
                                boolean isAnd)
Specified by:
searchUsers in interface OrganisationController

searchUsers

public ListSlice<UserDetail> searchUsers(UserDetailsSearchCriteria criteria)
Specified by:
searchUsers in interface OrganisationController

searchGroups

public ListSlice<Group> searchGroups(GroupsSearchCriteria criteria)
Specified by:
searchGroups in interface OrganisationController

searchGroupsIds

public String[] searchGroupsIds(boolean isRootGroup,
                                String componentId,
                                String[] profileId,
                                Group modelGroup)
Specified by:
searchGroupsIds in interface OrganisationController

searchGroups

public Group[] searchGroups(Group modelGroup,
                            boolean isAnd)
Specified by:
searchGroups in interface OrganisationController

reloadAdminCache

public void reloadAdminCache()
Specified by:
reloadAdminCache in interface OrganisationController

isSpaceAvailable

public boolean isSpaceAvailable(String spaceId,
                                String userId)
Specified by:
isSpaceAvailable in interface OrganisationController

isObjectAvailable

public boolean isObjectAvailable(int objectId,
                                 ObjectType objectType,
                                 String componentId,
                                 String userId)
Specified by:
isObjectAvailable in interface OrganisationController

isComponentManageable

public boolean isComponentManageable(String componentId,
                                     String userId)
Specified by:
isComponentManageable in interface OrganisationController

isComponentExist

public boolean isComponentExist(String componentId)
Specified by:
isComponentExist in interface OrganisationController

isComponentAvailable

public boolean isComponentAvailable(String componentId,
                                    String userId)
Specified by:
isComponentAvailable in interface OrganisationController

isAnonymousAccessActivated

public boolean isAnonymousAccessActivated()
Specified by:
isAnonymousAccessActivated in interface OrganisationController

getUsersIdsByRoleNames

public String[] getUsersIdsByRoleNames(String componentId,
                                       String objectId,
                                       ObjectType objectType,
                                       List<String> profileNames)
Specified by:
getUsersIdsByRoleNames in interface OrganisationController

getUsersIdsByRoleNames

public String[] getUsersIdsByRoleNames(String componentId,
                                       List<String> profileNames)
Specified by:
getUsersIdsByRoleNames in interface OrganisationController

getUsers

public UserDetail[] getUsers(String sPrefixTableName,
                             String sComponentName,
                             String sProfile)
Specified by:
getUsers in interface OrganisationController

getUserProfiles

public String[] getUserProfiles(String userId,
                                String componentId,
                                int objectId,
                                ObjectType objectType)
Specified by:
getUserProfiles in interface OrganisationController

getUserObjectProfiles

public Map<Integer,List<String>> getUserObjectProfiles(String userId,
                                                       String componentId,
                                                       ObjectType objectType)
Specified by:
getUserObjectProfiles in interface OrganisationController

getUserProfiles

public String[] getUserProfiles(String userId,
                                String componentId)
Specified by:
getUserProfiles in interface OrganisationController

getUserProfile

public ProfileInst getUserProfile(String profileId)
Specified by:
getUserProfile in interface OrganisationController

getUserManageableSpaceIds

public String[] getUserManageableSpaceIds(String sUserId)
Specified by:
getUserManageableSpaceIds in interface OrganisationController

getUserFull

public UserFull getUserFull(String sUserId)
Specified by:
getUserFull in interface OrganisationController

getUserDetails

public UserDetail[] getUserDetails(String[] asUserIds)
Specified by:
getUserDetails in interface OrganisationController

getUserDetailByDBId

public String getUserDetailByDBId(int id)
Specified by:
getUserDetailByDBId in interface OrganisationController

getUserDetail

public UserDetail getUserDetail(String sUserId)
Specified by:
getUserDetail in interface OrganisationController

getUserDBId

public int getUserDBId(String sUserId)
Specified by:
getUserDBId in interface OrganisationController

getSubSpacesContainingComponent

public List<SpaceInstLight> getSubSpacesContainingComponent(String spaceId,
                                                            String userId,
                                                            String componentName)
Specified by:
getSubSpacesContainingComponent in interface OrganisationController

getSpaceTreeview

public List<SpaceInstLight> getSpaceTreeview(String userId)
Specified by:
getSpaceTreeview in interface OrganisationController

getSpacePathToComponent

public List<SpaceInst> getSpacePathToComponent(String componentId)
Specified by:
getSpacePathToComponent in interface OrganisationController

getSpacePath

public List<SpaceInst> getSpacePath(String spaceId)
Specified by:
getSpacePath in interface OrganisationController

getSpaceNames

public String[] getSpaceNames(String[] asSpaceIds)
Specified by:
getSpaceNames in interface OrganisationController

getSpaceInstLightById

public SpaceInstLight getSpaceInstLightById(String spaceId)
Specified by:
getSpaceInstLightById in interface OrganisationController

getSpaceInstById

public SpaceInst getSpaceInstById(String sSpaceId)
Specified by:
getSpaceInstById in interface OrganisationController

getRootSpacesContainingComponent

public List<SpaceInstLight> getRootSpacesContainingComponent(String userId,
                                                             String componentName)
Specified by:
getRootSpacesContainingComponent in interface OrganisationController

getRootSpace

public SpaceInstLight getRootSpace(String spaceId)
Specified by:
getRootSpace in interface OrganisationController

getPathToGroup

public List<String> getPathToGroup(String groupId)
Specified by:
getPathToGroup in interface OrganisationController

getGroups

public Group[] getGroups(String[] groupsId)
Specified by:
getGroups in interface OrganisationController

getGroup

public Group getGroup(String sGroupId)
Specified by:
getGroup in interface OrganisationController

getGeneralSpaceId

public String getGeneralSpaceId()
Specified by:
getGeneralSpaceId in interface OrganisationController

getFiltredDirectUsers

public UserDetail[] getFiltredDirectUsers(String sGroupId,
                                          String sUserLastNameFilter)
Specified by:
getFiltredDirectUsers in interface OrganisationController

getDomain

public Domain getDomain(String domainId)
Specified by:
getDomain in interface OrganisationController

getDirectGroupIdsOfUser

public String[] getDirectGroupIdsOfUser(String userId)
Specified by:
getDirectGroupIdsOfUser in interface OrganisationController

getComponentParameterValue

public String getComponentParameterValue(String sComponentId,
                                         String parameterName)
Specified by:
getComponentParameterValue in interface OrganisationController

getComponentInstLight

public ComponentInstLight getComponentInstLight(String sComponentId)
Specified by:
getComponentInstLight in interface OrganisationController

getComponentInst

public ComponentInst getComponentInst(String sComponentId)
Specified by:
getComponentInst in interface OrganisationController

getComponentIdsForUser

public String[] getComponentIdsForUser(String sUserId,
                                       String sCompoName)
Specified by:
getComponentIdsForUser in interface OrganisationController

getCompoId

public String[] getCompoId(String sCompoName)
Specified by:
getCompoId in interface OrganisationController

getCompoForUser

public CompoSpace[] getCompoForUser(String sUserId,
                                    String sCompoName)
Specified by:
getCompoForUser in interface OrganisationController

getAvailDriverCompoIds

public String[] getAvailDriverCompoIds(String sClientSpaceId,
                                       String sUserId)
Specified by:
getAvailDriverCompoIds in interface OrganisationController

getAvailComponentInstLights

public List<ComponentInstLight> getAvailComponentInstLights(String userId,
                                                            String componentName)
Specified by:
getAvailComponentInstLights in interface OrganisationController

getAvailCompoIdsAtRoot

public String[] getAvailCompoIdsAtRoot(String sClientSpaceId,
                                       String sUserId)
Specified by:
getAvailCompoIdsAtRoot in interface OrganisationController

getAvailCompoIds

public String[] getAvailCompoIds(String sClientSpaceId,
                                 String sUserId)
Specified by:
getAvailCompoIds in interface OrganisationController

getAllowedSubSpaceIds

public String[] getAllowedSubSpaceIds(String userId,
                                      String spaceFatherId)
Specified by:
getAllowedSubSpaceIds in interface OrganisationController

getAllowedComponentIds

public String[] getAllowedComponentIds(String userId)
Specified by:
getAllowedComponentIds in interface OrganisationController

getAllUsersOfGroup

public UserDetail[] getAllUsersOfGroup(String groupId)
Specified by:
getAllUsersOfGroup in interface OrganisationController

getAllUsersInDomain

public UserDetail[] getAllUsersInDomain(String domainId)
Specified by:
getAllUsersInDomain in interface OrganisationController

getAllUsersIds

public String[] getAllUsersIds()
Specified by:
getAllUsersIds in interface OrganisationController

getAllUsers

public UserDetail[] getAllUsers()
Specified by:
getAllUsers in interface OrganisationController

getAllUsers

public UserDetail[] getAllUsers(String componentId)
Specified by:
getAllUsers in interface OrganisationController

getAllSubUsersNumber

public int getAllSubUsersNumber(String sGroupId)
Specified by:
getAllSubUsersNumber in interface OrganisationController

getAllSubSpaceIds

public String[] getAllSubSpaceIds(String sSpaceId,
                                  String sUserId)
Specified by:
getAllSubSpaceIds in interface OrganisationController

getAllSubSpaceIds

public String[] getAllSubSpaceIds(String sSpaceId)
Specified by:
getAllSubSpaceIds in interface OrganisationController

getAllSubGroups

public Group[] getAllSubGroups(String parentGroupId)
Specified by:
getAllSubGroups in interface OrganisationController

getAllSpaceIds

public String[] getAllSpaceIds(String sUserId)
Specified by:
getAllSpaceIds in interface OrganisationController

getAllSpaceIds

public String[] getAllSpaceIds()
Specified by:
getAllSpaceIds in interface OrganisationController

getAllRootSpaceIds

public String[] getAllRootSpaceIds(String sUserId)
Specified by:
getAllRootSpaceIds in interface OrganisationController

getAllRootSpaceIds

public String[] getAllRootSpaceIds()
Specified by:
getAllRootSpaceIds in interface OrganisationController

getAllRootGroupsInDomain

public Group[] getAllRootGroupsInDomain(String domainId)
Specified by:
getAllRootGroupsInDomain in interface OrganisationController

getAllRootGroups

public Group[] getAllRootGroups()
Specified by:
getAllRootGroups in interface OrganisationController

getAllGroups

public Group[] getAllGroups()
Specified by:
getAllGroups in interface OrganisationController

getAllGroupIdsOfUser

public String[] getAllGroupIdsOfUser(String userId)
Specified by:
getAllGroupIdsOfUser in interface OrganisationController

getAllDomains

public Domain[] getAllDomains()
Specified by:
getAllDomains in interface OrganisationController

getAllComponentsNames

public Map<String,String> getAllComponentsNames()
Specified by:
getAllComponentsNames in interface OrganisationController

getAllComponents

public Map<String,WAComponent> getAllComponents()
Specified by:
getAllComponents in interface OrganisationController

getAllComponentIdsRecur

public String[] getAllComponentIdsRecur(String sSpaceId,
                                        String sUserId,
                                        String sComponentRootName,
                                        boolean inCurrentSpace,
                                        boolean inAllSpaces)
Specified by:
getAllComponentIdsRecur in interface OrganisationController

getAllComponentIdsRecur

public String[] getAllComponentIdsRecur(String sSpaceId)
Specified by:
getAllComponentIdsRecur in interface OrganisationController

getAllComponentIds

public String[] getAllComponentIds(String sSpaceId)
Specified by:
getAllComponentIds in interface OrganisationController

getAdministratorUserIds

public String[] getAdministratorUserIds(String fromUserId)
Specified by:
getAdministratorUserIds in interface OrganisationController

isToolAvailable

public boolean isToolAvailable(String toolId)
Specified by:
isToolAvailable in interface OrganisationController

getAllUsers

public UserDetail[] getAllUsers(String sPrefixTableName,
                                String sComponentName)
Specified by:
getAllUsers in interface OrganisationController

getUserProfiles

public List<ProfileInst> getUserProfiles(String componentId,
                                         String objectId,
                                         String objectType)
Specified by:
getUserProfiles in interface OrganisationController

getAllUsersFromNewestToOldest

public List<UserDetail> getAllUsersFromNewestToOldest()
Specified by:
getAllUsersFromNewestToOldest in interface OrganisationController

getUsersOfDomainsFromNewestToOldest

public List<UserDetail> getUsersOfDomainsFromNewestToOldest(List<String> domainIds)
Specified by:
getUsersOfDomainsFromNewestToOldest in interface OrganisationController

getUsersOfDomains

public List<UserDetail> getUsersOfDomains(List<String> domainIds)
Specified by:
getUsersOfDomains in interface OrganisationController

isAdminTool

public boolean isAdminTool(String toolId)
Specified by:
isAdminTool in interface OrganisationController

getAvailCompoIds

public String[] getAvailCompoIds(String sUserId)
Specified by:
getAvailCompoIds in interface OrganisationController

getSearchableComponentsByCriteria

public List<String> getSearchableComponentsByCriteria(ComponentSearchCriteria criteria)
Specified by:
getSearchableComponentsByCriteria in interface OrganisationController


Copyright © 2016 Silverpeas. All Rights Reserved.