Examples of HPerson


Examples of org.zanata.model.HPerson

    @Test
    public void getContribStatsSameLocaleMultiTargets() {
        PersonDAO personDAO = seam.autowire(PersonDAO.class);
        String username = "demo";
        HPerson demoPerson = personDAO.findByUsername(username);

        // Initial state = new (en-us)
        HTextFlowTarget target1 = textFlowTargetDAO.findById(5L);

        // Initial state = new (en-us)
View Full Code Here

Examples of org.zanata.model.HPerson

    @Test
    public void getContributionStatisticsMultiLocale() {
        PersonDAO personDAO = seam.autowire(PersonDAO.class);
        String username = "demo";
        HPerson demoPerson = personDAO.findByUsername(username);

        // Initial state = needReview (AS)
        HTextFlowTarget target1 = textFlowTargetDAO.findById(1L);

        // Initial state = needReview (DE)
View Full Code Here

Examples of org.zanata.model.HPerson

    @Test
    public void getAllActiveAndMaintainedGroupsTest() {
        // personId = 1 is maintainers for group1 and group3(obsolote)
        PersonDAO personDAO = new PersonDAO(getSession());
        HPerson person = personDAO.findById(new Long(1));
        List<HIterationGroup> result =
                versionGroupServiceImpl.getAllActiveAndMaintainedGroups(person);

        assertThat(result.size(), equalTo(3));
    }
View Full Code Here

Examples of org.zanata.model.HPerson

        String username = "anAuthenticatedAccount";
        HAccount account = (HAccount) session.byNaturalId(HAccount.class).using("username", username).load();
        if (account == null) {
            account = new HAccount();
            account.setUsername(username);
            HPerson person = new HPerson();
            person.setEmail("email@example.com");
            person.setName("aPerson");
            person = (HPerson) session.merge(person);
            account.setPerson(person);
            account = (HAccount) session.merge(account);
        }
        seamAutowire.use(JpaIdentityStore.AUTHENTICATED_USER, account);
View Full Code Here

Examples of org.zanata.model.HPerson

                "initial comment\n"
                        + "Alice <alice@example.org>, 2010. #zanata\n"
                        + "Alice <alice@example.org>, 2011. #zanata";
        PoTargetHeader toHeader = new PoTargetHeader();

        HPerson alice = new HPerson();
        alice.setName("Alice");
        alice.setEmail("alice@example.org");
        List<HTextFlowTarget> hTargets = new ArrayList<HTextFlowTarget>();
        HTextFlowTarget tft1 = new HTextFlowTarget();
        tft1.setLastChanged(new Date(1302671654000L)); // 13 Apr 2011
        tft1.setLastModifiedBy(alice);
        hTargets.add(tft1);
View Full Code Here

Examples of org.zanata.model.HPerson

        when(mockWorkspace.removeEditorClients("sessionId")).thenReturn(
                editorClientIds);
        spy.getOrRegisterWorkspace(workspaceId);

        HAccount hAccount = new HAccount();
        HPerson person = new HPerson();
        person.setName("patrick");
        person.setEmail("pahuang@redhat.com");
        hAccount.setPerson(person);
        when(accountDAO.getByUsername("admin")).thenReturn(hAccount);

        spy.exitWorkspace("admin");
View Full Code Here

Examples of org.zanata.model.HPerson

    private static HTextFlowTarget addHTextFlowTarget(HLocale hLocale,
            HTextFlow hTextFlow, String username) {
        HTextFlowTarget hTextFlowTarget =
                new HTextFlowTarget(hTextFlow, hLocale);
        HPerson lastModifiedBy = new HPerson();
        HAccount account = new HAccount();
        account.setUsername(username);
        lastModifiedBy.setAccount(account);
        hTextFlowTarget.setLastModifiedBy(lastModifiedBy);
        hTextFlowTarget.setLastChanged(new Date());
        return hTextFlowTarget;
    }
View Full Code Here

Examples of org.zanata.model.HPerson

                    findActivity(actorId, context.getEntityType(),
                            context.getId(), activityType, currentActionTime);
            if (activity != null) {
                activity.updateActivity(currentActionTime, target, wordCount);
            } else {
                HPerson actor = personDAO.findById(actorId);
                activity =
                        new Activity(actor, context, target, activityType,
                                wordCount);
            }
            activityDAO.makePersistent(activity);
View Full Code Here

Examples of org.zanata.model.HPerson

        try {
            HDocument document = documentDAO.getById(event.getDocumentId());
            ActivityType activityType =
                    event.isSourceDocument() ? ActivityType.UPLOAD_SOURCE_DOCUMENT
                            : ActivityType.UPLOAD_TRANSLATION_DOCUMENT;
            HPerson actor = personDAO.findById(event.getActorId());
            logActivityAlreadyLocked(actor.getId(),
                    document.getProjectIteration(), document, activityType,
                    getDocumentWordCount(document));
        } finally {
            lock.unlock();
        }
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.