Package org.openengsb.core.ekb.transformation.wonderland.models

Examples of org.openengsb.core.ekb.transformation.wonderland.models.ModelA


        desc.forwardField("testA", "testB");
        desc.forwardField("blubA", "#test");
        desc.forwardField("#test", "blubB");
        installTransformation(desc);

        ModelA model = new ModelA();
        model.setIdA("test1");
        model.setTestA("test2");
        model.setBlubA("test3");

        ModelB result = new ModelB();
        result.setUnused("this is a test");

        result = (ModelB) service.performTransformation(getModelADescription(), getModelBDescription(),
View Full Code Here


        File descriptionFile =
            new File(getClass().getClassLoader().getResource("testDescription.transformation").getFile());
        List<TransformationDescription> descriptions = TransformationUtils.getDescriptionsFromXMLFile(descriptionFile);
        installTransformations(descriptions);

        ModelA modelA = new ModelA();
        modelA.setIdA("test1");
        modelA.setTestA("test2");
        modelA.setBlubA("test3");
        modelA.setBlaA("test4");

        ModelB modelB = new ModelB();
        modelB.setIdB("test1");
        modelB.setTestB("hello");
        modelB.setBlubB("test3#test4");

        ModelB resultB = transformModelAToModelB(modelA);
        ModelA resultA = transformModelBToModelA(modelB);

        assertThat(resultB.getIdB(), is("test1"));
        assertThat(resultB.getTestB(), is("test"));
        assertThat(resultB.getBlubB(), is("test3#test4"));

        assertThat(resultA.getIdA(), is("test1"));
        assertThat(resultA.getTestA(), is("world"));
        assertThat(resultA.getBlubA(), is("test3"));
        assertThat(resultA.getBlaA(), is("test4"));
    }
View Full Code Here

        elements.add("A");
        elements.add("B");
        elements.add("C");
        modelB.setElements(elements);

        ModelA modelA = new ModelA();
        modelA.setIdA("          Test         ");
        modelA.setTestA("Hello");
        modelA.setBlubA("testHellotest");

        ModelB resultB = transformModelAToModelB(modelA);
        ModelA resultA = transformModelBToModelA(modelB);

        assertThat(resultA.getIdA(), is(modelB.getIdB().toLowerCase()));
        assertThat(resultA.getTestA(), is(modelB.getTestB().toUpperCase()));
        assertThat(resultA.getBlubA(), is(modelB.getElements().size() + ""));
        assertThat(resultA.getBlaA(), is("Hello World"));

        assertThat(resultB.getIdB(), is("Test"));
        assertThat(resultB.getTestB(), is(modelA.getTestA().length() + ""));
        assertThat(resultB.getBlubB(), is("blubHelloblub"));
    }
View Full Code Here

        ModelB modelB = new ModelB();
        modelB.setIdB("??##??id");
        modelB.setTestB("hello");
        modelB.setBlubB("test3#test4");

        ModelA modelA = new ModelA();
        modelA.setIdA("1");
        modelA.setTestA("works?");

        ModelB resultB = transformModelAToModelB(modelA);
        ModelA resultA = transformModelBToModelA(modelB);

        assertThat(resultA.getIdA(), is("id"));
        assertThat(resultA.getTestA(), is("olleh"));
        assertThat(resultA.getBlubA(), is("test3"));
        assertThat(resultA.getBlaA(), is("test4"));

        assertThat(resultB.getIdB(), is("0001"));
        assertThat(resultB.getTestB(), is("works?!"));
        assertThat(resultB.getIntValue(), is(1));
    }
View Full Code Here

        desc.forwardField("idA", "idB");
        desc.forwardField("nested.value1", "testB");
        desc.forwardField("nested.value2", "blubB");
        installTransformation(desc);

        ModelA model = new ModelA();
        model.setIdA("test1");

        NestedObject nested = new NestedObject();
        nested.setValue1("test2");
        nested.setValue2("test3");
        model.setNested(nested);

        ModelB result = transformModelAToModelB(model);

        assertThat(result.getIdB(), is("test1"));
        assertThat(result.getTestB(), is("test2"));
View Full Code Here

        desc.forwardField("nested", "#test");
        desc.forwardField("#test.value1", "testB");
        desc.forwardField("#test.value2", "blubB");
        installTransformation(desc);

        ModelA model = new ModelA();
        model.setIdA("test1");

        NestedObject nested = new NestedObject();
        nested.setValue1("test2");
        nested.setValue2("test3");
        model.setNested(nested);

        ModelB result = transformModelAToModelB(model);

        assertThat(result.getIdB(), is("test1"));
        assertThat(result.getTestB(), is("test2"));
View Full Code Here

        desc.forwardField("blubA", "#test.value2");
        desc.forwardField("#test.value1", "testB");
        desc.forwardField("#test.value2", "blubB");
        installTransformation(desc);

        ModelA model = new ModelA();
        model.setIdA("test1");
        model.setBlaA("test2");
        model.setBlubA("test3");

        NestedObject nested = new NestedObject();
        model.setNested(nested);

        ModelB result = transformModelAToModelB(model);

        assertThat(result.getIdB(), is("test1"));
        assertThat(result.getTestB(), is("test2"));
View Full Code Here

TOP

Related Classes of org.openengsb.core.ekb.transformation.wonderland.models.ModelA

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.