org.kuali.rice.krad.service.impl
Class DictionaryValidationServiceImplTest

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.krad.test.KRADTestCase
                          extended by org.kuali.rice.krad.service.impl.DictionaryValidationServiceImplTest
All Implemented Interfaces:
MethodAware

public class DictionaryValidationServiceImplTest
extends KRADTestCase

DictionaryValidationServiceImplTest tests DictionaryValidationServiceImpl using the data dictionary configurations in org/kuali/rice/krad/test/datadictionary/validation

Author:
Kuali Rice Team (rice.collab@kuali.org)

Nested Class Summary
 
Nested classes/interfaces inherited from class org.kuali.rice.test.BaselineTestCase
BaselineTestCase.BaselineMode, BaselineTestCase.Mode
 
Field Summary
protected  DataObjectEntry addressEntry
           
 
Fields inherited from class org.kuali.rice.krad.test.KRADTestCase
dd
 
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
DictionaryValidationServiceImplTest()
           
 
Method Summary
protected  boolean hasError(DictionaryValidationResult dvr, String attributeName, String errorKey)
          checks whether a DictionaryValidationResult contains errors for a named attribute
 void setUp()
           
 void testCollectionConstraints()
           
 void testInvalidDCAddress()
           
 void testInvalidUSAddress()
           
 void testNoStateNoZipUSAddress()
           
 void testRequiredNestedAttribute()
           
 void testSimpleCaseConstraints()
           
 void testStateRangeValidationForPrerequisite()
          Testing state based validation state ranges, "ie state2>state4" and using prerequisite constraints
 void testStateValidation()
          General test for state based using case constraints and valid characters constraints.
 void testStateValidationConstraintOverrides()
          Testing of stateConstraintOverrides for multiple different cases
 void testStateValidationForMustOccurs()
          Tests for state based validation using a MustOccurs constraint.
 void testStateValidationSimpleConstraintWithOverrides()
           
 void testValidNonDCAddress()
           
 void testValidNonUSAddress()
           
 void testValidUSAddress()
           
 
Methods inherited from class org.kuali.rice.krad.test.KRADTestCase
getLoadApplicationLifecycle, getSuiteLifecycles, getTestDictionaryObject, loadSuiteTestData, setUpInternal
 
Methods inherited from class org.kuali.rice.test.BaselineTestCase
getClearDbPerTestLifecycles, getMode, getPerTestLifecycles, getPerTestTablesNotToClear, getPerTestTablesToClear, getRollbackClearDbPerTestLifecycles, getRollbackTestLifecycles
 
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, loadPerTestData, logAfterRun, logBeforeRun, report, setBaseDirSystemProperty, setClearTables, setModuleName, 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
 

Field Detail

addressEntry

protected DataObjectEntry addressEntry
Constructor Detail

DictionaryValidationServiceImplTest

public DictionaryValidationServiceImplTest()
Method Detail

setUp

public void setUp()
           throws Exception
Overrides:
setUp in class BaselineTestCase
Throws:
Exception

testValidNonUSAddress

public void testValidNonUSAddress()

testValidUSAddress

public void testValidUSAddress()

testInvalidUSAddress

public void testInvalidUSAddress()

testValidNonDCAddress

public void testValidNonDCAddress()

testInvalidDCAddress

public void testInvalidDCAddress()

testNoStateNoZipUSAddress

public void testNoStateNoZipUSAddress()

testSimpleCaseConstraints

public void testSimpleCaseConstraints()
                               throws IOException
Throws:
IOException

testRequiredNestedAttribute

public void testRequiredNestedAttribute()
                                 throws IOException
Throws:
IOException

testCollectionConstraints

public void testCollectionConstraints()
                               throws IOException
Throws:
IOException

testStateValidation

public void testStateValidation()
                         throws IOException
General test for state based using case constraints and valid characters constraints.

Throws:
IOException

testStateValidationForMustOccurs

public void testStateValidationForMustOccurs()
                                      throws IOException
Tests for state based validation using a MustOccurs constraint.

Throws:
IOException

testStateValidationConstraintOverrides

public void testStateValidationConstraintOverrides()
                                            throws IOException
Testing of stateConstraintOverrides for multiple different cases

Throws:
IOException

testStateRangeValidationForPrerequisite

public void testStateRangeValidationForPrerequisite()
                                             throws IOException
Testing state based validation state ranges, "ie state2>state4" and using prerequisite constraints

Throws:
IOException

testStateValidationSimpleConstraintWithOverrides

public void testStateValidationSimpleConstraintWithOverrides()

hasError

protected boolean hasError(DictionaryValidationResult dvr,
                           String attributeName,
                           String errorKey)
checks whether a DictionaryValidationResult contains errors for a named attribute

Parameters:
dvr - - the dictionary validation result
attributeName - - the attribute whose validation errors are being checked
errorKey - - a constant that retrieves an informational message to display to the user
Returns:
true if an error with the error key has been found for the attribute, false otherwise


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