com.ail.coretest
Class TestFactoryTypeMerging

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

public class TestFactoryTypeMerging
extends CoreUserTestCase

The core's factories support the concept of baseing one type on another - in effect allowing type definition to extend one another. The tests here try exercise that support.

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

Constructor Summary
TestFactoryTypeMerging(java.lang.String name)
          Constructs a test case with the given name.
 
Method Summary
 VersionEffectiveDate getVersionEffectiveDate()
          Always select the latest configuration.
static void main(java.lang.String[] args)
           
static junit.framework.Test suite()
           
 void testSimpleAttributeMerging()
          The Type class offers a merge() method which will merge values from a 'donor' object into a 'subject'.
 void testXmlInclude()
          Castor should support the use of <xi:include>.
 void testXmlIncludeRelativeUrl()
          xi:include doesn't support relative URIs out of the box.
 
Methods inherited from class com.ail.coretest.CoreUserTestCase
getConfiguration, getConfigurationNamespace, getCore, getSecurityPrincipal, 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

TestFactoryTypeMerging

public TestFactoryTypeMerging(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)

getVersionEffectiveDate

public VersionEffectiveDate getVersionEffectiveDate()
Always select the latest configuration.

Specified by:
getVersionEffectiveDate in interface CoreUser
Overrides:
getVersionEffectiveDate in class CoreUserTestCase
Returns:

testSimpleAttributeMerging

public void testSimpleAttributeMerging()
                                throws java.lang.Exception
The Type class offers a merge() method which will merge values from a 'donor' object into a 'subject'. The type factories use this method to implement the 'Extends' facility where one type definition extends another. The javadocs here describe what should happen during a merge. This test checks that functionality.

Throws:
java.lang.Exception

testXmlInclude

public void testXmlInclude()
                    throws java.lang.Exception
Castor should support the use of <xi:include>. This test instantiates a type whose definition uses xi:include to pull in external content.

Throws:
java.lang.Exception

testXmlIncludeRelativeUrl

public void testXmlIncludeRelativeUrl()
                               throws java.lang.Exception
xi:include doesn't support relative URIs out of the box. Without it, all URI's used to include content into an XML document have to be absolute. This isn't convenient, especially when we want let users move products and their type around in CMS without having to edit the content of the types which those products define. For this reason, extends the XML parser to support relative URLs. This test builds an instance of a type which includes using a relative URI.

Throws:
java.lang.Exception