Search in sources :

Example 6 with TestListOrders

use of io.atlasmap.java.test.TestListOrders in project atlasmap by atlasmap.

the class BaseDocumentWriterTest method reset.

@Before
public void reset() {
    classLoader = Thread.currentThread().getContextClassLoader();
    writer = new DocumentJavaFieldWriter(conversionService);
    writer.setTargetValueConverter(new TargetValueConverter(classLoader, conversionService) {

        public Object convert(AtlasInternalSession session, LookupTable lookupTable, Field sourceField, Object parentObject, Field targetField) throws AtlasException {
            return targetField.getValue();
        }
    });
    field = null;
    segmentContexts = new LinkedList<>();
    targetTestClassInstance = new TargetTestClass();
    targetTestClassInstance.setContact(new TargetContact());
    targetTestClassInstance.setAddress(new TargetAddress());
    targetOrderListInstance = new TestListOrders();
    targetOrderListInstance.setOrders(new LinkedList<>());
    targetOrderListInstance.getOrders().add(new TargetOrder());
    targetOrderListInstance.getOrders().add(new TargetOrder());
    targetTestClassInstance.setListOrders(targetOrderListInstance);
    targetOrderArrayInstance = new TargetOrderArray();
    targetOrderArrayInstance.setOrders(new BaseOrder[2]);
    targetOrderArrayInstance.getOrders()[0] = new TargetOrder();
    targetOrderArrayInstance.getOrders()[1] = new TargetOrder();
    targetTestClassInstance.setOrderArray(targetOrderArrayInstance);
}
Also used : AtlasInternalSession(io.atlasmap.spi.AtlasInternalSession) TargetContact(io.atlasmap.java.test.TargetContact) TargetAddress(io.atlasmap.java.test.TargetAddress) AtlasException(io.atlasmap.api.AtlasException) TargetOrderArray(io.atlasmap.java.test.TargetOrderArray) Field(io.atlasmap.v2.Field) JavaEnumField(io.atlasmap.java.v2.JavaEnumField) JavaField(io.atlasmap.java.v2.JavaField) TestListOrders(io.atlasmap.java.test.TestListOrders) LookupTable(io.atlasmap.v2.LookupTable) TargetOrder(io.atlasmap.java.test.TargetOrder) TargetTestClass(io.atlasmap.java.test.TargetTestClass) Before(org.junit.Before)

Aggregations

TestListOrders (io.atlasmap.java.test.TestListOrders)6 TargetAddress (io.atlasmap.java.test.TargetAddress)4 TargetOrder (io.atlasmap.java.test.TargetOrder)4 AtlasException (io.atlasmap.api.AtlasException)3 TargetOrderArray (io.atlasmap.java.test.TargetOrderArray)3 TargetTestClass (io.atlasmap.java.test.TargetTestClass)3 Test (org.junit.Test)3 TargetContact (io.atlasmap.java.test.TargetContact)2 TargetFlatPrimitiveClass (io.atlasmap.java.test.TargetFlatPrimitiveClass)2 JavaField (io.atlasmap.java.v2.JavaField)2 BaseOrder (io.atlasmap.java.test.BaseOrder)1 StateEnumClassLong (io.atlasmap.java.test.StateEnumClassLong)1 JavaEnumField (io.atlasmap.java.v2.JavaEnumField)1 AtlasInternalSession (io.atlasmap.spi.AtlasInternalSession)1 Field (io.atlasmap.v2.Field)1 LookupTable (io.atlasmap.v2.LookupTable)1 Before (org.junit.Before)1