}
public void test_430_erase_attribute_still_in_use() {
try {
// erase attribute
UpdatableChronicle chro = db.getChronicle("bt.schema3chro", true).edit();
assertEquals("t1v3", chro.getAttribute("prop1", true).get().toString());
// use the attribute
Attribute<?> a = chro.getAttribute("prop1", true);
a.reset();
chro.setAttribute(a);
chro.applyUpdates();
assertEquals("t1v2", chro.getAttribute("prop1", true).get().toString());
UpdatableSchema schema3 = db.getUpdatableSchemas("schema3").iterator().next();
schema3.addAttribute(1);
schema3.eraseAttribute(1);
schema3.applyUpdates();
assertEquals(null, schema3.getAttributeDefinition("prop1", false));
// value still here because it's the default value, which is not in the chronicle
assertEquals("t1v2", chro.getAttribute("prop1", true).get().toString());
} catch (Exception e) {
fail(e.getMessage());
}
}