com.ail.coretest
Class CoreUserTestCase

java.lang.Object
  extended by junit.framework.Assert
      extended by junit.framework.TestCase
          extended by com.ail.coretest.CoreUserTestCase
All Implemented Interfaces:
ConfigurationOwner, CoreUser, java.io.Serializable, junit.framework.Test
Direct Known Subclasses:
TestAcceptance, TestConfigurationServices, TestCoreHibernatePersistence, TestCoreValidator, TestCoreXMLStringMapping, TestFactoryTypeMerging, TestFinderService, TestGenerateDocument, TestPolicyPersistence, TestProductServices, TestServiceInvocation, TestTypeXpath, TestUtilityFunctions, TimezoneTest

public class CoreUserTestCase
extends junit.framework.TestCase
implements CoreUser, ConfigurationOwner

This class should be extended by any test that needs to act like a core user. I implements the CoreUser interface on behalf of test itself - making the test class cleaner. It also handles common tasks like cleaning up test data from the database when tests close.

Version:
$Revision: 1.3 $
See Also:
Serialized Form

Constructor Summary
CoreUserTestCase(java.lang.String s)
           
 
Method Summary
 Configuration getConfiguration()
          Method demanded by the ConfigurationOwner interface.
 java.lang.String getConfigurationNamespace()
          Method demanded by the ConfigurationOwner interface.
 Core getCore()
           
 java.security.Principal getSecurityPrincipal()
          Get the security principal associated with this instance.
 VersionEffectiveDate getVersionEffectiveDate()
          The Core uses this callback to determin which versions of artefacts it should use on the CoreUser's behalf.
 void resetConfiguration()
          Method demanded by the ConfigurationOwner interface.
 void setConfiguration(Configuration config)
          Method demanded by the ConfigurationOwner interface.
 void setCore(Core core)
           
 void setupSystemProperties()
          Setup the standard system properties that most test will need.
 void setVersionEffectiveDate(VersionEffectiveDate versionEffectiveDate)
           
 
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

CoreUserTestCase

public CoreUserTestCase(java.lang.String s)
Method Detail

getVersionEffectiveDate

public VersionEffectiveDate getVersionEffectiveDate()
Description copied from interface: CoreUser
The Core uses this callback to determin which versions of artefacts it should use on the CoreUser's behalf.

Specified by:
getVersionEffectiveDate in interface CoreUser
Returns:
The version date that the CoreUser is working at.

setVersionEffectiveDate

public void setVersionEffectiveDate(VersionEffectiveDate versionEffectiveDate)

getCore

public Core getCore()

setCore

public void setCore(Core core)

setConfiguration

public void setConfiguration(Configuration config)
Method demanded by the ConfigurationOwner interface.

Specified by:
setConfiguration in interface ConfigurationOwner
Parameters:
config - Configuration to use from now on.

getConfiguration

public Configuration getConfiguration()
Method demanded by the ConfigurationOwner interface.

Specified by:
getConfiguration in interface ConfigurationOwner
Returns:
The current configuration (at versionEffectiveDate).

getConfigurationNamespace

public java.lang.String getConfigurationNamespace()
Method demanded by the ConfigurationOwner interface.

Specified by:
getConfigurationNamespace in interface CoreUser
Returns:
The configuration namespace we're using

resetConfiguration

public void resetConfiguration()
Method demanded by the ConfigurationOwner interface.

Specified by:
resetConfiguration in interface ConfigurationOwner

setupSystemProperties

public void setupSystemProperties()
Setup the standard system properties that most test will need.


getSecurityPrincipal

public java.security.Principal getSecurityPrincipal()
Get the security principal associated with this instance.

Specified by:
getSecurityPrincipal in interface CoreUser
Returns:
The associated security principal - if defined, null otherwise.