Class VootTest
java.lang.Object
junit.framework.Assert
junit.framework.TestCase
edu.internet2.middleware.grouper.helper.GrouperTest
edu.internet2.middleware.grouperVoot.VootTest
- All Implemented Interfaces:
junit.framework.Test
- Direct Known Subclasses:
VootErrorsTest
,VootParamsLogicTest
,VootServiceLogicTest
Class to test the main service logic for the VOOT connector for Grouper.
-
Field Summary
FieldsFields inherited from class edu.internet2.middleware.grouper.helper.GrouperTest
testing
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected Object
callGroupsAPI
(String userUrl) Method the realize the call to VOOT groups api.protected Object
callGroupsAPI
(String userUrl, String search, String sortBy, int start, int count) Method the realize the call to VOOT groups api.protected Object
callPeopleAPI
(String userUrl, String groupUrl) Method the realize the call to VOOT people api.protected Object
callPeopleAPI
(String userUrl, String groupUrl, String sortBy, int start, int count) Method the realize the call to VOOT people api.protected abstract void
Method to create a registry with all the required users and groups to test all VOOT calls with this test suite.protected void
validateError
(Object resultObject, String error, String description) Method to validate error result from VOOT call.protected void
validateGroups
(Object resultObject, int total, String orderBy, int start, int count, int[] groups, String[] roles) Method to validate groups result from VOOT call.protected void
validateMembers
(Object resultObject, int total, String orderBy, int start, int count, edu.internet2.middleware.subject.Subject[] subjects, String[] roles) Method to validate subject result from VOOT call.Methods inherited from class edu.internet2.middleware.grouper.helper.GrouperTest
assertContains, assertContains, assertContainsAttributeDef, assertContainsAttributeDefName, assertContainsGroup, assertContainsGroups, assertContainsStem, assertContainsStems, assertContainsString, assertContainsString, assertDoNotFindGroupByAttribute, assertDoNotFindGroupByName, assertDoNotFindGroupByName, assertDoNotFindGroupByType, assertDoNotFindGroupByType, assertDoNotFindStemByName, assertDoNotFindStemByName, assertEnoughMemory, assertEquals, assertEquals, assertEqualsMultiKey, assertEqualsMultiKey, assertEqualsObjectArrays, assertEqualsObjectArrays, assertFindField, assertFindGroupByAttribute, assertFindGroupByName, assertFindGroupByName, assertFindGroupByType, assertFindGroupByType, assertFindGroupType, assertFindStemByName, assertFindStemByName, assertGroupAttribute, assertGroupCreateSubject, assertGroupCreateTime, assertGroupDescription, assertGroupDisplayExtension, assertGroupDisplayName, assertGroupExtension, assertGroupHasAdmin, assertGroupHasGroupAttrRead, assertGroupHasGroupAttrUpdate, assertGroupHasMember, assertGroupHasMember, assertGroupHasOptin, assertGroupHasOptout, assertGroupHasRead, assertGroupHasType, assertGroupHasUpdate, assertGroupHasView, assertGroupName, assertGroupSetsAndOrder, assertGroupUuid, assertHasPrivilege, assertHasPrivilege, assertHasPrivilege, assertNotContainsAttributeDef, assertNotContainsAttributeDefName, assertNotContainsGroup, assertNotContainsStem, assertStemCreateSubject, assertStemCreateTime, assertStemDescription, assertStemDisplayExtension, assertStemDisplayName, assertStemExtension, assertStemHasCreate, assertStemHasStem, assertStemName, assertStemUuid, deleteAllStemsIfExists, deleteGroupIfExists, deleteStemIfExists, errorInitializingTest, filterOutBuiltInGroups, groupsString, initGroupsAndAttributes, isTesting, printMemberships, setUp, setupConfigs, setupConfigsPostClearCache, setupInitDb, setupTestConfigForIncludeExclude, setupTests, stemName, stemsString, tearDown, tomcatRunTests, tomcatStart, tomcatStop, unexpectedException
Methods inherited from class junit.framework.TestCase
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, countTestCases, createResult, fail, fail, failNotEquals, failNotSame, failSame, format, getName, run, run, runBare, runTest, setName, toString
-
Field Details
-
GROUP_NAMES
-
GROUP_DESCRIPTIONS
-
-
Constructor Details
-
VootTest
public VootTest()Default constructor to initialize VOOT test cases. -
VootTest
Constructor with a test name as parameter.- Parameters:
name
- the name of this test execution on the test runner.
-
-
Method Details
-
createRegistryToTestVOOT
protected abstract void createRegistryToTestVOOT()Method to create a registry with all the required users and groups to test all VOOT calls with this test suite. To test all the combinations, the membership and read access to groups will be assigned to two different subjects with the following logic:- Group 0: Subject0 is not member, Subject1 is not member, Subject0 does not have read access, Subject1 does not have read access
- Group 1: Subject0 is admin member, Subject1 is not member, Subject0 has read access, Subject1 does not have read access
- Group 2: Subject0 is not member, Subject1 is admin member, Subject0 does not have read access, Subject1 has read access
- Group 3: Subject0 is member, Subject1 is member, Subject0 has read access, Subject1 has read access
- Group 4: Subject0 is admin member, Subject1 is not member, Subject0 does not have read access, Subject1 does not have read access
- Group 5: Subject0 is not member, Subject1 is admin member, Subject0 does not have read access, Subject1 does not have read access
- Group 6: Subject0 is member, Subject1 is member, Subject0 does not have read access, Subject1 does not have read access
- Group 7: Subject0 is not member, Subject1 is not member, Subject0 has read access, Subject1 does not have read access
- Group 8: Subject0 is not member, Subject1 is not member, Subject0 does not have read access, Subject1 has read access
- Group 9: Subject0 is not member, Subject1 is not member, Subject0 has read access, Subject1 has read access
- Group 10: Subject0 is updater member, Subject1 is not member, Subject0 has read access, Subject1 does not have read access
- Group 11: Subject0 is not member, Subject1 is updater member, Subject0 does not have access, Subject 1 has read access
-
callGroupsAPI
Method the realize the call to VOOT groups api.- Parameters:
grouperSession
- the grouper session to be used for callinguserUrl
- the url to call- Returns:
- the object obtained from VOOT call
-
callGroupsAPI
Method the realize the call to VOOT groups api.- Parameters:
grouperSession
- the grouper session to be used for callinguserUrl
- the url to callsortBy
- the field name to be used for sorting or null of no sorting.start
- the first element in the result set (0 means start from beginning).count
- the number of elements in the result set (-1 or 0 means find all).- Returns:
- the object obtained from VOOT call
-
callPeopleAPI
Method the realize the call to VOOT people api.- Parameters:
userUrl
- the url to callgroupUrl
- the url to callsortBy
- the field name to be used for sorting or null of no sorting.start
- the first element in the result set (0 means start from beginning).count
- the number of elements in the result set (-1 or 0 means find all).- Returns:
- the object obtained from VOOT call
-
callPeopleAPI
protected Object callPeopleAPI(String userUrl, String groupUrl, String sortBy, int start, int count) Method the realize the call to VOOT people api.- Parameters:
userUrl
- the url to callgroupUrl
- the url to call- Returns:
- the object obtained from VOOT call
-
validateGroups
protected void validateGroups(Object resultObject, int total, String orderBy, int start, int count, int[] groups, String[] roles) Method to validate groups result from VOOT call.- Parameters:
resultObject
- the object returned from VOOT call.count
- the number of groups expected to be in the output object.groups
- the groups id (in this class definition) to be searched in the result.
-
validateMembers
protected void validateMembers(Object resultObject, int total, String orderBy, int start, int count, edu.internet2.middleware.subject.Subject[] subjects, String[] roles) Method to validate subject result from VOOT call.- Parameters:
resultObject
- the object returned from VOOT call.subjects
- the subjects expected to be in the output.roles
- the roles of the subjects in the output.
-
validateError
Method to validate error result from VOOT call.- Parameters:
resultObject
- the object returned from VOOT call.error
- the error name returned from VOOT.description
- the error description returned from VOOT.
-