diff options
author | Dennis Huebner | 2015-12-03 15:18:34 +0000 |
---|---|---|
committer | Dennis Huebner | 2015-12-03 15:18:34 +0000 |
commit | 45df91ef60438138d7dc80ffcc92b382c4ca6ac0 (patch) | |
tree | 57e13968e1097713ae9995a57aee8f587a4ab769 | |
parent | 64cfd22b299dbea007f03d88dbda9d2f2e931668 (diff) | |
download | org.eclipse.emf-45df91ef60438138d7dc80ffcc92b382c4ca6ac0.tar.gz org.eclipse.emf-45df91ef60438138d7dc80ffcc92b382c4ca6ac0.tar.xz org.eclipse.emf-45df91ef60438138d7dc80ffcc92b382c4ca6ac0.zip |
[tests] Fixed test expectation.
Signed-off-by: Dennis Huebner <dennis.huebner@gmail.com>
4 files changed, 40 insertions, 1 deletions
diff --git a/plugins/org.eclipse.emf.ecore.xcore/src/org/eclipse/emf/ecore/xcore/XcoreRuntimeModule.java b/plugins/org.eclipse.emf.ecore.xcore/src/org/eclipse/emf/ecore/xcore/XcoreRuntimeModule.java index 492406531..68d07eb56 100644 --- a/plugins/org.eclipse.emf.ecore.xcore/src/org/eclipse/emf/ecore/xcore/XcoreRuntimeModule.java +++ b/plugins/org.eclipse.emf.ecore.xcore/src/org/eclipse/emf/ecore/xcore/XcoreRuntimeModule.java @@ -29,6 +29,7 @@ import org.eclipse.emf.ecore.xcore.scoping.XcoreResourceDescriptionManager; import org.eclipse.emf.ecore.xcore.scoping.XcoreResourceDescriptionStrategy; import org.eclipse.emf.ecore.xcore.scoping.XcoreScopeProvider; import org.eclipse.emf.ecore.xcore.scoping.XcoreSerializerScopeProvider; +import org.eclipse.emf.ecore.xcore.validation.XcoreAwareMessageProvider; import org.eclipse.emf.ecore.xcore.validation.XcoreDiagnosticConverter; import org.eclipse.emf.ecore.xcore.validation.XcoreDiagnostician; import org.eclipse.emf.ecore.xcore.validation.XcoreJvmTypeReferencesValidator; @@ -37,6 +38,7 @@ import org.eclipse.xtext.conversion.IValueConverterService; import org.eclipse.xtext.conversion.impl.QualifiedNameValueConverter; import org.eclipse.xtext.findReferences.IReferenceFinder; import org.eclipse.xtext.generator.IGenerator; +import org.eclipse.xtext.linking.ILinkingDiagnosticMessageProvider; import org.eclipse.xtext.naming.IQualifiedNameProvider; import org.eclipse.xtext.parser.antlr.IReferableElementsUnloader; import org.eclipse.xtext.resource.IContainer; @@ -227,4 +229,7 @@ public class XcoreRuntimeModule extends AbstractXcoreRuntimeModule { return XcoreReferenceFinder.class; } + public Class<? extends ILinkingDiagnosticMessageProvider> bindILinkingDiagnosticMessageProvider() { + return XcoreAwareMessageProvider.class; + } } diff --git a/plugins/org.eclipse.emf.ecore.xcore/src/org/eclipse/emf/ecore/xcore/validation/XcoreAwareMessageProvider.java b/plugins/org.eclipse.emf.ecore.xcore/src/org/eclipse/emf/ecore/xcore/validation/XcoreAwareMessageProvider.java new file mode 100644 index 000000000..1f8754104 --- /dev/null +++ b/plugins/org.eclipse.emf.ecore.xcore/src/org/eclipse/emf/ecore/xcore/validation/XcoreAwareMessageProvider.java @@ -0,0 +1,26 @@ +/** + * + */ +package org.eclipse.emf.ecore.xcore.validation; + +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.EStructuralFeature; +import org.eclipse.emf.ecore.xcore.XcorePackage; +import org.eclipse.xtext.util.Strings; +import org.eclipse.xtext.xbase.annotations.validation.UnresolvedFeatureCallTypeAwareMessageProvider; + +/** + * @author dhuebner + * + */ +public class XcoreAwareMessageProvider extends UnresolvedFeatureCallTypeAwareMessageProvider { + +@Override +protected String getTypeName(EClass c, EStructuralFeature referingFeature) { + String typeName = super.getTypeName(c, referingFeature); + if(Strings.isEmpty(typeName) && referingFeature == XcorePackage.Literals.XGENERIC_TYPE__TYPE) { + return " to a type"; + } + return typeName; +} +} diff --git a/tests/org.eclipse.emf.test.ecore.xcore/test-models/org/eclipse/emf/test/ecore/xcore/validation/Linking.xcore_test b/tests/org.eclipse.emf.test.ecore.xcore/test-models/org/eclipse/emf/test/ecore/xcore/validation/Linking.xcore_test index 2bb2f3dbf..e5d6eabaa 100644 --- a/tests/org.eclipse.emf.test.ecore.xcore/test-models/org/eclipse/emf/test/ecore/xcore/validation/Linking.xcore_test +++ b/tests/org.eclipse.emf.test.ecore.xcore/test-models/org/eclipse/emf/test/ecore/xcore/validation/Linking.xcore_test @@ -1,8 +1,8 @@ package linking /* XPECT validationIssues --- -error at 'baz' message 'Couldn't resolve reference to GenBase 'baz'.' error at 'baz' message 'A generic super type must refer to a class' +error at 'baz' message 'baz cannot be resolved to a type.' --- */ class bar extends baz {}
\ No newline at end of file diff --git a/tests/org.eclipse.emf.test.ecore.xcore/test-models/org/eclipse/emf/test/ecore/xcore/validation/Linking2.xcore_test b/tests/org.eclipse.emf.test.ecore.xcore/test-models/org/eclipse/emf/test/ecore/xcore/validation/Linking2.xcore_test new file mode 100644 index 000000000..f0724338a --- /dev/null +++ b/tests/org.eclipse.emf.test.ecore.xcore/test-models/org/eclipse/emf/test/ecore/xcore/validation/Linking2.xcore_test @@ -0,0 +1,8 @@ +package linking + +/* XPECT validationIssues --- +error at 'foo.bar.Baz' message 'A generic super type must refer to a class' +error at 'foo.bar.Baz' message 'foo.bar.Baz cannot be resolved to a type.' +--- */ + +class Bar extends foo.bar.Baz {}
\ No newline at end of file |