use of com.avaloq.tools.ddk.xtext.export.export.ExportModel in project dsl-devkit by dsldevkit.
the class ExportScopingTest method testEAttributeScope.
@Test
public void testEAttributeScope() throws IOException {
ExportModel model = (ExportModel) getTestSource().getModel();
IScope scope = scopeProvider.scope_EAttribute(model.getInterfaces().get(0), null);
// CHECKSTYLE:OFF (DuplicateString)
assertNotNull("Could not locate EStructuralFeature.", scope.getSingleElement(QualifiedName.create("unordered")));
assertNull("Located non-existent EStructuralFeature.", scope.getSingleElement(QualifiedName.create("expr")));
// CHECKSTYLE:ON
}
use of com.avaloq.tools.ddk.xtext.export.export.ExportModel in project dsl-devkit by dsldevkit.
the class ExportScopingTest method testInterfaceNavigationRefScope.
@Test
public void testInterfaceNavigationRefScope() throws IOException {
ExportModel model = (ExportModel) getTestSource().getModel();
IScope scope = scopeProvider.scope_InterfaceNavigation_ref(model.getInterfaces().get(0), null);
// CHECKSTYLE:OFF (DuplicateString)
assertNotNull("Could not locate InterfaceNavigationRef.", scope.getSingleElement(QualifiedName.create("expr")));
assertNull("Located non-existent InterfaceNavigationRef.", scope.getSingleElement(QualifiedName.create("unordered")));
// CHECKSTYLE:ON
}
use of com.avaloq.tools.ddk.xtext.export.export.ExportModel in project dsl-devkit by dsldevkit.
the class ExportJavaValidator method checkReferencedInterfaceDeclared.
/**
* Checks that there is an interface specification matching the given navigation.
*
* @param context
* navigation to check
*/
@Check
public void checkReferencedInterfaceDeclared(final InterfaceNavigation context) {
if (context.getRef() == null || context.getRef().getEReferenceType() == null) {
return;
}
ExportModel model = EObjectUtil.eContainer(context, ExportModel.class);
EClass type = context.getRef().getEReferenceType();
if (findMatchingInterfaces(model, type).isEmpty()) {
error("No interface specification declared matching type " + type.getName(), ExportPackage.Literals.INTERFACE_NAVIGATION__REF);
}
}
Aggregations