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

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


            List<TransformationDescription> result = graphDb.getTransformationPath(sourceModel, targetModel, ids);
            if (result == null || result.isEmpty()) {
                return source;
            }
            for (int i = 0; i < result.size(); i++) {
                TransformationDescription step = result.get(i);
                if (i != result.size() - 1) {
                    TransformationPerformer performer = new TransformationPerformer(modelRegistry, operationLoader);
                    source = performer.transformObject(step, source);
                } else {
                    TransformationPerformer performer = new TransformationPerformer(modelRegistry, operationLoader);
View Full Code Here


        graph.addModel(getModelCDescription());
        service.setOperationLoader(new TestTransformationOperationLoader());
    }

    private TransformationDescription getDescriptionForModelAToModelB() {
        return new TransformationDescription(getModelADescription(), getModelBDescription());
    }
View Full Code Here

    private TransformationDescription getDescriptionForModelAToModelB() {
        return new TransformationDescription(getModelADescription(), getModelBDescription());
    }

    private TransformationDescription getDescriptionForModelBToModelA() {
        return new TransformationDescription(getModelBDescription(), getModelADescription());
    }
View Full Code Here

        return (ModelA) service.performTransformation(getModelBDescription(), getModelADescription(), model);
    }

    @Test
    public void testIfTransformationDescriptionsBuiltCorrectly_shouldWork() throws Exception {
        TransformationDescription desc1 = getDescriptionForModelAToModelB();
        desc1.setId("aTob");
        desc1.forwardField("bla", "blub");

        TransformationDescription desc2 = getDescriptionForModelBToModelA();
        desc2.setId("bToa");

        assertThat(desc1.getId(), is("aTob"));
        assertThat(desc1.getTransformingSteps().size(), is(1));
        assertThat(desc2.getId(), is("bToa"));
        assertThat(desc2.getSourceModel(), is(getModelBDescription()));
        assertThat(desc2.getTargetModel(), is(getModelADescription()));
    }
View Full Code Here

        assertThat(desc2.getTargetModel(), is(getModelADescription()));
    }

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

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

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

    @Test
    public void testForwardTransformationsWithTemporaryField_shouldWork() 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

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

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

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

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

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

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

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

    @Test
    public void testSplitTransformation_shouldWork() throws Exception {
        TransformationDescription desc = getDescriptionForModelBToModelA();
        desc.forwardField("idB", "idA");
        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");
View Full Code Here

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

    @Test
    public void testSplitRegexTransformation_shouldWork() throws Exception {
        TransformationDescription desc = getDescriptionForModelBToModelA();
        desc.splitRegexField("blubB", "blubA", "[^#]+", "0");
        desc.splitRegexField("blubB", "blaA", "[^#]+", "1");
        installTransformation(desc);

        ModelB model = new ModelB();
        model.setBlubB("test3#test4");
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.