com.ail.coretest
Class TimezoneTest

java.lang.Object
  extended by junit.framework.Assert
      extended by junit.framework.TestCase
          extended by com.ail.coretest.CoreUserTestCase
              extended by com.ail.coretest.TimezoneTest
All Implemented Interfaces:
ConfigurationOwner, CoreUser, java.io.Serializable, junit.framework.Test

public class TimezoneTest
extends CoreUserTestCase

This test is used to ensure that the VersionEffectiveDate mechenism works across timezones. The test is not run like a normal junit test. Instead it is run from an ant script (TimezoneTest.xml). This is necessary in order to ensure that the test switches between timezones cleanly.

In summary, this is what the test does:

  1. In the GMT timezone:
    1. Reset a test class's configuration.
    2. Update the configure by setting the paramater "TestParameter" to the value "2"
  2. In the EST timezone:
    1. Load the configuration and fetch the value of "TestParameter"
    2. Fail if the test parameter's value is anything other than 2
  3. Version:
    $Revision: 1.2 $
    See Also:
    Serialized Form

    Constructor Summary
    TimezoneTest(java.lang.String name)
              Constructs a test case with the given name.
     
    Method Summary
    static void main(java.lang.String[] args)
               
    static junit.framework.Test suite()
               
     void testQueryConfig()
              If the timezone in EST: Get the value of TestParameter Fail if the value is not 2 Fail if any exceptions are thrown
     void testUpdateConfig()
              If the timezone is GMT: Get the class' configuration Set the value of TestParameter to 2 Save the configuration
     
    Methods inherited from class com.ail.coretest.CoreUserTestCase
    getConfiguration, getConfigurationNamespace, getCore, getSecurityPrincipal, getVersionEffectiveDate, resetConfiguration, setConfiguration, setCore, setupSystemProperties, setVersionEffectiveDate
     
    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

    TimezoneTest

    public TimezoneTest(java.lang.String name)
    Constructs a test case with the given name.

    Method Detail

    suite

    public static junit.framework.Test suite()

    main

    public static void main(java.lang.String[] args)

    testQueryConfig

    public void testQueryConfig()
                         throws java.lang.Exception
    If the timezone in EST:
    1. Get the value of TestParameter
    2. Fail if the value is not 2
    3. Fail if any exceptions are thrown

    Throws:
    java.lang.Exception

    testUpdateConfig

    public void testUpdateConfig()
                          throws java.lang.Exception
    If the timezone is GMT:
    1. Get the class' configuration
    2. Set the value of TestParameter to 2
    3. Save the configuration

    Throws:
    java.lang.Exception