|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjunit.framework.Assert
junit.framework.TestCase
com.ail.coretest.TestCoreConfiguration
public class TestCoreConfiguration
The tests defined here exercise the Core system's configuration handling. They use the Core class as an Service or core client would. Note: These tests assume that the JDBCConfigurationLoader is being used.
| Constructor Summary | |
|---|---|
TestCoreConfiguration(java.lang.String name)
Constructs a test case with the given name. |
|
| Method Summary | |
|---|---|
Configuration |
getConfiguration()
Method demanded by the ConfigurationOwner interface. |
java.lang.String |
getConfigurationNamespace()
Method demanded by the ConfigurationOwner interface. |
java.security.Principal |
getSecurityPrincipal()
Get the security principal associated with this instance. |
VersionEffectiveDate |
getVersionEffectiveDate()
Method demanded by the CoreUser interface. |
static void |
main(java.lang.String[] args)
|
void |
resetConfiguration()
Method demanded by the ConfigurationOwner interface. |
void |
setConfiguration(Configuration config)
Method demanded by the ConfigurationOwner interface. |
static junit.framework.Test |
suite()
|
void |
testConfigurationClass()
Test Configuration class itself. |
void |
testConfigurationHistory()
As new version of a configuration are stored, the core keeps hold of the old ones - so that callers who ask for yesterday's configuration (by setting their versionEffectiveDate to yesterdate) will get yesterdays configuration. |
void |
testConfigurationInheritance()
As of version 2.0 of the core, configurations support the notion of inheritance. |
void |
testConfigurationTimeout()
Check that the configuration timeout feature is working. |
void |
testGettingComplexGroupFromConfiguration()
Test to ensure that "complex" groups are retrieved correctly from configuration. |
void |
testGettingComplexParameterValuesFromConfiguration()
Test to ensure that "complex" parameters are retrieved correctly from configuration. |
void |
testGettingConfigurationSource()
Test to ensure that the configuration's source is correctly returned by the core. |
void |
testGettingParametersAsProperties()
Test that a group's parameters can be retrieved as a java.util.Properties. |
void |
testGettingParametersAsPropertiesForEmptyGroup()
Test that attempting to fetch Parameters as Properties for a group that doesn't exist returns a null. |
void |
testGettingParametersAsPropertiesGroupThatDontExist()
Test that attempting to fetch Parameters as Properties for a group that doesn't exist returns a null. |
void |
testGettingSimpleGroupFromConfiguration()
Test to ensure that "simple" groups are retrieved correctly from configuration. |
void |
testGettingSimpleGroupThatDontExist()
Check that an attempt to fetch a group that isn't defined is handled correctly. |
void |
testGettingSimpleParametersThatDontExist()
Check that an attempt to fetch a parameter that isn't defined is handled correctly. |
void |
testGettingSimpleParameterValuesFromConfiguration()
Test to ensure that "simple" parameters are retrieved correctly from configuration. |
void |
testGroupConfigurationBackStop()
If a request is made by a configuration user for a setting (parameter, group, etc) which is not defined in that user's configuration, the core should check it's own configuration. |
void |
testParameterConfigurationBackStop()
If a request is made by a configuration user for a setting (parameter, group, etc) which is not defined in that user's configuration, the core should check it's own configuration. |
void |
testSaveAndLoadConfiguration()
Check that configuration can be save and re-loaded. |
void |
testSaveAndLoadVersioningConfiguration()
Check that configuration access is correctly based on version effective date. |
void |
testSaveConfiguration()
Check that the core class can be used to save configuration. |
void |
testTimoutCachePerformace()
Test the effectiviness of the configuration timeout cache. |
void |
testUpdateCollisionDetection()
Check that the configure system correctly detects and prevents update collisions. |
| Methods inherited from class junit.framework.TestCase |
|---|
countTestCases, getName, run, run, runBare, 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 |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public TestCoreConfiguration(java.lang.String name)
| Method Detail |
|---|
public static junit.framework.Test suite()
public static void main(java.lang.String[] args)
public java.security.Principal getSecurityPrincipal()
getSecurityPrincipal in interface CoreUserpublic VersionEffectiveDate getVersionEffectiveDate()
getVersionEffectiveDate in interface CoreUserpublic void setConfiguration(Configuration config)
setConfiguration in interface ConfigurationOwnerconfig - Configuration to use from now on.public Configuration getConfiguration()
getConfiguration in interface ConfigurationOwnerpublic java.lang.String getConfigurationNamespace()
getConfigurationNamespace in interface CoreUserpublic void resetConfiguration()
resetConfiguration in interface ConfigurationOwner
public void testConfigurationClass()
throws java.lang.Exception
java.lang.Exceptionpublic void testSaveConfiguration()
public void testSaveAndLoadConfiguration()
public void testSaveAndLoadVersioningConfiguration()
Configurations are loaded with respect to their name, and the dates when they are valid. When a configuration is saved, only its start-date is filled in, the end-date is set when the configuration is updated. When a caller requests something from the core that requires the core to read from configuration it (the core) loadeds the configuration with respect to the date returned by the caller's getVersionEffectiveDate method. So, if you set your versionEffectiveDate to now, save your configuration and then try to re-load it you will find that it doesn't change.
public void testGettingSimpleParameterValuesFromConfiguration()
throws java.lang.Exception
this.createComplexConfiguration()
java.lang.Exception
public void testGettingSimpleParametersThatDontExist()
throws java.lang.Exception
code.getParameter()
should return a null.
this.createComplexConfiguration()
java.lang.Exceptionpublic void testGettingComplexParameterValuesFromConfiguration()
this.createComplexConfiguration()
public void testGettingConfigurationSource()
this.createComplexConfiguration()
public void testGettingSimpleGroupFromConfiguration()
this.createComplexConfiguration()
public void testGettingComplexGroupFromConfiguration()
this.createComplexConfiguration()
public void testGettingSimpleGroupThatDontExist()
code.getGroup()
should return a null.
this.createComplexConfiguration()
public void testGettingParametersAsProperties()
this.createComplexConfiguration()
public void testGettingParametersAsPropertiesForEmptyGroup()
this.createComplexConfiguration()
public void testGettingParametersAsPropertiesGroupThatDontExist()
this.createComplexConfiguration()
public void testParameterConfigurationBackStop()
The setup method saves a core configuration which defines TestParameter with the value 'SavedInCoreConfig'.
public void testGroupConfigurationBackStop()
The setup method saves a core configuration which defines TestGroup.
public void testConfigurationTimeout()
public void testTimoutCachePerformace()
public void testUpdateCollisionDetection()
throws java.lang.Exception
java.lang.Exception
public void testConfigurationHistory()
throws java.lang.Exception
java.lang.Exception
public void testConfigurationInheritance()
throws java.lang.Exception
java.lang.Exception
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||