@Test
  public void testIntegrationList() throws DatabindingFailedException {
    // TODO
    final VFeaturePathDomainModelReference pathReference =
        VViewFactory.eINSTANCE.createFeaturePathDomainModelReference();
    // create reference path to the attribute
    final LinkedList<EReference> referencePath = new LinkedList<EReference>();
    referencePath.add(TestPackage.eINSTANCE.getA_B());
    referencePath.add(TestPackage.eINSTANCE.getB_C());
    referencePath.add(TestPackage.eINSTANCE.getC_D());

    final EStructuralFeature feature = TestPackage.eINSTANCE.getD_YList();

    pathReference.getDomainModelEReferencePath().addAll(referencePath);
    pathReference.setDomainModelEFeature(feature);

    final IListProperty listProperty = databindingService.getListProperty(pathReference, null);

    // The converter should return an IEMFListProperty
    assertTrue(listProperty instanceof IEMFListProperty);

    final IEMFListProperty emfListProperty = (IEMFListProperty) listProperty;

    // Check EStructuralFeature of the property.
    assertEquals(feature, emfListProperty.getStructuralFeature());

    // Check correct path.
    final String expected = "A.b<B> => B.c<C> => C.d<D> => D.yList[]<EInt>"; // $NON-NLS-1$
    assertEquals(expected, emfListProperty.toString());
  }
Beispiel #2
0
  private static LeafCondition createLeafCondition() {
    final LeafCondition leafCondition = RuleFactory.eINSTANCE.createLeafCondition();
    final VFeaturePathDomainModelReference modelReference =
        VViewFactory.eINSTANCE.createFeaturePathDomainModelReference();
    modelReference.setDomainModelEFeature(BowlingPackage.eINSTANCE.getMerchandise_Name());
    modelReference
        .getDomainModelEReferencePath()
        .add(BowlingPackage.eINSTANCE.getFan_FavouriteMerchandise());
    leafCondition.setDomainModelReference(modelReference);

    return leafCondition;
  }