Search in sources :

Example 6 with ConfigOp

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

the class ConfigOpTest method testListLocalWithNoLocalRepository.

@Test
public void testListLocalWithNoLocalRepository() {
    ConfigDatabase database = mock(ConfigDatabase.class);
    when(database.getAll()).thenThrow(new ConfigException(StatusCode.INVALID_LOCATION));
    ConfigOp config = new ConfigOp(database);
    exception.expect(ConfigException.class);
    config.setScope(ConfigScope.LOCAL).setAction(ConfigAction.CONFIG_LIST).setName(null).setValue(null).call();
}
Also used : ConfigOp(org.locationtech.geogig.api.porcelain.ConfigOp) ConfigDatabase(org.locationtech.geogig.storage.ConfigDatabase) ConfigException(org.locationtech.geogig.api.porcelain.ConfigException) Test(org.junit.Test)

Example 7 with ConfigOp

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

the class ConfigOpTest method testEmptyNameForUnset.

@Test
public void testEmptyNameForUnset() {
    final ConfigOp config = geogig.command(ConfigOp.class);
    exception.expect(ConfigException.class);
    config.setScope(ConfigScope.GLOBAL).setAction(ConfigAction.CONFIG_UNSET).setName("").setValue(null).call();
}
Also used : ConfigOp(org.locationtech.geogig.api.porcelain.ConfigOp) Test(org.junit.Test)

Example 8 with ConfigOp

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

the class ConfigOpTest method testGetLocalWithNoLocalRepository.

@Test
public void testGetLocalWithNoLocalRepository() {
    ConfigDatabase database = mock(ConfigDatabase.class);
    when(database.get(anyString())).thenThrow(new ConfigException(StatusCode.INVALID_LOCATION));
    ConfigOp config = new ConfigOp(database);
    exception.expect(ConfigException.class);
    config.setScope(ConfigScope.LOCAL).setAction(ConfigAction.CONFIG_GET).setName("section.key").setValue(null).call();
}
Also used : ConfigOp(org.locationtech.geogig.api.porcelain.ConfigOp) ConfigDatabase(org.locationtech.geogig.storage.ConfigDatabase) ConfigException(org.locationtech.geogig.api.porcelain.ConfigException) Test(org.junit.Test)

Example 9 with ConfigOp

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

the class ConfigOpTest method testRemovingMissingSection.

@Test
public void testRemovingMissingSection() {
    final ConfigOp config = geogig.command(ConfigOp.class);
    exception.expect(ConfigException.class);
    config.setScope(ConfigScope.GLOBAL).setAction(ConfigAction.CONFIG_REMOVE_SECTION).setName("unusedsectionname").setValue(null).call();
}
Also used : ConfigOp(org.locationtech.geogig.api.porcelain.ConfigOp) Test(org.junit.Test)

Example 10 with ConfigOp

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

the class ConfigOpTest method testNoNameForRemoveSection.

@Test
public void testNoNameForRemoveSection() {
    final ConfigOp config = geogig.command(ConfigOp.class);
    exception.expect(ConfigException.class);
    config.setScope(ConfigScope.GLOBAL).setAction(ConfigAction.CONFIG_REMOVE_SECTION).setName(null).setValue(null).call();
}
Also used : ConfigOp(org.locationtech.geogig.api.porcelain.ConfigOp) Test(org.junit.Test)

Aggregations

ConfigOp (org.locationtech.geogig.api.porcelain.ConfigOp)22 Test (org.junit.Test)21 Remote (org.locationtech.geogig.api.Remote)4 ConfigException (org.locationtech.geogig.api.porcelain.ConfigException)4 RemoteAddOp (org.locationtech.geogig.api.porcelain.RemoteAddOp)4 ConfigDatabase (org.locationtech.geogig.storage.ConfigDatabase)4 HashMap (java.util.HashMap)3 Map (java.util.Map)2 RemoteListOp (org.locationtech.geogig.api.porcelain.RemoteListOp)2 RemoteRemoveOp (org.locationtech.geogig.api.porcelain.RemoteRemoveOp)2 Matchers.anyString (org.mockito.Matchers.anyString)1