Package org.locationtech.geogig.api

Examples of org.locationtech.geogig.api.GeogigTransaction.command()


        }

        assertEquals(expectedMain, logged);

        // Verify that the transaction has the commit
        logs = t.command(LogOp.class).call();
        logged = new ArrayList<RevCommit>();
        for (; logs.hasNext();) {
            logged.add(logs.next());
        }
View Full Code Here


        // start the first transaction
        GeogigTransaction transaction1 = geogig.command(TransactionBegin.class).call();

        // perform a commit in the transaction
        insertAndAdd(transaction1, points2);
        RevCommit transaction1Commit = transaction1.command(CommitOp.class).setMessage("Commit2")
                .call();

        // Verify that the base repository is unchanged
        Iterator<RevCommit> logs = geogig.command(LogOp.class).call();
        assertEquals(mainCommit, logs.next());
View Full Code Here

        Iterator<RevCommit> logs = geogig.command(LogOp.class).call();
        assertEquals(mainCommit, logs.next());
        assertFalse(logs.hasNext());

        // Verify that the transaction has the commit
        logs = transaction1.command(LogOp.class).call();
        assertEquals(transaction1Commit, logs.next());
        assertEquals(mainCommit, logs.next());
        assertFalse(logs.hasNext());

        // start the second transaction
View Full Code Here

        // start the second transaction
        GeogigTransaction transaction2 = geogig.command(TransactionBegin.class).call();

        // perform a commit in the transaction
        insertAndAdd(transaction2, points3);
        RevCommit transaction2Commit = transaction2.command(CommitOp.class).setMessage("Commit3")
                .call();

        // Verify that the base repository is unchanged
        logs = geogig.command(LogOp.class).call();
        assertEquals(mainCommit, logs.next());
View Full Code Here

        logs = geogig.command(LogOp.class).call();
        assertEquals(mainCommit, logs.next());
        assertFalse(logs.hasNext());

        // Verify that the transaction has the commit
        logs = transaction2.command(LogOp.class).call();
        assertEquals(transaction2Commit, logs.next());
        assertEquals(mainCommit, logs.next());
        assertFalse(logs.hasNext());

        // Commit the first transaction
View Full Code Here

        geogig.command(CheckoutOp.class).setSource("master").call();
        insertAndAdd(points1_modified);
        RevCommit modifiedCommit = geogig.command(CommitOp.class).setMessage("Commit2").call();
        GeogigTransaction tx = geogig.command(TransactionBegin.class).call();
        try {
            tx.command(MergeOp.class).addCommit(Suppliers.ofInstance(mainCommit.getId())).call();
            fail("Expected a merge conflict!");
        } catch (org.locationtech.geogig.api.porcelain.MergeConflictsException e) {
            // expected.
        }
        List<Conflict> txConflicts = tx.command(ConflictsReadOp.class).call();
View Full Code Here

            tx.command(MergeOp.class).addCommit(Suppliers.ofInstance(mainCommit.getId())).call();
            fail("Expected a merge conflict!");
        } catch (org.locationtech.geogig.api.porcelain.MergeConflictsException e) {
            // expected.
        }
        List<Conflict> txConflicts = tx.command(ConflictsReadOp.class).call();
        List<Conflict> baseConflicts = geogig.command(ConflictsReadOp.class).call();
        assertTrue("There should be no conflicts outside the transaction",
                baseConflicts.size() == 0);
        assertTrue("There should be conflicts in the transaction", txConflicts.size() != 0);
    }
View Full Code Here

        // start the first transaction
        GeogigTransaction transaction1 = geogig.command(TransactionBegin.class).call();

        // make a new branch
        transaction1.command(BranchCreateOp.class).setAutoCheckout(true).setName("branch1").call();

        // perform a commit in the transaction
        insertAndAdd(transaction1, points2);
        RevCommit transaction1Commit = transaction1.command(CommitOp.class).setMessage("Commit2")
                .call();
View Full Code Here

        // make a new branch
        transaction1.command(BranchCreateOp.class).setAutoCheckout(true).setName("branch1").call();

        // perform a commit in the transaction
        insertAndAdd(transaction1, points2);
        RevCommit transaction1Commit = transaction1.command(CommitOp.class).setMessage("Commit2")
                .call();

        // Verify that the base repository is unchanged
        Iterator<RevCommit> logs = geogig.command(LogOp.class).call();
        assertEquals(logs.next(), mainCommit);
View Full Code Here

        Iterator<RevCommit> logs = geogig.command(LogOp.class).call();
        assertEquals(logs.next(), mainCommit);
        assertFalse(logs.hasNext());

        // Verify that the transaction has the commit
        logs = transaction1.command(LogOp.class).call();
        assertEquals(logs.next(), transaction1Commit);
        assertEquals(logs.next(), mainCommit);
        assertFalse(logs.hasNext());

        // start the second transaction
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.