org.opensubsystems.security.logic
Class UserExtrasControllerTest.UserExtrasControllerTestInternal

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.security.persist.db.SecureDatabaseTest
                  extended by org.opensubsystems.security.logic.UserExtrasControllerTest.UserExtrasControllerTestInternal
All Implemented Interfaces:
junit.framework.Test
Enclosing class:
UserExtrasControllerTest

public static class UserExtrasControllerTest.UserExtrasControllerTestInternal
extends SecureDatabaseTest

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  org.opensubsystems.security.persist.InternalSessionFactory m_sessionFactory
          Factory to manage internal sessions.
protected  org.opensubsystems.security.logic.UserController m_userControl
          Controller used to manipulate users.
protected  org.opensubsystems.security.logic.UserExtrasController m_userExtrasControl
          Controller used to manipulate users.
protected  org.opensubsystems.security.persist.UserFactory m_userFactory
          Factory to manage users.
protected  TestUserDatabaseFactoryUtils m_userFactoryUtils
          Factory utilities to manage users.
 
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
UserExtrasControllerTest.UserExtrasControllerTestInternal(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  int getNumberOfUsers()
          Get number of users in the database
 void testImportAndCleanWithCorrectUserData()
          Test for importing user data from the MS Excel file
 void testImportAndCleanWithSomeIncorrectUserData()
          Test for importing user data from the MS Excel file
 void testImportCheckAndCleanWithSomeIncorrectUserData()
          Test for importing user data from the MS Excel file
 void testImportWithAllCorrectUserData()
          Test for importing user data from the MS Excel file
 void testImportWithSomeIncorrectUserData()
          Test for importing user data from the MS Excel file
 
Methods inherited from class org.opensubsystems.security.persist.db.SecureDatabaseTest
setUp, tearDown
 
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_sessionFactory

protected org.opensubsystems.security.persist.InternalSessionFactory m_sessionFactory
Factory to manage internal sessions.


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_userExtrasControl

protected org.opensubsystems.security.logic.UserExtrasController m_userExtrasControl
Controller used to manipulate users.


m_userFactoryUtils

protected TestUserDatabaseFactoryUtils m_userFactoryUtils
Factory utilities to manage users.

Constructor Detail

UserExtrasControllerTest.UserExtrasControllerTestInternal

public UserExtrasControllerTest.UserExtrasControllerTestInternal(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

testImportWithSomeIncorrectUserData

public void testImportWithSomeIncorrectUserData()
                                         throws java.lang.Exception
Test for importing user data from the MS Excel file

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

testImportWithAllCorrectUserData

public void testImportWithAllCorrectUserData()
                                      throws java.lang.Exception
Test for importing user data from the MS Excel file

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

testImportAndCleanWithSomeIncorrectUserData

public void testImportAndCleanWithSomeIncorrectUserData()
                                                 throws java.lang.Exception
Test for importing user data from the MS Excel file

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

testImportAndCleanWithCorrectUserData

public void testImportAndCleanWithCorrectUserData()
                                           throws java.lang.Exception
Test for importing user data from the MS Excel file

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

testImportCheckAndCleanWithSomeIncorrectUserData

public void testImportCheckAndCleanWithSomeIncorrectUserData()
                                                      throws java.lang.Exception
Test for importing user data from the MS Excel file

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

getNumberOfUsers

protected int getNumberOfUsers()
                        throws java.lang.Exception
Get number of users in the database

Returns:
int - number of users in the database
Throws:
java.lang.Exception - - an error has occured

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.