Examples of TextFlowTarget


Examples of org.zanata.rest.dto.resource.TextFlowTarget

        assertThat(response.getResponseStatus(), is(Status.OK));

        TranslationsResource doc = response.getEntity();
        assertThat("should have one textFlow", doc.getTextFlowTargets().size(),
                is(1));
        TextFlowTarget tft = doc.getTextFlowTargets().get(0);

        assertThat(tft, notNullValue());
        assertThat("should have a textflow with this id", tft.getResId(),
                is("tf1"));

        assertThat("expected de target", tft, notNullValue());
        assertThat("expected translation for de", tft.getContents(),
                is(asList("hei verden")));
    }
View Full Code Here

Examples of org.zanata.rest.dto.resource.TextFlowTarget

        Resource doc1 = putDoc1(false);
        doc1.setRevision(1);
        TextFlow tf1 = doc1.getTextFlows().get(0);
        tf1.setRevision(1);
        TranslationsResource target1 = putTarget1();
        TextFlowTarget tft1 = target1.getTextFlowTargets().get(0);
        tft1.setTextFlowRevision(1);
        tft1.setRevision(1);
        expectDocs(true, false, doc1);
        expectTarget1(target1);
    }
View Full Code Here

Examples of org.zanata.rest.dto.resource.TextFlowTarget

        Resource doc1 = putDoc1(false);
        doc1.setRevision(1);
        TextFlow tf1 = doc1.getTextFlows().get(0);
        tf1.setRevision(1);
        TranslationsResource target1 = putTarget1();
        TextFlowTarget tft1 = target1.getTextFlowTargets().get(0);
        tft1.setTextFlowRevision(1);
        tft1.setRevision(1);
        expectDocs(true, false, doc1);
        expectTarget1(target1);
        Resource doc2 = postDoc2(false);
        doc2.setRevision(1);
        TextFlow tf2 = doc2.getTextFlows().get(0);
        tf2.setRevision(1);
        TranslationsResource target2 = putTarget2();
        TextFlowTarget tft2 = target2.getTextFlowTargets().get(0);
        tft2.setTextFlowRevision(1);
        tft2.setRevision(1);
        expectDocs(true, false, doc1, doc2);
        expectTarget1(target1);
        expectTarget2(target2);
    }
View Full Code Here

Examples of org.zanata.rest.dto.resource.TextFlowTarget

        Resource doc1 = putDoc1(false);
        doc1.setRevision(1);
        TextFlow tf1 = doc1.getTextFlows().get(0);
        tf1.setRevision(1);
        TranslationsResource target1 = putTarget1();
        TextFlowTarget tft1 = target1.getTextFlowTargets().get(0);
        tft1.setTextFlowRevision(1);
        Resource doc2 = postDoc2(false);
        doc2.setRevision(1);
        TextFlow tf2 = doc2.getTextFlows().get(0);
        tf2.setRevision(1);
        TranslationsResource target2 = putTarget2();
        TextFlowTarget tft2 = target2.getTextFlowTargets().get(0);
        tft2.setTextFlowRevision(1);
        expectDocs(true, false, doc1, doc2);
        tft1.setRevision(1);
        tft2.setRevision(1);
        expectTarget1(target1);
        expectTarget2(target2);
        // this put should have the effect of deleting doc2
        putDoc1(false);
        deleteDoc2();
View Full Code Here

Examples of org.zanata.rest.dto.resource.TextFlowTarget

    private final Logger log = LoggerFactory
            .getLogger(TranslationsResourceTestObjectFactory.class);

    public TranslationsResource getTestObject() {
        TranslationsResource entity = new TranslationsResource();
        TextFlowTarget target = new TextFlowTarget("rest1");
        target.setContents("hello world");
        target.setState(ContentState.Approved);
        target.setTranslator(new Person("root@localhost", "Administrator"));
        // for the convenience of test
        target.getExtensions(true);
        entity.getTextFlowTargets().add(target);
        entity.getExtensions(true);
        return entity;
    }
View Full Code Here

Examples of org.zanata.rest.dto.resource.TextFlowTarget

        return entity;
    }

    public TranslationsResource getTestObject2() {
        TranslationsResource entity = new TranslationsResource();
        TextFlowTarget target = new TextFlowTarget("rest1");
        target.setContents("hello world");
        target.setState(ContentState.Approved);
        target.setTranslator(new Person("root@localhost", "Administrator"));
        target.getExtensions(true);
        TextFlowTarget target2 = new TextFlowTarget("rest2");
        target2.setContents("greeting world");
        target2.setState(ContentState.Approved);
        target2.setTranslator(new Person("root@localhost", "Administrator"));
        target2.getExtensions(true);
        entity.getTextFlowTargets().add(target2);
        entity.getExtensions(true);
        log.debug(entity.toString());
        return entity;
    }
View Full Code Here

Examples of org.zanata.rest.dto.resource.TextFlowTarget

        return entity;
    }

    public TranslationsResource getTextFlowTargetCommentTest() {
        TranslationsResource sr = getTestObject();
        TextFlowTarget stf = sr.getTextFlowTargets().get(0);

        SimpleComment simpleComment =
                new SimpleComment("textflowtarget comment");

        stf.getExtensions(true).add(simpleComment);
        return sr;
    }
View Full Code Here

Examples of org.zanata.rest.dto.resource.TextFlowTarget

        return sr;
    }

    public TranslationsResource getAllExtension() {
        TranslationsResource sr = getPoTargetHeaderTextFlowTargetTest();
        TextFlowTarget stf = sr.getTextFlowTargets().get(0);

        SimpleComment simpleComment =
                new SimpleComment("textflowtarget comment");

        stf.getExtensions(true).add(simpleComment);
        return sr;
    }
View Full Code Here

Examples of org.zanata.rest.dto.resource.TextFlowTarget

        return targetCount;
    }

    private static void addSampleTranslation(TranslationsResource translations,
            String resId) {
        TextFlowTarget target = new TextFlowTarget(resId);
        target.setRevision(1);
        target.setState(ContentState.Translated);
        target.setContents("translated " + resId);
        translations.getTextFlowTargets().add(target);
    }
View Full Code Here

Examples of org.zanata.rest.dto.resource.TextFlowTarget

        Resource doc1 = putDoc1(false);
        doc1.setRevision(1);
        TextFlow tf1 = doc1.getTextFlows().get(0);
        tf1.setRevision(1);
        TranslationsResource target1 = putTarget1();
        TextFlowTarget tft1 = target1.getTextFlowTargets().get(0);
        tft1.setTextFlowRevision(1);
        expectDocs(true, false, doc1);
        tft1.setRevision(1);
        expectTarget1(target1);
        deleteDoc1(); // doc1 becomes obsolete
        getZero();
        dontExpectTarget1();
        putDoc1(false); // doc1 resurrected, rev 1
        doc1.setRevision(1);
        tf1.setRevision(1);
        tft1.setTextFlowRevision(1);
        expectDocs(true, false, doc1);
        expectTarget1(target1);
    }
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.