Package org.evolizer.model.resources.entities.humans

Examples of org.evolizer.model.resources.entities.humans.Person


     *            The revision number of the files to be removed.
     * @param author
     *            The author to modify.
     */
    private void cleanUpCommitter(long revNum, String author) {
        Person authPerson = fPersons.get(author);
        if (authPerson != null) {
            Set<Role> roles = authPerson.getRoles();
            boolean needUpdate = false;
            for (Role r : roles) {
                if (r instanceof CommitterRole) {
                    ArrayList<Revision> toRemove = new ArrayList<Revision>();
                    for (Revision rev : ((CommitterRole) r).getArtifacts()) {
View Full Code Here


        if ((commitMessage == null) || (commitMessage.compareTo("") == 0)) {
            commitMessage = MapperMessages.SVNModelMapper_emptyMessage;
        }

        // Create Person
        Person authorPerson = createPerson(author);

        ModificationReport report = new ModificationReport();
        report.setCreationTime(creationTime);
        report.setCommitMessage(commitMessage);
        report.setLinesAdd(linesAdded);
View Full Code Here

        String authorName = name;
        if ((authorName == null) || (authorName.compareTo("") == 0)) {
            authorName = MapperMessages.SVNModelMapper_noAuthor;
        }

        Person person = fPersons.get(authorName);
        if (person == null) {
            person = new Person();

            if (isEmail(authorName)) {
                person.setEmail(authorName);
            }
            // TODO should we be more precise?
            person.setFirstName(authorName);

            CommitterRole role = new CommitterRole();
            person.addRole(role);
            fCurrPerson = person;
            fCurrRole = role;
            fPersons.put(authorName, person);
            LOGGER.debug(NLS.bind(MapperMessages.SVNModelMapper_createdPerson, name));
        }
View Full Code Here

    fSessionHandler = null;
  }

  @Test
  public void testPerson() {
    Person p = new Person();
    p.setFirstName("Michael");
    p.setLastName("Wuersch");
    p.addNickName("Michili");
    p.addNickName("'se Michiator");
    assertEquals("Michael Wuersch", p.getLabel());
   
    Person pp = saveAndReloadUniqueFromDB(p, "from Person", Person.class);
   
    assertEquals("Michael", pp.getFirstName());
    assertEquals("Wuersch", pp.getLastName());
    assertTrue(pp.getNickNames().contains("Michili"));
    assertTrue(pp.getNickNames().contains("'se Michiator"));
  }
View Full Code Here

    assertEquals("Developer", pRole.getLabel());
  }
 
  @Test
  public void testPersonWithRoles() {
    Person p = new Person();
    p.setFirstName("Emanuel");
    p.setLastName("Giger");
    p.addNickName("Gigs");
    p.addNickName("Flex0r");

   
    Role firstRole = new Role("Developer");
    Role secondRole = new Role("Gamer");
   
    p.addRole(firstRole);
    p.addRole(secondRole);

    save(p, firstRole, secondRole);
    Person loadedP = loadUnique("from Person", Person.class);
    assertEquals("Emanuel Giger", loadedP.getLabel());
    Set<Role> roles = loadedP.getRoles();
    assertEquals(2, roles.size());
    assertTrue(roles.contains(firstRole));
    assertTrue(roles.contains(secondRole));
  }
View Full Code Here

TOP

Related Classes of org.evolizer.model.resources.entities.humans.Person

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.