Package org.openengsb.core.ekb.api.transformation

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


        assertThat(result.getBlaA(), is("test4"));
    }

    @Test
    public void testMapTransformation_shoulWork() throws Exception {
        TransformationDescription desc = getDescriptionForModelBToModelA();
        desc.forwardField("idB", "idA");
        desc.forwardField("testB", "testA");
        Map<String, String> mapping = new HashMap<String, String>();
        mapping.put("hello", "world");
        mapping.put("dog", "cat");
        desc.mapField("blubB", "blubA", mapping);
        installTransformation(desc);

        ModelB model1 = new ModelB();
        model1.setIdB("test1");
        model1.setTestB("test2");
View Full Code Here


        assertThat(result2.getBlubA(), is("cat"));
    }

    @Test
    public void testSubStringTransformation_shouldWork() throws Exception {
        TransformationDescription desc = getDescriptionForModelAToModelB();
        desc.substringField("idA", "idB", "0", "4");
        installTransformation(desc);

        ModelA model = new ModelA();
        model.setIdA("this is a test");
View Full Code Here

        assertThat(result.getIdB(), is("this"));
    }

    @Test
    public void testValueTransformation_shouldWork() throws Exception {
        TransformationDescription desc = getDescriptionForModelAToModelB();
        desc.forwardField("idA", "idB");
        desc.valueField("testB", "blub");
        installTransformation(desc);

        ModelA model = new ModelA();
        model.setIdA("this is a test");
View Full Code Here

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

    @Test
    public void testLengthTransformation_shouldWork() throws Exception {
        TransformationDescription desc = getDescriptionForModelBToModelA();
        desc.lengthField("testB", "testA", null);
        desc.lengthField("elements", "blubA", "size");
        installTransformation(desc);

        ModelB model = new ModelB();
        model.setTestB("Hello");
        List<String> elements = new ArrayList<String>();
View Full Code Here

        assertThat(result.getBlubA(), is(model.getElements().size() + ""));
    }

    @Test
    public void testTrimTransformation_shouldWork() throws Exception {
        TransformationDescription desc = getDescriptionForModelBToModelA();
        desc.trimField("testB", "testA");
        installTransformation(desc);

        ModelB model = new ModelB();
        model.setTestB("       Hello      ");
View Full Code Here

        assertThat(result.getTestA(), is("Hello"));
    }

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

        ModelA model = new ModelA();
        model.setTestA("hello");
View Full Code Here

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

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

        ModelA model = new ModelA();
        model.setTestA("HELLO");
View Full Code Here

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

    @Test
    public void testReplaceTransformation_shouldWork() throws Exception {
        TransformationDescription desc = getDescriptionForModelAToModelB();
        desc.replaceField("testA", "testB", "test", "blub");
        installTransformation(desc);

        ModelA model = new ModelA();
        model.setTestA("testHellotest");
View Full Code Here

        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

        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

TOP

Related Classes of org.openengsb.core.ekb.api.transformation.TransformationDescription

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.