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

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


    private static ModelDescription getModelCDescription() {
        return new ModelDescription(ModelC.class, new Version(1, 0, 0).toString());
    }

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


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

    private TransformationDescription getDescriptionForModelBToModelC() {
        return new TransformationDescription(getModelBDescription(), getModelCDescription());
    }
View Full Code Here

    private TransformationDescription getDescriptionForModelBToModelC() {
        return new TransformationDescription(getModelBDescription(), getModelCDescription());
    }

    private TransformationDescription getDescriptionForModelAToModelC() {
        return new TransformationDescription(getModelADescription(), getModelCDescription());
    }
View Full Code Here

        return new TransformationDescription(getModelADescription(), getModelCDescription());
    }

    @Test
    public void testIsTransformationPossible_shouldFindPath() throws Exception {
        TransformationDescription description = getDescriptionForModelAToModelB();
        description.setId("test");
        graph.addTransformation(description);
        boolean possible = graph.isTransformationPossible(getModelADescription(), getModelBDescription(), null);
        assertThat(possible, is(true));
    }
View Full Code Here

        assertThat(possible, is(true));
    }

    @Test
    public void testIsTransformationPossiblePath_shouldFindPath() throws Exception {
        TransformationDescription description = getDescriptionForModelAToModelB();
        graph.addTransformation(description);
        TransformationDescription description2 = getDescriptionForModelBToModelC();
        graph.addTransformation(description2);
        boolean possible = graph.isTransformationPossible(getModelADescription(), getModelBDescription(), null);
        assertThat(possible, is(true));
    }
View Full Code Here

        assertThat(possible, is(true));
    }

    @Test
    public void testFindTransformationPathWithIDs_shouldFindDifferentPaths() throws Exception {
        TransformationDescription description1 = getDescriptionForModelAToModelB();
        description1.setId("test1");
        graph.addTransformation(description1);
        TransformationDescription description2 = getDescriptionForModelAToModelB();
        description2.setId("test2");
        graph.addTransformation(description2);
        TransformationDescription description3 = getDescriptionForModelBToModelC();
        graph.addTransformation(description3);

        List<TransformationDescription> path1 =
            graph.getTransformationPath(getModelADescription(), getModelCDescription(), Arrays.asList("test1"));
        List<TransformationDescription> path2 =
View Full Code Here

        assertThat(graph.isModelActive(getModelADescription()), is(true));
    }
   
    @Test
    public void testIfDeactivatedModelsAreNotUsed_shouldIgnoreInactiveModels() throws Exception {
        TransformationDescription description = getDescriptionForModelAToModelB();
        description.setId("test1");
        graph.addTransformation(description);
        description = getDescriptionForModelBToModelC();
        description.setId("test2");
        graph.addTransformation(description);
        boolean possible1 = graph.isTransformationPossible(getModelADescription(), getModelCDescription(), null);
        graph.removeModel(getModelBDescription());
        boolean possible2 = graph.isTransformationPossible(getModelADescription(), getModelCDescription(), null);
        description = getDescriptionForModelAToModelC();
        description.setId("test3");
        graph.addTransformation(description);
        boolean possible3 = graph.isTransformationPossible(getModelADescription(), getModelCDescription(), null);
        assertThat(possible1, is(true));
        assertThat(possible2, is(false));
        assertThat(possible3, is(true));
View Full Code Here

        assertThat(possible3, is(true));
    }
   
    @Test
    public void testIfLoadingByFilenameWorks_shouldLoadByFilename() throws Exception {
        TransformationDescription description = getDescriptionForModelAToModelB();
        description.setId("test1");
        graph.addTransformation(description);
        description = getDescriptionForModelBToModelC();
        description.setId("test2");
        graph.addTransformation(description);
        description = getDescriptionForModelAToModelB();
        description.setId("test3");
        description.setFileName("testfile");
        graph.addTransformation(description);
        description = getDescriptionForModelBToModelC();
        description.setId("test4");
        graph.addTransformation(description);
       
        List<TransformationDescription> result = graph.getTransformationsPerFileName("testfile");
        assertThat(result.size(), is(1));
        assertThat(result.get(0).getId(), is("test3"));
View Full Code Here

        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

        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

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.