net.sf.jsefa.test.xml
Class PolymorphismTest

java.lang.Object
  extended by junit.framework.Assert
      extended by junit.framework.TestCase
          extended by net.sf.jsefa.test.xml.PolymorphismTest
All Implemented Interfaces:
junit.framework.Test

public class PolymorphismTest
extends junit.framework.TestCase

Test for testing the correct serialization/deserialization with equally named elements of different data types.

Author:
Norman Lahme-Huetig

Constructor Summary
PolymorphismTest()
           
 
Method Summary
 void testElementForInstanceWithSameType()
          Test with the following characteristics:
1. complex element which is top level (i. e. for which an entry point exists)
2. the type of the element is concrete (mapped to a concrete class) and has subtypes 3. the type of the element instance is the same as type of the element Expectations:
The element instance gets no xsi:type attribute
 void testElementWithAbstractType()
          Test with the following characteristics:
1. complex element which is top level (i. e. for which an entry point exists)
2. the type of the element is abstract (mapped to an interface) and has subtypes Expectations:
The element instance gets an xsi:type attribute
 void testExceptionOnMultipleSubelementsWithInterferingTypeDTO()
          Test with the following characteristics:
1. multiple complex elements which are sub elements of a top level element
2. the type of each element is a subtype or supertype of the types of the other elements 3. the elements have the same name Expectations:
An IOFactoryException is thrown as the name of an element together with its type is ambiguous
 void testExceptionOnMultipleSubelementsWithSameConcreteTypeDTO()
          Test with the following characteristics:
1. multiple complex elements which are sub elements of a top level element
2. each element as the same type 3. the elements have the same name Expectations:
An IOFactoryException is thrown as the name of an element together with its type is ambiguous
 void testListItemsForFirstInstanceWithSameType()
          Test with the following characteristics:
1. complex elements which are items of element list
2. the type of the elements is concrete (mapped to a concrete class) and has subtypes 3. only one element instance has the same type as the element Expectations:
The one element instance gets no xsi:type attribute but the others do
 void testListItemsWithAbstractType()
          Test with the following characteristics:
1. complex elements which are items of element list
2. the type of the elements is abstract (mapped to an interface) and has subtypes Expectations:
Each element instance gets an xsi:type attribute
 void testMultipleSubelementsWithLeafTypes()
          Test with the following characteristics:
1. multiple complex elements which are sub elements of a top level element
2. the different type of the elements do not have subtypes 3. the elements have the same name Expectations:
Each element instance gets an xsi:type attribute
 void testSingleSubelementForInstanceWithSameType()
          Test with the following characteristics:
1. complex element which is a sub element of a top level element
2. the type of the element is concrete (mapped to a concrete class) and has subtypes 3. the type of the element instance is the same as type of the element Expectations:
The element instance gets no xsi:type attribute
 void testSingleSubelementWithAbstractType()
          Test with the following characteristics:
1. complex element which is a sub element of a top level element
2. the type of the element is abstract (mapped to an interface) and has subtypes Expectations:
The element instance gets an xsi:type attribute
 
Methods inherited from class junit.framework.TestCase
countTestCases, createResult, getName, run, run, runBare, runTest, setName, setUp, tearDown, 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, failNotEquals, failNotSame, failSame, format
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PolymorphismTest

public PolymorphismTest()
Method Detail

testElementWithAbstractType

public void testElementWithAbstractType()
Test with the following characteristics:
1. complex element which is top level (i. e. for which an entry point exists)
2. the type of the element is abstract (mapped to an interface) and has subtypes

Expectations:
The element instance gets an xsi:type attribute


testElementForInstanceWithSameType

public void testElementForInstanceWithSameType()
Test with the following characteristics:
1. complex element which is top level (i. e. for which an entry point exists)
2. the type of the element is concrete (mapped to a concrete class) and has subtypes

3. the type of the element instance is the same as type of the element Expectations:
The element instance gets no xsi:type attribute


testSingleSubelementWithAbstractType

public void testSingleSubelementWithAbstractType()
Test with the following characteristics:
1. complex element which is a sub element of a top level element
2. the type of the element is abstract (mapped to an interface) and has subtypes

Expectations:
The element instance gets an xsi:type attribute


testSingleSubelementForInstanceWithSameType

public void testSingleSubelementForInstanceWithSameType()
Test with the following characteristics:
1. complex element which is a sub element of a top level element
2. the type of the element is concrete (mapped to a concrete class) and has subtypes

3. the type of the element instance is the same as type of the element Expectations:
The element instance gets no xsi:type attribute


testMultipleSubelementsWithLeafTypes

public void testMultipleSubelementsWithLeafTypes()
Test with the following characteristics:
1. multiple complex elements which are sub elements of a top level element
2. the different type of the elements do not have subtypes 3. the elements have the same name Expectations:
Each element instance gets an xsi:type attribute


testExceptionOnMultipleSubelementsWithSameConcreteTypeDTO

public void testExceptionOnMultipleSubelementsWithSameConcreteTypeDTO()
Test with the following characteristics:
1. multiple complex elements which are sub elements of a top level element
2. each element as the same type 3. the elements have the same name Expectations:
An IOFactoryException is thrown as the name of an element together with its type is ambiguous


testExceptionOnMultipleSubelementsWithInterferingTypeDTO

public void testExceptionOnMultipleSubelementsWithInterferingTypeDTO()
Test with the following characteristics:
1. multiple complex elements which are sub elements of a top level element
2. the type of each element is a subtype or supertype of the types of the other elements 3. the elements have the same name Expectations:
An IOFactoryException is thrown as the name of an element together with its type is ambiguous


testListItemsWithAbstractType

public void testListItemsWithAbstractType()
Test with the following characteristics:
1. complex elements which are items of element list
2. the type of the elements is abstract (mapped to an interface) and has subtypes

Expectations:
Each element instance gets an xsi:type attribute


testListItemsForFirstInstanceWithSameType

public void testListItemsForFirstInstanceWithSameType()
Test with the following characteristics:
1. complex elements which are items of element list
2. the type of the elements is concrete (mapped to a concrete class) and has subtypes

3. only one element instance has the same type as the element Expectations:
The one element instance gets no xsi:type attribute but the others do



Copyright © 2014. All rights reserved.