Examples of TransformationDescription


Examples of org.openengsb.core.ekb.api.transformation.TransformationDescription

        assertThat(result.getTestB(), is("blubHelloblub"));
    }

    @Test
    public void testReverseTransformation_shouldWork() throws Exception {
        TransformationDescription desc = getDescriptionForModelAToModelB();
        desc.reverseField("testA", "testB");
        installTransformation(desc);

        ModelA model = new ModelA();
        model.setTestA("This is a teststring");
View Full Code Here

Examples of org.openengsb.core.ekb.api.transformation.TransformationDescription

        assertThat(result.getTestB(), is("gnirtstset a si sihT"));
    }

    @Test
    public void testPadTransformation_shouldWork() throws Exception {
        TransformationDescription desc = getDescriptionForModelAToModelB();
        desc.padField("idA", "idB", "4", "0", "Start");
        desc.padField("testA", "testB", "7", "!", "End");
        installTransformation(desc);

        ModelA model = new ModelA();
        model.setIdA("1");
        model.setTestA("works?");
View Full Code Here

Examples of org.openengsb.core.ekb.api.transformation.TransformationDescription

        assertThat(result.getTestB(), is("works?!"));
    }

    @Test
    public void testRemoveLeadingText_shouldWork() throws Exception {
        TransformationDescription desc = getDescriptionForModelBToModelA();
        desc.removeLeadingField("idB", "idA", "[#?]+", "3");
        desc.removeLeadingField("testB", "testA", "#+", "2");
        desc.removeLeadingField("blubB", "blubA", "[#?]+", "0");
        desc.removeLeadingField("blubB", "blaA", "#+", "3");
        installTransformation(desc);

        ModelB model = new ModelB();
        model.setIdB("#?##blub");
        model.setTestB("##blub");
View Full Code Here

Examples of org.openengsb.core.ekb.api.transformation.TransformationDescription

        assertThat(result.getBlaA(), is("?#?#?test"));
    }

    @Test
    public void testInstantiate_shouldWork() throws Exception {
        TransformationDescription desc = getDescriptionForModelAToModelB();
        desc.instantiateField("intValue", Integer.class.getName(), "parseInt", "idA");
        installTransformation(desc);

        ModelA model = new ModelA();
        model.setIdA("42");
View Full Code Here

Examples of org.openengsb.core.ekb.api.transformation.TransformationDescription

        assertThat(result.getIntValue(), is(42));
    }

    @Test
    public void testInitiateWithNoParameters_shouldCreateInstance() throws Exception {
        TransformationDescription desc = getDescriptionForModelAToModelB();
        desc.instantiateField("elements", ArrayList.class.getName(), null);
        installTransformation(desc);
        ModelA model = new ModelA();
        ModelB result = transformModelAToModelB(model);
        assertThat(result.getElements(), notNullValue());
    }
View Full Code Here

Examples of org.openengsb.core.ekb.api.transformation.TransformationDescription

        assertThat(result.getElements(), notNullValue());
    }
   
    @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);
View Full Code Here

Examples of org.openengsb.core.ekb.api.transformation.TransformationDescription

        assertThat(result.getNested().getValue2(), is(model.getBlubB()));
    }

    @Test
    public void testIfMergeIsWorking_shouldNotChangeUnusedField() throws Exception {
        TransformationDescription desc = getDescriptionForModelAToModelB();
        desc.forwardField("idA", "idB");
        desc.forwardField("testA", "testB");
        desc.forwardField("blubA", "#test");
        desc.forwardField("#test", "blubB");
        installTransformation(desc);

        ModelA model = new ModelA();
        model.setIdA("test1");
        model.setTestA("test2");
View Full Code Here

Examples of org.openengsb.core.ekb.api.transformation.TransformationDescription

        assertThat(resultB.getIntValue(), is(1));
    }

    @Test
    public void testNestedFieldAccess_shouldWork() throws Exception {
        TransformationDescription desc = getDescriptionForModelAToModelB();
        desc.forwardField("idA", "idB");
        desc.forwardField("nested.value1", "testB");
        desc.forwardField("nested.value2", "blubB");
        installTransformation(desc);

        ModelA model = new ModelA();
        model.setIdA("test1");
View Full Code Here

Examples of org.openengsb.core.ekb.api.transformation.TransformationDescription

        assertThat(result.getBlubB(), is("test3"));
    }

    @Test
    public void testNestedObjectsReadAccess_shouldWork() throws Exception {
        TransformationDescription desc = getDescriptionForModelAToModelB();
        desc.forwardField("idA", "idB");
        desc.forwardField("nested", "#test");
        desc.forwardField("#test.value1", "testB");
        desc.forwardField("#test.value2", "blubB");
        installTransformation(desc);

        ModelA model = new ModelA();
        model.setIdA("test1");
View Full Code Here

Examples of org.openengsb.core.ekb.api.transformation.TransformationDescription

        assertThat(result.getBlubB(), is("test3"));
    }

    @Test
    public void testNestedObjectsWriteAccess_shouldWork() throws Exception {
        TransformationDescription desc = getDescriptionForModelAToModelB();
        desc.forwardField("idA", "idB");
        desc.forwardField("nested", "#test");
        desc.forwardField("blaA", "#test.value1");
        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");
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.