use of org.eclipse.xtext.ide.tests.testlanguage.partialSerializationTestLanguage.MandatoryValue in project xtext-core by eclipse.
the class PartialSerializerTest method testOptionalChildListInsertIntoFirst.
@Test
public void testOptionalChildListInsertIntoFirst() {
ITextRegionAccess diff = recordDiff(OptionalChildList.class, "#13 x2", (OptionalChildList it) -> {
MandatoryValue newMandatoryValue = fac.createMandatoryValue();
newMandatoryValue.setName("x1");
it.getChildren().add(0, newMandatoryValue);
});
String expectation = "0 0 H\n" + " B OptionalChildList Model\n" + "0 3 S \"#13\" Model:'#13'\n" + "3 1 1 H \" \" Whitespace:TerminalRule'WS'\n" + " B MandatoryValue'x1' MandatoryValue path:OptionalChildList/children[0]\n" + "4 2 1 S \"x1\" MandatoryValue:name=ID\n" + " E MandatoryValue'x1' MandatoryValue path:OptionalChildList/children[0]\n" + "6 0 1 H\n" + " B MandatoryValue'x2' OptionalChildList:children+=MandatoryValue path:OptionalChildList/children[1]\n" + "6 2 S \"x2\" MandatoryValue:name=ID\n" + " E MandatoryValue'x2' OptionalChildList:children+=MandatoryValue path:OptionalChildList/children[1]\n" + " E OptionalChildList Model\n" + "8 0 H\n" + "------------ diff 1 ------------\n" + "3 1 H \" \" Whitespace:TerminalRule'WS'\n" + "4 2 S \"x2\" MandatoryValue:name=ID\n";
changeSerializerTestHelper.operator_tripleEquals(diff, expectation);
}
use of org.eclipse.xtext.ide.tests.testlanguage.partialSerializationTestLanguage.MandatoryValue in project xtext-core by eclipse.
the class PartialSerializerTest method testOptionalChildListInsertIntoEmpty.
@Test
public void testOptionalChildListInsertIntoEmpty() {
ITextRegionAccess diff = recordDiff(OptionalChildList.class, "#13", (OptionalChildList it) -> {
MandatoryValue newMandatoryValue = fac.createMandatoryValue();
newMandatoryValue.setName("foo");
it.getChildren().add(newMandatoryValue);
});
String expectation = "0 0 H\n" + " B OptionalChildList Model\n" + "0 3 1 S \"#13\" Model:'#13'\n" + "3 0 1 H\n" + " B MandatoryValue'foo' MandatoryValue path:OptionalChildList/children[0]\n" + "3 3 1 S \"foo\" MandatoryValue:name=ID\n" + " E MandatoryValue'foo' MandatoryValue path:OptionalChildList/children[0]\n" + " E OptionalChildList Model\n" + "6 0 1 H\n" + "------------ diff 1 ------------\n" + "0 3 S \"#13\" Model:'#13'\n" + "3 0 H\n";
changeSerializerTestHelper.operator_tripleEquals(diff, expectation);
}
use of org.eclipse.xtext.ide.tests.testlanguage.partialSerializationTestLanguage.MandatoryValue in project xtext-core by eclipse.
the class OptionalChildImpl method basicSetChild.
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain basicSetChild(MandatoryValue newChild, NotificationChain msgs) {
MandatoryValue oldChild = child;
child = newChild;
if (eNotificationRequired()) {
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, PartialSerializationTestLanguagePackage.OPTIONAL_CHILD__CHILD, oldChild, newChild);
if (msgs == null)
msgs = notification;
else
msgs.add(notification);
}
return msgs;
}
use of org.eclipse.xtext.ide.tests.testlanguage.partialSerializationTestLanguage.MandatoryValue in project xtext-core by eclipse.
the class TwoChildsImpl method basicSetDirectChild.
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain basicSetDirectChild(MandatoryValue newDirectChild, NotificationChain msgs) {
MandatoryValue oldDirectChild = directChild;
directChild = newDirectChild;
if (eNotificationRequired()) {
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, PartialSerializationTestLanguagePackage.TWO_CHILDS__DIRECT_CHILD, oldDirectChild, newDirectChild);
if (msgs == null)
msgs = notification;
else
msgs.add(notification);
}
return msgs;
}
Aggregations