Examples of TransformationDescription


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

            getExampleRequestDescription(), model);
    }

    @Test
    public void testIfTransformationWorks_shouldWork() throws Exception {
        TransformationDescription description =
            new TransformationDescription(getExampleRequestDescription(), getExampleResponseDescription());
        description.concatField("result", "-", "name", "id");
        transformationEngine.saveDescription(description);

        ExampleRequestModel modelA = new ExampleRequestModel();
        modelA.setName("test");
        modelA.setId(42);
View Full Code Here

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

        BundleContext context = getBundleContext();
        Dictionary<String, String> dictionary = new Hashtable<String, String>();
        dictionary.put("transformation.operation", "dummy");
        context.registerService(TransformationOperation.class, new DummyTransformationOperation(), dictionary);

        TransformationDescription description =
            new TransformationDescription(getExampleResponseDescription(), getExampleRequestDescription());
        description.addStep("dummy", Arrays.asList("result"), "name", new HashMap<String, String>());
        transformationEngine.saveDescription(description);

        ExampleResponseModel modelA = new ExampleResponseModel();
        modelA.setResult("teststring");
View Full Code Here

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

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

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

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

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

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

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

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

        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

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

        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

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

        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

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

        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

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

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