use of org.locationtech.geogig.api.porcelain.RemoteAddOp in project GeoGig by boundlessgeo.
the class RemoteAddOpTest method testAddRemoteThatExists.
@Test
public void testAddRemoteThatExists() {
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();
}
use of org.locationtech.geogig.api.porcelain.RemoteAddOp 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());
}
Aggregations