org.opensubsystems.security.patterns.listdata.persist.db
Class SecureListDatabaseFactoryTest

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
All Implemented Interfaces:
junit.framework.Test
Direct Known Subclasses:
DomainDatabaseFactoryTest.DomainDatabaseFactoryTestInternal, InternalSessionDatabaseFactoryTest.InternalSessionDatabaseFactoryTestInternal, RoleControllerTest.RoleControllerTestInternal, RoleDatabaseFactoryTest.RoleDatabaseFactoryTestInternal, RoleDatabaseFactoryTest1.RoleDatabaseFactoryTestInternal1, SessionViewDatabaseFactoryTest.SessionViewDatabaseFactoryTestInternal, UserDatabaseFactoryTest.UserDatabaseFactoryTestInternal

public abstract class SecureListDatabaseFactoryTest
extends org.opensubsystems.patterns.listdata.persist.db.ListDatabaseFactoryTest

Base class for classes that test functionality of classes that implement ListDatabaseFactory interface and ListDatabaseFactoryImpl class and at the same time they need to have setup SecureCallContext to provide security related functionality. This class implements tests for all list related functionality provided by the mentioned interface. Once you derive your test from this class, just add test that tests the functionality you have implemented in your derived database factory class, the base class functionality will be tested automatically.

Version:
$Id: SecureListDatabaseFactoryTest.java,v 1.22 2007/01/23 06:03:00 bastafidli Exp $
Author:
Miro Halas
Code reviewer:
Miro Halas
Code reviewed:
1.9 2004/12/20 20:39:33 jlegeny

Field Summary
protected  int[] m_arrDomainIDs
          List of all extra domain IDs
protected  boolean m_bSecurityDataLoaded
          This flag tells us if security test data were loaded
 
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
SecureListDatabaseFactoryTest(java.lang.String strTestName, SecureListDatabaseTestUtils listTestUtils)
          Constructor
 
Method Summary
protected  void setUp()
          
protected  void tearDown()
          
 void testLoadPagesFromFirstToLastForMultipleDomains()
          Test loading pages by browsing through the whole list page by page from the first to the last therefore retrieving every page of the list in sequential order.
 void testLoadPagesFromLastToFirstForMultipleDomains()
          Test loading pages by browsing through the whole list page by page from the last to the first therefore retrieving every page of the list in sequential order and testing the retrieved data to make sure that we have retrieved the correct data.
 void testLoadPagesRandomForMultipleDomains()
          Test loading pages from the list by randomly selecting a page and then retrieving it.
 
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_bSecurityDataLoaded

protected boolean m_bSecurityDataLoaded
This flag tells us if security test data were loaded


m_arrDomainIDs

protected int[] m_arrDomainIDs
List of all extra domain IDs

Constructor Detail

SecureListDatabaseFactoryTest

public SecureListDatabaseFactoryTest(java.lang.String strTestName,
                                     SecureListDatabaseTestUtils listTestUtils)
                              throws java.lang.Exception
Constructor

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

setUp

protected void setUp()
              throws java.lang.Exception

Overrides:
setUp in class org.opensubsystems.patterns.listdata.persist.db.ListDatabaseFactoryTest
Throws:
java.lang.Exception

tearDown

protected void tearDown()
                 throws java.lang.Exception

Overrides:
tearDown in class org.opensubsystems.patterns.listdata.persist.db.ListDatabaseFactoryTest
Throws:
java.lang.Exception

testLoadPagesFromFirstToLastForMultipleDomains

public void testLoadPagesFromFirstToLastForMultipleDomains()
                                                    throws java.lang.Exception
Test loading pages by browsing through the whole list page by page from the first to the last therefore retrieving every page of the list in sequential order. The database now contains data in multiple domains so we will test if the data are retrieved from correct domain.

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

testLoadPagesFromLastToFirstForMultipleDomains

public void testLoadPagesFromLastToFirstForMultipleDomains()
                                                    throws java.lang.Exception
Test loading pages by browsing through the whole list page by page from the last to the first therefore retrieving every page of the list in sequential order and testing the retrieved data to make sure that we have retrieved the correct data. The database now contains data in multiple domains so we will test if the data are retrieved from correct domain.

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

testLoadPagesRandomForMultipleDomains

public void testLoadPagesRandomForMultipleDomains()
                                           throws java.lang.Exception
Test loading pages from the list by randomly selecting a page and then retrieving it. Every page in the data set will be retrieved in random order and performance of the data retrieval will be monitored. The database now contains data in multiple domains so we will test if the data are retrieved from correct domain. This test use test util to do various tests

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


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