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

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


            split = target.split(";");
            className = split[0];
            version = split.length > 1 ? split[1] : "1.0.0";
            ModelDescription targetModel = new ModelDescription(className, version);
           
            activeDescription = new TransformationDescription(sourceModel, targetModel, id);
            activeDescription.setFileName(fileName);
        } else if (localName.equals("source-field")) {
            activeSourceField = true;
        } else if (localName.equals("target-field")) {
            activeTargetField = true;
View Full Code Here


        calculator = new PropertyConnectionCalculator(new TestModelRegistry());
    }

    @Test
    public void testIfSimplePropertyConnectionWorks_shouldWork() throws Exception {
        TransformationDescription description =
            new TransformationDescription(getModelADescription(), getModelBDescription());
        description.forwardField("idA", "idB");
        description.forwardField("idA", "testB");
        description.forwardField("testA", "testB");
        Map<String, Set<String>> result = calculator.getPropertyConnections(description);
        assertThat(result.get("idA").contains("idB"), is(true));
        assertThat(result.get("idA").contains("testB"), is(true));
        assertThat(result.get("idA").size(), is(2));
        assertThat(result.get("testA").contains("testB"), is(true));
View Full Code Here

        assertThat(result.get("testA").size(), is(1));
    }

    @Test
    public void testIfComplexPropertyConnectionWorks_shouldWork() throws Exception {
        TransformationDescription description =
            new TransformationDescription(getModelADescription(), getModelBDescription());
        description.concatField("testB", "#", "idA", "blubA", "blaA");
        description.mapField("idA", "idB", new HashMap<String, String>());
        description.valueField("blubB", "42");
        description.concatField("blubB", ".", "testA", "blubA");
        Map<String, Set<String>> result = calculator.getPropertyConnections(description);
        assertThat(result.get("idA").contains("idB"), is(true));
        assertThat(result.get("idA").contains("testB"), is(true));
        assertThat(result.get("idA").size(), is(2));
        assertThat(result.get("testA").contains("blubB"), is(true));
View Full Code Here

        assertThat(result.get("blubA").size(), is(2));
    }

    @Test
    public void testIfSimplePropertyConnectionWorksWithTemporaryFields_shouldWork() throws Exception {
        TransformationDescription description =
            new TransformationDescription(getModelADescription(), getModelBDescription());
        description.forwardField("idA", "#A");
        description.forwardField("#A", "#B");
        description.forwardField("#B", "#C");
        description.forwardField("#C", "#D");
        description.forwardField("#D", "#E");
        description.forwardField("#E", "#F");
        description.forwardField("#F", "idB");
        Map<String, Set<String>> result = calculator.getPropertyConnections(description);
       
        assertThat(result.get("idA").contains("idB"), is(true));
        assertThat(result.get("idA").size(), is(1));
    }
View Full Code Here

        assertThat(result.get("idA").size(), is(1));
    }
   
    @Test
    public void testIfComplexPropertyConnectionWorksWithTemporaryFields_shouldWork() throws Exception {
        TransformationDescription description =
            new TransformationDescription(getModelADescription(), getModelBDescription());
        description.forwardField("idA", "#id");
        description.forwardField("#id", "#id+");
        description.forwardField("blubA", "#blub");
        description.concatField("#test", "#", "#id+", "#blub", "blaA");
        description.forwardField("#test", "testB");
        description.mapField("idA", "idB", new HashMap<String, String>());
        description.valueField("blubB", "42");
        description.concatField("blubB", ".", "testA", "#blub");
        Map<String, Set<String>> result = calculator.getPropertyConnections(description);
        assertThat(result.get("idA").contains("idB"), is(true));
        assertThat(result.get("idA").contains("testB"), is(true));
        assertThat(result.get("idA").size(), is(2));
        assertThat(result.get("testA").contains("blubB"), is(true));
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.