Package org.evolizer.versioncontrol.cvs.model.entities

Examples of org.evolizer.versioncontrol.cvs.model.entities.ModificationReport


    p3.setFirstName("fn3");
    p3.setLastName("ln3");
    p3.setEmail("3@3.ch");
;

    ModificationReport mr1 = new ModificationReport("2006/11/08 12:00:00");
    mr1.setAuthor(p1);
    ModificationReport mr2 = new ModificationReport("2006/11/09 12:00:00");
    mr2.setAuthor(p2);
    ModificationReport mr3 = new ModificationReport("2006/11/10 12:00:00");
    mr3.setAuthor(p3);
    fEvolizerSession.startTransaction();
    fEvolizerSession.saveObject(mr1.getAuthor());
    fEvolizerSession.saveObject(mr2.getAuthor());
    fEvolizerSession.saveObject(mr3.getAuthor());
    fEvolizerSession.endTransaction();
   
    Revision rev1 = new Revision("1");
    rev1.setReport(mr1);
    Revision rev2 = new Revision("2");
View Full Code Here


    author.setEmail("gigs@orc-warriors.ogrimmar.horde");

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

    ModificationReport oldReport = new ModificationReport();
    oldReport.setCommitMessage("old message");
    oldReport.setCreationTime(date);
    oldReport.setLinesAdd(12);
    oldReport.setLinesDel(14);
    oldReport.setAuthor(author);

    Revision currentRevision = new Revision("1.2");
    currentRevision.setState("active");
    currentRevision.setSource("source code of rev 1.2");

    ModificationReport currentReport = new ModificationReport();
    currentReport.setCommitMessage("current message");
    currentReport.setCreationTime(date);
    currentReport.setLinesAdd(16);
    currentReport.setLinesDel(18);
    currentReport.setAuthor(author);

    Revision newRevision = new Revision("1.3");
    newRevision.setState("active");

    ModificationReport newReport = new ModificationReport();
    newReport.setCommitMessage("new message");
    newReport.setCreationTime(date);
    newReport.setLinesAdd(22);
    newReport.setLinesDel(17);
    newReport.setAuthor(author);

    oldRevision.setReport(oldReport);
    currentRevision.setReport(currentReport);
    newRevision.setReport(newReport);

    currentRevision.setPreviousRevision(oldRevision);
    currentRevision.setNextRevision(newRevision);
   
   
    fEvolizerSession.startTransaction();
    fEvolizerSession.saveObject(author);
    fEvolizerSession.saveObject(oldRevision);
    fEvolizerSession.saveObject(newRevision);
    fEvolizerSession.saveObject(currentRevision);
    fEvolizerSession.endTransaction();
    fEvolizerSession.close();

    fEvolizerSession = fSessionHandler.getCurrentSession(fDBUrl);

    List<Revision> revResults = fEvolizerSession
        .query("from Revision as b where b.number = '1.2'", Revision.class);
    assertEquals(1, revResults.size());

    Revision resultCurrentRevision = (Revision) revResults.get(0);
    assertEquals("1.2", resultCurrentRevision.getNumber());
    assertEquals("source code of rev 1.2", resultCurrentRevision.getSource());
    assertEquals("1.1", resultCurrentRevision.getPreviousRevision()
        .getNumber());
    assertEquals("1.3", resultCurrentRevision.getNextRevision().getNumber());

    ModificationReport resultReport = resultCurrentRevision.getReport();
    assertEquals("current message", resultReport.getCommitMessage());
    assertEquals(date, resultReport.getCreationTime());
    assertEquals(16, resultReport.getLinesAdd());
    assertEquals(18, resultReport.getLinesDel());
    assertEquals("Emanuel", resultReport.getAuthor().getFirstName());
    assertEquals("gigs@orc-warriors.ogrimmar.horde", resultReport
        .getAuthor().getEmail());

    resultReport = resultCurrentRevision.getPreviousRevision().getReport();
    assertEquals("old message", resultReport.getCommitMessage());
    assertEquals(date, resultReport.getCreationTime());
    assertEquals(12, resultReport.getLinesAdd());
    assertEquals(14, resultReport.getLinesDel());
    assertEquals("Giger", resultReport.getAuthor().getLastName());
    assertEquals("gigs@orc-warriors.ogrimmar.horde", resultReport
        .getAuthor().getEmail());

    resultReport = resultCurrentRevision.getNextRevision().getReport();
    assertEquals("new message", resultReport.getCommitMessage());
    assertEquals(date, resultReport.getCreationTime());
    assertEquals(22, resultReport.getLinesAdd());
    assertEquals(17, resultReport.getLinesDel());
    assertEquals("Emanuel", resultReport.getAuthor().getFirstName());
    assertEquals("gigs@orc-warriors.ogrimmar.horde", resultReport
        .getAuthor().getEmail());
  }
View Full Code Here

    public void testSpecificModificationReport() {
        VersionedFile file =
                sSession.uniqueResult(
                        "from VersionedFile where path = 'test_package/Variables.java'",
                        VersionedFile.class);
        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

        SVNNodeKind nodeKind = getEntryType(addEntry, logEntry);
        // Path points to a File
        if (nodeKind == SVNNodeKind.FILE) {
            if (addEntry.getCopyPath() == null) {
                SVNVersionedFile file = (SVNVersionedFile) fModelMapper.createFile(addEntry.getPath());
                ModificationReport report =
                        fModelMapper.createModificationReport(logEntry.getDate(), logEntry.getMessage(), logEntry
                                .getAuthor());
                fModelMapper.createBranchRevision(
                        logEntry.getRevision(),
                        file,
View Full Code Here

        if (nodeKind == SVNNodeKind.FILE) {
            if (addEntry.getCopyPath() == null) {
                // This is a file that has been added just to the release, without being in the repository
                // (sometimes it happens for READMEs and build files)
                SVNVersionedFile file = (SVNVersionedFile) fModelMapper.createFile(addEntry.getPath());
                ModificationReport report =
                        fModelMapper.createModificationReport(logEntry.getDate(), logEntry.getMessage(), logEntry
                                .getAuthor());
                fModelMapper.createRevision(logEntry.getRevision(), file, changeSet, report, null, false, null);
            } else {
                fModelMapper.addToRelease(release, changeSet, logEntry.getDate(), logEntry.getMessage(), logEntry
View Full Code Here

            SVNLogEntry logEntry,
            Transaction changeSet,
            String movedFromPath) throws SVNImporterException {

        SVNVersionedFile file = (SVNVersionedFile) fModelMapper.createFile(logEntryPath.getPath());
        ModificationReport report;
        if ((logEntryPath.getType() == SVNLogEntryPath.TYPE_MODIFIED) && fCalculateLineChanges) {
            // Calculate line changes depending on user request and create the ModificationReport accordingly
            long prevRevisionNumber =
                    Long.parseLong(fModelMapper.getPreviousRevision(logEntryPath.getPath(), logEntry.getRevision()));
            int[] linesChanged =
View Full Code Here

         */
        SVNRevision revision = getClosestRevision(fromFile, fromRevNum);
        SVNRevision newRevision = new SVNRevision("" + toRevNum);
        newRevision.setChangeSet(changeSet);
        changeSet.addRevision(newRevision); // Transaction -> SVNRevision
        ModificationReport report = this.createModificationReport(date, message, author);

        // Getting the committer role and adding this new revision to it
        for (Role r : report.getAuthor().getRoles()) {
            if (r instanceof CommitterRole) {
                ((CommitterRole) r).addRevision(newRevision);
                break;
            }
        }
View Full Code Here

            String newRevisionFileName = oldRevisionFileName.replaceFirst(fromPath, toPath);
            if (oldRevision.getState() == null) {
                // I create the new SVNRevision which will have as a revision number the one of the branch/release
                // creation
                SVNRevision newRevision = new SVNRevision(revisionNum + "");
                ModificationReport report = this.createModificationReport(creationTime, commitMessage, author);
                newRevision.setReport(report);

                // I also need to create a new File, as it is actually done by the SVN
                // It's the same of the old one, but with a different path
                SVNVersionedFile newFile = (SVNVersionedFile) createFile(newRevisionFileName);
View Full Code Here

        }

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

        ModificationReport report = new ModificationReport();
        report.setCreationTime(creationTime);
        report.setCommitMessage(commitMessage);
        report.setLinesAdd(linesAdded);
        report.setLinesDel(linesDeleted);
        report.setAuthor(authorPerson);

        return report;
    }
View Full Code Here

            // That file does not exist yet
            toUpdate = (SVNVersionedFile) createFile(path);
            toUpdate.setCopiedFrom(toCopy);
            toCopy.setCopiedTo(toUpdate);
            SVNRevision revision = getClosestRevision(toCopy, replacementRevisionNum);
            ModificationReport report = this.createModificationReport(date, message, author);

            SVNRevision newRevision = new SVNRevision("" + currentRevisionNum);
            // Usual SVNRevision initialization
            changeSet.addRevision(newRevision); // Transaction -> SVNRevision
            newRevision.setChangeSet(changeSet); // SVNRevision -> Transaction
View Full Code Here

TOP

Related Classes of org.evolizer.versioncontrol.cvs.model.entities.ModificationReport

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.