org.exoplatform.commons.testing.mock
Class SimpleMockOrganizationService

java.lang.Object
  extended by org.exoplatform.commons.testing.mock.SimpleMockOrganizationService
All Implemented Interfaces:
org.exoplatform.services.organization.OrganizationService

public class SimpleMockOrganizationService
extends Object
implements org.exoplatform.services.organization.OrganizationService

A partial implementation of OrganizationService for use in tests of classes that rely on it. It provides a simple method to insert the membership data : addMemberships(String, String...) Uses dumb implementations of Group, User and Membership based on an identifier. All find operations are implemented. Write operations are not implemented.

Author:
patricelamarque

Constructor Summary
SimpleMockOrganizationService()
           
 
Method Summary
 void addListenerPlugin(org.exoplatform.container.component.ComponentPlugin listener)
           
 void addMemberships(String user, String... membershipExprs)
          Insert a new membership.
 org.exoplatform.services.organization.GroupHandler getGroupHandler()
           
 org.exoplatform.services.organization.MembershipHandler getMembershipHandler()
           
 org.exoplatform.services.organization.MembershipTypeHandler getMembershipTypeHandler()
           
 org.exoplatform.services.organization.UserHandler getUserHandler()
           
 org.exoplatform.services.organization.UserProfileHandler getUserProfileHandler()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SimpleMockOrganizationService

public SimpleMockOrganizationService()
Method Detail

addMemberships

public void addMemberships(String user,
                           String... membershipExprs)
Insert a new membership. The user, group and membership type are added to the model if they don't exist.

Parameters:
user - username username for the membership
membershipExprs - membership expressions in the classical form [TYPE:]GROUP . TYPE may be omitted. In that case "*" membership will be used.

getGroupHandler

public org.exoplatform.services.organization.GroupHandler getGroupHandler()
Specified by:
getGroupHandler in interface org.exoplatform.services.organization.OrganizationService

getMembershipHandler

public org.exoplatform.services.organization.MembershipHandler getMembershipHandler()
Specified by:
getMembershipHandler in interface org.exoplatform.services.organization.OrganizationService

getMembershipTypeHandler

public org.exoplatform.services.organization.MembershipTypeHandler getMembershipTypeHandler()
Specified by:
getMembershipTypeHandler in interface org.exoplatform.services.organization.OrganizationService

getUserHandler

public org.exoplatform.services.organization.UserHandler getUserHandler()
Specified by:
getUserHandler in interface org.exoplatform.services.organization.OrganizationService

getUserProfileHandler

public org.exoplatform.services.organization.UserProfileHandler getUserProfileHandler()
Specified by:
getUserProfileHandler in interface org.exoplatform.services.organization.OrganizationService

addListenerPlugin

public void addListenerPlugin(org.exoplatform.container.component.ComponentPlugin listener)
                       throws Exception
Specified by:
addListenerPlugin in interface org.exoplatform.services.organization.OrganizationService
Throws:
Exception


Copyright © 2013 eXo Platform SAS. All Rights Reserved.