org.opensubsystems.patterns.listdata.logic
Class ListControllerTest

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

public abstract class ListControllerTest
extends org.opensubsystems.core.persist.db.DatabaseTest

Generic list controller tests that should apply to any data objects that implement the list data patter and are be accesible by pages. When you implement new data object, which needs to be accessible by pages, derive new class from this class and just pass the list test utilities specific to your data object. Then using your new class you can execute all list tests for your new data object.

Version:
$Id: ListControllerTest.java,v 1.15 2007/02/01 07:26:17 bastafidli Exp $
Author:
Julo Legeny
Code reviewer:
Miro Halas
Code reviewed:
1.8 2005/11/04 00:20:15 jlegeny

Field Summary
protected  ListDatabaseTestUtils m_listTestUtils
          Utility class used to generate data for controller test.
 
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
ListControllerTest(java.lang.String strTestName, ListDatabaseTestUtils listTestUtils)
          Constructor.
 
Method Summary
protected  org.opensubsystems.patterns.listdata.logic.ListController getListController()
          Get list controller to use during this test.
 void testGetExactPage()
          Test of method getExactPage
 void testGetExactPageKeepSelected()
          Test of method getExactPage with keeping selected items
 void testGetNextPage()
          Test of method getNextPage
 void testGetNextPageKeepSelected()
          Test of method getNextPage with keeping selected items
 void testGetOrderAsc()
          Test of method getOrder - ascending order
 void testGetOrderAscKeepSelected()
          Test of method getOrder - ascending order keeping selected items
 void testGetOrderDesc()
          Test of method getOrder - descending order
 void testGetOrderDescKeepSelected()
          Test of method getOrder - descending order keeping selected items
 void testGetPrevPage()
          Test of method getPrevPage
 void testGetSetFilter()
          Test of method getSetFilter
 void testGetSetPageSize()
          Test of method getSetPageSize
 void testGetSetPageSizeKeepSelected()
          Test of method getSetPageSize keeping selected items
 void testGetShowList()
          Test of method getShowList
 void testGetShowListKeepSelected()
          Test of method getShowList keeping selected items
 void testGetShowListWithPresetSize()
          Test of method getShowList
 void testGetShowListWithPresetSizeKeepSelected()
          Test of method getShowList keeping selected items
 
Methods inherited from class org.opensubsystems.core.persist.db.DatabaseTest
addDataSource, addDataSource, getDataSourceName, setDataSourceName, setUp, tearDown
 
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_listTestUtils

protected ListDatabaseTestUtils m_listTestUtils
Utility class used to generate data for controller test.

Constructor Detail

ListControllerTest

public ListControllerTest(java.lang.String strTestName,
                          ListDatabaseTestUtils listTestUtils)
Constructor.

Parameters:
strTestName - - name of the test
listTestUtils - - utilities used during test
Method Detail

testGetNextPage

public void testGetNextPage()
                     throws java.lang.Exception
Test of method getNextPage

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

testGetNextPageKeepSelected

public void testGetNextPageKeepSelected()
                                 throws java.lang.Exception
Test of method getNextPage with keeping selected items

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

testGetPrevPage

public void testGetPrevPage()
                     throws java.lang.Exception
Test of method getPrevPage

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

testGetExactPage

public void testGetExactPage()
                      throws java.lang.Exception
Test of method getExactPage

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

testGetExactPageKeepSelected

public void testGetExactPageKeepSelected()
                                  throws java.lang.Exception
Test of method getExactPage with keeping selected items

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

testGetSetFilter

public void testGetSetFilter()
                      throws java.lang.Exception
Test of method getSetFilter

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

testGetOrderDesc

public void testGetOrderDesc()
                      throws java.lang.Exception
Test of method getOrder - descending order

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

testGetOrderDescKeepSelected

public void testGetOrderDescKeepSelected()
                                  throws java.lang.Exception
Test of method getOrder - descending order keeping selected items

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

testGetOrderAsc

public void testGetOrderAsc()
                     throws java.lang.Exception
Test of method getOrder - ascending order

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

testGetOrderAscKeepSelected

public void testGetOrderAscKeepSelected()
                                 throws java.lang.Exception
Test of method getOrder - ascending order keeping selected items

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

testGetSetPageSize

public void testGetSetPageSize()
                        throws java.lang.Exception
Test of method getSetPageSize

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

testGetSetPageSizeKeepSelected

public void testGetSetPageSizeKeepSelected()
                                    throws java.lang.Exception
Test of method getSetPageSize keeping selected items

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

testGetShowList

public void testGetShowList()
                     throws java.lang.Exception
Test of method getShowList

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

testGetShowListKeepSelected

public void testGetShowListKeepSelected()
                                 throws java.lang.Exception
Test of method getShowList keeping selected items

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

testGetShowListWithPresetSize

public void testGetShowListWithPresetSize()
                                   throws java.lang.Exception
Test of method getShowList

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

testGetShowListWithPresetSizeKeepSelected

public void testGetShowListWithPresetSizeKeepSelected()
                                               throws java.lang.Exception
Test of method getShowList keeping selected items

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

getListController

protected org.opensubsystems.patterns.listdata.logic.ListController getListController()
                                                                               throws org.opensubsystems.core.error.OSSException
Get list controller to use during this test. This is in separate method so it can be overriden and derived list controller can be supplied forexample implementing security ;-).

Returns:
ListController - instance of controller to use to test
Throws:
org.opensubsystems.core.error.OSSException - - an error has occured


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