<?xml version='1.0'?>
<TestDescriptor xmlns="http://castor.exolab.org/Test" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://castor.exolab.org/Test http://castor.exolab.org/Test">
    <Name>Mapping Include Test</Name>
    <Author>Arnaud Blandin</Author>
    <Comment>
        This test checks the behavior of the include tag that allows to include
        mapping documents inside a mapping.
    </Comment>
    <Comment>
        Note:  The mapping files in this test explicitly assume that the CTF
        is being run from the bin directory.  The directory structure of Castor
        in SVN is hardcoded into the mapping files.  This is unfortunate.
    </Comment>

    <Category>basic capability</Category>

    <MarshallingTest>
        <Root_Object random="false" dump="true">A</Root_Object>

        <UnitTestCase>
            <Name>Simple Test</Name>
            <Mapping_File>mapping.xml</Mapping_File>
            <Input>input.xml</Input>
            <GoldFile>output.xml</GoldFile>
            <ObjectBuilder>Builder</ObjectBuilder>
        </UnitTestCase>

        <UnitTestCase>
            <Name>Failure Test Endless Loop 1</Name>
            <Mapping_File>bad_mapping1.xml</Mapping_File>
            <Input>input.xml</Input>
            <ObjectBuilder>Builder</ObjectBuilder>
            <Failure exception="org.exolab.castor.mapping.MappingException"
                     FailureStep="unmarshal-reference">true</Failure>
        </UnitTestCase>

       <UnitTestCase>
            <Name>Failure Test Endless Loop 2</Name>
            <Mapping_File>bad_mapping2.xml</Mapping_File>
            <Input>input.xml</Input>
            <ObjectBuilder>Builder</ObjectBuilder>
            <Failure exception="org.exolab.castor.mapping.MappingException"
                     FailureStep="unmarshal-reference">true</Failure>
        </UnitTestCase>
    </MarshallingTest>
</TestDescriptor>
