Examples of ModelB


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

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

        model.setIdA("test1");
        model.setTestA("test2");
        model.setBlubA("test3");
        model.setBlaA("test4");

        ModelB result = transformModelAToModelB(model);
        assertThat(result.getIdB(), is("test1"));
        assertThat(result.getTestB(), is("test2"));
        assertThat(result.getBlubB(), is("test3#test4"));
    }
View Full Code Here

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

        desc.forwardField("testB", "testA");
        desc.splitField("blubB", "blubA", "#", "0");
        desc.splitField("blubB", "blaA", "#", "1");
        installTransformation(desc);

        ModelB model = new ModelB();
        model.setIdB("test1");
        model.setTestB("test2");
        model.setBlubB("test3#test4");

        ModelA result = transformModelBToModelA(model);
        assertThat(result.getIdA(), is("test1"));
        assertThat(result.getTestA(), is("test2"));
        assertThat(result.getBlubA(), is("test3"));
View Full Code Here

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

        TransformationDescription desc = getDescriptionForModelBToModelA();
        desc.splitRegexField("blubB", "blubA", "[^#]+", "0");
        desc.splitRegexField("blubB", "blaA", "[^#]+", "1");
        installTransformation(desc);

        ModelB model = new ModelB();
        model.setBlubB("test3#test4");

        ModelA result = transformModelBToModelA(model);
        assertThat(result.getBlubA(), is("test3"));
        assertThat(result.getBlaA(), is("test4"));
    }
View Full Code Here

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

        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");
        model1.setBlubB("hello");

        ModelB model2 = new ModelB();
        model2.setIdB("test1");
        model2.setTestB("test2");
        model2.setBlubB("dog");

        ModelA result1 = transformModelBToModelA(model1);
        ModelA result2 = transformModelBToModelA(model2);

        assertThat(result1.getBlubA(), is("world"));
View Full Code Here

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

        installTransformation(desc);

        ModelA model = new ModelA();
        model.setIdA("this is a test");

        ModelB result = transformModelAToModelB(model);
        assertThat(result.getIdB(), is("this"));
    }
View Full Code Here

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

        installTransformation(desc);

        ModelA model = new ModelA();
        model.setIdA("this is a test");

        ModelB result = transformModelAToModelB(model);
        assertThat(result.getIdB(), is("this is a test"));
        assertThat(result.getTestB(), is("blub"));
    }
View Full Code Here

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

        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>();
        elements.add("A");
        elements.add("B");
        elements.add("C");
        model.setElements(elements);

        ModelA result = transformModelBToModelA(model);
        assertThat(result.getTestA(), is(model.getTestB().length() + ""));
        assertThat(result.getBlubA(), is(model.getElements().size() + ""));
    }
View Full Code Here

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

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

        ModelB model = new ModelB();
        model.setTestB("       Hello      ");

        ModelA result = transformModelBToModelA(model);
        assertThat(result.getTestA(), is("Hello"));
    }
View Full Code Here

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

        installTransformation(desc);

        ModelA model = new ModelA();
        model.setTestA("hello");

        ModelB result = transformModelAToModelB(model);
        assertThat(result.getTestB(), is("HELLO"));
    }
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.