<?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>Unmarshalling Listener Test</Name>
    <Author>Paul Christmann</Author>
    <Comment>
        This test checks the behavior of the Unmarshal Listener, making
        sure it is invoked at appropriate times.
    </Comment>

    <Category>basic capability</Category>

    <MarshallingTest>

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

        <UnitTestCase>
            <Name>Vanilla test with no listener</Name>
            <Mapping_File>mapping.xml</Mapping_File>
            <Input>input.xml</Input>
            <GoldFile>goldfiles/data/output.xml</GoldFile>
        </UnitTestCase>

        <UnitTestCase>
            <Name>Unmarshal listener test</Name>
            <Mapping_File>mapping.xml</Mapping_File>
            <Input>input.xml</Input>
            <GoldFile>goldfiles/data/output.xml</GoldFile>
            <Listener>
                <GoldFile>goldfiles/listeners/simple-unmarshal.xml</GoldFile>
                <ClassName>SimpleListener</ClassName>
                <Type>Unmarshal</Type>
            </Listener>
        </UnitTestCase>

        <UnitTestCase>
            <Name>Marshal listener test</Name>
            <Mapping_File>mapping.xml</Mapping_File>
            <Input>input.xml</Input>
            <GoldFile>goldfiles/data/output.xml</GoldFile>
            <Listener>
                <GoldFile>goldfiles/listeners/simple-marshal.xml</GoldFile>
                <ClassName>SimpleListener</ClassName>
                <Type>Marshal</Type>
            </Listener>
        </UnitTestCase>

        <UnitTestCase>
            <Name>Marshal and Unmarshal listener test</Name>
            <Mapping_File>mapping.xml</Mapping_File>
            <Input>input.xml</Input>
            <GoldFile>goldfiles/data/output.xml</GoldFile>
            <Listener>
                <GoldFile>goldfiles/listeners/simple-listener.xml</GoldFile>
                <ClassName>SimpleListener</ClassName>
                <Type>Both</Type>
            </Listener>
        </UnitTestCase>

        <UnitTestCase>
            <Name>Modifying Unmarshal listener test</Name>
            <Mapping_File>mapping.xml</Mapping_File>
            <Input>input.xml</Input>
            <GoldFile>goldfiles/data/modified-unmarshal.xml</GoldFile>
            <Listener>
                <GoldFile>goldfiles/listeners/modified-unmarshal.xml</GoldFile>
                <ClassName>MutatingListener</ClassName>
                <Type>Unmarshal</Type>
            </Listener>
        </UnitTestCase>

        <UnitTestCase>
            <Name>Modifying Marshal listener test</Name>
            <Mapping_File>mapping.xml</Mapping_File>
            <Input>input.xml</Input>
            <GoldFile>goldfiles/data/modified-marshal.xml</GoldFile>
            <Listener>
                <GoldFile>goldfiles/listeners/modified-marshal.xml</GoldFile>
                <ClassName>MutatingListener</ClassName>
                <Type>Marshal</Type>
            </Listener>
        </UnitTestCase>

    </MarshallingTest>
</TestDescriptor>
