Examples of ModelB


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

    @Test
    public void testInitiateWithParameters_shouldCreateInstance() throws Exception {
        TransformationDescription desc = getDescriptionForModelBToModelA();
        desc.instantiateField("nested", NestedObject.class.getName(), null, "testB", "blubB");
        installTransformation(desc);
        ModelB model = new ModelB();
        model.setTestB("testvalue1");
        model.setBlubB("testvalue2");
        ModelA result = transformModelBToModelA(model);
        assertThat(result.getNested(), notNullValue());
        assertThat(result.getNested().getValue1(), is(model.getTestB()));
        assertThat(result.getNested().getValue2(), is(model.getBlubB()));
    }
View Full Code Here

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

        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(),
            model, result);

        assertThat(result.getUnused(), is("this is a test"));
    }
View Full Code Here

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

        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

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

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

        ModelB modelB = new ModelB();
        modelB.setIdB("TEST");
        modelB.setTestB("test2");
        modelB.setBlubB("testHellotest");
        List<String> elements = new ArrayList<String>();
        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

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

    public void testRetrievedTransformationsFromFile3_shouldWork() throws Exception {
        File descriptionFile =
            new File(getClass().getClassLoader().getResource("testDescription3.transformation").getFile());
        List<TransformationDescription> descriptions = TransformationUtils.getDescriptionsFromXMLFile(descriptionFile);
        installTransformations(descriptions);
        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

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

        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"));
        assertThat(result.getBlubB(), is("test3"));
    }
View Full Code Here

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

        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"));
        assertThat(result.getBlubB(), is("test3"));
    }
View Full Code Here

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

        model.setBlubA("test3");

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

        ModelB result = transformModelAToModelB(model);

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

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

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

        ModelB result = transformModelAToModelB(model);

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

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

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

        ModelB result = transformModelAToModelB(model);

        assertThat(result.getIdB(), is("test1"));
        assertThat(result.getTestB(), is("test2"));
        assertThat(result.getBlubB(), is("test3"));
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.