Search in sources :

Example 16 with EClassInfo

use of org.eclipse.xtext.xtext.ecoreInference.EClassifierInfo.EClassInfo in project xtext-core by eclipse.

the class TypeHierarchyHelperTest method testSimpeCase02.

@Test
public void testSimpeCase02() throws Exception {
    // no uplift for less than two children
    EClassInfo a = addClass("a");
    EClassInfo b = addClass("b");
    b.addSupertype(a);
    addAttribute(b, INT, "f1");
    assertEquals(0, a.getEClass().getEStructuralFeatures().size());
    assertEquals(1, b.getEClass().getEStructuralFeatures().size());
    liftUpFeatures();
    assertEquals(0, a.getEClass().getEStructuralFeatures().size());
    assertEquals(1, b.getEClass().getEStructuralFeatures().size());
}
Also used : EClassInfo(org.eclipse.xtext.xtext.ecoreInference.EClassifierInfo.EClassInfo) Test(org.junit.Test)

Aggregations

EClassInfo (org.eclipse.xtext.xtext.ecoreInference.EClassifierInfo.EClassInfo)16 Test (org.junit.Test)10 EClass (org.eclipse.emf.ecore.EClass)7 EStructuralFeature (org.eclipse.emf.ecore.EStructuralFeature)3 EcorePackage (org.eclipse.emf.ecore.EcorePackage)3 EReference (org.eclipse.emf.ecore.EReference)2 ArrayList (java.util.ArrayList)1 Collection (java.util.Collection)1 URI (org.eclipse.emf.common.util.URI)1 EClassifier (org.eclipse.emf.ecore.EClassifier)1 EObject (org.eclipse.emf.ecore.EObject)1 EcoreFactory (org.eclipse.emf.ecore.EcoreFactory)1