Package org.zanata.model

Examples of org.zanata.model.HProjectIteration


    public void testCopyVersionSettings() {
        String projectSlug = "sample-project";
        String versionSlug = "1.0";
        String newVersionSlug = "new-version";

        HProjectIteration existingVersion =
                projectIterationDAO.getBySlug(projectSlug, versionSlug);

        HProjectIteration newVersion = new HProjectIteration();
        newVersion.setSlug(newVersionSlug);
        newVersion.setProject(existingVersion.getProject());

        newVersion =
                service.copyVersionSettings(existingVersion, newVersion);

        assertVersion(existingVersion, newVersion, newVersionSlug,
                newVersion.getStatus());
    }
View Full Code Here


                newVersion.getStatus());
    }

    @Test
    public void testCopyDocument() throws Exception {
        HProjectIteration dummyVersion = getDummyVersion("new-version");
        HDocument existingDoc = documentDAO.getById(1L);

        HDocument newDocument =
                service.copyDocument(dummyVersion, existingDoc);
View Full Code Here

                    existingTarget, newTarget);
        }
    }

    private HProjectIteration getDummyVersion(String newVersionSlug) {
        HProjectIteration dummyVersion = new HProjectIteration();
        dummyVersion.setSlug(newVersionSlug);
        return dummyVersion;
    }
View Full Code Here

    @PerformanceProfiling
    public void pushTranslation() {
        EntityMaker entityMaker = EntityMakerBuilder.builder()
                .addFieldOrPropertyMaker(HProject.class, "sourceViewURL",
                        FixedValueMaker.EMPTY_STRING_MAKER).build();
        HProjectIteration iteration = entityMaker
                .makeAndPersist(getEm(), HProjectIteration.class);
        HLocale srcLocale = createAndPersistLocale(LocaleId.EN_US, getEm());
        HLocale transLocale = createAndPersistLocale(LocaleId.DE, getEm());

        String versionSlug = iteration.getSlug();
        String projectSlug = iteration.getProject().getSlug();

        HDocument document = new HDocument("message", ContentType.PO, srcLocale);
        document.setProjectIteration(iteration);
        getEm().persist(document);
        getEm().flush();
View Full Code Here

     */
    private void testMostRecentMatch(TranslationFinder service) {
        ProjectIterationDAO projectIterationDAO =
                seam.autowire(ProjectIterationDAO.class);

        HProjectIteration version =
                projectIterationDAO.getBySlug("same-project", "same-version");
        assert version != null;

        HDocument hDoc = version.getDocuments().get("/same/document0");

        HTextFlow textFlow = hDoc.getTextFlows().get(0);
        Optional<HTextFlowTarget> match =
                service.searchBestMatchTransMemory(textFlow,
                        LocaleId.DE,
View Full Code Here

        // Prepare Execution
        ProjectIterationDAO iterationDAO =
                seam.autowire(ProjectIterationDAO.class);

        // Get the project iteration
        HProjectIteration queryProjIter =
                iterationDAO.getBySlug(execution.getProject(), execution.getVersion());

        assert queryProjIter != null;

        // Create the document
View Full Code Here

        assertThat(iter.hasNext(), Matchers.not(true));
    }

    @Test
    public void findTextFlowsForProjectIter() throws Exception {
        HProjectIteration projIter =
                projectIterDao.getBySlug("sample-project", "1.0");
        @Cleanup
        CloseableIterator<HTextFlow> iter =
                dao.findTextFlowsByProjectIteration(projIter);
        assertThat(Iterators.size(iter),
View Full Code Here

                equalTo(TEXTFLOWS_IN_SAMPLE_PROJECT_10));
    }

    @Test
    public void findTextFlowsForEmptyProjectIteration() throws Exception {
        HProjectIteration projIter =
                projectIterDao.getBySlug("retired-project", "retired-current");
        @Cleanup
        CloseableIterator<HTextFlow> iter =
                dao.findTextFlowsByProjectIteration(projIter);
        assertThat(iter.hasNext(), Matchers.not(true));
View Full Code Here

    }

    private void verifyObsoleteDocument(final String docID) throws Exception {
        ProjectIterationDAO projectIterationDAO =
                getSeamAutowire().autowire(ProjectIterationDAO.class);
        HProjectIteration iteration =
                projectIterationDAO.getBySlug(projectSlug, iter);
        Map<String, HDocument> allDocuments = iteration.getAllDocuments();
        HDocument hDocument = allDocuments.get(docID);
        // FIXME hDocument is coming back null
        // Assert.assertNotNull(hDocument);
        // Assert.assertTrue(hDocument.isObsolete());
    }
View Full Code Here

    private void verifyObsoleteResource(final String docID,
            final String resourceID) throws Exception {
        ProjectIterationDAO projectIterationDAO =
                getSeamAutowire().autowire(ProjectIterationDAO.class);
        HProjectIteration iteration =
                projectIterationDAO.getBySlug(projectSlug, iter);
        Map<String, HDocument> allDocuments = iteration.getAllDocuments();
        HDocument hDocument = allDocuments.get(docID);
        // FIXME hDocument is coming back null
        // HTextFlow hResource = hDocument.getAllTextFlows().get(resourceID);
        // Assert.assertNotNull(hResource);
        // Assert.assertTrue(hResource.isObsolete());
View Full Code Here

TOP

Related Classes of org.zanata.model.HProjectIteration

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.