org.kuali.rice.kew.routeheader
Class AppDocStatusTest

java.lang.Object
  extended by org.kuali.rice.test.BaseRiceTestCase
      extended by org.kuali.rice.test.RiceTestCase
          extended by org.kuali.rice.test.RiceInternalSuiteDataTestCase
              extended by org.kuali.rice.test.BaseModuleTestCase
                  extended by org.kuali.rice.test.BaselineTestCase
                      extended by org.kuali.rice.kew.test.KEWTestCase
                          extended by org.kuali.rice.kew.routeheader.AppDocStatusTest
All Implemented Interfaces:
MethodAware

public class AppDocStatusTest
extends KEWTestCase


Nested Class Summary
 
Nested classes/interfaces inherited from class org.kuali.rice.kew.test.KEWTestCase
KEWTestCase.ClearCacheLifecycle
 
Nested classes/interfaces inherited from class org.kuali.rice.test.BaselineTestCase
BaselineTestCase.BaselineMode, BaselineTestCase.Mode
 
Field Summary
 
Fields inherited from class org.kuali.rice.test.BaselineTestCase
dirty
 
Fields inherited from class org.kuali.rice.test.BaseModuleTestCase
LOG, moduleName
 
Fields inherited from class org.kuali.rice.test.RiceTestCase
DEFAULT_TEST_HARNESS_SPRING_BEANS, failedSuiteTestName, perTestLifeCycles, SUITE_LIFE_CYCLES_FAILED, SUITE_LIFE_CYCLES_RAN, suiteLifeCycles
 
Fields inherited from class org.kuali.rice.test.BaseRiceTestCase
log, method
 
Constructor Summary
AppDocStatusTest()
           
 
Method Summary
protected  void assertAppDocStatuses(String documentId, String[] appDocStatuses)
          Verifies the document application document status history
protected  void assertSearchStatus(String documentTypeName, Person user, String appDocStatus, int expected, long changed)
          Verifies the DocumentSearchService finds documents with a given app document status
protected  void loadTestData()
           
 void testAppDocStatusValuesNotDefined()
          This method is similar to the above test, except that the doctype definition does NOT specify a valid set of values.
 void testInvalidAppDocStatusValue()
          This test attempts to set an invalid status value for a document that has a valid set of statuses defined.
 void testSearching()
           
 void testValidAppDocStatus()
          This method performs several positive tests related to Application Document Status For these tests the doctype definition defines a valid set of statuses.
 
Methods inherited from class org.kuali.rice.kew.test.KEWTestCase
clearCacheManagers, getGroupIdForName, getLoadApplicationLifecycle, getPerTestLifecycles, getPerTestTablesNotToClear, getPerTestTablesToClear, getPrincipalIdForName, getPrincipalNameForId, getSuiteLifecycles, getTransactionTemplate, loadDefaultTestData, loadPerTestData, loadSuiteTestData, loadXmlFile, loadXmlFile, loadXmlFileFromFileSystem, loadXmlStream, setUpAfterDataLoad
 
Methods inherited from class org.kuali.rice.test.BaselineTestCase
getClearDbPerTestLifecycles, getMode, getRollbackClearDbPerTestLifecycles, getRollbackTestLifecycles, setUp
 
Methods inherited from class org.kuali.rice.test.BaseModuleTestCase
getModuleName
 
Methods inherited from class org.kuali.rice.test.RiceInternalSuiteDataTestCase
getKIMDataLoadOrderFile, getKIMSqlFileBaseLocation, getKRADDefaultSuiteTestData
 
Methods inherited from class org.kuali.rice.test.RiceTestCase
configureLogging, dumpMemory, getBaseDir, getConfigLocations, getFullTestName, getModuleTestConfigLocation, getRiceMasterDefaultConfigFile, getTestHarnessConfig, getTestHarnessSpringBeansLocation, getTestHarnessSpringResourceLoader, getUserDir, logAfterRun, logBeforeRun, report, setBaseDirSystemProperty, setClearTables, setModuleName, setUpInternal, startLifecycles, startSuiteDataLoaderLifecycles, stopLifecycles, tearDown
 
Methods inherited from class org.kuali.rice.test.BaseRiceTestCase
getName, getPerTestDataLoaderLifecycle, resetLogLevels, setLogLevel, setName, setTestMethod
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AppDocStatusTest

public AppDocStatusTest()
Method Detail

loadTestData

protected void loadTestData()
                     throws Exception
Overrides:
loadTestData in class KEWTestCase
Throws:
Exception

testValidAppDocStatus

public void testValidAppDocStatus()
                           throws Exception
This method performs several positive tests related to Application Document Status For these tests the doctype definition defines a valid set of statuses. It also defines two status transitions in the route path It tests: - That the AppDocStatus is properly set by the workflow engine during appropriate transitions. - That the AppDocStatus may be retrieved by the client API - That the AppDocStatus may be set by the client API - That a history of AppDocStatus transitions is created.

Throws:
Exception

testAppDocStatusValuesNotDefined

public void testAppDocStatusValuesNotDefined()
                                      throws Exception
This method is similar to the above test, except that the doctype definition does NOT specify a valid set of values. This means that the value can be any valid string.

Throws:
Exception

testInvalidAppDocStatusValue

public void testInvalidAppDocStatusValue()
                                  throws Exception
This test attempts to set an invalid status value for a document that has a valid set of statuses defined. It expects to throw a WorkflowRuntimeException when attempting to set the invalid status value.

Throws:
Exception

testSearching

public void testSearching()
                   throws InterruptedException
Throws:
InterruptedException

assertSearchStatus

protected void assertSearchStatus(String documentTypeName,
                                  Person user,
                                  String appDocStatus,
                                  int expected,
                                  long changed)
Verifies the DocumentSearchService finds documents with a given app document status

Parameters:
documentTypeName - the doc type
user - user for lookup
appDocStatus - the app doc status target
expected - the expected number of results
changed - the time the transition occurred (used for from/to range)

assertAppDocStatuses

protected void assertAppDocStatuses(String documentId,
                                    String[] appDocStatuses)
Verifies the document application document status history

Parameters:
documentId - the doc id
appDocStatuses - list of app doc statuses in chronological order


Copyright © 2005-2012 The Kuali Foundation. All Rights Reserved.