org.opensubsystems.security.logic
Class UserControllerTest.UserControllerTestInternal

java.lang.Object
  extended by junit.framework.Assert
      extended by junit.framework.TestCase
          extended by org.opensubsystems.core.persist.db.DatabaseTest
              extended by org.opensubsystems.patterns.listdata.logic.ListControllerTest
                  extended by org.opensubsystems.security.patterns.listdata.logic.impl.SecureListControllerTest
                      extended by org.opensubsystems.security.logic.UserControllerTest.UserControllerTestInternal
All Implemented Interfaces:
junit.framework.Test
Enclosing class:
UserControllerTest

public static class UserControllerTest.UserControllerTestInternal
extends SecureListControllerTest

Internal class which can be included in other test suites directly without including the above suite. This allows us to group multiple tests together and the execute the DatabaseTestSetup only once


Field Summary
protected  org.opensubsystems.security.persist.RoleFactory m_roleFactory
          Factory to manage roles.
protected  TestRoleDatabaseFactoryUtils m_roleFactoryUtils
          Factory utilities to manage roles.
protected  org.opensubsystems.security.logic.UserController m_userControl
          Controller used to manipulate users.
protected  org.opensubsystems.security.persist.UserFactory m_userFactory
          Factory to manage users.
 
Fields inherited from class org.opensubsystems.patterns.listdata.logic.ListControllerTest
m_listTestUtils
 
Fields inherited from class org.opensubsystems.core.persist.db.DatabaseTest
DEFAULT_DB_PASSWORD, DEFAULT_DB_USER, DEFAULT_PROPERTY_FILE, m_connection, m_iRequestedConnectionCount, m_transaction
 
Constructor Summary
UserControllerTest.UserControllerTestInternal(java.lang.String strTestName)
          Constructor
 
Method Summary
protected  void comparePersonalRoleWithUser(org.opensubsystems.security.data.Role testPersonalRole, org.opensubsystems.security.data.User templateUser)
          Compare user with his personal role
protected  void compareUsers(org.opensubsystems.security.data.User testUser, org.opensubsystems.security.data.User templateUser)
          Compare two users.
protected  void compareUsersWithoutLoginNameAndEmail(org.opensubsystems.security.data.User testUser, org.opensubsystems.security.data.User templateUser)
          Compare two users.
protected  void compareUsersWithoutLoginNameEmailPassword(org.opensubsystems.security.data.User testUser, org.opensubsystems.security.data.User templateUser)
          Compare two users.
protected  void compareUsersWithoutPassword(org.opensubsystems.security.data.User testUser, org.opensubsystems.security.data.User templateUser)
          Compare two users.
 void testChangeLoginName()
          Test for changing of login name for user
 void testChangePassword()
          Test for changing password for user
 void testCheckForInternalEnabledUsers()
          Test for checkForInternalEnabledUsers method
 void testCreate()
          Test for creating user
 void testCreateWithNoRoles()
          Test for creating user
 void testCreateWithRoles()
          Test for creating user
 void testDelete()
          Test for deleting user
 void testDeleteMultiple()
          Test for deleting multiple users
 void testGetById()
          Test for getting of the user
 void testGetByLoginName()
          Test for getting of the user using login name.
 void testGetUserWithRoles()
          Test for getting user with assigned roles
 void testRoles()
          Test of getRoles methods in controller
 void testSave()
          Test for saving user
 void testSaveWithNoPasswordChange()
          Test for saving user without changing password
 void testSaveWithRoles()
          Test for saving user with roles assigned
 void testSaveWithRolesWithNoPasswordChange()
          Test for saving user with roles without changing his password.
 void testUpdateEnableFalse()
          Test for disabling users
 void testUpdateEnableFalseAllUsers()
          Test for disabling all users.
 void testUpdateEnableTrue()
          Test for enabling Users
 
Methods inherited from class org.opensubsystems.security.patterns.listdata.logic.impl.SecureListControllerTest
getListController, setUp, tearDown
 
Methods inherited from class org.opensubsystems.patterns.listdata.logic.ListControllerTest
testGetExactPage, testGetExactPageKeepSelected, testGetNextPage, testGetNextPageKeepSelected, testGetOrderAsc, testGetOrderAscKeepSelected, testGetOrderDesc, testGetOrderDescKeepSelected, testGetPrevPage, testGetSetFilter, testGetSetPageSize, testGetSetPageSizeKeepSelected, testGetShowList, testGetShowListKeepSelected, testGetShowListWithPresetSize, testGetShowListWithPresetSizeKeepSelected
 
Methods inherited from class org.opensubsystems.core.persist.db.DatabaseTest
addDataSource, addDataSource, getDataSourceName, setDataSourceName
 
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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

m_roleFactory

protected org.opensubsystems.security.persist.RoleFactory m_roleFactory
Factory to manage roles.


m_userFactory

protected org.opensubsystems.security.persist.UserFactory m_userFactory
Factory to manage users.


m_userControl

protected org.opensubsystems.security.logic.UserController m_userControl
Controller used to manipulate users.


m_roleFactoryUtils

protected TestRoleDatabaseFactoryUtils m_roleFactoryUtils
Factory utilities to manage roles.

Constructor Detail

UserControllerTest.UserControllerTestInternal

public UserControllerTest.UserControllerTestInternal(java.lang.String strTestName)
                                              throws java.lang.Exception
Constructor

Parameters:
strTestName - - name of the test
Throws:
java.lang.Exception - - an error has occured
Method Detail

testGetById

public void testGetById()
                 throws java.lang.Exception
Test for getting of the user

Throws:
java.lang.Exception - - an error has occured

testGetByLoginName

public void testGetByLoginName()
                        throws java.lang.Exception
Test for getting of the user using login name.

Throws:
java.lang.Exception - - an error has occured

testGetUserWithRoles

public void testGetUserWithRoles()
                          throws java.lang.Exception
Test for getting user with assigned roles

Throws:
java.lang.Exception - - an error has occured

testRoles

public void testRoles()
               throws java.lang.Exception
Test of getRoles methods in controller

Throws:
java.lang.Exception - - an error has occured

testCreate

public void testCreate()
                throws java.lang.Exception
Test for creating user

Throws:
java.lang.Exception - - an error has occured

testCreateWithNoRoles

public void testCreateWithNoRoles()
                           throws java.lang.Exception
Test for creating user

Throws:
java.lang.Exception - - an error has occured

testCreateWithRoles

public void testCreateWithRoles()
                         throws java.lang.Exception
Test for creating user

Throws:
java.lang.Exception - - an error has occured

testSave

public void testSave()
              throws java.lang.Exception
Test for saving user

Throws:
java.lang.Exception - - error occured

testSaveWithNoPasswordChange

public void testSaveWithNoPasswordChange()
                                  throws java.lang.Exception
Test for saving user without changing password

Throws:
java.lang.Exception - - an error has occured

testChangeLoginName

public void testChangeLoginName()
                         throws java.lang.Exception
Test for changing of login name for user

Throws:
java.lang.Exception - - an error has occured

testChangePassword

public void testChangePassword()
                        throws java.lang.Exception
Test for changing password for user

Throws:
java.lang.Exception - - an error has occured

testSaveWithRoles

public void testSaveWithRoles()
                       throws java.lang.Exception
Test for saving user with roles assigned

Throws:
java.lang.Exception - - an error has occured

testSaveWithRolesWithNoPasswordChange

public void testSaveWithRolesWithNoPasswordChange()
                                           throws java.lang.Exception
Test for saving user with roles without changing his password.

Throws:
java.lang.Exception - - an error has occured

testDelete

public void testDelete()
                throws java.lang.Exception
Test for deleting user

Throws:
java.lang.Exception - - an error has occured

testDeleteMultiple

public void testDeleteMultiple()
                        throws java.lang.Exception
Test for deleting multiple users

Throws:
java.lang.Exception - - an error has occured

testUpdateEnableTrue

public void testUpdateEnableTrue()
                          throws java.lang.Exception
Test for enabling Users

Throws:
java.lang.Exception - - an error has occured

testUpdateEnableFalse

public void testUpdateEnableFalse()
                           throws java.lang.Exception
Test for disabling users

Throws:
java.lang.Exception - - an error has occured

testUpdateEnableFalseAllUsers

public void testUpdateEnableFalseAllUsers()
                                   throws java.lang.Exception
Test for disabling all users. These shouldn't be disabled because at least 1 superuser has to remain.

Throws:
java.lang.Exception - - an error has occured

testCheckForInternalEnabledUsers

public void testCheckForInternalEnabledUsers()
                                      throws java.lang.Exception
Test for checkForInternalEnabledUsers method

Throws:
java.lang.Exception - - an error has occured

compareUsers

protected void compareUsers(org.opensubsystems.security.data.User testUser,
                            org.opensubsystems.security.data.User templateUser)
Compare two users.

Parameters:
testUser - - user which should be tested
templateUser - - user which serves as template

compareUsersWithoutPassword

protected void compareUsersWithoutPassword(org.opensubsystems.security.data.User testUser,
                                           org.opensubsystems.security.data.User templateUser)
Compare two users.

Parameters:
testUser - - user which should be tested
templateUser - - user which serves as template

compareUsersWithoutLoginNameAndEmail

protected void compareUsersWithoutLoginNameAndEmail(org.opensubsystems.security.data.User testUser,
                                                    org.opensubsystems.security.data.User templateUser)
Compare two users.

Parameters:
testUser - - user which should be tested
templateUser - - user which serves as template

compareUsersWithoutLoginNameEmailPassword

protected void compareUsersWithoutLoginNameEmailPassword(org.opensubsystems.security.data.User testUser,
                                                         org.opensubsystems.security.data.User templateUser)
Compare two users.

Parameters:
testUser - - user which should be tested
templateUser - - user which serves as template

comparePersonalRoleWithUser

protected void comparePersonalRoleWithUser(org.opensubsystems.security.data.Role testPersonalRole,
                                           org.opensubsystems.security.data.User templateUser)
Compare user with his personal role

Parameters:
testPersonalRole - - personal role which should be tested
templateUser - - user which serves as template


Copyright © 2003 - 2006 OpenSubsystems s.r.o.