org.opensubsystems.security.logic
Class SessionControllerSecurityTest.SessionControllerSecurityTestInternal

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

public static class SessionControllerSecurityTest.SessionControllerSecurityTestInternal
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.ExternalSessionFactory m_externalSessionFactory
          Factory to use to execute persistence operations.
protected  org.opensubsystems.security.persist.InternalSessionFactory m_internalSessionFactory
          Factory to use to execute persistence operations.
protected  org.opensubsystems.security.persist.db.AccessRightDatabaseFactory m_rightFactory
          Factory to manage access rights.
protected  org.opensubsystems.security.persist.RoleFactory m_roleFactory
          Factory to manage roles.
protected  org.opensubsystems.security.logic.SessionController m_sessionControl
          Controller to manage sessions.
protected  org.opensubsystems.security.persist.SessionViewFactory m_sessionViewFactory
          Factory to use to execute persistence operations.
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
SessionControllerSecurityTest.SessionControllerSecurityTestInternal(java.lang.String strTestName)
          Constructor
 
Method Summary
 void testCheckLoggedInUserCheck()
          Test checking if the user is logged in.
 void testCheckLoggedInUserCheckId()
          Test checking if the user is logged in.
 void testCleanOrphanSessionCheck()
          Test for cleaning of orphan sessions.
 void testCleanOrphanSessionCheckId()
          Test for cleaning of orphan sessions.
 void testDetachCheck()
          Test for detach.
 void testDetachCheckId()
          Test for detach.
 void testGetSessionsCheck()
          Test for getting of the role.
 void testGetSessionsCheckId()
          Test for getting of the role.
 void testGetUserIdCheck()
          Test for getting of the user ID knowing just internal session code.
 void testGetUserIdCheckId()
          Test for getting of the user ID knowing just internal session code.
 void testLogoutCheck()
          Test for logout of the user (deleting of user's int.session and all related ext.sessions).
 void testLogoutCheckId()
          Test for logout of the user (deleting of user's int.session and all related ext.sessions).
 void testLogoutSessionsCheck()
          Test for logout of the user sessions (deleting of user's int.sessions and all related ext.sessions).
 void testLogoutSessionsCheckId()
          Test for logout of the user sessions (deleting of user's int.sessions and all related ext.sessions).
 void testUpdateEnableCheck()
          Test checking if the user is logged in.
 void testUpdateEnableCheckCategorySuperUser()
          Test checking if the user is logged in.
 void testUpdateEnableCheckId()
          Test checking if the user is logged in.
 
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_rightFactory

protected org.opensubsystems.security.persist.db.AccessRightDatabaseFactory m_rightFactory
Factory to manage access rights.


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_internalSessionFactory

protected org.opensubsystems.security.persist.InternalSessionFactory m_internalSessionFactory
Factory to use to execute persistence operations.


m_externalSessionFactory

protected org.opensubsystems.security.persist.ExternalSessionFactory m_externalSessionFactory
Factory to use to execute persistence operations.


m_sessionViewFactory

protected org.opensubsystems.security.persist.SessionViewFactory m_sessionViewFactory
Factory to use to execute persistence operations.


m_sessionControl

protected org.opensubsystems.security.logic.SessionController m_sessionControl
Controller to manage sessions.

Constructor Detail

SessionControllerSecurityTest.SessionControllerSecurityTestInternal

public SessionControllerSecurityTest.SessionControllerSecurityTestInternal(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

testGetSessionsCheck

public void testGetSessionsCheck()
                          throws java.lang.Exception
Test for getting of the role. User have action granted for all data objects of given type (no id and no categories specified when granting access).

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

testGetSessionsCheckId

public void testGetSessionsCheckId()
                            throws java.lang.Exception
Test for getting of the role. User have access granted to specific data object (identified by identifier) of given data type.

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

testLogoutCheck

public void testLogoutCheck()
                     throws java.lang.Exception
Test for logout of the user (deleting of user's int.session and all related ext.sessions). User have action granted for all data objects of given type (no id and no categories specified when granting access).

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

testLogoutCheckId

public void testLogoutCheckId()
                       throws java.lang.Exception
Test for logout of the user (deleting of user's int.session and all related ext.sessions). User have access granted to specific data object (identified by identifier) of given data type.

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

testLogoutSessionsCheck

public void testLogoutSessionsCheck()
                             throws java.lang.Exception
Test for logout of the user sessions (deleting of user's int.sessions and all related ext.sessions). User have action granted for all data objects of given type (no id and no categories specified when granting access).

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

testLogoutSessionsCheckId

public void testLogoutSessionsCheckId()
                               throws java.lang.Exception
Test for logout of the user sessions (deleting of user's int.sessions and all related ext.sessions). User have access granted to specific data object (identified by identifier) of given data type.

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

testDetachCheck

public void testDetachCheck()
                     throws java.lang.Exception
Test for detach. User have action granted for all data objects of given type (no id and no categories specified when granting access).

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

testDetachCheckId

public void testDetachCheckId()
                       throws java.lang.Exception
Test for detach. User have access granted to specific data object (identified by identifier) of given data type.

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

testCleanOrphanSessionCheck

public void testCleanOrphanSessionCheck()
                                 throws java.lang.Exception
Test for cleaning of orphan sessions. User have action granted for all data objects of given type (no id and no categories specified when granting access).

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

testCleanOrphanSessionCheckId

public void testCleanOrphanSessionCheckId()
                                   throws java.lang.Exception
Test for cleaning of orphan sessions. User have access granted to specific data object (identified by identifier) of given data type.

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

testUpdateEnableCheck

public void testUpdateEnableCheck()
                           throws java.lang.Exception
Test checking if the user is logged in. User have action granted for all data objects of given type (no id and no categories specified when granting access).

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

testUpdateEnableCheckId

public void testUpdateEnableCheckId()
                             throws java.lang.Exception
Test checking if the user is logged in. User have access granted to specific data object (identified by identifier) of given data type.

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

testUpdateEnableCheckCategorySuperUser

public void testUpdateEnableCheckCategorySuperUser()
                                            throws java.lang.Exception
Test checking if the user is logged in. User have access granted to a group of objects based on categories the objects belong to.

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

testCheckLoggedInUserCheck

public void testCheckLoggedInUserCheck()
                                throws java.lang.Exception
Test checking if the user is logged in. User have action granted for all data objects of given type (no id and no categories specified when granting access).

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

testCheckLoggedInUserCheckId

public void testCheckLoggedInUserCheckId()
                                  throws java.lang.Exception
Test checking if the user is logged in. User have access granted to specific data object (identified by identifier) of given data type.

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

testGetUserIdCheck

public void testGetUserIdCheck()
                        throws java.lang.Exception
Test for getting of the user ID knowing just internal session code. User has to have action granted for all data objects of given type (no id and no categories specified when granting access).

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

testGetUserIdCheckId

public void testGetUserIdCheckId()
                          throws java.lang.Exception
Test for getting of the user ID knowing just internal session code. User has to have access granted to specific data object (identified by identifier) of given data type.

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


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