pt.digitalis.dif.utils.identity.tests
Class AbstractIdentityManagerImplTest

java.lang.Object
  extended by junit.framework.Assert
      extended by junit.framework.TestCase
          extended by pt.digitalis.dif.utils.identity.tests.AbstractIdentityManagerImplTest
All Implemented Interfaces:
junit.framework.Test

public abstract class AbstractIdentityManagerImplTest
extends junit.framework.TestCase

Defines unit tests for the identity manager implementation.

Author:
Luis Pinto lpinto@digitalis.pt
Created on:
2012/10/30

Field Summary
protected static String A_BULK_ATTRIBUTE_NAME
          A bulk parameter name.
protected static String A_BULK_ATTRIBUTE_VALUE
          A bulk parameter value.
protected static String A_CHANGED_ATTRIBUTE_VALUE
          A changed attribute value.
protected static String A_CHANGED_BULK_ATTRIBUTE_VALUE
          A changed bulk parameter value.
protected static String AN_ATTRIBUTE_NAME
          An attribute name.
protected static String AN_ATTRIBUTE_VALUE
          An attribute value.
protected static String ANOTHER_ATTRIBUTE_NAME
          Another attribute name.
protected static String ANOTHER_ATTRIBUTE_VALUE
          Another parameter value.
protected static String ANOTHER_BULK_ATTRIBUTE_NAME
          Another bulk parameter name.
protected static String ANOTHER_BULK_ATTRIBUTE_VALUE
          Another bulk parameter value.
protected static String ANOTHER_CHANGED_ATTRIBUTE_VALUE
          Another changed parameter value.
protected static String ANOTHER_CHANGED_BULK_PARAMETER_VALUE
          Another changed bulk parameter value.
protected  IIdentityManager identityManagerImpl
          The test object.
protected  String MAIN_GROUP_NAME
          Main group name.
static String N_A
          The 'N/A' String literal.
 
Constructor Summary
AbstractIdentityManagerImplTest()
           
 
Method Summary
protected  void createGroup()
          Creates a group and adds it to the identity manager.
protected  void createGroup(String groupName)
          Creates a group and adds it to the identity manager.
protected  void createGroup(String groupName, String parentGroup)
          Creates a group and adds it to the identity manager.
protected  void createUser()
          Creates a user and adds it to the identity manager.
protected  void createUser(String userID)
          Creates a user and adds it to the identity manager.
protected  void removeGroup()
          Removes the group NEW_GROUP_NAME from the identity manager.
protected  void removeGroup(String groupId)
          Removes a group from the identity manager.
protected  void removeUser(String userId)
          Removes a user from the identity manager.
protected  void setUp()
           
 void tearDown()
           
 void testFindAllGroups()
          Tests if the obtainance of all groups in the system work correctly
 void testFindllUsers()
          Tests if the obtainance of all users in the system work correctly
 void testFindUserGroups()
          Test the find user groups methods
 void testGroupGroups()
          Tests searching for groups with a given parent.
 void testGroupOperations()
          Tests the group operations.
 void testGroupOperationsInFailureBehaviour()
          Tests the group operations forcing failure behavior.
 void testIllegalOperations()
          Tests the illegal operations.
 void testInitialization()
          Tests the static Identity Manager Initialization
 void testNotAvailable()
          Not available test condition
 void testRelationOperations()
          Tests the identity manager's relation operations.
 void testUserAttributes()
          Tests the finders by attributes
 void testUserOperations()
          Tests the user operations.
 void testUserOperationsInFailureBehaviour()
          Tests the user operations forcing failure behavior.
 
Methods inherited from class junit.framework.TestCase
countTestCases, createResult, getName, run, run, runBare, runTest, setName, toString
 
Methods inherited from class junit.framework.Assert
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, fail, fail, failNotEquals, failNotSame, failSame, format
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

A_BULK_ATTRIBUTE_NAME

protected static final String A_BULK_ATTRIBUTE_NAME
A bulk parameter name.

See Also:
Constant Field Values

A_BULK_ATTRIBUTE_VALUE

protected static final String A_BULK_ATTRIBUTE_VALUE
A bulk parameter value.

See Also:
Constant Field Values

A_CHANGED_ATTRIBUTE_VALUE

protected static final String A_CHANGED_ATTRIBUTE_VALUE
A changed attribute value.

See Also:
Constant Field Values

A_CHANGED_BULK_ATTRIBUTE_VALUE

protected static final String A_CHANGED_BULK_ATTRIBUTE_VALUE
A changed bulk parameter value.

See Also:
Constant Field Values

AN_ATTRIBUTE_NAME

protected static final String AN_ATTRIBUTE_NAME
An attribute name.

See Also:
Constant Field Values

AN_ATTRIBUTE_VALUE

protected static final String AN_ATTRIBUTE_VALUE
An attribute value.

See Also:
Constant Field Values

ANOTHER_ATTRIBUTE_NAME

protected static final String ANOTHER_ATTRIBUTE_NAME
Another attribute name.

See Also:
Constant Field Values

ANOTHER_ATTRIBUTE_VALUE

protected static final String ANOTHER_ATTRIBUTE_VALUE
Another parameter value.

See Also:
Constant Field Values

ANOTHER_BULK_ATTRIBUTE_NAME

protected static final String ANOTHER_BULK_ATTRIBUTE_NAME
Another bulk parameter name.

See Also:
Constant Field Values

ANOTHER_BULK_ATTRIBUTE_VALUE

protected static final String ANOTHER_BULK_ATTRIBUTE_VALUE
Another bulk parameter value.

See Also:
Constant Field Values

ANOTHER_CHANGED_ATTRIBUTE_VALUE

protected static final String ANOTHER_CHANGED_ATTRIBUTE_VALUE
Another changed parameter value.

See Also:
Constant Field Values

ANOTHER_CHANGED_BULK_PARAMETER_VALUE

protected static final String ANOTHER_CHANGED_BULK_PARAMETER_VALUE
Another changed bulk parameter value.

See Also:
Constant Field Values

N_A

public static final String N_A
The 'N/A' String literal.

See Also:
Constant Field Values

identityManagerImpl

protected IIdentityManager identityManagerImpl
The test object.


MAIN_GROUP_NAME

protected String MAIN_GROUP_NAME
Main group name.

Constructor Detail

AbstractIdentityManagerImplTest

public AbstractIdentityManagerImplTest()
Method Detail

createGroup

protected void createGroup()
                    throws IdentityManagerException
Creates a group and adds it to the identity manager.

Throws:
IdentityManagerException - if the user can't be created

createGroup

protected void createGroup(String groupName)
                    throws IdentityManagerException
Creates a group and adds it to the identity manager.

Parameters:
groupName -
Throws:
IdentityManagerException - if the user can't be created

createGroup

protected void createGroup(String groupName,
                           String parentGroup)
                    throws IdentityManagerException
Creates a group and adds it to the identity manager.

Parameters:
groupName - the group name
parentGroup - the group parent group
Throws:
IdentityManagerException - if the user can't be created

createUser

protected void createUser()
                   throws IdentityManagerException,
                          InternalFrameworkException
Creates a user and adds it to the identity manager.

Throws:
IdentityManagerException - if the user can't be created
InternalFrameworkException

createUser

protected void createUser(String userID)
                   throws IdentityManagerException,
                          InternalFrameworkException
Creates a user and adds it to the identity manager.

Parameters:
userID - the user ID
Throws:
IdentityManagerException - if the user can't be created
InternalFrameworkException

removeGroup

protected void removeGroup()
                    throws IdentityManagerException
Removes the group NEW_GROUP_NAME from the identity manager.

Throws:
IdentityManagerException - if the user can't be created

removeGroup

protected void removeGroup(String groupId)
                    throws IdentityManagerException
Removes a group from the identity manager.

Parameters:
groupId - the group ID to remove
Throws:
IdentityManagerException

removeUser

protected void removeUser(String userId)
                   throws IdentityManagerException
Removes a user from the identity manager.

Parameters:
userId - the id of the user to remove
Throws:
IdentityManagerException - if the user can't be created

setUp

protected void setUp()
              throws Exception
Overrides:
setUp in class junit.framework.TestCase
Throws:
Exception
See Also:
TestCase.setUp()

tearDown

public void tearDown()
Overrides:
tearDown in class junit.framework.TestCase
See Also:
TestCase.tearDown()

testFindAllGroups

public void testFindAllGroups()
                       throws IdentityManagerException
Tests if the obtainance of all groups in the system work correctly

Throws:
IdentityManagerException

testFindllUsers

public void testFindllUsers()
                     throws IdentityManagerException
Tests if the obtainance of all users in the system work correctly

Throws:
IdentityManagerException

testFindUserGroups

public void testFindUserGroups()
Test the find user groups methods


testGroupGroups

public void testGroupGroups()
                     throws IdentityManagerException
Tests searching for groups with a given parent.

Throws:
IdentityManagerException - if the identity manager can't be accessed

testGroupOperations

public void testGroupOperations()
Tests the group operations.


testGroupOperationsInFailureBehaviour

public void testGroupOperationsInFailureBehaviour()
                                           throws IdentityManagerException
Tests the group operations forcing failure behavior.

Throws:
IdentityManagerException - if the identity manager can't be accessed

testIllegalOperations

public void testIllegalOperations()
                           throws InternalFrameworkException
Tests the illegal operations.

Throws:
InternalFrameworkException

testInitialization

public void testInitialization()
Tests the static Identity Manager Initialization


testNotAvailable

public void testNotAvailable()
                      throws IdentityManagerException
Not available test condition

Throws:
IdentityManagerException

testRelationOperations

public void testRelationOperations()
                            throws IdentityManagerException,
                                   InternalFrameworkException
Tests the identity manager's relation operations.

Throws:
IdentityManagerException - if the operation can't be executed
InternalFrameworkException

testUserAttributes

public void testUserAttributes()
                        throws IdentityManagerException,
                               InternalFrameworkException
Tests the finders by attributes

Throws:
InternalFrameworkException
IdentityManagerException

testUserOperations

public void testUserOperations()
                        throws IdentityManagerException,
                               InternalFrameworkException
Tests the user operations.

Throws:
IdentityManagerException - if the attribute values can't be changed
InternalFrameworkException

testUserOperationsInFailureBehaviour

public void testUserOperationsInFailureBehaviour()
                                          throws IdentityManagerException
Tests the user operations forcing failure behavior.

Throws:
IdentityManagerException - if the identity manager can't be accessed


Copyright © 2014 Digitalis Informática Lda. All Rights Reserved.