Search in sources :

Example 1 with BaseAttribute

use of org.eclipse.xtext.linking.bug287988Test.BaseAttribute in project xtext-core by eclipse.

the class BaseAttributeImpl method setTypeRef.

/**
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
public void setTypeRef(BaseAttribute newTypeRef) {
    BaseAttribute oldTypeRef = typeRef;
    typeRef = newTypeRef;
    if (eNotificationRequired())
        eNotify(new ENotificationImpl(this, Notification.SET, Bug287988TestPackage.BASE_ATTRIBUTE__TYPE_REF, oldTypeRef, typeRef));
}
Also used : ENotificationImpl(org.eclipse.emf.ecore.impl.ENotificationImpl) BaseAttribute(org.eclipse.xtext.linking.bug287988Test.BaseAttribute)

Example 2 with BaseAttribute

use of org.eclipse.xtext.linking.bug287988Test.BaseAttribute in project xtext-core by eclipse.

the class Bug287988WithEagerLinkingTest method testAction_03.

@Override
@Test
public void testAction_03() throws Exception {
    String modelAsString = "actions master mytype attr1; attribute ref attr3 attr2;";
    Model model = (Model) getModelAndExpect(modelAsString, 1);
    assertEquals(2, model.getAttributes().size());
    BaseAttribute baseAttribute = model.getAttributes().get(1);
    assertNull(baseAttribute.getTypeRef());
}
Also used : Model(org.eclipse.xtext.linking.bug287988Test.Model) BaseAttribute(org.eclipse.xtext.linking.bug287988Test.BaseAttribute) Test(org.junit.Test)

Example 3 with BaseAttribute

use of org.eclipse.xtext.linking.bug287988Test.BaseAttribute in project xtext-core by eclipse.

the class Bug287988Test method testAction_03.

@Test
public void testAction_03() throws Exception {
    String modelAsString = "actions master mytype attr1; attribute ref attr3 attr2;";
    Model model = (Model) getModelAndExpect(modelAsString, 1);
    assertEquals(2, model.getAttributes().size());
    BaseAttribute baseAttribute = model.getAttributes().get(1);
    assertNotNull(baseAttribute.getTypeRef());
    EObject eObject = baseAttribute.getTypeRef();
    assertTrue(eObject.eIsProxy());
}
Also used : EObject(org.eclipse.emf.ecore.EObject) Model(org.eclipse.xtext.linking.bug287988Test.Model) BaseAttribute(org.eclipse.xtext.linking.bug287988Test.BaseAttribute) Test(org.junit.Test)

Example 4 with BaseAttribute

use of org.eclipse.xtext.linking.bug287988Test.BaseAttribute in project xtext-core by eclipse.

the class Bug287988Test method checkSecondAttrRefersToFirst.

protected void checkSecondAttrRefersToFirst(String modelAsString) throws Exception {
    Model model = (Model) getModel(modelAsString);
    assertEquals(2, model.getAttributes().size());
    BaseAttribute baseAttribute = model.getAttributes().get(1);
    assertEquals(model.getAttributes().get(0), baseAttribute.getTypeRef());
}
Also used : Model(org.eclipse.xtext.linking.bug287988Test.Model) BaseAttribute(org.eclipse.xtext.linking.bug287988Test.BaseAttribute)

Example 5 with BaseAttribute

use of org.eclipse.xtext.linking.bug287988Test.BaseAttribute in project xtext-core by eclipse.

the class Bug287988Test method testAction_02.

@Test
public void testAction_02() throws Exception {
    String modelAsString = "actions master mytype attr1; attribute myOtherType attr2;";
    Model model = (Model) getModel(modelAsString);
    assertEquals(2, model.getAttributes().size());
    BaseAttribute baseAttribute = model.getAttributes().get(1);
    assertNull(baseAttribute.getTypeRef());
}
Also used : Model(org.eclipse.xtext.linking.bug287988Test.Model) BaseAttribute(org.eclipse.xtext.linking.bug287988Test.BaseAttribute) Test(org.junit.Test)

Aggregations

BaseAttribute (org.eclipse.xtext.linking.bug287988Test.BaseAttribute)5 Model (org.eclipse.xtext.linking.bug287988Test.Model)4 Test (org.junit.Test)3 EObject (org.eclipse.emf.ecore.EObject)1 ENotificationImpl (org.eclipse.emf.ecore.impl.ENotificationImpl)1