org.kuali.rice.kew.docsearch
Class SearchableAttributeTest

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.docsearch.DocumentSearchTestBase
                              extended by org.kuali.rice.kew.docsearch.SearchableAttributeTest
All Implemented Interfaces:
MethodAware

public class SearchableAttributeTest
extends DocumentSearchTestBase

Tests the StandardGenericXMLSearchableAttribute. KULWF-654: Tests the resolution to this issue by configuring a CustomActionListAttribute as well as a searchable attribute.


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
SearchableAttributeTest()
           
 
Method Summary
private  void assertSearchableAttributeMultiplesWork(DocumentType docType, String principalId, String fieldDefKey, String[][] searchValues, int[] resultSizes)
          A convenience method for testing multiple value fields on searchable attributes.
private  void assertSearchableAttributeWildcardsWork(DocumentType docType, String principalId, String fieldDefKey, String[] searchValues, int[] resultSizes)
          A convenience method for testing wildcards on searchable attributes.
protected  String getPrincipalId(String networkId)
           
protected  RouteHeaderService getRouteHeaderService()
           
protected  void loadTestData()
           
 void testCustomSearchableAttributesWithDataType()
           
 void testSearchableAttributeSearch()
          This tests the ability to get the searchableAttributeValues directly without going through the document.
 void testSearchableAttributeTrim()
           
 void testSearchAttributesAcrossDocumentTypeVersions()
          Tests searching documents with searchable attributes
 void testValidateUserSearchInputsNoCast()
          Per KULRICE-3681, tests that StandardGenericXMLSearchableAttribute throws no cast class exception when it shouldn't
 void testWildcardsOnSearchableAttributes()
          Tests the usage of wildcards on searchable attributes of varying data types.
 
Methods inherited from class org.kuali.rice.kew.docsearch.DocumentSearchTestBase
createSearchAttributeCriteriaComponent, createSearchAttributeCriteriaComponent, createSearchAttributeCriteriaComponent, createSearchAttributeCriteriaComponent, getAttribute
 
Methods inherited from class org.kuali.rice.kew.test.KEWTestCase
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, getKNSDefaultSuiteTestData
 
Methods inherited from class org.kuali.rice.test.RiceTestCase
configureLogging, dumpMemory, getBaseDir, getConfigLocations, getFullTestName, getModuleTestConfigLocation, getRiceMasterDefaultConfigFile, getTestHarnessConfig, getTestHarnessSpringBeansLocation, getTestHarnessSpringResourceLoader, 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

SearchableAttributeTest

public SearchableAttributeTest()
Method Detail

loadTestData

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

testSearchableAttributeSearch

public void testSearchableAttributeSearch()
                                   throws Exception
This tests the ability to get the searchableAttributeValues directly without going through the document.

Throws:
Exception

getRouteHeaderService

protected RouteHeaderService getRouteHeaderService()

getPrincipalId

protected String getPrincipalId(String networkId)

testCustomSearchableAttributesWithDataType

public void testCustomSearchableAttributesWithDataType()
                                                throws Exception
Throws:
Exception

testSearchAttributesAcrossDocumentTypeVersions

public void testSearchAttributesAcrossDocumentTypeVersions()
                                                    throws Exception
Tests searching documents with searchable attributes

Throws:
WorkflowException
Exception

testWildcardsOnSearchableAttributes

public void testWildcardsOnSearchableAttributes()
                                         throws Exception
Tests the usage of wildcards on searchable attributes of varying data types. Note that the bounds of ".."-related search expressions will not throw an exception if the lower bound is greater than the upper bound; instead, such an expression will simply return zero results.

Throws:
Exception

assertSearchableAttributeWildcardsWork

private void assertSearchableAttributeWildcardsWork(DocumentType docType,
                                                    String principalId,
                                                    String fieldDefKey,
                                                    String[] searchValues,
                                                    int[] resultSizes)
                                             throws Exception
A convenience method for testing wildcards on searchable attributes.

Parameters:
docType - The document type containing the attributes.
principalId - The ID of the user performing the search.
fieldDefKey - The name of the field given by the field definition on the searchable attribute.
searchValues - The wildcard-filled search strings to test.
resultSizes - The number of expected documents to be returned by the search; use -1 to indicate that an error should have occurred.
Throws:
Exception

assertSearchableAttributeMultiplesWork

private void assertSearchableAttributeMultiplesWork(DocumentType docType,
                                                    String principalId,
                                                    String fieldDefKey,
                                                    String[][] searchValues,
                                                    int[] resultSizes)
                                             throws Exception
A convenience method for testing multiple value fields on searchable attributes.

Parameters:
docType - The document type containing the attributes.
principalId - The ID of the user performing the search.
fieldDefKey - The name of the field given by the field definition on the searchable attribute.
searchValues - The wildcard-filled search strings to test.
resultSizes - The number of expected documents to be returned by the search; use -1 to indicate that an error should have occurred.
Throws:
Exception

testValidateUserSearchInputsNoCast

public void testValidateUserSearchInputsNoCast()
Per KULRICE-3681, tests that StandardGenericXMLSearchableAttribute throws no cast class exception when it shouldn't


testSearchableAttributeTrim

public void testSearchableAttributeTrim()


Copyright © 2004-2011 The Kuali Foundation. All Rights Reserved.