Search in sources :

Example 6 with DuplicateDataDatabaseException

use of com.runwaysdk.dataaccess.database.DuplicateDataDatabaseException in project geoprism-registry by terraframe.

the class ListTypeTest method testFailMarkAsInvalidByType.

@Test
@Request
public void testFailMarkAsInvalidByType() {
    JsonObject json = getJson(USATestData.ORG_NPS.getServerObject(), USATestData.HIER_ADMIN, USATestData.DISTRICT, USATestData.COUNTRY, USATestData.STATE);
    ListType masterlist = ListType.apply(json);
    try {
        masterlist.markAsInvalid(USATestData.HIER_ADMIN.getServerObject(), USATestData.COUNTY.getServerObject());
        Assert.assertTrue(masterlist.isValid());
    } catch (DuplicateDataDatabaseException e) {
        masterlist.delete();
    }
}
Also used : SingleListType(net.geoprism.registry.SingleListType) IntervalListType(net.geoprism.registry.IntervalListType) ListType(net.geoprism.registry.ListType) IncrementalListType(net.geoprism.registry.IncrementalListType) JsonObject(com.google.gson.JsonObject) DuplicateDataDatabaseException(com.runwaysdk.dataaccess.database.DuplicateDataDatabaseException) ClassificationTypeTest(net.geoprism.registry.classification.ClassificationTypeTest) Test(org.junit.Test) Request(com.runwaysdk.session.Request)

Example 7 with DuplicateDataDatabaseException

use of com.runwaysdk.dataaccess.database.DuplicateDataDatabaseException in project geoprism-registry by terraframe.

the class ListTypeTest method testFailMarkAsInvalidByHierarchy.

@Test
@Request
public void testFailMarkAsInvalidByHierarchy() {
    JsonObject json = getJson(USATestData.ORG_NPS.getServerObject(), USATestData.HIER_ADMIN, USATestData.DISTRICT, USATestData.COUNTRY, USATestData.STATE);
    ListType masterlist = ListType.apply(json);
    try {
        masterlist.markAsInvalid(USATestData.HIER_SCHOOL.getServerObject(), USATestData.DISTRICT.getServerObject());
        Assert.assertTrue(masterlist.isValid());
    } catch (DuplicateDataDatabaseException e) {
        masterlist.delete();
    }
}
Also used : SingleListType(net.geoprism.registry.SingleListType) IntervalListType(net.geoprism.registry.IntervalListType) ListType(net.geoprism.registry.ListType) IncrementalListType(net.geoprism.registry.IncrementalListType) JsonObject(com.google.gson.JsonObject) DuplicateDataDatabaseException(com.runwaysdk.dataaccess.database.DuplicateDataDatabaseException) ClassificationTypeTest(net.geoprism.registry.classification.ClassificationTypeTest) Test(org.junit.Test) Request(com.runwaysdk.session.Request)

Aggregations

JsonObject (com.google.gson.JsonObject)7 DuplicateDataDatabaseException (com.runwaysdk.dataaccess.database.DuplicateDataDatabaseException)7 Request (com.runwaysdk.session.Request)7 ListType (net.geoprism.registry.ListType)7 Test (org.junit.Test)7 IncrementalListType (net.geoprism.registry.IncrementalListType)6 IntervalListType (net.geoprism.registry.IntervalListType)6 SingleListType (net.geoprism.registry.SingleListType)6 ClassificationTypeTest (net.geoprism.registry.classification.ClassificationTypeTest)6