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

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


  @Test
  public void testRevisonAndModReportAndPersonMapping() throws ParseException, EvolizerException {

    SimpleDateFormat df = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss");
    Date date = df.parse("2006/01/02 01:02:03");
    Person author = new Person();
    author.setFirstName("Emanuel");
    author.setLastName("Giger");
    author.setEmail("gigs@orc-warriors.ogrimmar.horde");

    Revision oldRevision = new Revision("1.1");
    oldRevision.setState("active");

    ModificationReport oldReport = new ModificationReport();
View Full Code Here


    releaseOne.setTimeStamp(date);
    releaseTwo.setTimeStamp(date);
   
    ModificationReport modReport = new ModificationReport();
   
    modReport.setAuthor(new Person());
   
    Revision revOne = new Revision("1.1");
    Revision revTwo = new Revision("1.2");
    Revision revThree= new Revision("1.3");
    Revision revFour = new Revision("1.4");
View Full Code Here

    transaction.setFinished(date);
    Revision rev = new Revision("1.1");
    transaction.addRevision(rev);
   
    ModificationReport modReport = new ModificationReport();
    modReport.setAuthor(new Person());
    rev.setReport(modReport);
   
    fEvolizerSession.startTransaction();
    fEvolizerSession.saveObject(modReport.getAuthor());
    fEvolizerSession.saveObject(rev);
View Full Code Here

  @Test
  public void testModReportEqualsAndHashCode(){
    ModificationReport m1 = new ModificationReport();
    ModificationReport m2 = new ModificationReport();
    Date date = new Date();
    Person author = new Person();
    m1.setCreationTime(date);
    m2.setCreationTime(date);
   
    m1.setAuthor(author);
    m2.setAuthor(author);
View Full Code Here

        assertEquals(
                "The total number of authors found is not what it's supposed to be",
                st.countTokens(),
                getPersons().size());
        while (st.hasMoreTokens()) {
            Person author = getSpecificPerson(st.nextToken());
            assertNotNull("Author " + author.getFirstName() + " was not found during the import", author);
            if (author.getFirstName().compareTo(props.getProperty("testedAuthor")) == 0) {
                int totalCommits = Integer.parseInt(props.getProperty("totalCommits"));

                List<Long> res =
                        sSession
                                .query(
                                        "SELECT r.number FROM Revision as r, Person as p, CommitterRole as c WHERE c in elements(p.roles) and r in elements(c.artifacts) AND p.firstName='"
                                                + author.getFirstName() + "' GROUP BY r.number",
                                        Long.class);
                assertEquals(
                        "Total commits found for author " + author.getFirstName() + " is not what expected ",
                        totalCommits,
                        res.size());
            }
        }
    }
View Full Code Here

     * @param email
     *            the new authors email address
     */
    public void setAuthorsEmailAddress(String email) {
        if (author == null) {
            author = new Person();
        }
        author.setEmail(email);
    }
View Full Code Here

     * @param name
     *            the name
     */
    public void addNickNameToAuthor(String name) {
        if (author == null) {
            author = new Person();
            author.addNickName(name);
        } else {
            author.addNickName(name);
        }
    }
View Full Code Here

        LOGGER.debug("Revisions loaded.");

        List<Transaction> transactions = new Vector<Transaction>();

        Person precedingAuthor = null;
        long precedingCheckInTime = 0;
        long precedingTransactionStart = 0;
        String precedingLogMessage = null;

        Transaction transaction = null;

        LOGGER.debug("Reconstructing transactions from CVS information.");
        int revTotal = revisionsOrderedByCreationTimeAsc.size();
        for (int i = 0; (i < revisionsOrderedByCreationTimeAsc.size()) && !monitor.isCanceled(); i++) {
            Revision revision = revisionsOrderedByCreationTimeAsc.get(i);
            monitor.subTask("Examining revision " + i + " / " + revTotal);

            Person currentAuthor = revision.getAuthor();
            long currentCheckInTime = revision.getCreationTime().getTime();
            String currentLogMessage = revision.getCommitMessage();

            // Two authors (or log messages) a1 and a2 are equal if both are null or if a1 equals a2
            boolean authorsAreEqual =
View Full Code Here

        ModificationReport report = file.getRevisions().get(1).getReport();
        assertEquals("Wrong commit message for the report being tested", "change in trial branch", report
                .getCommitMessage());
        assertEquals("Wrong number of lines deleted for the report being tested", 9, report.getLinesDel());
        assertEquals("Wrong number of lines added for the report being tested", 1, report.getLinesAdd());
        Person p = sSession.uniqueResult("from Person where firstName='Giacomo Ghezzi'", Person.class);
        assertEquals("ModificationReport author is not what expected", p, report.getAuthor());
    }
View Full Code Here

    /**
     * Tests a specific author
     */
    @Test
    public void testSpecificAuthor() {
        Person p = sSession.uniqueResult("from Person where firstName='Giacomo Ghezzi'", Person.class);
        assertEquals("Wrong author email", "Giacomo@ifidyn165.ifi.uzh.ch", p.getEmail());
        Set<Role> roles = p.getRoles();
        assertEquals("The author being tested has the wrong number of associtated roles", 1, roles.size());
        assertTrue("Wrong role associated to the author being tested", roles.iterator().next() instanceof CommitterRole);
    }
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.