Package org.evolizer.versioncontrol.svn.model.entities

Examples of org.evolizer.versioncontrol.svn.model.entities.SVNVersionedFile


         * it is created on the fly.
         */

        Transaction t = sModelMapper.createTransaction(new Date(13143647));
        ModificationReport m = sModelMapper.createModificationReport(new Date(132323), "another message", sAuthorName);
        SVNVersionedFile f = sModelMapper.createFile("/file.txt");
        SVNRevision rev2 =
            sModelMapper.createBranchRevision(2, f, t, m, null, false, "These are the new contents", "branch");

        // Check the branch was created and was added to the related field
        Field branchesField = SVNModelMapper.class.getDeclaredField("fBranches");
View Full Code Here


        assertEquals("The test transaction does not contain the test revision", sRev.getId(), toAnalyze.getInvolvedRevisions().iterator().next().getId());
        assertEquals("The test revision's author is not what expected", sRev.getAuthor().getId(), toAnalyze.getInvolvedRevisions().iterator().next().getAuthor().getId());

        Person p = sSession.uniqueResult("from Person as p where p.firstName ='" + sAuthor.getFirstName() + "'", Person.class);
        CommitterRole r = (CommitterRole) p.getRoles().iterator().next();
        SVNVersionedFile f = sSession.uniqueResult("from SVNVersionedFile where path= '/rootDir/dir/file.txt'", SVNVersionedFile.class);
        assertEquals(toAnalyze.getInvolvedRevisions().iterator().next().getId(), f.getRevisions().iterator().next().getId());
        assertEquals("The saved revision was not associated to its saved author", r.getArtifacts().iterator().next(), toAnalyze.getInvolvedRevisions().iterator().next());
    }
View Full Code Here

     */
    @Test
    public void testRemoveFromRelease() throws Exception{
        Transaction t = sModelMapper.createTransaction(new Date(97897899));
        ModificationReport m = sModelMapper.createModificationReport(new Date(155323), "another message", sAuthorName);
        SVNVersionedFile f = sModelMapper.createFile("/rootDir/dir/file2.txt");
        sModelMapper.createRevision(2, f, t, m, null, false, "These are the new contents");
        sModelMapper.finalizeTransaction(t, new ArrayList<String>());
       
        Transaction newTrans = sModelMapper.createTransaction(new Date(1576763378));
        SVNRelease newRel =
View Full Code Here

     */
    @Test
    public void testReplaceInRelease() throws Exception{
        Transaction t = sModelMapper.createTransaction(new Date(97897899));
        ModificationReport m = sModelMapper.createModificationReport(new Date(155323), "another message", sAuthorName);
        SVNVersionedFile f = sModelMapper.createFile("/rootDir2/dir/file3.txt");
        sModelMapper.createRevision(2, f, t, m, null, false, "These are the new contents");
        sModelMapper.finalizeTransaction(t, new ArrayList<String>());
       
       
        Transaction newTrans = sModelMapper.createTransaction(new Date(1599997378));
View Full Code Here

     */
    @Test
    public void testRemoveFromBranch() throws Exception {
        Transaction t = sModelMapper.createTransaction(new Date(97897899));
        ModificationReport m = sModelMapper.createModificationReport(new Date(155323), "another message", sAuthorName);
        SVNVersionedFile f = sModelMapper.createFile("/rootDir/dir/file2.txt");
        sModelMapper.createRevision(2, f, t, m, null, false, "These are the new contents");
        sModelMapper.finalizeTransaction(t, new ArrayList<String>());
       
        Transaction newTrans = sModelMapper.createTransaction(new Date(1576763378));
               
View Full Code Here

    /**
     * Tests files that were moved and deleted
     */
    @Test
    public void testMoveAndDelete() {
        SVNVersionedFile newerFile = getFile("/trunk/httpunit/index.html");
        assertNotNull("File /trunk/httpunit/index.html doesn't exist in the data extracted", newerFile);

        SVNVersionedFile f = getFile("/trunk/httpunit/doc/index.html");
        assertNotNull("File /trunk/httpunit/doc/index.html doesn't exist in the data extracted", newerFile);
        assertEquals("The last version of File " + f.getPath()
                + " is not the one expected (the one in which the move was made)", "22", f.getLatestRevision()
                .getNumber());
        assertEquals(
                "The first version of File " + newerFile.getPath()
                        + " is not the one expected (the one in which the move was made, and thus the file created)",
                "22",
                getFirstRevision(newerFile).getNumber());
        assertEquals(
                "The original file, " + newerFile.getPath() + " is coming doesn't have a link to the moved file",
                newerFile,
                f.getCopiedTo());
        assertEquals("File " + newerFile.getPath() + " is not linked to the one it has been copied from", newerFile
                .getCopiedFrom(), f);
        assertEquals(((SVNRevision) getFirstRevision(newerFile)).getAncestor(), f.getLatestRevision());
        newerFile = f;

        SVNVersionedFile deletedFile =
                getFile("/trunk/httpunit/src/com/meterware/httpunit/UncheckedParameterCollection.java");
        assertNotNull(
                "File /trunk/httpunit/src/com/meterware/httpunit/UncheckedParameterCollection.java doesn't exist in the data extracted",
                deletedFile);
        assertEquals("209", deletedFile.getLatestRevision().getNumber());
    }
View Full Code Here

    /**
     * Tests files that were moved and deleted
     */
    @Test
    public void testMoveAndDelete() {
        SVNVersionedFile newerFile = getFile("/importer_test/trunk/project/TestFile2.txt");
        assertNotNull(
                "File /importer_test/trunk/project/TestFile2.txt doesn't exist in the data extracted",
                newerFile);
       
            SVNVersionedFile f = getFile("/importer_test/trunk/project/TestFolder1/TestFile2.txt");
            assertNotNull("File /importer_test/trunk/project/TestFolder1/TestFile2.txt doesn't exist in the data extracted", f);
            assertEquals("The last version of File " + f.getPath()
                    + " is not the one expected (the one in which the move was made)", "23", f.getLatestRevision().getNumber());
            assertEquals("The first version of File " + newerFile.getPath()
                    + " is not the one expected (the one in which the move was made, and thus the file created)",
                    "23", newerFile.getRevisions().get(0).getNumber());
            assertEquals("The original file " + newerFile.getPath()
                    + " doesn't have a link to the moved file", newerFile, f.getCopiedTo());
            assertEquals(
                    "File " + newerFile.getPath() + " is not linked to the one it has been copied from",
                    newerFile.getCopiedFrom(),
                    f);
            assertEquals(((SVNRevision) newerFile.getRevisions().get(0)).getAncestor(), f.getLatestRevision());
            newerFile = f;
            f = getFile("/importer_test/trunk/project/TestFolder2/TestFile2.txt");
            assertNotNull("File /importer_test/trunk/project/TestFolder2/TestFile2.txt doesn't exist in the data extracted", f);
            assertEquals("The last version of File " + f.getPath()
                    + " is not the one expected (the one in which the move was made)", "11", f.getLatestRevision().getNumber());
            assertEquals("The first version of File " + newerFile.getPath()
                    + " is not the one expected (the one in which the move was made, and thus the file created)",
                    "11", getFirstRevision(newerFile).getNumber());
            assertEquals("The original file " + newerFile.getPath()
                    + " doesn't have a link to the moved file", newerFile, f.getCopiedTo());
            assertEquals(
                    "File " + newerFile.getPath() + " is not linked to the one it has been copied from",
                    newerFile.getCopiedFrom(),
                    f);
            assertEquals(((SVNRevision) getFirstRevision(newerFile)).getAncestor(), f.getLatestRevision());
           
            SVNVersionedFile deletedFile = getFile("/importer_test/trunk/project/TestFolder1/TestFile4.txt");
            assertNotNull(
                    "File /importer_test/trunk/project/TestFolder1/TestFile4.txt doesn't exist in the data extracted",
                    deletedFile);
            assertEquals("23", deletedFile.getLatestRevision().getNumber());
       
    }
View Full Code Here

    public void testFileContent()
            throws SecurityException,
            IllegalArgumentException,
            NoSuchFieldException,
            IllegalAccessException {
        SVNVersionedFile f = getFile("/importer_test/trunk/project/TestFile2.txt");
        for (Revision ver : f.getRevisions()) {
            if (ver.getNumber().compareTo("23") == 0) {
                assertEquals(
                        "The file extracted in the import is not as the one residing in the repository",
                        fetchFile("/importer_test/trunk/project/TestFile2.txt", 23),
                        ver.getSourceCodeWrapper().getSource());
View Full Code Here

     * Tests files that were moved and deleted
     */
    @Test
    public void testMoveAndDelete() {
        if (props.getProperty("movedFileName") != null || props.getProperty("movedFileName").compareTo("") != 0) {
            SVNVersionedFile newerFile = getFile(props.getProperty("movedFileName"));
            assertNotNull(
                    "File " + props.getProperty("movedFileName") + " doesn't exist in the data extracted",
                    newerFile);
            for (int i = 1; i <= Integer.parseInt(props.getProperty("totMoves")); i++) {
                SVNVersionedFile f = getFile(props.getProperty("move" + i + ".source"));
                assertNotNull("File " + props.getProperty("move" + i + ".source")
                        + " doesn't exist in the data extracted", newerFile);
                assertEquals("The last version of File " + f.getPath()
                        + " is not the one expected (the one in which the move was made)", (Long) Long.parseLong(props
                        .getProperty("move" + i + ".revision")), (Long) Long.parseLong(f.getLatestRevision()
                        .getNumber()));
                assertEquals(
                        "The first version of File "
                                + newerFile.getPath()
                                + " is not the one expected (the one in which the move was made, and thus the file created)",
                        (Long) Long.parseLong(props.getProperty("move" + i + ".revision")),
                        (Long) Long.parseLong(newerFile.getRevisions().get(0).getNumber()));
                assertEquals("The original file, " + newerFile.getPath()
                        + " is coming doesn't have a link to the moved file", newerFile, f.getCopiedTo());
                assertEquals(
                        "File " + newerFile.getPath() + " is not linked to the one it has been copied from",
                        newerFile.getCopiedFrom(),
                        f);
                assertEquals(((SVNRevision) newerFile.getRevisions().get(0)).getAncestor(), f.getLatestRevision());
                newerFile = f;
            }
        } else {
            SVNVersionedFile deletedFile = getFile(props.getProperty("deletedFileName"));
            assertNotNull(
                    "File " + props.getProperty("deletedFileName") + " doesn't exist in the data extracted",
                    deletedFile);
            assertEquals((Long) Long.parseLong(props.getProperty("deleteRevision")), (Long) Long.parseLong(deletedFile
                    .getLatestRevision().getNumber()));
        }
    }
View Full Code Here

        // Check if path points to a directory or a file on current revision
        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(),
View Full Code Here

TOP

Related Classes of org.evolizer.versioncontrol.svn.model.entities.SVNVersionedFile

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.