use of org.locationtech.geogig.api.porcelain.ConfigOp in project GeoGig by boundlessgeo.
the class ConfigOpTest method testEmptyNameAndValueForGet.
@Test
public void testEmptyNameAndValueForGet() {
final ConfigOp config = geogig.command(ConfigOp.class);
exception.expect(ConfigException.class);
config.setScope(ConfigScope.GLOBAL).setAction(ConfigAction.CONFIG_GET).setName("").setValue("").call();
}
use of org.locationtech.geogig.api.porcelain.ConfigOp in project GeoGig by boundlessgeo.
the class ConfigOpTest method testFallback.
@Test
public void testFallback() {
final ConfigOp config = geogig.command(ConfigOp.class);
// Set a value in global config, then try to get value from local even though
// we're not in a valid repository
config.setAction(ConfigAction.CONFIG_SET).setScope(ConfigScope.GLOBAL).setName("section.key").setValue("1").call();
Optional<Map<String, String>> value = config.setAction(ConfigAction.CONFIG_GET).setScope(ConfigScope.LOCAL).setName("section.key").setValue(null).call();
assertTrue(value.isPresent());
assertEquals("1", value.get().get("section.key"));
value = Optional.absent();
value = config.setAction(ConfigAction.CONFIG_GET).setScope(ConfigScope.LOCAL).setName("section.key").setValue("").call();
assertTrue(value.isPresent());
assertEquals("1", value.get().get("section.key"));
}
use of org.locationtech.geogig.api.porcelain.ConfigOp in project GeoGig by boundlessgeo.
the class ConfigOpTest method testNoNameForUnset.
@Test
public void testNoNameForUnset() {
final ConfigOp config = geogig.command(ConfigOp.class);
exception.expect(ConfigException.class);
config.setScope(ConfigScope.GLOBAL).setAction(ConfigAction.CONFIG_UNSET).setName(null).setValue(null).call();
}
use of org.locationtech.geogig.api.porcelain.ConfigOp in project GeoGig by boundlessgeo.
the class ConfigOpTest method testNoNameForSet.
@Test
public void testNoNameForSet() {
final ConfigOp config = geogig.command(ConfigOp.class);
exception.expect(ConfigException.class);
config.setScope(ConfigScope.GLOBAL).setAction(ConfigAction.CONFIG_SET).setName(null).setValue(null).call();
}
use of org.locationtech.geogig.api.porcelain.ConfigOp in project GeoGig by boundlessgeo.
the class ConfigOpTest method testEmptyNameForRemoveSection.
@Test
public void testEmptyNameForRemoveSection() {
final ConfigOp config = geogig.command(ConfigOp.class);
exception.expect(ConfigException.class);
config.setScope(ConfigScope.GLOBAL).setAction(ConfigAction.CONFIG_REMOVE_SECTION).setName("").call();
}
Aggregations