use of org.locationtech.geogig.api.porcelain.ConfigOp in project GeoGig by boundlessgeo.
the class RemoteRemoveOpTest method testRemoveRemoteWithNoURL.
@Test
public void testRemoveRemoteWithNoURL() {
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 RemoteRemoveOp remoteRemove = geogig.command(RemoteRemoveOp.class);
Remote deletedRemote = remoteRemove.setName(remoteName).call();
assertEquals(remoteName, deletedRemote.getName());
assertEquals("", deletedRemote.getFetchURL());
assertEquals("", deletedRemote.getPushURL());
assertEquals("+refs/heads/*:refs/remotes/" + remoteName + "/*", deletedRemote.getFetch());
}
use of org.locationtech.geogig.api.porcelain.ConfigOp in project GeoGig by boundlessgeo.
the class RemoteRemoveOpTest method testRemoveRemoteWithNoFetch.
@Test
public void testRemoveRemoteWithNoFetch() {
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();
final RemoteRemoveOp remoteRemove = geogig.command(RemoteRemoveOp.class);
Remote deletedRemote = remoteRemove.setName(remoteName).call();
assertEquals(remoteName, deletedRemote.getName());
assertEquals(remoteURL, deletedRemote.getFetchURL());
assertEquals(remoteURL, deletedRemote.getPushURL());
assertEquals("", deletedRemote.getFetch());
}
use of org.locationtech.geogig.api.porcelain.ConfigOp in project GeoGig by boundlessgeo.
the class RemoteListOpTest method testListRemoteWithNoFetch.
@Test
public void testListRemoteWithNoFetch() {
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();
final RemoteListOp remoteList = geogig.command(RemoteListOp.class);
ImmutableList<Remote> allRemotes = remoteList.call();
assertTrue(allRemotes.isEmpty());
}
use of org.locationtech.geogig.api.porcelain.ConfigOp in project GeoGig by boundlessgeo.
the class RemoteListOpTest method testListRemoteWithNoURL.
@Test
public void testListRemoteWithNoURL() {
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);
ImmutableList<Remote> allRemotes = remoteList.call();
assertTrue(allRemotes.isEmpty());
}
use of org.locationtech.geogig.api.porcelain.ConfigOp in project GeoGig by boundlessgeo.
the class ConfigOpTest method testEmptyNameAndValueForSet.
@Test
public void testEmptyNameAndValueForSet() {
final ConfigOp config = geogig.command(ConfigOp.class);
exception.expect(ConfigException.class);
config.setScope(ConfigScope.GLOBAL).setAction(ConfigAction.CONFIG_SET).setName("").setValue("").call();
}
Aggregations