org.opensubsystems.security.logic
Class DomainControllerTest.DomainControllerTestInternal

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.DomainControllerTest.DomainControllerTestInternal
All Implemented Interfaces:
junit.framework.Test
Enclosing class:
DomainControllerTest

public static class DomainControllerTest.DomainControllerTestInternal
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.logic.DomainController m_domainControl
          Controller used to manipulate domains.
protected  org.opensubsystems.security.persist.DomainFactory m_domainFactory
          Factory to manage domains.
protected  org.opensubsystems.security.persist.RoleFactory m_roleFactory
          Factory to manage roles.
protected  TestRoleDatabaseFactoryUtils m_roleFactoryUtils
          Factory utilities to manage roles.
 
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
DomainControllerTest.DomainControllerTestInternal(java.lang.String strTestName)
          Constructor
 
Method Summary
protected  void compareDomains(org.opensubsystems.security.data.Domain testDomain, org.opensubsystems.security.data.Domain templateDomain)
          Compare two domains.
 void testCreate()
          Test for creating domain
 void testCreateWithNoRoles()
          Test for creating domain without roles
 void testCreateWithRoles()
          Test for creating domain with roles
 void testDelete()
          Test for deleting Domain
 void testDeleteByIds()
          Test for deleting domains knowing array of their IDs
 void testDeleteByIdsWithCurrentDomainId()
          Test for deleting domains knowing array of their IDs and there will be also current domain ID
 void testExistDomain()
          Test for getting flag signaling existence of an domain within the database
 void testGet()
          Test for getting of the domain by id
 void testGetCurrentDomainWithRoles()
          Test for getting current domain with assigned roles
 void testGetDomainWithRoles()
          Test for getting domain with assigned roles
 void testGetDomainWithRolesSelfreg()
          Test for getting domain with assigned roles when there already exist self registered user role
 void testRoles()
          Test of getRoles methods in controller
 void testSave()
          Test for saving Domain
 void testSaveWithRoles()
          Test for saving user with roles assigned
 void testUpdateEnable()
          Test of updateEnable method
 void testUpdateEnableCurrentDomain()
          Test of updateEnable method when there has to be disabled current domain
 
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_domainFactory

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


m_domainControl

protected org.opensubsystems.security.logic.DomainController m_domainControl
Controller used to manipulate domains.


m_roleFactoryUtils

protected TestRoleDatabaseFactoryUtils m_roleFactoryUtils
Factory utilities to manage roles.

Constructor Detail

DomainControllerTest.DomainControllerTestInternal

public DomainControllerTest.DomainControllerTestInternal(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

testGet

public void testGet()
             throws java.lang.Exception
Test for getting of the domain by id

Throws:
java.lang.Exception - - error occured

testExistDomain

public void testExistDomain()
                     throws java.lang.Exception
Test for getting flag signaling existence of an domain within the database

Throws:
java.lang.Exception - - error occured during getting domain

testCreate

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

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

testSave

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

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

testDelete

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

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

testDeleteByIds

public void testDeleteByIds()
                     throws java.lang.Exception
Test for deleting domains knowing array of their IDs

Throws:
java.lang.Exception - - error occured while deleting more domains

testDeleteByIdsWithCurrentDomainId

public void testDeleteByIdsWithCurrentDomainId()
                                        throws java.lang.Exception
Test for deleting domains knowing array of their IDs and there will be also current domain ID

Throws:
java.lang.Exception - - error occured while deleting more domains

testUpdateEnable

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

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

testUpdateEnableCurrentDomain

public void testUpdateEnableCurrentDomain()
                                   throws java.lang.Exception
Test of updateEnable method when there has to be disabled current domain

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

testGetCurrentDomainWithRoles

public void testGetCurrentDomainWithRoles()
                                   throws java.lang.Exception
Test for getting current domain with assigned roles

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

testGetDomainWithRoles

public void testGetDomainWithRoles()
                            throws java.lang.Exception
Test for getting domain with assigned roles

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

testGetDomainWithRolesSelfreg

public void testGetDomainWithRolesSelfreg()
                                   throws java.lang.Exception
Test for getting domain with assigned roles when there already exist self registered user role

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

testCreateWithNoRoles

public void testCreateWithNoRoles()
                           throws java.lang.Exception
Test for creating domain without roles

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

testCreateWithRoles

public void testCreateWithRoles()
                         throws java.lang.Exception
Test for creating domain with roles

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

compareDomains

protected void compareDomains(org.opensubsystems.security.data.Domain testDomain,
                              org.opensubsystems.security.data.Domain templateDomain)
Compare two domains.

Parameters:
testDomain - - domain which should be tested
templateDomain - - domain which serves as template


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