org.opensubsystems.security.persist.db
Class RoleDatabaseFactoryTest.RoleDatabaseFactoryTestInternal

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.persist.db.ListDatabaseFactoryTest
                  extended by org.opensubsystems.security.patterns.listdata.persist.db.SecureListDatabaseFactoryTest
                      extended by org.opensubsystems.security.persist.db.RoleDatabaseFactoryTest.RoleDatabaseFactoryTestInternal
All Implemented Interfaces:
junit.framework.Test
Enclosing class:
RoleDatabaseFactoryTest

public static class RoleDatabaseFactoryTest.RoleDatabaseFactoryTestInternal
extends SecureListDatabaseFactoryTest

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.DomainFactory m_domainFactory
          Factory to manage domains.
protected  org.opensubsystems.security.persist.db.RoleDatabaseFactory m_roleFactory
          Factory to manage roles.
protected  TestRoleDatabaseFactoryUtils m_roleFactoryUtils
          Factory utilities to manage roles.
protected  org.opensubsystems.security.persist.db.RoleDatabaseSchema m_roleSchema
          Schema for database dependent operations.
protected  org.opensubsystems.security.persist.db.UserDatabaseFactory m_userFactory
          Factory to manage users.
protected  TestUserDatabaseFactoryUtils m_userFactoryUtils
          Factory utilities to manage users.
 
Fields inherited from class org.opensubsystems.security.patterns.listdata.persist.db.SecureListDatabaseFactoryTest
m_arrDomainIDs, m_bSecurityDataLoaded
 
Fields inherited from class org.opensubsystems.patterns.listdata.persist.db.ListDatabaseFactoryTest
DEFAULT_LOADTEST_LIST_SIZE, DEFAULT_LOADTEST_LOADTIME, DEFAULT_LOADTEST_PAGE_SIZE, m_listTestUtils, s_iLoadtestListSize, s_iLoadtestLoadTime, s_iLoadtestPageSize
 
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
RoleDatabaseFactoryTest.RoleDatabaseFactoryTestInternal(java.lang.String strTestName)
          Constructor
 
Method Summary
 void testAssignRoleToDomain()
          test of assignRoleToDomain method
 void testAssignRoleToUser()
          test of assignRoleToUser method
 void testCheckUniqueConstraint()
          Test creation of role - there will be created role 1 first and after that another role that with the same name.
 void testCreatePersonal()
          Test of create personal role
 void testCreateRegular()
          Test creation of regular role.
 void testCreateUnmodifiable()
          Test creation of unmodifiable role.
 void testDelete()
          Test of delete method
 void testDeleteMultiple()
          test of delete method
 void testDeletePersonal()
          Test of deletePersonal method
 void testRemoveFromDomain()
          test of removeFromDomain method
 void testRemoveFromDomains()
          Test of removeFromDomains method
 void testRemoveFromUser()
          test of removeFromUser method
 void testRemoveFromUsers()
          Test of removeFromUsers method
 void testSavePersonal()
          Test of savePersonal method
 void testSavePersonalRole()
          Test of save personal role method
 void testSavePersonalRoleUnmodifiable()
          Test of save personal role method - there will be within the DB specified personal role, that is unmodifiable (DB attribute UNMODIFIABLE = 1).
 void testSaveRegularRole()
          Test of save regular role method
 void testSaveRegularRoleUnmodifiable()
          Test of save regular role method - there will be within the DB specified regular role, that is unmodifiable (DB attribute UNMODIFIABLE = 1).
 void testSaveUnmodifiableRole()
          Test of save unmodifiable role method
 void testUpdateEnable()
          Test of updateEnable method
 
Methods inherited from class org.opensubsystems.security.patterns.listdata.persist.db.SecureListDatabaseFactoryTest
setUp, tearDown, testLoadPagesFromFirstToLastForMultipleDomains, testLoadPagesFromLastToFirstForMultipleDomains, testLoadPagesRandomForMultipleDomains
 
Methods inherited from class org.opensubsystems.patterns.listdata.persist.db.ListDatabaseFactoryTest
doLoadTestGet, doTestGet, doTestGetColumns, doTestLoadPagesFromFirstToLast, doTestLoadPagesFromLastToFirst, doTestLoadPagesRandom, testGet, testGetColumns, testGetColumnsUsingId, testLoadPagesFromFirstToLast, testLoadPagesFromLastToFirst, testLoadPagesFromLastToFirstMoreSortableColumns, testLoadPagesRandom
 
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_domainFactory

protected org.opensubsystems.security.persist.DomainFactory m_domainFactory
Factory to manage domains.


m_roleSchema

protected org.opensubsystems.security.persist.db.RoleDatabaseSchema m_roleSchema
Schema for database dependent operations.


m_roleFactory

protected org.opensubsystems.security.persist.db.RoleDatabaseFactory m_roleFactory
Factory to manage roles.


m_userFactory

protected org.opensubsystems.security.persist.db.UserDatabaseFactory m_userFactory
Factory to manage users.


m_roleFactoryUtils

protected TestRoleDatabaseFactoryUtils m_roleFactoryUtils
Factory utilities to manage roles.


m_userFactoryUtils

protected TestUserDatabaseFactoryUtils m_userFactoryUtils
Factory utilities to manage users.

Constructor Detail

RoleDatabaseFactoryTest.RoleDatabaseFactoryTestInternal

public RoleDatabaseFactoryTest.RoleDatabaseFactoryTestInternal(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

testCreateRegular

public void testCreateRegular()
                       throws java.lang.Exception
Test creation of regular role.

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

testCreateUnmodifiable

public void testCreateUnmodifiable()
                            throws java.lang.Exception
Test creation of unmodifiable role.

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

testCreatePersonal

public void testCreatePersonal()
                        throws java.lang.Exception
Test of create personal role

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

testCheckUniqueConstraint

public void testCheckUniqueConstraint()
                               throws java.lang.Exception
Test creation of role - there will be created role 1 first and after that another role that with the same name. There shoul be thrown unique constraint exception with specified unique constraint name within sql exception.

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

testSaveRegularRole

public void testSaveRegularRole()
                         throws java.lang.Exception
Test of save regular role method

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

testSaveRegularRoleUnmodifiable

public void testSaveRegularRoleUnmodifiable()
                                     throws java.lang.Exception
Test of save regular role method - there will be within the DB specified regular role, that is unmodifiable (DB attribute UNMODIFIABLE = 1). This role should not be updated.

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

testSavePersonalRole

public void testSavePersonalRole()
                          throws java.lang.Exception
Test of save personal role method

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

testSavePersonalRoleUnmodifiable

public void testSavePersonalRoleUnmodifiable()
                                      throws java.lang.Exception
Test of save personal role method - there will be within the DB specified personal role, that is unmodifiable (DB attribute UNMODIFIABLE = 1). This role should not be updated.

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

testSaveUnmodifiableRole

public void testSaveUnmodifiableRole()
                              throws java.lang.Exception
Test of save unmodifiable role method

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

testSavePersonal

public void testSavePersonal()
                      throws java.lang.Exception
Test of savePersonal method

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

testDeleteMultiple

public void testDeleteMultiple()
                        throws java.lang.Exception
test of delete method

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

testDelete

public void testDelete()
                throws java.lang.Exception
Test of delete method

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

testDeletePersonal

public void testDeletePersonal()
                        throws java.lang.Exception
Test of deletePersonal method

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

testAssignRoleToUser

public void testAssignRoleToUser()
                          throws java.lang.Exception
test of assignRoleToUser method

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

testAssignRoleToDomain

public void testAssignRoleToDomain()
                            throws java.lang.Exception
test of assignRoleToDomain method

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

testRemoveFromUser

public void testRemoveFromUser()
                        throws java.lang.Exception
test of removeFromUser method

Throws:
java.lang.Exception - - error during test

testRemoveFromDomain

public void testRemoveFromDomain()
                          throws java.lang.Exception
test of removeFromDomain method

Throws:
java.lang.Exception - - error during test

testRemoveFromUsers

public void testRemoveFromUsers()
                         throws java.lang.Exception
Test of removeFromUsers method

Throws:
java.lang.Exception - - error during test

testRemoveFromDomains

public void testRemoveFromDomains()
                           throws java.lang.Exception
Test of removeFromDomains method

Throws:
java.lang.Exception - - error during test

testUpdateEnable

public void testUpdateEnable()
                      throws java.lang.Exception
Test of updateEnable method

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


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