Package org.locationtech.geogig.api

Examples of org.locationtech.geogig.api.Remote


        String remoteName2 = "myremote2";
        String remoteURL2 = "http://test2.org";
        String branch = "mybranch";

        Remote remote = remoteAdd.setName(remoteName1).setURL(remoteURL1).call();

        assertEquals(remoteName1, remote.getName());
        assertEquals(remoteURL1, remote.getFetchURL());
        assertEquals(remoteURL1, remote.getPushURL());
        assertEquals("+refs/heads/*:refs/remotes/" + remoteName1 + "/*", remote.getFetch());

        remote = remoteAdd.setName(remoteName2).setURL(remoteURL2).setBranch(branch).call();

        assertEquals(remoteName2, remote.getName());
        assertEquals(remoteURL2, remote.getFetchURL());
        assertEquals(remoteURL2, remote.getPushURL());
        assertEquals("+refs/heads/" + branch + ":refs/remotes/" + remoteName2 + "/" + branch,
                remote.getFetch());

        final RemoteListOp remoteList = geogig.command(RemoteListOp.class);

        ImmutableList<Remote> allRemotes = remoteList.call();

        assertEquals(2, allRemotes.size());

        Remote firstRemote = allRemotes.get(0);
        Remote secondRemote = allRemotes.get(1);

        if (!firstRemote.getName().equals(remoteName1)) {
            // swap first and second
            Remote tempRemote = firstRemote;
            firstRemote = secondRemote;
            secondRemote = tempRemote;
        }

        assertEquals(remoteName1, firstRemote.getName());
View Full Code Here


        final RemoteAddOp remoteAdd = geogig.command(RemoteAddOp.class);

        String remoteName = "myremote";
        String remoteURL = "http://test.com";

        Remote remote = remoteAdd.setName(remoteName).setURL(remoteURL).call();

        assertEquals(remoteName, remote.getName());
        assertEquals(remoteURL, remote.getFetchURL());
        assertEquals(remoteURL, remote.getPushURL());
        assertEquals("+refs/heads/*:refs/remotes/" + remoteName + "/*", remote.getFetch());

        final ConfigOp config = geogig.command(ConfigOp.class);
        config.setAction(ConfigAction.CONFIG_UNSET).setName("remote." + remoteName + ".url").call();

        final RemoteListOp remoteList = geogig.command(RemoteListOp.class);
View Full Code Here

        final RemoteAddOp remoteAdd = geogig.command(RemoteAddOp.class);

        String remoteName = "myremote";
        String remoteURL = "http://test.com";

        Remote remote = remoteAdd.setName(remoteName).setURL(remoteURL).call();

        assertEquals(remoteName, remote.getName());
        assertEquals(remoteURL, remote.getFetchURL());
        assertEquals(remoteURL, remote.getPushURL());
        assertEquals("+refs/heads/*:refs/remotes/" + remoteName + "/*", remote.getFetch());

        final ConfigOp config = geogig.command(ConfigOp.class);
        config.setAction(ConfigAction.CONFIG_UNSET).setName("remote." + remoteName + ".fetch")
                .call();

View Full Code Here

    @Override
    protected TransferSummary _call() {

        final String remoteName = this.remoteName == null ? "origin" : this.remoteName;

        final Remote remote = resolveRemote(remoteName);

        final List<TransferableRef> refsToPush = resolveRefs();

        SendPack sendPack = command(SendPack.class);
        sendPack.setRemote(remote);
View Full Code Here

        final RemoteAddOp remoteAdd = geogig.command(RemoteAddOp.class);

        String remoteName = "myremote";
        String remoteURL = "http://test.com";

        Remote remote = remoteAdd.setName(remoteName).setURL(remoteURL).setBranch(null).call();

        assertEquals(remoteName, remote.getName());
        assertEquals(remoteURL, remote.getFetchURL());
        assertEquals(remoteURL, remote.getPushURL());
        assertEquals("+refs/heads/*:refs/remotes/" + remoteName + "/*", remote.getFetch());
    }
View Full Code Here

        final RemoteAddOp remoteAdd = geogig.command(RemoteAddOp.class);

        String remoteName = "myremote";
        String remoteURL = "http://test.com";

        Remote remote = remoteAdd.setName(remoteName).setURL(remoteURL).setBranch("").call();

        assertEquals(remoteName, remote.getName());
        assertEquals(remoteURL, remote.getFetchURL());
        assertEquals(remoteURL, remote.getPushURL());
        assertEquals("+refs/heads/*:refs/remotes/" + remoteName + "/*", remote.getFetch());
    }
View Full Code Here

        String remoteName = "myremote";
        String remoteURL = "http://test.com";
        String branch = "mybranch";

        Remote remote = remoteAdd.setName(remoteName).setURL(remoteURL).setBranch(branch).call();

        assertEquals(remoteName, remote.getName());
        assertEquals(remoteURL, remote.getFetchURL());
        assertEquals(remoteURL, remote.getPushURL());
        assertEquals("+refs/heads/" + branch + ":refs/remotes/" + remoteName + "/" + branch,
                remote.getFetch());
    }
View Full Code Here

        final RemoteAddOp remoteAdd = geogig.command(RemoteAddOp.class);

        String remoteName = "myremote";
        String remoteURL = "http://test.com";

        Remote remote = remoteAdd.setName(remoteName).setURL(remoteURL).call();

        assertEquals(remoteName, remote.getName());
        assertEquals(remoteURL, remote.getFetchURL());
        assertEquals(remoteURL, remote.getPushURL());
        assertEquals("+refs/heads/*:refs/remotes/" + remoteName + "/*", remote.getFetch());

        exception.expect(RemoteException.class);
        remoteAdd.setName(remoteName).setURL("someotherurl.com").call();
    }
View Full Code Here

        String remoteURL1 = "http://test.com";

        String remoteName2 = "myremote2";
        String remoteURL2 = "http://test2.org";

        Remote remote = remoteAdd.setName(remoteName1).setURL(remoteURL1).call();

        assertEquals(remoteName1, remote.getName());
        assertEquals(remoteURL1, remote.getFetchURL());
        assertEquals(remoteURL1, remote.getPushURL());
        assertEquals("+refs/heads/*:refs/remotes/" + remoteName1 + "/*", remote.getFetch());

        remote = remoteAdd.setName(remoteName2).setURL(remoteURL2).call();

        assertEquals(remoteName2, remote.getName());
        assertEquals(remoteURL2, remote.getFetchURL());
        assertEquals(remoteURL2, remote.getPushURL());
        assertEquals("+refs/heads/*:refs/remotes/" + remoteName2 + "/*", remote.getFetch());
    }
View Full Code Here

        final RemoteAddOp remoteAdd = geogig.command(RemoteAddOp.class);

        String remoteName = "myremote";
        String remoteURL = "http://test.com";

        Remote remote = remoteAdd.setName(remoteName).setURL(remoteURL).call();

        assertEquals(remoteName, remote.getName());
        assertEquals(remoteURL, remote.getFetchURL());
        assertEquals(remoteURL, remote.getPushURL());
        assertEquals("+refs/heads/*:refs/remotes/" + remoteName + "/*", remote.getFetch());

        final RemoteRemoveOp remoteRemove = geogig.command(RemoteRemoveOp.class);

        exception.expect(RemoteException.class);
        remoteRemove.setName("nonexistent").call();
View Full Code Here

TOP

Related Classes of org.locationtech.geogig.api.Remote

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.