use of com.runwaysdk.dataaccess.database.DuplicateDataDatabaseException in project geoprism-registry by terraframe.
the class ListTypeInheritedHierarchyTest method testMarkAsInvalidByInheritedParent.
@Test
@Request
public void testMarkAsInvalidByInheritedParent() {
JsonObject json = ListTypeTest.getJson(USATestData.ORG_NPS.getServerObject(), USATestData.HIER_SCHOOL, USATestData.SCHOOL_ZONE, USATestData.DISTRICT, USATestData.STATE);
ListType masterlist = ListType.apply(json);
try {
masterlist.markAsInvalid(USATestData.HIER_ADMIN.getServerObject(), USATestData.STATE.getServerObject());
Assert.assertFalse(masterlist.isValid());
} catch (DuplicateDataDatabaseException e) {
masterlist.delete();
}
}
use of com.runwaysdk.dataaccess.database.DuplicateDataDatabaseException in project geoprism-registry by terraframe.
the class ListTypeTest method testCreateMultipleNonMaster.
// @Test
// @Request
// public void testCreateMultiple()
// {
// JsonObject json = getJson(USATestData.ORG_NPS.getServerObject(),
// USATestData.HIER_ADMIN, USATestData.STATE, ListType.PUBLIC, true);
//
// ListType test1 = ListType.apply(json);
//
// try
// {
// json.addProperty(ListType.CODE, "CODE_2");
//
// ListType test2 = ListType.apply(json);
// test2.delete();
//
// Assert.fail("Able to apply multiple masterlists with the same universal");
// }
// catch (DuplicateListTypeException e)
// {
// test1.delete();
// }
// }
//
@Test
@Request
public void testCreateMultipleNonMaster() {
JsonObject json = getJson(USATestData.ORG_NPS.getServerObject(), USATestData.HIER_ADMIN, USATestData.STATE);
ListType test1 = ListType.apply(json);
try {
json.addProperty(ListType.CODE, "CODE_2");
ListType test2 = ListType.apply(json);
test2.delete();
} catch (DuplicateDataDatabaseException e) {
test1.delete();
Assert.fail("Not able to apply multiple masterlists with the same universal when list is not a master");
}
}
use of com.runwaysdk.dataaccess.database.DuplicateDataDatabaseException in project geoprism-registry by terraframe.
the class ListTypeTest method testMarkAsInvalidByParent.
@Test
@Request
public void testMarkAsInvalidByParent() {
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.STATE.getServerObject());
Assert.assertFalse(masterlist.getValid());
} catch (DuplicateDataDatabaseException e) {
masterlist.delete();
}
}
use of com.runwaysdk.dataaccess.database.DuplicateDataDatabaseException in project geoprism-registry by terraframe.
the class ListTypeTest method testMarkAsInvalidByDirectType.
@Test
@Request
public void testMarkAsInvalidByDirectType() {
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.DISTRICT.getServerObject());
Assert.assertFalse(masterlist.getValid());
} catch (DuplicateDataDatabaseException e) {
masterlist.delete();
}
}
use of com.runwaysdk.dataaccess.database.DuplicateDataDatabaseException in project geoprism-registry by terraframe.
the class ListTypeTest method testMarkAllAsInvalid.
@Test
@Request
public void testMarkAllAsInvalid() {
JsonObject json = getJson(USATestData.ORG_NPS.getServerObject(), USATestData.HIER_ADMIN, USATestData.STATE);
ListType masterlist = ListType.apply(json);
try {
ListType.markAllAsInvalid(USATestData.HIER_ADMIN.getServerObject(), USATestData.STATE.getServerObject());
ListType test = ListType.get(masterlist.getOid());
Assert.assertFalse(test.getValid());
} catch (DuplicateDataDatabaseException e) {
masterlist.delete();
}
}
Aggregations