org.kuali.rice.kns.util
Class MessageMapTest

java.lang.Object
  extended by org.junit.Assert
      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.test.KNSTestCase
                      extended by org.kuali.rice.kns.util.MessageMapTest
All Implemented Interfaces:
MethodAware

public class MessageMapTest
extends KNSTestCase

This class tests the ErrorMap methods.


Field Summary
private static String MIXED_LIST_PATTERN
           
 
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
MessageMapTest()
           
 
Method Summary
private  MessageMap buildReplaceErrorMap()
           
private  void checkMessageParemeters(TypedArrayList errorMessages, int messageIndex, String expectedKeyConstant, String[] expectedParameters)
           
 void testContainsKeyMatchingPattern_mixedList_empty()
           
 void testContainsKeyMatchingPattern_mixedList_simpleMatch()
           
 void testContainsKeyMatchingPattern_mixedList_simpleNoMatch()
           
 void testContainsKeyMatchingPattern_mixedList_wildcardMatch()
           
 void testErrorCount()
          Test all errors are getting added and counted correctly.
 void testErrorPath()
          Test the error path is being prepended.
 void testFieldMessages()
          Test messages are getting accumulated correctly for a property.
 void testMessageCollisions()
          Verify that using the same error message multiple times correctly stores different parameters each time.
 void testMessageParameters()
          Test message parameters are being correctly added and associated with an error message.
 void testPropertiesWithErrors()
          Test that properties added with errors are being kept.
 void testPut()
          ErrorMap should only allow String keys and values.
 void testReplace_matchingProperty_matchingKey_noParams()
           
 void testReplace_matchingProperty_matchingKey_withParams()
           
 void testReplace_matchingProperty_noMatchingKey()
           
 void testReplace_noMatchingProperty()
           
 void testReplace_testEquals()
           
 
Methods inherited from class org.kuali.test.KNSTestCase
getContextName, getLoadApplicationLifecycle, getModuleName, getPort, getRelativeWebappRoot, getSuiteLifecycles, loadSuiteTestData, setContextName, setRelativeWebappRoot, setUp, tearDown
 
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, getPerTestLifecycles, getRiceMasterDefaultConfigFile, getTestHarnessConfig, getTestHarnessSpringBeansLocation, getTestHarnessSpringResourceLoader, loadPerTestData, logAfterRun, logBeforeRun, report, setBaseDirSystemProperty, setModuleName, setUpInternal, startLifecycles, startSuiteDataLoaderLifecycles, stopLifecycles
 
Methods inherited from class org.kuali.rice.test.BaseRiceTestCase
getName, getPerTestDataLoaderLifecycle, resetLogLevels, setLogLevel, setName, setTestMethod
 
Methods inherited from class org.junit.Assert
assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertThat, assertThat, assertTrue, assertTrue, fail, fail
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MIXED_LIST_PATTERN

private static final String MIXED_LIST_PATTERN
See Also:
Constant Field Values
Constructor Detail

MessageMapTest

public MessageMapTest()
Method Detail

testPut

public void testPut()
ErrorMap should only allow String keys and values.


testErrorCount

public void testErrorCount()
Test all errors are getting added and counted correctly.


testFieldMessages

public void testFieldMessages()
Test messages are getting accumulated correctly for a property.


testErrorPath

public void testErrorPath()
Test the error path is being prepended.


testPropertiesWithErrors

public void testPropertiesWithErrors()
Test that properties added with errors are being kept.


testMessageParameters

public void testMessageParameters()
Test message parameters are being correctly added and associated with an error message.


checkMessageParemeters

private void checkMessageParemeters(TypedArrayList errorMessages,
                                    int messageIndex,
                                    String expectedKeyConstant,
                                    String[] expectedParameters)

testMessageCollisions

public void testMessageCollisions()
Verify that using the same error message multiple times correctly stores different parameters each time. (Reproduces bug KULNRVSYS-943).


testContainsKeyMatchingPattern_mixedList_empty

public void testContainsKeyMatchingPattern_mixedList_empty()

testContainsKeyMatchingPattern_mixedList_simpleNoMatch

public void testContainsKeyMatchingPattern_mixedList_simpleNoMatch()

testContainsKeyMatchingPattern_mixedList_simpleMatch

public void testContainsKeyMatchingPattern_mixedList_simpleMatch()

testContainsKeyMatchingPattern_mixedList_wildcardMatch

public void testContainsKeyMatchingPattern_mixedList_wildcardMatch()

testReplace_testEquals

public void testReplace_testEquals()

testReplace_noMatchingProperty

public void testReplace_noMatchingProperty()

testReplace_matchingProperty_noMatchingKey

public void testReplace_matchingProperty_noMatchingKey()

testReplace_matchingProperty_matchingKey_noParams

public void testReplace_matchingProperty_matchingKey_noParams()

testReplace_matchingProperty_matchingKey_withParams

public void testReplace_matchingProperty_matchingKey_withParams()

buildReplaceErrorMap

private MessageMap buildReplaceErrorMap()


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