Search in sources :

Example 11 with RemoteAddOp

use of org.locationtech.geogig.api.porcelain.RemoteAddOp in project GeoGig by boundlessgeo.

the class RemoteAddOpTest method testEmptyName.

@Test
public void testEmptyName() {
    final RemoteAddOp remoteAdd = geogig.command(RemoteAddOp.class);
    exception.expect(RemoteException.class);
    remoteAdd.setName("").setURL("http://test.com").call();
}
Also used : RemoteAddOp(org.locationtech.geogig.api.porcelain.RemoteAddOp) Test(org.junit.Test)

Example 12 with RemoteAddOp

use of org.locationtech.geogig.api.porcelain.RemoteAddOp in project GeoGig by boundlessgeo.

the class RemoteAddOpTest method testNullURL.

@Test
public void testNullURL() {
    final RemoteAddOp remoteAdd = geogig.command(RemoteAddOp.class);
    exception.expect(RemoteException.class);
    remoteAdd.setName("myremote").setURL(null).call();
}
Also used : RemoteAddOp(org.locationtech.geogig.api.porcelain.RemoteAddOp) Test(org.junit.Test)

Example 13 with RemoteAddOp

use of org.locationtech.geogig.api.porcelain.RemoteAddOp in project GeoGig by boundlessgeo.

the class RemoteAddOpTest method testNullName.

@Test
public void testNullName() {
    final RemoteAddOp remoteAdd = geogig.command(RemoteAddOp.class);
    exception.expect(RemoteException.class);
    remoteAdd.setName(null).setURL("http://test.com").call();
}
Also used : RemoteAddOp(org.locationtech.geogig.api.porcelain.RemoteAddOp) Test(org.junit.Test)

Example 14 with RemoteAddOp

use of org.locationtech.geogig.api.porcelain.RemoteAddOp in project GeoGig by boundlessgeo.

the class RemoteRemoveOpTest method testRemoveNonexistentRemote.

@Test
public void testRemoveNonexistentRemote() {
    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();
}
Also used : RemoteRemoveOp(org.locationtech.geogig.api.porcelain.RemoteRemoveOp) RemoteAddOp(org.locationtech.geogig.api.porcelain.RemoteAddOp) Remote(org.locationtech.geogig.api.Remote) Test(org.junit.Test)

Example 15 with RemoteAddOp

use of org.locationtech.geogig.api.porcelain.RemoteAddOp in project GeoGig by boundlessgeo.

the class RemoteAddOpTest method testAddRemoteWithBranch.

@Test
public void testAddRemoteWithBranch() {
    final RemoteAddOp remoteAdd = geogig.command(RemoteAddOp.class);
    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());
}
Also used : RemoteAddOp(org.locationtech.geogig.api.porcelain.RemoteAddOp) Remote(org.locationtech.geogig.api.Remote) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)17 RemoteAddOp (org.locationtech.geogig.api.porcelain.RemoteAddOp)17 Remote (org.locationtech.geogig.api.Remote)13 RemoteRemoveOp (org.locationtech.geogig.api.porcelain.RemoteRemoveOp)5 ConfigOp (org.locationtech.geogig.api.porcelain.ConfigOp)4 RemoteListOp (org.locationtech.geogig.api.porcelain.RemoteListOp)3 Ref (org.locationtech.geogig.api.Ref)1 UpdateRef (org.locationtech.geogig.api.plumbing.UpdateRef)1