use of org.eclipse.xtext.validation.csvalidationtest.impl.TransientObjectImpl in project xtext-core by eclipse.
the class ConcreteSyntaxValidationTest method testTransientObject.
@Test
public void testTransientObject() {
TransientObject to = new TransientObjectImpl() {
@Override
public boolean eIsSet(int featureID) {
switch(featureID) {
case CsvalidationtestPackage.TRANSIENT_OBJECT__NESTED:
return nested != null && !"default".equals(nested.getVal2());
}
return super.eIsSet(featureID);
}
@Override
public EList<EObject> eContents() {
EList<EObject> r = new BasicEList<EObject>();
if (nested != null)
r.add(nested);
return r;
}
};
to.setNested(f.createTransientObjectSub());
to.getNested().setVal2("default");
validate(to).assertOK();
to.setVal1("xxx");
to.getNested().setVal2("something");
to.getNested().setVal3("something");
validate(to).assertOK();
}
Aggregations