Package eu.scape_project.planning.services.myexperiment.domain

Examples of eu.scape_project.planning.services.myexperiment.domain.WorkflowDescription


        planGenerator.addSourcePort();
        planGenerator.addTargetPort();

        addMigrationMock(planGenerator);
        WorkflowDescription wf = mockQa("QA component");
        when(wf.acceptsLeftMimetype("image/jp2")).thenReturn(true);
        planGenerator.addQaComponent(wf, generateQaContent(QA_DATAFLOW_ID, "QA component"), DEFAULT_PARAMETERS,
            DEFAULT_MEASURES);

        Document doc = getDocument(planGenerator);
View Full Code Here


        planGenerator.addSourcePort();
        planGenerator.addTargetPort();

        addMigrationMock(planGenerator);
        WorkflowDescription wf = mockQa("QA component");
        when(wf.acceptsRightMimetype("image/jp2")).thenReturn(true);
        planGenerator.addQaComponent(wf, generateQaContent(QA_DATAFLOW_ID, "QA component"), DEFAULT_PARAMETERS,
            DEFAULT_MEASURES);

        Document doc = getDocument(planGenerator);
View Full Code Here

        planGenerator.addSourcePort();
        planGenerator.addTargetPort();

        addMigrationMock(planGenerator);
        WorkflowDescription wf1 = mockQaAny("QA component 1");
        planGenerator.addQaComponent(wf1, generateQaContent(QA_DATAFLOW_ID, "QA component 1"), DEFAULT_PARAMETERS,
            DEFAULT_MEASURES);
        WorkflowDescription wf2 = mockQaAny("QA component 2");
        planGenerator.addQaComponent(wf2, generateQaContent(QA_DATAFLOW_ID, "QA component 2"), DEFAULT_PARAMETERS,
            DEFAULT_MEASURES);

        Document doc = getDocument(planGenerator);
View Full Code Here

        DocumentException {
        T2FlowExecutablePlanGenerator planGenerator = new T2FlowExecutablePlanGenerator("Name", "Author", "image/tiff",
            "image/jp2");

        planGenerator.addSourcePort();
        WorkflowDescription wf = mockCcAny("CC Component");
        planGenerator.addCcComponent(wf, generateCcContent(CC_DATAFLOW_ID, "CC Component"), DEFAULT_PARAMETERS,
            DEFAULT_MEASURES, InputSource.SOURCE_OBJECT);

        Document doc = getDocument(planGenerator);
View Full Code Here

        planGenerator.addSourcePort();
        planGenerator.addTargetPort();

        addMigrationMock(planGenerator);
        WorkflowDescription wf = mockCcAny("CC Component");
        planGenerator.addCcComponent(wf, generateCcContent(CC_DATAFLOW_ID, "CC Component"), DEFAULT_PARAMETERS,
            DEFAULT_MEASURES, InputSource.TARGET_OBJECT);

        Document doc = getDocument(planGenerator);
View Full Code Here

        planGenerator.addSourcePort();
        planGenerator.addTargetPort();

        addMigrationMock(planGenerator);
        WorkflowDescription wf1 = mockCcAny("CC Component 1");
        planGenerator.addCcComponent(wf1, generateCcContent(CC_DATAFLOW_ID, "CC Component 1"), DEFAULT_PARAMETERS,
            DEFAULT_MEASURES, InputSource.SOURCE_OBJECT);
        WorkflowDescription wf2 = mockCcAny("CC Component 2");
        planGenerator.addCcComponent(wf2, generateCcContent(CC_DATAFLOW_ID, "CC Component 2"), DEFAULT_PARAMETERS,
            DEFAULT_MEASURES, InputSource.TARGET_OBJECT);

        Document doc = getDocument(planGenerator);
View Full Code Here

     *
     * @param planGenerator
     *            the plan generator to user
     */
    private void addMigrationMock(T2FlowExecutablePlanGenerator planGenerator) {
        WorkflowDescription wf = mock(WorkflowDescription.class);
        when(wf.getDataflowId()).thenReturn(MIGRATION_DATAFLOW_ID);

        List<Port> inputPorts = new ArrayList<Port>(1);
        inputPorts.add(new Port("source", "Description", ComponentConstants.VALUE_SOURCE_OBJECT));
        when(wf.getInputPorts()).thenReturn(inputPorts);

        List<Port> outputPorts = new ArrayList<Port>(1);
        outputPorts.add(new Port("target", "Description", ComponentConstants.VALUE_TARGET_OBJECT));
        when(wf.getOutputPorts()).thenReturn(outputPorts);

        List<MigrationPath> migrationPaths = new ArrayList<MigrationPath>(1);
        migrationPaths.add(new MigrationPath("image/tiff", "image/jp2"));
        when(wf.getMigrationPaths()).thenReturn(migrationPaths);

        planGenerator.setMigrationComponent(wf, generateMigrationContent(MIGRATION_DATAFLOW_ID, "Migration component"),
            new HashMap<String, String>(0));
    }
View Full Code Here

     * @param name
     *            the component name
     * @return a mock of a QA component
     */
    private WorkflowDescription mockQa(String name) {
        WorkflowDescription wf = mock(WorkflowDescription.class);
        when(wf.getName()).thenReturn(name);
        when(wf.getDataflowId()).thenReturn(QA_DATAFLOW_ID);

        List<Port> inputPorts = new ArrayList<Port>(2);
        inputPorts.add(new Port("left", "Description", ComponentConstants.VALUE_LEFT_OBJECT));
        inputPorts.add(new Port("right", "Description", ComponentConstants.VALUE_RIGHT_OBJECT));
        when(wf.getInputPorts()).thenReturn(inputPorts);

        List<Port> outputPorts = new ArrayList<Port>(1);
        outputPorts.add(new Port("qa_output", "Description",
            "http://purl.org/DP/quality/measures#1"));
        when(wf.getOutputPorts()).thenReturn(outputPorts);

        List<String> measures = new ArrayList<String>(1);
        measures.add("http://purl.org/DP/quality/measures#1");

        return wf;
View Full Code Here

     * @param name
     *            the component name
     * @return a mock of the QA component
     */
    private WorkflowDescription mockQaAny(String name) {
        WorkflowDescription wf = mockQa(name);
        when(wf.acceptsMimetypes(any(String.class), any(String.class))).thenReturn(true);
        when(wf.acceptsLeftMimetype(any(String.class))).thenReturn(true);
        when(wf.acceptsRightMimetype(any(String.class))).thenReturn(true);
        when(wf.handlesMimetype(any(String.class))).thenReturn(true);
        return wf;
    }
View Full Code Here

     * @param name
     *            the component name
     * @return a mock of the CC component
     */
    private WorkflowDescription mockCcAny(String name) {
        WorkflowDescription wf = mock(WorkflowDescription.class);
        when(wf.getName()).thenReturn(name);
        when(wf.getDataflowId()).thenReturn(CC_DATAFLOW_ID);

        List<Port> inputPorts = new ArrayList<Port>(1);
        inputPorts.add(new Port("source", "Description", ComponentConstants.VALUE_SOURCE_OBJECT));
        when(wf.getInputPorts()).thenReturn(inputPorts);

        List<Port> outputPorts = new ArrayList<Port>(1);
        outputPorts.add(new Port("cc_output", "Description",
            "http://purl.org/DP/quality/measures#1"));
        when(wf.getOutputPorts()).thenReturn(outputPorts);

        when(wf.handlesMimetype(any(String.class))).thenReturn(true);
        return wf;
    }
View Full Code Here

TOP

Related Classes of eu.scape_project.planning.services.myexperiment.domain.WorkflowDescription

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.