Examples of TransformationDescription


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

        assertThat(result.get(0).getId(), is("test3"));
    }
   
    @Test
    public void testIfTransformationDeletionWorks_shouldDeleteTransformationDescription() throws Exception {
        TransformationDescription description = getDescriptionForModelAToModelB();
        description.setId("test1");
        graph.addTransformation(description);
        boolean possible1 = graph.isTransformationPossible(getModelADescription(), getModelBDescription(), null);
        graph.removeTransformation(description);
        boolean possible2 = graph.isTransformationPossible(getModelADescription(), getModelBDescription(), null);
        assertThat(possible1, is(true));
View Full Code Here

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

        return new ModelDescription(EOModel.class, exampleDomainVersion.toString());
    }

    private List<TransformationDescription> generateTransformationDescriptions() {
        List<TransformationDescription> descriptions = new ArrayList<TransformationDescription>();
        TransformationDescription desc =
            new TransformationDescription(getSourceModelADescription(), getEOModelDescription());
        desc.forwardField("name", "nameA");
        desc.forwardField("shared", "shared");
        desc.setId("AtoEO");
        descriptions.add(desc);
        desc = new TransformationDescription(getSourceModelBDescription(), getEOModelDescription());
        desc.forwardField("name", "nameB");
        desc.forwardField("shared", "shared");
        desc.setId("BtoEO");
        descriptions.add(desc);
        desc = new TransformationDescription(getEOModelDescription(), getSourceModelADescription());
        desc.forwardField("nameA", "name");
        desc.forwardField("shared", "shared");
        desc.setId("EOtoA");
        descriptions.add(desc);
        desc = new TransformationDescription(getEOModelDescription(), getSourceModelBDescription());
        desc.forwardField("nameB", "name");
        desc.forwardField("shared", "shared");
        desc.setId("EOtoB");
        descriptions.add(desc);
        return descriptions;
    }
View Full Code Here

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

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

        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

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

        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

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

        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

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

        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
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.