Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEd Merks2012-09-11 13:03:54 +0000
committerEd Merks2012-09-11 13:03:54 +0000
commit94a6c74e259d14ac81c90a75f8c5d20f9b7ef37a (patch)
tree654101432538874162137c0acdf7b87ec8ad52d9 /tests/org.eclipse.emf.test.ecore.xcore/src/org/eclipse
parent87762970bca247ee50356461d0735a04f24216ca (diff)
downloadorg.eclipse.emf-94a6c74e259d14ac81c90a75f8c5d20f9b7ef37a.tar.gz
org.eclipse.emf-94a6c74e259d14ac81c90a75f8c5d20f9b7ef37a.tar.xz
org.eclipse.emf-94a6c74e259d14ac81c90a75f8c5d20f9b7ef37a.zip
[389245] Fix line endings in repo
Diffstat (limited to 'tests/org.eclipse.emf.test.ecore.xcore/src/org/eclipse')
-rw-r--r--tests/org.eclipse.emf.test.ecore.xcore/src/org/eclipse/emf/test/ecore/xcore/EObjectFormatter.java374
-rw-r--r--tests/org.eclipse.emf.test.ecore.xcore/src/org/eclipse/emf/test/ecore/xcore/GenModelFormatter.java222
-rw-r--r--tests/org.eclipse.emf.test.ecore.xcore/src/org/eclipse/emf/test/ecore/xcore/MultiFileTest.xtend188
-rw-r--r--tests/org.eclipse.emf.test.ecore.xcore/src/org/eclipse/emf/test/ecore/xcore/ParsingTest.xtend428
-rw-r--r--tests/org.eclipse.emf.test.ecore.xcore/src/org/eclipse/emf/test/ecore/xcore/generator/GeneratorTest.xtend92
-rw-r--r--tests/org.eclipse.emf.test.ecore.xcore/src/org/eclipse/emf/test/ecore/xcore/genmodel/XcoreGenModelTest.java132
-rw-r--r--tests/org.eclipse.emf.test.ecore.xcore/src/org/eclipse/emf/test/ecore/xcore/interpreter/XcoreInterpreterTest.xtend328
-rw-r--r--tests/org.eclipse.emf.test.ecore.xcore/src/org/eclipse/emf/test/ecore/xcore/mapping/XcoreMapperTest.xtend192
-rw-r--r--tests/org.eclipse.emf.test.ecore.xcore/src/org/eclipse/emf/test/ecore/xcore/scoping/LazyGenModelInferenceTest.java334
-rw-r--r--tests/org.eclipse.emf.test.ecore.xcore/src/org/eclipse/emf/test/ecore/xcore/scoping/LinkingTest.xtend208
-rw-r--r--tests/org.eclipse.emf.test.ecore.xcore/src/org/eclipse/emf/test/ecore/xcore/scoping/XbaseScopingTest.xtend86
-rw-r--r--tests/org.eclipse.emf.test.ecore.xcore/src/org/eclipse/emf/test/ecore/xcore/scoping/XcoreScopingTest.java154
-rw-r--r--tests/org.eclipse.emf.test.ecore.xcore/src/org/eclipse/emf/test/ecore/xcore/smoketest/XcoreSmokeTest.xtend122
-rw-r--r--tests/org.eclipse.emf.test.ecore.xcore/src/org/eclipse/emf/test/ecore/xcore/validation/EClass-AtMostOneID.xcore36
-rw-r--r--tests/org.eclipse.emf.test.ecore.xcore/src/org/eclipse/emf/test/ecore/xcore/validation/EClass-ConsistentSuperTypesConflict.xcore42
-rw-r--r--tests/org.eclipse.emf.test.ecore.xcore/src/org/eclipse/emf/test/ecore/xcore/validation/EClass-ConsistentSuperTypesDuplicate.xcore24
-rw-r--r--tests/org.eclipse.emf.test.ecore.xcore/src/org/eclipse/emf/test/ecore/xcore/validation/EClass-DisjointFeatureAndOperationSignatures.xcore20
-rw-r--r--tests/org.eclipse.emf.test.ecore.xcore/src/org/eclipse/emf/test/ecore/xcore/validation/EClass-NoCircularSuperTypes.xcore18
-rw-r--r--tests/org.eclipse.emf.test.ecore.xcore/src/org/eclipse/emf/test/ecore/xcore/validation/EClass-UniqueFeatureNames.xcore36
-rw-r--r--tests/org.eclipse.emf.test.ecore.xcore/src/org/eclipse/emf/test/ecore/xcore/validation/EClass-UniqueOperationSignatures.xcore20
-rw-r--r--tests/org.eclipse.emf.test.ecore.xcore/src/org/eclipse/emf/test/ecore/xcore/validation/EClass-WellformedMapEntryClass.xcore20
-rw-r--r--tests/org.eclipse.emf.test.ecore.xcore/src/org/eclipse/emf/test/ecore/xcore/validation/EClass-WellformedMapEntryNoInstanceClassName.xcore30
-rw-r--r--tests/org.eclipse.emf.test.ecore.xcore/src/org/eclipse/emf/test/ecore/xcore/validation/EClassifier-UniqueTypeParameterNames.xcore18
-rw-r--r--tests/org.eclipse.emf.test.ecore.xcore/src/org/eclipse/emf/test/ecore/xcore/validation/EEnum-UniqueEnumeratorLiterals.xcore22
-rw-r--r--tests/org.eclipse.emf.test.ecore.xcore/src/org/eclipse/emf/test/ecore/xcore/validation/EEnum-UniqueEnumeratorNames.xcore22
-rw-r--r--tests/org.eclipse.emf.test.ecore.xcore/src/org/eclipse/emf/test/ecore/xcore/validation/EGenericType-ClassNotPermitted.xcore20
-rw-r--r--tests/org.eclipse.emf.test.ecore.xcore/src/org/eclipse/emf/test/ecore/xcore/validation/EGenericType-ConsistentArgumentNoneAllowed.xcore20
-rw-r--r--tests/org.eclipse.emf.test.ecore.xcore/src/org/eclipse/emf/test/ecore/xcore/validation/EGenericType-ConsistentArgumentsIncorrectNumber.xcore20
-rw-r--r--tests/org.eclipse.emf.test.ecore.xcore/src/org/eclipse/emf/test/ecore/xcore/validation/EGenericType-ConsistentArgumentsInvalidSubstitution.xcore36
-rw-r--r--tests/org.eclipse.emf.test.ecore.xcore/src/org/eclipse/emf/test/ecore/xcore/validation/EGenericType-ConsistentArgumentsNone.xcore20
-rw-r--r--tests/org.eclipse.emf.test.ecore.xcore/src/org/eclipse/emf/test/ecore/xcore/validation/EGenericType-DataTypeNotPermitted.xcore20
-rw-r--r--tests/org.eclipse.emf.test.ecore.xcore/src/org/eclipse/emf/test/ecore/xcore/validation/EGenericType-NoClass.xcore20
-rw-r--r--tests/org.eclipse.emf.test.ecore.xcore/src/org/eclipse/emf/test/ecore/xcore/validation/EGenericType-PrimitiveTypePermitted.xcore20
-rw-r--r--tests/org.eclipse.emf.test.ecore.xcore/src/org/eclipse/emf/test/ecore/xcore/validation/EObject-EveryMapEntryUnique.xcore22
-rw-r--r--tests/org.eclipse.emf.test.ecore.xcore/src/org/eclipse/emf/test/ecore/xcore/validation/EOperation-UniqueParameterNames.xcore20
-rw-r--r--tests/org.eclipse.emf.test.ecore.xcore/src/org/eclipse/emf/test/ecore/xcore/validation/EOperation-UniqueTypeParameterNames.xcore20
-rw-r--r--tests/org.eclipse.emf.test.ecore.xcore/src/org/eclipse/emf/test/ecore/xcore/validation/EPackage-UniqueClassifierNames.xcore20
-rw-r--r--tests/org.eclipse.emf.test.ecore.xcore/src/org/eclipse/emf/test/ecore/xcore/validation/EReference-ConsistentContainer.xcore44
-rw-r--r--tests/org.eclipse.emf.test.ecore.xcore/src/org/eclipse/emf/test/ecore/xcore/validation/EReference-ConsistentOppositeBadTransient.xcore22
-rw-r--r--tests/org.eclipse.emf.test.ecore.xcore/src/org/eclipse/emf/test/ecore/xcore/validation/EReference-ConsistentOppositeBothContainment.xcore24
-rw-r--r--tests/org.eclipse.emf.test.ecore.xcore/src/org/eclipse/emf/test/ecore/xcore/validation/EReference-ConsistentOppositeNotMatching.xcore22
-rw-r--r--tests/org.eclipse.emf.test.ecore.xcore/src/org/eclipse/emf/test/ecore/xcore/validation/EReference-SingleContainer.xcore22
-rw-r--r--tests/org.eclipse.emf.test.ecore.xcore/src/org/eclipse/emf/test/ecore/xcore/validation/ETypedElement-ConsistentBounds.xcore20
-rw-r--r--tests/org.eclipse.emf.test.ecore.xcore/src/org/eclipse/emf/test/ecore/xcore/validation/XcoreValidationTest.java192
44 files changed, 1886 insertions, 1886 deletions
diff --git a/tests/org.eclipse.emf.test.ecore.xcore/src/org/eclipse/emf/test/ecore/xcore/EObjectFormatter.java b/tests/org.eclipse.emf.test.ecore.xcore/src/org/eclipse/emf/test/ecore/xcore/EObjectFormatter.java
index 500f98e6a..bc6986fa9 100644
--- a/tests/org.eclipse.emf.test.ecore.xcore/src/org/eclipse/emf/test/ecore/xcore/EObjectFormatter.java
+++ b/tests/org.eclipse.emf.test.ecore.xcore/src/org/eclipse/emf/test/ecore/xcore/EObjectFormatter.java
@@ -1,187 +1,187 @@
-/**
- * Copyright (c) 2011 itemis AG (http://www.itemis.eu) and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- */
-package org.eclipse.emf.test.ecore.xcore;
-
-
-import java.util.List;
-
-import org.eclipse.emf.common.util.URI;
-import org.eclipse.emf.ecore.EAttribute;
-import org.eclipse.emf.ecore.EFactory;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EReference;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.emf.ecore.InternalEObject;
-import org.eclipse.emf.ecore.util.EcoreUtil;
-
-import com.google.common.base.Function;
-import com.google.common.base.Joiner;
-import com.google.common.collect.Iterables;
-
-
-/**
- * @author Moritz Eysholdt - Initial contribution and API
- *
- * TODO: move this to xtext.util
- */
-public class EObjectFormatter implements Function<EObject, String>
-{
-
- protected boolean resolveCrossReferences = false;
-
- protected boolean showIndex = false;
-
- public String apply(EObject from)
- {
- return format(from);
- }
-
- protected String assignmentOperator(EObject object, EStructuralFeature feature)
- {
- if (feature instanceof EReference && !((EReference)feature).isContainment())
- return "->";
- else
- return "=";
- }
-
- public String format(EObject object)
- {
- if (object == null)
- return "null";
- StringBuilder result = new StringBuilder();
- result.append(object.eClass().getName());
- result.append(" {");
- for (EStructuralFeature feature : object.eClass().getEAllStructuralFeatures())
- if (shouldFormat(object, feature))
- result.append(indent("\n" + format(object, feature)));
- result.append("\n}");
- return result.toString();
- }
-
- protected String format(EObject object, EStructuralFeature feature)
- {
- StringBuilder result = new StringBuilder();
- result.append(feature.getName());
- result.append(" ");
- result.append(assignmentOperator(object, feature));
- result.append(" ");
- Object val = object.eGet(feature, resolveCrossReferences);
- if (feature.isMany())
- {
- result.append("[");
- List<?> vals = (List<?>)val;
- List<?> sortedVals = sort(object, feature, vals);
- if (vals == sortedVals)
- {
- for (int i = 0; i < vals.size(); i++)
- if (shouldFormat(object, feature, i, vals.get(i)))
- result.append(indent("\n" + format(object, feature, i, vals.get(i))));
- }
- else
- {
- for (int i = 0; i < sortedVals.size(); i++)
- if (shouldFormat(object, feature, sortedVals.get(i)))
- result.append(indent("\n" + format(object, feature, sortedVals.get(i))));
- }
- result.append("\n]");
- }
- else
- result.append(indent(format(object, feature, val)));
- return result.toString();
- }
-
- protected String format(EObject object, EStructuralFeature feature, int index, Object value)
- {
- if (showIndex)
- return index + ": " + format(object, feature, value);
- return format(object, feature, value);
- }
-
- protected String format(EObject object, EStructuralFeature feature, Object value)
- {
- if (feature instanceof EAttribute)
- return formatAttributeValue(object, (EAttribute)feature, value);
- else if (feature instanceof EReference)
- {
- EReference ref = (EReference)feature;
- if (ref.isContainment())
- return format((EObject)value);
- return formatCrossRefValue(object, ref, (EObject)value);
- }
- return "";
- }
-
- public String format(Iterable<? extends EObject> object)
- {
- return Joiner.on('\n').join(Iterables.transform(object, this));
- }
-
- protected String formatAttributeValue(EObject object, EAttribute feature, Object value)
- {
- if (value == null)
- return "null";
- EFactory factory = feature.getEAttributeType().getEPackage().getEFactoryInstance();
- String stringVal = factory.convertToString(feature.getEAttributeType(), value);
- return "'" + stringVal + "'";
- }
-
- protected String formatCrossRefValue(EObject object, EReference feature, EObject value)
- {
- if (value == null)
- return "null";
- if (value.eIsProxy())
- return "proxy (URI: " + ((InternalEObject)value).eProxyURI() + ")";
- if (value.eResource() == object.eResource())
- return value.eClass().getName() + " " + object.eResource().getURIFragment(value);
- URI uri = EcoreUtil.getURI(value);
- uri = uri.deresolve(object.eResource().getURI());
- return value.eClass().getName() + " " + uri.toString();
- }
-
- protected String indent(String string)
- {
- return string.replaceAll("\\n", "\n\t");
- }
-
- public EObjectFormatter resolveCrossReferences()
- {
- this.resolveCrossReferences = true;
- return this;
- }
-
- protected boolean shouldFormat(EObject object, EStructuralFeature feature)
- {
- if (feature.isDerived())
- return false;
- if (feature instanceof EReference && ((EReference)feature).isContainer())
- return false;
- return object.eIsSet(feature);
- }
-
- protected boolean shouldFormat(EObject object, EStructuralFeature feature, int index, Object value)
- {
- return true;
- }
-
- protected boolean shouldFormat(EObject object, EStructuralFeature feature, Object value)
- {
- return true;
- }
-
- public EObjectFormatter showIndex()
- {
- this.showIndex = true;
- return this;
- }
-
- protected List<?> sort(EObject obj, EStructuralFeature feature, List<?> values)
- {
- return values;
- }
-
-}
+/**
+ * Copyright (c) 2011 itemis AG (http://www.itemis.eu) and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ */
+package org.eclipse.emf.test.ecore.xcore;
+
+
+import java.util.List;
+
+import org.eclipse.emf.common.util.URI;
+import org.eclipse.emf.ecore.EAttribute;
+import org.eclipse.emf.ecore.EFactory;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EReference;
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.emf.ecore.InternalEObject;
+import org.eclipse.emf.ecore.util.EcoreUtil;
+
+import com.google.common.base.Function;
+import com.google.common.base.Joiner;
+import com.google.common.collect.Iterables;
+
+
+/**
+ * @author Moritz Eysholdt - Initial contribution and API
+ *
+ * TODO: move this to xtext.util
+ */
+public class EObjectFormatter implements Function<EObject, String>
+{
+
+ protected boolean resolveCrossReferences = false;
+
+ protected boolean showIndex = false;
+
+ public String apply(EObject from)
+ {
+ return format(from);
+ }
+
+ protected String assignmentOperator(EObject object, EStructuralFeature feature)
+ {
+ if (feature instanceof EReference && !((EReference)feature).isContainment())
+ return "->";
+ else
+ return "=";
+ }
+
+ public String format(EObject object)
+ {
+ if (object == null)
+ return "null";
+ StringBuilder result = new StringBuilder();
+ result.append(object.eClass().getName());
+ result.append(" {");
+ for (EStructuralFeature feature : object.eClass().getEAllStructuralFeatures())
+ if (shouldFormat(object, feature))
+ result.append(indent("\n" + format(object, feature)));
+ result.append("\n}");
+ return result.toString();
+ }
+
+ protected String format(EObject object, EStructuralFeature feature)
+ {
+ StringBuilder result = new StringBuilder();
+ result.append(feature.getName());
+ result.append(" ");
+ result.append(assignmentOperator(object, feature));
+ result.append(" ");
+ Object val = object.eGet(feature, resolveCrossReferences);
+ if (feature.isMany())
+ {
+ result.append("[");
+ List<?> vals = (List<?>)val;
+ List<?> sortedVals = sort(object, feature, vals);
+ if (vals == sortedVals)
+ {
+ for (int i = 0; i < vals.size(); i++)
+ if (shouldFormat(object, feature, i, vals.get(i)))
+ result.append(indent("\n" + format(object, feature, i, vals.get(i))));
+ }
+ else
+ {
+ for (int i = 0; i < sortedVals.size(); i++)
+ if (shouldFormat(object, feature, sortedVals.get(i)))
+ result.append(indent("\n" + format(object, feature, sortedVals.get(i))));
+ }
+ result.append("\n]");
+ }
+ else
+ result.append(indent(format(object, feature, val)));
+ return result.toString();
+ }
+
+ protected String format(EObject object, EStructuralFeature feature, int index, Object value)
+ {
+ if (showIndex)
+ return index + ": " + format(object, feature, value);
+ return format(object, feature, value);
+ }
+
+ protected String format(EObject object, EStructuralFeature feature, Object value)
+ {
+ if (feature instanceof EAttribute)
+ return formatAttributeValue(object, (EAttribute)feature, value);
+ else if (feature instanceof EReference)
+ {
+ EReference ref = (EReference)feature;
+ if (ref.isContainment())
+ return format((EObject)value);
+ return formatCrossRefValue(object, ref, (EObject)value);
+ }
+ return "";
+ }
+
+ public String format(Iterable<? extends EObject> object)
+ {
+ return Joiner.on('\n').join(Iterables.transform(object, this));
+ }
+
+ protected String formatAttributeValue(EObject object, EAttribute feature, Object value)
+ {
+ if (value == null)
+ return "null";
+ EFactory factory = feature.getEAttributeType().getEPackage().getEFactoryInstance();
+ String stringVal = factory.convertToString(feature.getEAttributeType(), value);
+ return "'" + stringVal + "'";
+ }
+
+ protected String formatCrossRefValue(EObject object, EReference feature, EObject value)
+ {
+ if (value == null)
+ return "null";
+ if (value.eIsProxy())
+ return "proxy (URI: " + ((InternalEObject)value).eProxyURI() + ")";
+ if (value.eResource() == object.eResource())
+ return value.eClass().getName() + " " + object.eResource().getURIFragment(value);
+ URI uri = EcoreUtil.getURI(value);
+ uri = uri.deresolve(object.eResource().getURI());
+ return value.eClass().getName() + " " + uri.toString();
+ }
+
+ protected String indent(String string)
+ {
+ return string.replaceAll("\\n", "\n\t");
+ }
+
+ public EObjectFormatter resolveCrossReferences()
+ {
+ this.resolveCrossReferences = true;
+ return this;
+ }
+
+ protected boolean shouldFormat(EObject object, EStructuralFeature feature)
+ {
+ if (feature.isDerived())
+ return false;
+ if (feature instanceof EReference && ((EReference)feature).isContainer())
+ return false;
+ return object.eIsSet(feature);
+ }
+
+ protected boolean shouldFormat(EObject object, EStructuralFeature feature, int index, Object value)
+ {
+ return true;
+ }
+
+ protected boolean shouldFormat(EObject object, EStructuralFeature feature, Object value)
+ {
+ return true;
+ }
+
+ public EObjectFormatter showIndex()
+ {
+ this.showIndex = true;
+ return this;
+ }
+
+ protected List<?> sort(EObject obj, EStructuralFeature feature, List<?> values)
+ {
+ return values;
+ }
+
+}
diff --git a/tests/org.eclipse.emf.test.ecore.xcore/src/org/eclipse/emf/test/ecore/xcore/GenModelFormatter.java b/tests/org.eclipse.emf.test.ecore.xcore/src/org/eclipse/emf/test/ecore/xcore/GenModelFormatter.java
index 2c63386bc..77cc09d43 100644
--- a/tests/org.eclipse.emf.test.ecore.xcore/src/org/eclipse/emf/test/ecore/xcore/GenModelFormatter.java
+++ b/tests/org.eclipse.emf.test.ecore.xcore/src/org/eclipse/emf/test/ecore/xcore/GenModelFormatter.java
@@ -1,111 +1,111 @@
-/**
- * Copyright (c) 2011-2012 Eclipse contributors and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- */
-package org.eclipse.emf.test.ecore.xcore;
-
-
-import org.eclipse.emf.codegen.ecore.genmodel.GenClass;
-import org.eclipse.emf.codegen.ecore.genmodel.GenDataType;
-import org.eclipse.emf.codegen.ecore.genmodel.GenFeature;
-import org.eclipse.emf.codegen.ecore.genmodel.GenModel;
-import org.eclipse.emf.codegen.ecore.genmodel.GenModelPackage;
-import org.eclipse.emf.codegen.ecore.genmodel.GenPackage;
-import org.eclipse.emf.codegen.ecore.genmodel.util.GenModelSwitch;
-import org.eclipse.emf.ecore.ENamedElement;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EPackage;
-import org.eclipse.emf.ecore.EReference;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.emf.ecore.EcorePackage;
-import org.eclipse.emf.ecore.util.EcoreSwitch;
-import org.eclipse.xtext.EcoreUtil2;
-
-
-public class GenModelFormatter extends EObjectFormatter
-{
-
- private static class EcoreTitleSwitch extends EcoreSwitch<String>
- {
- @Override
- public String caseENamedElement(ENamedElement object)
- {
- EPackage pkg = EcoreUtil2.getContainerOfType(object, EPackage.class);
- StringBuilder result = new StringBuilder();
- if (pkg != object)
- {
- result.append(pkg.getName());
- result.append("::");
- }
- result.append(object.getName());
- return result.toString();
- }
-
- @Override
- public String caseEStructuralFeature(EStructuralFeature object)
- {
- StringBuilder result = new StringBuilder();
- result.append(doSwitch(object.getEContainingClass()));
- result.append("::");
- result.append(object.getName());
- return result.toString();
- }
- }
-
- private static class GenModelTitleSwitch extends GenModelSwitch<String>
- {
- @Override
- public String caseGenClass(GenClass object)
- {
- return object.getQualifiedInterfaceName();
- }
-
- @Override
- public String caseGenDataType(GenDataType object)
- {
- return object.getQualifiedInstanceClassName();
- }
-
- @Override
- public String caseGenFeature(GenFeature object)
- {
- StringBuilder result = new StringBuilder();
- result.append(doSwitch(object.getGenClass()));
- result.append(".");
- result.append(object.getName());
- return result.toString();
- }
-
- @Override
- public String caseGenModel(GenModel object)
- {
- return object.getModelName();
- }
-
- @Override
- public String caseGenPackage(GenPackage object)
- {
- return object.getQualifiedPackageInterfaceName();
- }
-
- }
-
- @Override
- protected String formatCrossRefValue(EObject object, EReference feature, EObject value)
- {
- if (value != null && !value.eIsProxy())
- {
- String title = null;
- if (value.eClass().getEPackage() == EcorePackage.eINSTANCE)
- title = new EcoreTitleSwitch().doSwitch(value);
- else if (value.eClass().getEPackage() == GenModelPackage.eINSTANCE)
- title = new GenModelTitleSwitch().doSwitch(value);
- if (title != null)
- return value.eClass().getName() + " " + title;
- }
- return super.formatCrossRefValue(object, feature, value);
- }
-}
+/**
+ * Copyright (c) 2011-2012 Eclipse contributors and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ */
+package org.eclipse.emf.test.ecore.xcore;
+
+
+import org.eclipse.emf.codegen.ecore.genmodel.GenClass;
+import org.eclipse.emf.codegen.ecore.genmodel.GenDataType;
+import org.eclipse.emf.codegen.ecore.genmodel.GenFeature;
+import org.eclipse.emf.codegen.ecore.genmodel.GenModel;
+import org.eclipse.emf.codegen.ecore.genmodel.GenModelPackage;
+import org.eclipse.emf.codegen.ecore.genmodel.GenPackage;
+import org.eclipse.emf.codegen.ecore.genmodel.util.GenModelSwitch;
+import org.eclipse.emf.ecore.ENamedElement;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EPackage;
+import org.eclipse.emf.ecore.EReference;
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.emf.ecore.EcorePackage;
+import org.eclipse.emf.ecore.util.EcoreSwitch;
+import org.eclipse.xtext.EcoreUtil2;
+
+
+public class GenModelFormatter extends EObjectFormatter
+{
+
+ private static class EcoreTitleSwitch extends EcoreSwitch<String>
+ {
+ @Override
+ public String caseENamedElement(ENamedElement object)
+ {
+ EPackage pkg = EcoreUtil2.getContainerOfType(object, EPackage.class);
+ StringBuilder result = new StringBuilder();
+ if (pkg != object)
+ {
+ result.append(pkg.getName());
+ result.append("::");
+ }
+ result.append(object.getName());
+ return result.toString();
+ }
+
+ @Override
+ public String caseEStructuralFeature(EStructuralFeature object)
+ {
+ StringBuilder result = new StringBuilder();
+ result.append(doSwitch(object.getEContainingClass()));
+ result.append("::");
+ result.append(object.getName());
+ return result.toString();
+ }
+ }
+
+ private static class GenModelTitleSwitch extends GenModelSwitch<String>
+ {
+ @Override
+ public String caseGenClass(GenClass object)
+ {
+ return object.getQualifiedInterfaceName();
+ }
+
+ @Override
+ public String caseGenDataType(GenDataType object)
+ {
+ return object.getQualifiedInstanceClassName();
+ }
+
+ @Override
+ public String caseGenFeature(GenFeature object)
+ {
+ StringBuilder result = new StringBuilder();
+ result.append(doSwitch(object.getGenClass()));
+ result.append(".");
+ result.append(object.getName());
+ return result.toString();
+ }
+
+ @Override
+ public String caseGenModel(GenModel object)
+ {
+ return object.getModelName();
+ }
+
+ @Override
+ public String caseGenPackage(GenPackage object)
+ {
+ return object.getQualifiedPackageInterfaceName();
+ }
+
+ }
+
+ @Override
+ protected String formatCrossRefValue(EObject object, EReference feature, EObject value)
+ {
+ if (value != null && !value.eIsProxy())
+ {
+ String title = null;
+ if (value.eClass().getEPackage() == EcorePackage.eINSTANCE)
+ title = new EcoreTitleSwitch().doSwitch(value);
+ else if (value.eClass().getEPackage() == GenModelPackage.eINSTANCE)
+ title = new GenModelTitleSwitch().doSwitch(value);
+ if (title != null)
+ return value.eClass().getName() + " " + title;
+ }
+ return super.formatCrossRefValue(object, feature, value);
+ }
+}
diff --git a/tests/org.eclipse.emf.test.ecore.xcore/src/org/eclipse/emf/test/ecore/xcore/MultiFileTest.xtend b/tests/org.eclipse.emf.test.ecore.xcore/src/org/eclipse/emf/test/ecore/xcore/MultiFileTest.xtend
index c93c023a8..d391043f7 100644
--- a/tests/org.eclipse.emf.test.ecore.xcore/src/org/eclipse/emf/test/ecore/xcore/MultiFileTest.xtend
+++ b/tests/org.eclipse.emf.test.ecore.xcore/src/org/eclipse/emf/test/ecore/xcore/MultiFileTest.xtend
@@ -1,95 +1,95 @@
-/**
- * Copyright (c) 2011-2012 Eclipse contributors and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- */
-package org.eclipse.emf.test.ecore.xcore
-
-import com.google.inject.Inject
-import org.eclipse.emf.codegen.ecore.genmodel.GenClass
-import org.eclipse.emf.common.util.URI
-import org.eclipse.emf.ecore.xcore.XClass
-import org.eclipse.emf.ecore.xcore.XcoreInjectorProvider
-import org.eclipse.xtext.junit4.InjectWith
-import org.eclipse.xtext.junit4.XtextRunner
-import org.eclipse.xtext.junit4.validation.ValidationTestHelper
-import org.eclipse.xtext.resource.XtextResourceSet
-import org.eclipse.xtext.util.StringInputStream
-import org.junit.Test
-import org.junit.runner.RunWith
-
-import static org.junit.Assert.*
-
-import org.eclipse.emf.ecore.xcore.XReference
-import org.eclipse.emf.ecore.xcore.mappings.XcoreMapper
-
-@RunWith(typeof(XtextRunner))
-@InjectWith(typeof(XcoreInjectorProvider))
-class MultiFileTest {
-
- @Inject
- XtextResourceSet resourceSet
-
- @Inject
- ValidationTestHelper validator
-
- @Inject
- extension XcoreMapper mapper
-
- @Test
- def void testReferenceBetweenTwoModels() {
- val resourceA = resourceSet.createResource(URI::createURI('file:/modelA.xcore'))
- val resourceB = resourceSet.createResource(URI::createURI('file:/modelB.xcore'))
- resourceB.load(new StringInputStream('''
- package packB
-
- class TypeB {
- }
- '''.toString), null)
- resourceA.load(new StringInputStream('''
- package packA
-
- class TypeA {
- refers packB.TypeB refToB
- }
- '''.toString), null)
-
- validator.assertNoErrors(resourceA.contents.head)
- validator.assertNoErrors(resourceB.contents.head)
- val allContents = resourceA.allContents
- val xclass = allContents.filter(typeof(XClass)).head
- val referencedGenClass = xclass.members.head.type.type
- assertEquals('TypeB', (referencedGenClass as GenClass).name)
- }
-
- @Test
- def void testBidirectionalReferenceBetweenTwoModels() {
- val resourceA = resourceSet.createResource(URI::createURI('file:/modelA.xcore'))
- val resourceB = resourceSet.createResource(URI::createURI('file:/modelB.xcore'))
- resourceB.load(new StringInputStream('''
- package packB
-
- class TypeB {
- refers packA.TypeA refToA opposite refToB
- }
- '''.toString), null)
- resourceA.load(new StringInputStream('''
- package packA
-
- class TypeA {
- refers packB.TypeB refToB opposite refToA
- }
- '''.toString), null)
-
- validator.assertNoErrors(resourceA.contents.head)
- validator.assertNoErrors(resourceB.contents.head)
- val allContents = resourceA.allContents
- val xclass = allContents.filter(typeof(XClass)).head
- val referencedGenClass = xclass.members.head.type.type
- assertEquals('TypeB', (referencedGenClass as GenClass).name)
- val ref = xclass.members.head as XReference
- assertEquals(ref , (ref.opposite.XFeature as XReference).opposite.XFeature)
- }
+/**
+ * Copyright (c) 2011-2012 Eclipse contributors and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ */
+package org.eclipse.emf.test.ecore.xcore
+
+import com.google.inject.Inject
+import org.eclipse.emf.codegen.ecore.genmodel.GenClass
+import org.eclipse.emf.common.util.URI
+import org.eclipse.emf.ecore.xcore.XClass
+import org.eclipse.emf.ecore.xcore.XcoreInjectorProvider
+import org.eclipse.xtext.junit4.InjectWith
+import org.eclipse.xtext.junit4.XtextRunner
+import org.eclipse.xtext.junit4.validation.ValidationTestHelper
+import org.eclipse.xtext.resource.XtextResourceSet
+import org.eclipse.xtext.util.StringInputStream
+import org.junit.Test
+import org.junit.runner.RunWith
+
+import static org.junit.Assert.*
+
+import org.eclipse.emf.ecore.xcore.XReference
+import org.eclipse.emf.ecore.xcore.mappings.XcoreMapper
+
+@RunWith(typeof(XtextRunner))
+@InjectWith(typeof(XcoreInjectorProvider))
+class MultiFileTest {
+
+ @Inject
+ XtextResourceSet resourceSet
+
+ @Inject
+ ValidationTestHelper validator
+
+ @Inject
+ extension XcoreMapper mapper
+
+ @Test
+ def void testReferenceBetweenTwoModels() {
+ val resourceA = resourceSet.createResource(URI::createURI('file:/modelA.xcore'))
+ val resourceB = resourceSet.createResource(URI::createURI('file:/modelB.xcore'))
+ resourceB.load(new StringInputStream('''
+ package packB
+
+ class TypeB {
+ }
+ '''.toString), null)
+ resourceA.load(new StringInputStream('''
+ package packA
+
+ class TypeA {
+ refers packB.TypeB refToB
+ }
+ '''.toString), null)
+
+ validator.assertNoErrors(resourceA.contents.head)
+ validator.assertNoErrors(resourceB.contents.head)
+ val allContents = resourceA.allContents
+ val xclass = allContents.filter(typeof(XClass)).head
+ val referencedGenClass = xclass.members.head.type.type
+ assertEquals('TypeB', (referencedGenClass as GenClass).name)
+ }
+
+ @Test
+ def void testBidirectionalReferenceBetweenTwoModels() {
+ val resourceA = resourceSet.createResource(URI::createURI('file:/modelA.xcore'))
+ val resourceB = resourceSet.createResource(URI::createURI('file:/modelB.xcore'))
+ resourceB.load(new StringInputStream('''
+ package packB
+
+ class TypeB {
+ refers packA.TypeA refToA opposite refToB
+ }
+ '''.toString), null)
+ resourceA.load(new StringInputStream('''
+ package packA
+
+ class TypeA {
+ refers packB.TypeB refToB opposite refToA
+ }
+ '''.toString), null)
+
+ validator.assertNoErrors(resourceA.contents.head)
+ validator.assertNoErrors(resourceB.contents.head)
+ val allContents = resourceA.allContents
+ val xclass = allContents.filter(typeof(XClass)).head
+ val referencedGenClass = xclass.members.head.type.type
+ assertEquals('TypeB', (referencedGenClass as GenClass).name)
+ val ref = xclass.members.head as XReference
+ assertEquals(ref , (ref.opposite.XFeature as XReference).opposite.XFeature)
+ }
} \ No newline at end of file
diff --git a/tests/org.eclipse.emf.test.ecore.xcore/src/org/eclipse/emf/test/ecore/xcore/ParsingTest.xtend b/tests/org.eclipse.emf.test.ecore.xcore/src/org/eclipse/emf/test/ecore/xcore/ParsingTest.xtend
index 86b308b71..9b7e7a333 100644
--- a/tests/org.eclipse.emf.test.ecore.xcore/src/org/eclipse/emf/test/ecore/xcore/ParsingTest.xtend
+++ b/tests/org.eclipse.emf.test.ecore.xcore/src/org/eclipse/emf/test/ecore/xcore/ParsingTest.xtend
@@ -1,215 +1,215 @@
-/**
- * Copyright (c) 2011-2012 Eclipse contributors and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- */
-package org.eclipse.emf.test.ecore.xcore
-
-import org.junit.runner.RunWith
-import org.eclipse.xtext.junit4.InjectWith
-import com.google.inject.Inject
-import org.eclipse.xtext.junit4.util.ParseHelper
-import org.eclipse.emf.ecore.xcore.XPackage
-import org.junit.Test
-import static org.junit.Assert.*
-import org.eclipse.xtext.junit4.XtextRunner
-import org.eclipse.emf.ecore.xcore.XcoreInjectorProvider
-import org.eclipse.emf.ecore.xcore.XClass
-import org.eclipse.emf.ecore.xcore.XcoreExtensions
-import org.eclipse.emf.ecore.xcore.XReference
-import org.eclipse.xtext.resource.XtextResource
-import org.eclipse.emf.ecore.xcore.XOperation
-import org.eclipse.xtext.junit4.validation.ValidationTestHelper
-import org.eclipse.emf.ecore.util.EcoreUtil
-import org.eclipse.emf.ecore.xcore.XAttribute
-import org.eclipse.emf.codegen.ecore.genmodel.GenClassifier
-
-@RunWith(typeof(XtextRunner))
-@InjectWith(typeof(XcoreInjectorProvider))
-class ParsingTest extends Object {
-
- @Inject
- ParseHelper<XPackage> parser
-
- @Inject
- extension XcoreExtensions exts
-
- @Inject
- extension ValidationTestHelper vth
-
- @Test
- def void parseSimpleFile() {
- val parse = parser.parse("package foo");
- assertEquals("foo", parse.getName());
- }
-
- @Test
- def void testJvmTypes() {
- val pack = parser.parse('''
- package foo
- class A
- {
- refers A a
- }
- ''')
- EcoreUtil::resolveAll(pack.eResource)
- vth.assertNoErrors(pack);
- }
-
- @Test
- def void testSuperTypeLinking_1() {
- val pack = parser.parse('''
- package foo
- class A {}
- class B extends A {}
- ''')
- val clazz = pack.classifiers.get(1) as XClass
- assertEquals("A", clazz.superTypes.head.genClass.name)
- }
-
- @Test
- def void testSuperTypeLinking_2() {
- val pack = parser.parse('''
- package foo
- class A {}
- class B extends foo.A {}
- ''')
- val clazz = pack.classifiers.get(1) as XClass
- assertEquals("A", clazz.superTypes.head.genClass.name)
- }
-
- @Test
- def void testReferenceToAnnotation() {
- val pack = parser.parse('''
- package foo
- annotation 'foo/bar' as foo
- @foo(holla='bar')
- class A {}
- ''')
- val clazz = pack.classifiers.get(0) as XClass
- assertEquals(pack.annotationDirectives.head, clazz.annotations.head.source)
- }
-
- @Test
- def void testReferenceToOpposite() {
- val text = '''
- package foo
- class X
- {
- refers X x opposite y
- refers X y opposite x
- op void foo() {
- val X x = null
- }
- }
- '''.toString
- val pack = parser.parse(text)
- {
- val clazz = pack.classifiers.get(0) as XClass
- val refs = clazz.members.filter(typeof(XReference)).iterator
- var refX = refs.next
- var refY = refs.next
- assertEquals(refY.name, refX.opposite.name)
- assertEquals(refX.name, refY.opposite.name)
- }
- val resource = pack.eResource as XtextResource
- val elements = resource.contents.size
- resource.update(0, text.length, text)
- {
- val clazz = (resource.contents.get(0) as XPackage).classifiers.get(0) as XClass
- val refs = clazz.members.filter(typeof(XReference)).iterator
- var refX = refs.next
- var refY = refs.next
- assertEquals(refY.name, refX.opposite.name)
- assertEquals(refX.name, refY.opposite.name)
- assertEquals(elements, resource.contents.size)
- }
-
- resource.reparse(text)
- {
- val clazz = (resource.contents.get(0) as XPackage).classifiers.get(0) as XClass
- val refs = clazz.members.filter(typeof(XReference)).iterator
- var refX = refs.next
- var refY = refs.next
- assertEquals(refY.name, refX.opposite.name)
- assertEquals(refX.name, refY.opposite.name)
- assertEquals(elements, resource.contents.size)
- }
- }
-
- @Test
- def void operationReturnsVoid() {
- val pack = parser.parse('''
- package foo
- class Bar {
- op void operation() {}
- }
- ''');
- val clazz = pack.classifiers.head as XClass
- val operation = clazz.members.head as XOperation
- assertTrue(clazz.eResource.errors.isEmpty)
- assertNull(operation.type)
- }
-
- @Test
- def void referenceMayNotBeVoid() {
- val pack = parser.parse('''
- package foo
- class Bar {
- refers void referenceName
- }
- ''');
- assertTrue(pack.eResource.errors.toString, 1 <= pack.eResource.errors.size)
- }
-
- @Test
- def void stringResolvesToEString() {
- val pack = parser.parse('''
- package foo
- class Bar {
- String value
- }
- ''');
- val clazz = pack.classifiers.head as XClass
- val attribute = clazz.members.head as XAttribute
- assertTrue(attribute.type.type instanceof GenClassifier)
- assertEquals("EString", (attribute.type.type as GenClassifier).getName())
- }
-
- @Test
- def void testEcoreDataTypeAliases() {
- val pack = parser.parse('''
- package foo
- class A
- {
- java.math.BigDecimal _bigDecimal
- java.math.BigInteger _bigInteger
- boolean _boolean
- Boolean _Boolean
- byte _byte
- Byte _Byte
- char _char
- Character _Character
- java.util.Date _date
- double _double
- Double _Double
- float _float
- Float _Float
- int _int
- Integer _Integer
- Class _class
- Object _object
- long _long
- Long _Long
- short _short
- Short _Short
- String _String
- }
- ''')
- EcoreUtil::resolveAll(pack.eResource)
- vth.assertNoErrors(pack);
- }
-
+/**
+ * Copyright (c) 2011-2012 Eclipse contributors and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ */
+package org.eclipse.emf.test.ecore.xcore
+
+import org.junit.runner.RunWith
+import org.eclipse.xtext.junit4.InjectWith
+import com.google.inject.Inject
+import org.eclipse.xtext.junit4.util.ParseHelper
+import org.eclipse.emf.ecore.xcore.XPackage
+import org.junit.Test
+import static org.junit.Assert.*
+import org.eclipse.xtext.junit4.XtextRunner
+import org.eclipse.emf.ecore.xcore.XcoreInjectorProvider
+import org.eclipse.emf.ecore.xcore.XClass
+import org.eclipse.emf.ecore.xcore.XcoreExtensions
+import org.eclipse.emf.ecore.xcore.XReference
+import org.eclipse.xtext.resource.XtextResource
+import org.eclipse.emf.ecore.xcore.XOperation
+import org.eclipse.xtext.junit4.validation.ValidationTestHelper
+import org.eclipse.emf.ecore.util.EcoreUtil
+import org.eclipse.emf.ecore.xcore.XAttribute
+import org.eclipse.emf.codegen.ecore.genmodel.GenClassifier
+
+@RunWith(typeof(XtextRunner))
+@InjectWith(typeof(XcoreInjectorProvider))
+class ParsingTest extends Object {
+
+ @Inject
+ ParseHelper<XPackage> parser
+
+ @Inject
+ extension XcoreExtensions exts
+
+ @Inject
+ extension ValidationTestHelper vth
+
+ @Test
+ def void parseSimpleFile() {
+ val parse = parser.parse("package foo");
+ assertEquals("foo", parse.getName());
+ }
+
+ @Test
+ def void testJvmTypes() {
+ val pack = parser.parse('''
+ package foo
+ class A
+ {
+ refers A a
+ }
+ ''')
+ EcoreUtil::resolveAll(pack.eResource)
+ vth.assertNoErrors(pack);
+ }
+
+ @Test
+ def void testSuperTypeLinking_1() {
+ val pack = parser.parse('''
+ package foo
+ class A {}
+ class B extends A {}
+ ''')
+ val clazz = pack.classifiers.get(1) as XClass
+ assertEquals("A", clazz.superTypes.head.genClass.name)
+ }
+
+ @Test
+ def void testSuperTypeLinking_2() {
+ val pack = parser.parse('''
+ package foo
+ class A {}
+ class B extends foo.A {}
+ ''')
+ val clazz = pack.classifiers.get(1) as XClass
+ assertEquals("A", clazz.superTypes.head.genClass.name)
+ }
+
+ @Test
+ def void testReferenceToAnnotation() {
+ val pack = parser.parse('''
+ package foo
+ annotation 'foo/bar' as foo
+ @foo(holla='bar')
+ class A {}
+ ''')
+ val clazz = pack.classifiers.get(0) as XClass
+ assertEquals(pack.annotationDirectives.head, clazz.annotations.head.source)
+ }
+
+ @Test
+ def void testReferenceToOpposite() {
+ val text = '''
+ package foo
+ class X
+ {
+ refers X x opposite y
+ refers X y opposite x
+ op void foo() {
+ val X x = null
+ }
+ }
+ '''.toString
+ val pack = parser.parse(text)
+ {
+ val clazz = pack.classifiers.get(0) as XClass
+ val refs = clazz.members.filter(typeof(XReference)).iterator
+ var refX = refs.next
+ var refY = refs.next
+ assertEquals(refY.name, refX.opposite.name)
+ assertEquals(refX.name, refY.opposite.name)
+ }
+ val resource = pack.eResource as XtextResource
+ val elements = resource.contents.size
+ resource.update(0, text.length, text)
+ {
+ val clazz = (resource.contents.get(0) as XPackage).classifiers.get(0) as XClass
+ val refs = clazz.members.filter(typeof(XReference)).iterator
+ var refX = refs.next
+ var refY = refs.next
+ assertEquals(refY.name, refX.opposite.name)
+ assertEquals(refX.name, refY.opposite.name)
+ assertEquals(elements, resource.contents.size)
+ }
+
+ resource.reparse(text)
+ {
+ val clazz = (resource.contents.get(0) as XPackage).classifiers.get(0) as XClass
+ val refs = clazz.members.filter(typeof(XReference)).iterator
+ var refX = refs.next
+ var refY = refs.next
+ assertEquals(refY.name, refX.opposite.name)
+ assertEquals(refX.name, refY.opposite.name)
+ assertEquals(elements, resource.contents.size)
+ }
+ }
+
+ @Test
+ def void operationReturnsVoid() {
+ val pack = parser.parse('''
+ package foo
+ class Bar {
+ op void operation() {}
+ }
+ ''');
+ val clazz = pack.classifiers.head as XClass
+ val operation = clazz.members.head as XOperation
+ assertTrue(clazz.eResource.errors.isEmpty)
+ assertNull(operation.type)
+ }
+
+ @Test
+ def void referenceMayNotBeVoid() {
+ val pack = parser.parse('''
+ package foo
+ class Bar {
+ refers void referenceName
+ }
+ ''');
+ assertTrue(pack.eResource.errors.toString, 1 <= pack.eResource.errors.size)
+ }
+
+ @Test
+ def void stringResolvesToEString() {
+ val pack = parser.parse('''
+ package foo
+ class Bar {
+ String value
+ }
+ ''');
+ val clazz = pack.classifiers.head as XClass
+ val attribute = clazz.members.head as XAttribute
+ assertTrue(attribute.type.type instanceof GenClassifier)
+ assertEquals("EString", (attribute.type.type as GenClassifier).getName())
+ }
+
+ @Test
+ def void testEcoreDataTypeAliases() {
+ val pack = parser.parse('''
+ package foo
+ class A
+ {
+ java.math.BigDecimal _bigDecimal
+ java.math.BigInteger _bigInteger
+ boolean _boolean
+ Boolean _Boolean
+ byte _byte
+ Byte _Byte
+ char _char
+ Character _Character
+ java.util.Date _date
+ double _double
+ Double _Double
+ float _float
+ Float _Float
+ int _int
+ Integer _Integer
+ Class _class
+ Object _object
+ long _long
+ Long _Long
+ short _short
+ Short _Short
+ String _String
+ }
+ ''')
+ EcoreUtil::resolveAll(pack.eResource)
+ vth.assertNoErrors(pack);
+ }
+
} \ No newline at end of file
diff --git a/tests/org.eclipse.emf.test.ecore.xcore/src/org/eclipse/emf/test/ecore/xcore/generator/GeneratorTest.xtend b/tests/org.eclipse.emf.test.ecore.xcore/src/org/eclipse/emf/test/ecore/xcore/generator/GeneratorTest.xtend
index 1fb56ae00..5d74fe8d3 100644
--- a/tests/org.eclipse.emf.test.ecore.xcore/src/org/eclipse/emf/test/ecore/xcore/generator/GeneratorTest.xtend
+++ b/tests/org.eclipse.emf.test.ecore.xcore/src/org/eclipse/emf/test/ecore/xcore/generator/GeneratorTest.xtend
@@ -1,47 +1,47 @@
-/**
- * Copyright (c) 2011-2012 Eclipse contributors and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- */
-package org.eclipse.emf.test.ecore.xcore.generator
-
-import com.google.inject.Inject
-import org.eclipse.emf.ecore.xcore.XPackage
-import org.eclipse.emf.ecore.xcore.XcoreInjectorProvider
-import org.eclipse.emf.ecore.xcore.generator.XcoreGenerator
-import org.eclipse.xtext.generator.InMemoryFileSystemAccess
-import org.eclipse.xtext.junit4.InjectWith
-import org.eclipse.xtext.junit4.XtextRunner
-import org.eclipse.xtext.junit4.util.ParseHelper
-import org.junit.Test
-import org.junit.runner.RunWith
-
-import static org.junit.Assert.*
-import org.eclipse.xtext.generator.IFileSystemAccess
-
-@RunWith(typeof(XtextRunner))
-@InjectWith(typeof(XcoreInjectorProvider))
-class GeneratorTest {
-
- @Inject
- ParseHelper<XPackage> parser
-
- @Inject
- XcoreGenerator xcoreGenerator
-
- @Test
- def void testGenerator() {
- val xPackage = parser.parse('''
- @GenModel(modelDirectory="Nowhere")
- package test
- class X {}
- ''')
- val inmemFsa = new InMemoryFileSystemAccess()
- xcoreGenerator.doGenerate(xPackage.eResource, inmemFsa)
- assertEquals(inmemFsa.files.keySet.toString, 8, inmemFsa.files.size)
-
- assertNotNull(inmemFsa.files.get(IFileSystemAccess::DEFAULT_OUTPUT+'/test/util/TestSwitch.java'))
- }
+/**
+ * Copyright (c) 2011-2012 Eclipse contributors and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ */
+package org.eclipse.emf.test.ecore.xcore.generator
+
+import com.google.inject.Inject
+import org.eclipse.emf.ecore.xcore.XPackage
+import org.eclipse.emf.ecore.xcore.XcoreInjectorProvider
+import org.eclipse.emf.ecore.xcore.generator.XcoreGenerator
+import org.eclipse.xtext.generator.InMemoryFileSystemAccess
+import org.eclipse.xtext.junit4.InjectWith
+import org.eclipse.xtext.junit4.XtextRunner
+import org.eclipse.xtext.junit4.util.ParseHelper
+import org.junit.Test
+import org.junit.runner.RunWith
+
+import static org.junit.Assert.*
+import org.eclipse.xtext.generator.IFileSystemAccess
+
+@RunWith(typeof(XtextRunner))
+@InjectWith(typeof(XcoreInjectorProvider))
+class GeneratorTest {
+
+ @Inject
+ ParseHelper<XPackage> parser
+
+ @Inject
+ XcoreGenerator xcoreGenerator
+
+ @Test
+ def void testGenerator() {
+ val xPackage = parser.parse('''
+ @GenModel(modelDirectory="Nowhere")
+ package test
+ class X {}
+ ''')
+ val inmemFsa = new InMemoryFileSystemAccess()
+ xcoreGenerator.doGenerate(xPackage.eResource, inmemFsa)
+ assertEquals(inmemFsa.files.keySet.toString, 8, inmemFsa.files.size)
+
+ assertNotNull(inmemFsa.files.get(IFileSystemAccess::DEFAULT_OUTPUT+'/test/util/TestSwitch.java'))
+ }
} \ No newline at end of file
diff --git a/tests/org.eclipse.emf.test.ecore.xcore/src/org/eclipse/emf/test/ecore/xcore/genmodel/XcoreGenModelTest.java b/tests/org.eclipse.emf.test.ecore.xcore/src/org/eclipse/emf/test/ecore/xcore/genmodel/XcoreGenModelTest.java
index 50ffff9d6..15d384d6d 100644
--- a/tests/org.eclipse.emf.test.ecore.xcore/src/org/eclipse/emf/test/ecore/xcore/genmodel/XcoreGenModelTest.java
+++ b/tests/org.eclipse.emf.test.ecore.xcore/src/org/eclipse/emf/test/ecore/xcore/genmodel/XcoreGenModelTest.java
@@ -1,66 +1,66 @@
-/**
- * Copyright (c) 2011-2012 Eclipse contributors and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- */
-package org.eclipse.emf.test.ecore.xcore.genmodel;
-
-
-import org.eclipse.emf.codegen.ecore.genmodel.GenBase;
-import org.eclipse.emf.ecore.util.EcoreUtil;
-import org.eclipse.emf.ecore.xcore.XNamedElement;
-import org.eclipse.emf.ecore.xcore.XcoreInjectorProvider;
-import org.eclipse.emf.ecore.xcore.mappings.XcoreMapper;
-import org.eclipse.emf.test.ecore.xcore.GenModelFormatter;
-import org.eclipse.xtext.junit4.InjectWith;
-import org.eclipse.xtext.junit4.parameterized.InjectParameter;
-import org.eclipse.xtext.junit4.parameterized.Offset;
-import org.eclipse.xtext.junit4.parameterized.ParameterSyntax;
-import org.eclipse.xtext.junit4.parameterized.ParameterizedXtextRunner;
-import org.eclipse.xtext.junit4.parameterized.ResourceURIs;
-import org.eclipse.xtext.junit4.parameterized.XpectString;
-import org.eclipse.xtext.junit4.validation.ValidationTestHelper;
-import org.eclipse.xtext.resource.XtextResource;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-
-import com.google.inject.Inject;
-
-
-@SuppressWarnings("restriction")
-@InjectWith(XcoreInjectorProvider.class)
-@RunWith(ParameterizedXtextRunner.class)
-@ResourceURIs(baseDir = "src/org/eclipse/emf/test/ecore/xcore/genmodel", fileExtensions = "xcore")
-public class XcoreGenModelTest
-{
-
- @Inject
- private XcoreMapper mapper;
-
- @InjectParameter
- private Offset offset;
-
- @InjectParameter
- private XtextResource resource;
-
- @Inject
- private ValidationTestHelper validationHelper;
-
- @Test
- public void noValidationIssues()
- {
- validationHelper.assertNoIssues(resource.getContents().get(0));
- }
-
- @XpectString
- @ParameterSyntax("'at' offset=OFFSET")
- public String genBase()
- {
- EcoreUtil.resolveAll(resource);
- GenBase gen = mapper.getGen((XNamedElement)offset.getEObject());
- return new GenModelFormatter().resolveCrossReferences().format(gen);
- }
-
-}
+/**
+ * Copyright (c) 2011-2012 Eclipse contributors and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ */
+package org.eclipse.emf.test.ecore.xcore.genmodel;
+
+
+import org.eclipse.emf.codegen.ecore.genmodel.GenBase;
+import org.eclipse.emf.ecore.util.EcoreUtil;
+import org.eclipse.emf.ecore.xcore.XNamedElement;
+import org.eclipse.emf.ecore.xcore.XcoreInjectorProvider;
+import org.eclipse.emf.ecore.xcore.mappings.XcoreMapper;
+import org.eclipse.emf.test.ecore.xcore.GenModelFormatter;
+import org.eclipse.xtext.junit4.InjectWith;
+import org.eclipse.xtext.junit4.parameterized.InjectParameter;
+import org.eclipse.xtext.junit4.parameterized.Offset;
+import org.eclipse.xtext.junit4.parameterized.ParameterSyntax;
+import org.eclipse.xtext.junit4.parameterized.ParameterizedXtextRunner;
+import org.eclipse.xtext.junit4.parameterized.ResourceURIs;
+import org.eclipse.xtext.junit4.parameterized.XpectString;
+import org.eclipse.xtext.junit4.validation.ValidationTestHelper;
+import org.eclipse.xtext.resource.XtextResource;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+import com.google.inject.Inject;
+
+
+@SuppressWarnings("restriction")
+@InjectWith(XcoreInjectorProvider.class)
+@RunWith(ParameterizedXtextRunner.class)
+@ResourceURIs(baseDir = "src/org/eclipse/emf/test/ecore/xcore/genmodel", fileExtensions = "xcore")
+public class XcoreGenModelTest
+{
+
+ @Inject
+ private XcoreMapper mapper;
+
+ @InjectParameter
+ private Offset offset;
+
+ @InjectParameter
+ private XtextResource resource;
+
+ @Inject
+ private ValidationTestHelper validationHelper;
+
+ @Test
+ public void noValidationIssues()
+ {
+ validationHelper.assertNoIssues(resource.getContents().get(0));
+ }
+
+ @XpectString
+ @ParameterSyntax("'at' offset=OFFSET")
+ public String genBase()
+ {
+ EcoreUtil.resolveAll(resource);
+ GenBase gen = mapper.getGen((XNamedElement)offset.getEObject());
+ return new GenModelFormatter().resolveCrossReferences().format(gen);
+ }
+
+}
diff --git a/tests/org.eclipse.emf.test.ecore.xcore/src/org/eclipse/emf/test/ecore/xcore/interpreter/XcoreInterpreterTest.xtend b/tests/org.eclipse.emf.test.ecore.xcore/src/org/eclipse/emf/test/ecore/xcore/interpreter/XcoreInterpreterTest.xtend
index 1b1b94819..88188a0a0 100644
--- a/tests/org.eclipse.emf.test.ecore.xcore/src/org/eclipse/emf/test/ecore/xcore/interpreter/XcoreInterpreterTest.xtend
+++ b/tests/org.eclipse.emf.test.ecore.xcore/src/org/eclipse/emf/test/ecore/xcore/interpreter/XcoreInterpreterTest.xtend
@@ -1,165 +1,165 @@
-/**
- * Copyright (c) 2011-2012 Eclipse contributors and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- */
-package org.eclipse.emf.test.ecore.xcore.interpreter
-
-import com.google.inject.Inject
-import org.eclipse.emf.common.util.BasicEList
-import org.eclipse.emf.ecore.EClass
-import org.eclipse.emf.ecore.EPackage
-import org.eclipse.emf.ecore.xcore.XPackage
-import org.eclipse.emf.ecore.xcore.XcoreInjectorProvider
-import org.eclipse.xtext.junit4.InjectWith
-import org.eclipse.xtext.junit4.XtextRunner
-import org.eclipse.xtext.junit4.util.ParseHelper
-import org.eclipse.xtext.junit4.validation.ValidationTestHelper
-import org.junit.Test
-import org.junit.runner.RunWith
-
-import static org.junit.Assert.*
-import org.eclipse.emf.ecore.EDataType
-import org.eclipse.emf.common.util.URI
-import org.eclipse.emf.ecore.EEnum
-import java.util.List
-
-@RunWith(typeof(XtextRunner))
-@InjectWith(typeof(XcoreInjectorProvider))
-class XcoreInterpreterTest {
-
- @Inject
- ParseHelper<XPackage> parse
-
- @Inject
- ValidationTestHelper validator
-
- @Test
- def void testInterpretation() {
- val pack = parse.parse('''
- package foo.bar
-
- class Foo {
- op String doStuff(String msg) {
- return "Foo says hi to "+msg
- }
- }
- ''')
- validator.assertNoErrors(pack)
- val ePackage = pack.eResource.contents.get(2) as EPackage
- val fooClass = ePackage.getEClassifier("Foo") as EClass
- val foo = ePackage.EFactoryInstance.create(fooClass)
- assertEquals("Foo says hi to Bar", foo.eInvoke(fooClass.EOperations.head, new BasicEList(newArrayList("Bar"))))
- }
-
- @Test
- def void testInterpretation_2() {
- val pack = parse.parse('''
- package foo.bar
-
- class Foo {
- op String call1(String msg) {
- return "call1"+call2("call1"+msg)
- }
-
- op String call2(String msg) {
- return "call2"+msg
- }
- }
- ''')
- validator.assertNoErrors(pack)
- val ePackage = pack.eResource.contents.get(2) as EPackage
- val fooClass = ePackage.getEClassifier("Foo") as EClass
- val foo = ePackage.EFactoryInstance.create(fooClass)
- assertEquals("call1call2call1Bar", foo.eInvoke(fooClass.EOperations.head, new BasicEList(newArrayList("Bar"))))
- }
-
- @Test
- def void testFeatureAccessors() {
- val pack = parse.parse('''
- package foo.bar
-
- class Foo {
- String value
- op void storeValue(String newValue) {
- value = newValue
- }
-
- op String fetchValue() {
- return value
- }
- }
- ''')
- validator.assertNoErrors(pack)
- val ePackage = pack.eResource.contents.get(2) as EPackage
- val fooClass = ePackage.getEClassifier("Foo") as EClass
- val foo = ePackage.EFactoryInstance.create(fooClass)
- foo.eInvoke(fooClass.EOperations.head, new BasicEList(newArrayList("Bar")));
- assertEquals("Bar", foo.eInvoke(fooClass.EOperations.get(1), null));
- }
-
- @Test
- def void testConversionDelegates() {
- val pack = parse.parse('''
- package foo.bar
-
- type URI wraps org.eclipse.emf.common.util.URI
- create { if (it == null) null else org::eclipse::emf::common::util::URI::createURI(it) }
- convert { it?.toString }
- ''')
- validator.assertNoErrors(pack)
- val ePackage = pack.eResource.contents.get(2) as EPackage
- val uriDataType = ePackage.getEClassifier("URI") as EDataType
- val literal = "http://www.eclipse.org"
- val uri = ePackage.EFactoryInstance.createFromString(uriDataType, literal) as URI;
- assertEquals(literal, ePackage.EFactoryInstance.convertToString(uriDataType, uri));
- }
-
- @Test
- def void testSettingDelegates() {
- val pack = parse.parse('''
- package foo.bar
- class Foo
- {
- String name
- String alias get { name}
- }
- ''')
- validator.assertNoErrors(pack)
- val ePackage = pack.eResource.contents.get(2) as EPackage
- val fooClass = ePackage.getEClassifier("Foo") as EClass
- val foo = ePackage.EFactoryInstance.create(fooClass)
- foo.eSet(fooClass.getEStructuralFeature("name"), "Sven");
- assertEquals("Sven", foo.eGet(fooClass.getEStructuralFeature("alias")));
- }
- @Test
- def void testEnum() {
- val pack = parse.parse('''
- package foo.bar
- enum NodeKind { Singleton Root Intermediate Leaf }
- class Node
- {
- refers Node parent opposite children
- contains Node[0..*] children opposite parent
- op boolean hasChildren() { !children.empty }
- transient volatile derived readonly NodeKind nodeKind
- get
- {
- if (hasChildren()) {if (parent == null) {NodeKind::ROOT} else {NodeKind::INTERMEDIATE}}
- else {if (parent == null) {NodeKind::SINGLETON} else {NodeKind::LEAF}}
- }
- }
- ''')
- validator.assertNoErrors(pack)
- val ePackage = pack.eResource.contents.get(2) as EPackage
- val nodeKindEnum = ePackage.getEClassifier("NodeKind") as EEnum
- val nodeClass = ePackage.getEClassifier("Node") as EClass
- val node = ePackage.EFactoryInstance.create(nodeClass)
- assertEquals(nodeKindEnum.getEEnumLiteral("Singleton"), node.eGet(nodeClass.getEStructuralFeature("nodeKind")));
- val childNode = ePackage.EFactoryInstance.create(nodeClass)
- (node.eGet(nodeClass.getEStructuralFeature("children")) as List).add(childNode);
- assertEquals(nodeKindEnum.getEEnumLiteral("Root"), node.eGet(nodeClass.getEStructuralFeature("nodeKind")));
- }
+/**
+ * Copyright (c) 2011-2012 Eclipse contributors and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ */
+package org.eclipse.emf.test.ecore.xcore.interpreter
+
+import com.google.inject.Inject
+import org.eclipse.emf.common.util.BasicEList
+import org.eclipse.emf.ecore.EClass
+import org.eclipse.emf.ecore.EPackage
+import org.eclipse.emf.ecore.xcore.XPackage
+import org.eclipse.emf.ecore.xcore.XcoreInjectorProvider
+import org.eclipse.xtext.junit4.InjectWith
+import org.eclipse.xtext.junit4.XtextRunner
+import org.eclipse.xtext.junit4.util.ParseHelper
+import org.eclipse.xtext.junit4.validation.ValidationTestHelper
+import org.junit.Test
+import org.junit.runner.RunWith
+
+import static org.junit.Assert.*
+import org.eclipse.emf.ecore.EDataType
+import org.eclipse.emf.common.util.URI
+import org.eclipse.emf.ecore.EEnum
+import java.util.List
+
+@RunWith(typeof(XtextRunner))
+@InjectWith(typeof(XcoreInjectorProvider))
+class XcoreInterpreterTest {
+
+ @Inject
+ ParseHelper<XPackage> parse
+
+ @Inject
+ ValidationTestHelper validator
+
+ @Test
+ def void testInterpretation() {
+ val pack = parse.parse('''
+ package foo.bar
+
+ class Foo {
+ op String doStuff(String msg) {
+ return "Foo says hi to "+msg
+ }
+ }
+ ''')
+ validator.assertNoErrors(pack)
+ val ePackage = pack.eResource.contents.get(2) as EPackage
+ val fooClass = ePackage.getEClassifier("Foo") as EClass
+ val foo = ePackage.EFactoryInstance.create(fooClass)
+ assertEquals("Foo says hi to Bar", foo.eInvoke(fooClass.EOperations.head, new BasicEList(newArrayList("Bar"))))
+ }
+
+ @Test
+ def void testInterpretation_2() {
+ val pack = parse.parse('''
+ package foo.bar
+
+ class Foo {
+ op String call1(String msg) {
+ return "call1"+call2("call1"+msg)
+ }
+
+ op String call2(String msg) {
+ return "call2"+msg
+ }
+ }
+ ''')
+ validator.assertNoErrors(pack)
+ val ePackage = pack.eResource.contents.get(2) as EPackage
+ val fooClass = ePackage.getEClassifier("Foo") as EClass
+ val foo = ePackage.EFactoryInstance.create(fooClass)
+ assertEquals("call1call2call1Bar", foo.eInvoke(fooClass.EOperations.head, new BasicEList(newArrayList("Bar"))))
+ }
+
+ @Test
+ def void testFeatureAccessors() {
+ val pack = parse.parse('''
+ package foo.bar
+
+ class Foo {
+ String value
+ op void storeValue(String newValue) {
+ value = newValue
+ }
+
+ op String fetchValue() {
+ return value
+ }
+ }
+ ''')
+ validator.assertNoErrors(pack)
+ val ePackage = pack.eResource.contents.get(2) as EPackage
+ val fooClass = ePackage.getEClassifier("Foo") as EClass
+ val foo = ePackage.EFactoryInstance.create(fooClass)
+ foo.eInvoke(fooClass.EOperations.head, new BasicEList(newArrayList("Bar")));
+ assertEquals("Bar", foo.eInvoke(fooClass.EOperations.get(1), null));
+ }
+
+ @Test
+ def void testConversionDelegates() {
+ val pack = parse.parse('''
+ package foo.bar
+
+ type URI wraps org.eclipse.emf.common.util.URI
+ create { if (it == null) null else org::eclipse::emf::common::util::URI::createURI(it) }
+ convert { it?.toString }
+ ''')
+ validator.assertNoErrors(pack)
+ val ePackage = pack.eResource.contents.get(2) as EPackage
+ val uriDataType = ePackage.getEClassifier("URI") as EDataType
+ val literal = "http://www.eclipse.org"
+ val uri = ePackage.EFactoryInstance.createFromString(uriDataType, literal) as URI;
+ assertEquals(literal, ePackage.EFactoryInstance.convertToString(uriDataType, uri));
+ }
+
+ @Test
+ def void testSettingDelegates() {
+ val pack = parse.parse('''
+ package foo.bar
+ class Foo
+ {
+ String name
+ String alias get { name}
+ }
+ ''')
+ validator.assertNoErrors(pack)
+ val ePackage = pack.eResource.contents.get(2) as EPackage
+ val fooClass = ePackage.getEClassifier("Foo") as EClass
+ val foo = ePackage.EFactoryInstance.create(fooClass)
+ foo.eSet(fooClass.getEStructuralFeature("name"), "Sven");
+ assertEquals("Sven", foo.eGet(fooClass.getEStructuralFeature("alias")));
+ }
+ @Test
+ def void testEnum() {
+ val pack = parse.parse('''
+ package foo.bar
+ enum NodeKind { Singleton Root Intermediate Leaf }
+ class Node
+ {
+ refers Node parent opposite children
+ contains Node[0..*] children opposite parent
+ op boolean hasChildren() { !children.empty }
+ transient volatile derived readonly NodeKind nodeKind
+ get
+ {
+ if (hasChildren()) {if (parent == null) {NodeKind::ROOT} else {NodeKind::INTERMEDIATE}}
+ else {if (parent == null) {NodeKind::SINGLETON} else {NodeKind::LEAF}}
+ }
+ }
+ ''')
+ validator.assertNoErrors(pack)
+ val ePackage = pack.eResource.contents.get(2) as EPackage
+ val nodeKindEnum = ePackage.getEClassifier("NodeKind") as EEnum
+ val nodeClass = ePackage.getEClassifier("Node") as EClass
+ val node = ePackage.EFactoryInstance.create(nodeClass)
+ assertEquals(nodeKindEnum.getEEnumLiteral("Singleton"), node.eGet(nodeClass.getEStructuralFeature("nodeKind")));
+ val childNode = ePackage.EFactoryInstance.create(nodeClass)
+ (node.eGet(nodeClass.getEStructuralFeature("children")) as List).add(childNode);
+ assertEquals(nodeKindEnum.getEEnumLiteral("Root"), node.eGet(nodeClass.getEStructuralFeature("nodeKind")));
+ }
} \ No newline at end of file
diff --git a/tests/org.eclipse.emf.test.ecore.xcore/src/org/eclipse/emf/test/ecore/xcore/mapping/XcoreMapperTest.xtend b/tests/org.eclipse.emf.test.ecore.xcore/src/org/eclipse/emf/test/ecore/xcore/mapping/XcoreMapperTest.xtend
index 49a329de7..f30f490d7 100644
--- a/tests/org.eclipse.emf.test.ecore.xcore/src/org/eclipse/emf/test/ecore/xcore/mapping/XcoreMapperTest.xtend
+++ b/tests/org.eclipse.emf.test.ecore.xcore/src/org/eclipse/emf/test/ecore/xcore/mapping/XcoreMapperTest.xtend
@@ -1,97 +1,97 @@
-/**
- * Copyright (c) 2011-2012 Eclipse contributors and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- */
-package org.eclipse.emf.test.ecore.xcore.mapping
-
-import org.junit.runner.RunWith
-import org.eclipse.xtext.junit4.XtextRunner
-import org.eclipse.xtext.junit4.InjectWith
-import org.eclipse.emf.ecore.xcore.XcoreInjectorProvider
-import com.google.inject.Inject
-import org.eclipse.xtext.junit4.util.ParseHelper
-import org.eclipse.emf.ecore.xcore.XPackage
-import org.eclipse.emf.ecore.xcore.mappings.XcoreMapper
-import static org.junit.Assert.*
-import org.junit.Test
-import org.eclipse.emf.ecore.xcore.XClass
-import org.eclipse.emf.ecore.xcore.XStructuralFeature
-import org.eclipse.emf.ecore.xcore.XOperation
-
-@RunWith(typeof(XtextRunner))
-@InjectWith(typeof(XcoreInjectorProvider))
-class XcoreMapperTest {
-
- @Inject
- ParseHelper<XPackage> parser
-
- @Inject
- extension XcoreMapper mapper
-
- @Test
- def testMapping() {
- val pack = parser.parse('''
- package foo.bar
-
- type String wraps java.lang.String
-
- class X {
- attr String name
- refers Y reference
- }
-
- class Y<T> extends X {
- op String toString(X x) {
- return null
- }
- }
- ''')
- assertNotNull(pack.mapping.EPackage)
- assertEquals(pack.mapping.EPackage,pack.mapping.genPackage.getEcorePackage)
- assertEquals(pack,pack.mapping.genPackage.toXcoreMapping.xcoreElement)
- assertEquals(pack,pack.mapping.EPackage.toXcoreMapping.xcoreElement)
-
- for (clazz : pack.classifiers.filter(typeof(XClass))) {
- assertNotNull(clazz.mapping.EClass)
- assertEquals(clazz.mapping.EClass,clazz.mapping.genClass.ecoreClass)
- assertEquals(clazz,clazz.mapping.genClass.toXcoreMapping.xcoreElement)
- assertEquals(clazz,clazz.mapping.EClass.toXcoreMapping.xcoreElement)
-
- for (member : clazz.members) {
- switch member {
- XStructuralFeature : {
- assertNotNull(member.mapping.EStructuralFeature)
- assertEquals(member.mapping.EStructuralFeature, member.mapping.genFeature.ecoreFeature)
- assertEquals(member,member.mapping.EStructuralFeature.toXcoreMapping.xcoreElement)
- assertEquals(member,member.mapping.genFeature.toXcoreMapping.xcoreElement)
- //TODO jvm stuff
- }
- XOperation : {
- assertNotNull(member.mapping.EOperation)
- assertEquals(member.mapping.EOperation, member.mapping.genOperation.ecoreOperation)
- assertEquals(member,member.mapping.EOperation.toXcoreMapping.xcoreElement)
- assertEquals(member,member.mapping.genOperation.toXcoreMapping.xcoreElement)
- //TODO jvm stuff
- for (parameter : member.parameters) {
- assertNotNull(parameter.mapping.EParameter)
- assertEquals(parameter.mapping.EParameter, parameter.mapping.genParameter.ecoreParameter)
- assertEquals(parameter,parameter.mapping.EParameter.toXcoreMapping.xcoreElement)
- assertEquals(parameter,parameter.mapping.genParameter.toXcoreMapping.xcoreElement)
- //TODO jvm stuff
- }
- }
- }
- }
- for (typeParameter : clazz.typeParameters) {
- assertNotNull(typeParameter.mapping.ETypeParameter)
- assertEquals(typeParameter.mapping.ETypeParameter, typeParameter.mapping.genTypeParameter.ecoreTypeParameter)
- assertEquals(typeParameter,typeParameter.mapping.ETypeParameter.toXcoreMapping.xcoreElement)
- assertEquals(typeParameter,typeParameter.mapping.genTypeParameter.toXcoreMapping.xcoreElement)
- //TODO jvm stuff
- }
- }
- }
+/**
+ * Copyright (c) 2011-2012 Eclipse contributors and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ */
+package org.eclipse.emf.test.ecore.xcore.mapping
+
+import org.junit.runner.RunWith
+import org.eclipse.xtext.junit4.XtextRunner
+import org.eclipse.xtext.junit4.InjectWith
+import org.eclipse.emf.ecore.xcore.XcoreInjectorProvider
+import com.google.inject.Inject
+import org.eclipse.xtext.junit4.util.ParseHelper
+import org.eclipse.emf.ecore.xcore.XPackage
+import org.eclipse.emf.ecore.xcore.mappings.XcoreMapper
+import static org.junit.Assert.*
+import org.junit.Test
+import org.eclipse.emf.ecore.xcore.XClass
+import org.eclipse.emf.ecore.xcore.XStructuralFeature
+import org.eclipse.emf.ecore.xcore.XOperation
+
+@RunWith(typeof(XtextRunner))
+@InjectWith(typeof(XcoreInjectorProvider))
+class XcoreMapperTest {
+
+ @Inject
+ ParseHelper<XPackage> parser
+
+ @Inject
+ extension XcoreMapper mapper
+
+ @Test
+ def testMapping() {
+ val pack = parser.parse('''
+ package foo.bar
+
+ type String wraps java.lang.String
+
+ class X {
+ attr String name
+ refers Y reference
+ }
+
+ class Y<T> extends X {
+ op String toString(X x) {
+ return null
+ }
+ }
+ ''')
+ assertNotNull(pack.mapping.EPackage)
+ assertEquals(pack.mapping.EPackage,pack.mapping.genPackage.getEcorePackage)
+ assertEquals(pack,pack.mapping.genPackage.toXcoreMapping.xcoreElement)
+ assertEquals(pack,pack.mapping.EPackage.toXcoreMapping.xcoreElement)
+
+ for (clazz : pack.classifiers.filter(typeof(XClass))) {
+ assertNotNull(clazz.mapping.EClass)
+ assertEquals(clazz.mapping.EClass,clazz.mapping.genClass.ecoreClass)
+ assertEquals(clazz,clazz.mapping.genClass.toXcoreMapping.xcoreElement)
+ assertEquals(clazz,clazz.mapping.EClass.toXcoreMapping.xcoreElement)
+
+ for (member : clazz.members) {
+ switch member {
+ XStructuralFeature : {
+ assertNotNull(member.mapping.EStructuralFeature)
+ assertEquals(member.mapping.EStructuralFeature, member.mapping.genFeature.ecoreFeature)
+ assertEquals(member,member.mapping.EStructuralFeature.toXcoreMapping.xcoreElement)
+ assertEquals(member,member.mapping.genFeature.toXcoreMapping.xcoreElement)
+ //TODO jvm stuff
+ }
+ XOperation : {
+ assertNotNull(member.mapping.EOperation)
+ assertEquals(member.mapping.EOperation, member.mapping.genOperation.ecoreOperation)
+ assertEquals(member,member.mapping.EOperation.toXcoreMapping.xcoreElement)
+ assertEquals(member,member.mapping.genOperation.toXcoreMapping.xcoreElement)
+ //TODO jvm stuff
+ for (parameter : member.parameters) {
+ assertNotNull(parameter.mapping.EParameter)
+ assertEquals(parameter.mapping.EParameter, parameter.mapping.genParameter.ecoreParameter)
+ assertEquals(parameter,parameter.mapping.EParameter.toXcoreMapping.xcoreElement)
+ assertEquals(parameter,parameter.mapping.genParameter.toXcoreMapping.xcoreElement)
+ //TODO jvm stuff
+ }
+ }
+ }
+ }
+ for (typeParameter : clazz.typeParameters) {
+ assertNotNull(typeParameter.mapping.ETypeParameter)
+ assertEquals(typeParameter.mapping.ETypeParameter, typeParameter.mapping.genTypeParameter.ecoreTypeParameter)
+ assertEquals(typeParameter,typeParameter.mapping.ETypeParameter.toXcoreMapping.xcoreElement)
+ assertEquals(typeParameter,typeParameter.mapping.genTypeParameter.toXcoreMapping.xcoreElement)
+ //TODO jvm stuff
+ }
+ }
+ }
} \ No newline at end of file
diff --git a/tests/org.eclipse.emf.test.ecore.xcore/src/org/eclipse/emf/test/ecore/xcore/scoping/LazyGenModelInferenceTest.java b/tests/org.eclipse.emf.test.ecore.xcore/src/org/eclipse/emf/test/ecore/xcore/scoping/LazyGenModelInferenceTest.java
index 8d141c179..f803243bd 100644
--- a/tests/org.eclipse.emf.test.ecore.xcore/src/org/eclipse/emf/test/ecore/xcore/scoping/LazyGenModelInferenceTest.java
+++ b/tests/org.eclipse.emf.test.ecore.xcore/src/org/eclipse/emf/test/ecore/xcore/scoping/LazyGenModelInferenceTest.java
@@ -1,167 +1,167 @@
-/**
- * Copyright (c) 2011-2012 Eclipse contributors and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- */
-package org.eclipse.emf.test.ecore.xcore.scoping;
-
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertTrue;
-
-import java.io.IOException;
-import java.util.Iterator;
-
-import org.eclipse.emf.codegen.ecore.genmodel.GenModelPackage;
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.common.util.URI;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EcorePackage;
-import org.eclipse.emf.ecore.resource.Resource;
-import org.eclipse.emf.ecore.xcore.XcoreInjectorProvider;
-import org.eclipse.emf.ecore.xcore.XcoreStandaloneSetup;
-import org.eclipse.emf.ecore.xcore.resource.XcoreResource;
-import org.eclipse.xtext.common.types.TypesPackage;
-import org.eclipse.xtext.junit4.GlobalRegistries;
-import org.eclipse.xtext.junit4.InjectWith;
-import org.eclipse.xtext.junit4.XtextRunner;
-import org.eclipse.xtext.resource.IEObjectDescription;
-import org.eclipse.xtext.resource.IResourceDescription;
-import org.eclipse.xtext.resource.IResourceDescription.Manager;
-import org.eclipse.xtext.resource.XtextResource;
-import org.eclipse.xtext.resource.XtextResourceSet;
-import org.eclipse.xtext.util.StringInputStream;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-
-import com.google.inject.Guice;
-import com.google.inject.Inject;
-import com.google.inject.Injector;
-import com.google.inject.Provider;
-
-
-@RunWith(XtextRunner.class)
-@InjectWith(LazyGenModelInferenceTest.MyXcoreInjectorProvider.class)
-public class LazyGenModelInferenceTest
-{
-
- @Inject
- private Provider<XtextResourceSet> resourceSetProvider;
-
- public static class MyXcoreInjectorProvider extends XcoreInjectorProvider
- {
-
- private Injector injector;
-
- @Override
- public Injector getInjector()
- {
- if (injector == null)
- {
- stateBeforeInjectorCreation = GlobalRegistries.makeCopyOfGlobalState();
- this.injector =
- new XcoreStandaloneSetup()
- {
- @Override
- public Injector createInjector()
- {
- return Guice.createInjector(new org.eclipse.emf.ecore.xcore.XcoreRuntimeModule()
- {
- @Override
- public Class<? extends XtextResource> bindXtextResource()
- {
- return InspectableXcoreResource.class;
- }
- });
- }
- }.createInjectorAndDoEMFRegistration();
- stateAfterInjectorCreation = GlobalRegistries.makeCopyOfGlobalState();
- }
- return injector;
- }
-
- @Override
- public void setupRegistry()
- {
- super.setupRegistry();
- if (injector != null)
- {
- new XcoreStandaloneSetup().register(injector);
- }
- }
- }
-
- public static class InspectableXcoreResource extends XcoreResource
- {
-
- public EList<EObject> getContentsUnsafe()
- {
- return contents;
- }
-
- public boolean isFullyInitialized()
- {
- return fullyInitialized;
- }
-
- }
-
- @Test
- public void testSetup()
- {
- XtextResourceSet resourceSet = resourceSetProvider.get();
- Resource resource = resourceSet.createResource(URI.createURI("foo.xcore"));
- assertTrue(resource.toString(), resource instanceof InspectableXcoreResource);
- assertNull(((InspectableXcoreResource)resource).getContentsUnsafe());
- assertFalse(((InspectableXcoreResource)resource).isFullyInitialized());
- }
-
- @Test
- public void testContentsWithoutDerived() throws IOException
- {
- XtextResourceSet resourceSet = resourceSetProvider.get();
- Resource resource = resourceSet.createResource(URI.createURI("foo.xcore"));
- resource.load(new StringInputStream("package foo.bar class Baz {}"), null);
- assertEquals(1, ((InspectableXcoreResource)resource).getContentsUnsafe().size());
- assertFalse(((InspectableXcoreResource)resource).isFullyInitialized());
- }
-
- @Test
- public void testContentsWithDerived() throws IOException
- {
- XtextResourceSet resourceSet = resourceSetProvider.get();
- Resource resource = resourceSet.createResource(URI.createURI("foo.xcore"));
- resource.load(new StringInputStream("package foo.bar class Baz {}"), null);
- assertTrue(1 < resource.getContents().size());
- assertTrue(((InspectableXcoreResource)resource).isFullyInitialized());
- }
-
- public void testResourceDescriptionManagerDoesNotResolve() throws IOException
- {
- XtextResourceSet resourceSet = resourceSetProvider.get();
- InspectableXcoreResource resource = (InspectableXcoreResource)resourceSet.createResource(URI.createURI("foo.xcore"));
- resource.load(new StringInputStream("package foo.bar class Baz {}"), null);
- Manager manager = resource.getResourceServiceProvider().getResourceDescriptionManager();
- IResourceDescription resourceDescription = manager.getResourceDescription(resource);
-
- Iterator<IEObjectDescription> eclass = resourceDescription.getExportedObjectsByType(EcorePackage.Literals.ECLASS).iterator();
- Iterator<IEObjectDescription> genclass = resourceDescription.getExportedObjectsByType(GenModelPackage.Literals.GEN_CLASS).iterator();
- Iterator<IEObjectDescription> jvmTypes = resourceDescription.getExportedObjectsByType(TypesPackage.Literals.JVM_GENERIC_TYPE).iterator();
- final String expected = "foo.bar.Baz";
- assertEquals(expected, eclass.next().getName().toString());
- assertFalse(eclass.hasNext());
- assertEquals(expected, genclass.next().getName().toString());
- assertFalse(genclass.hasNext());
- assertEquals(expected, jvmTypes.next().getName().toString());
- assertEquals(expected + "Impl", jvmTypes.next().getName().toString());
- assertFalse(genclass.hasNext());
-
- assertEquals(1, resource.getContentsUnsafe().size());
- assertFalse(resource.isFullyInitialized());
- }
-
-}
+/**
+ * Copyright (c) 2011-2012 Eclipse contributors and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ */
+package org.eclipse.emf.test.ecore.xcore.scoping;
+
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
+
+import java.io.IOException;
+import java.util.Iterator;
+
+import org.eclipse.emf.codegen.ecore.genmodel.GenModelPackage;
+import org.eclipse.emf.common.util.EList;
+import org.eclipse.emf.common.util.URI;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EcorePackage;
+import org.eclipse.emf.ecore.resource.Resource;
+import org.eclipse.emf.ecore.xcore.XcoreInjectorProvider;
+import org.eclipse.emf.ecore.xcore.XcoreStandaloneSetup;
+import org.eclipse.emf.ecore.xcore.resource.XcoreResource;
+import org.eclipse.xtext.common.types.TypesPackage;
+import org.eclipse.xtext.junit4.GlobalRegistries;
+import org.eclipse.xtext.junit4.InjectWith;
+import org.eclipse.xtext.junit4.XtextRunner;
+import org.eclipse.xtext.resource.IEObjectDescription;
+import org.eclipse.xtext.resource.IResourceDescription;
+import org.eclipse.xtext.resource.IResourceDescription.Manager;
+import org.eclipse.xtext.resource.XtextResource;
+import org.eclipse.xtext.resource.XtextResourceSet;
+import org.eclipse.xtext.util.StringInputStream;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+import com.google.inject.Guice;
+import com.google.inject.Inject;
+import com.google.inject.Injector;
+import com.google.inject.Provider;
+
+
+@RunWith(XtextRunner.class)
+@InjectWith(LazyGenModelInferenceTest.MyXcoreInjectorProvider.class)
+public class LazyGenModelInferenceTest
+{
+
+ @Inject
+ private Provider<XtextResourceSet> resourceSetProvider;
+
+ public static class MyXcoreInjectorProvider extends XcoreInjectorProvider
+ {
+
+ private Injector injector;
+
+ @Override
+ public Injector getInjector()
+ {
+ if (injector == null)
+ {
+ stateBeforeInjectorCreation = GlobalRegistries.makeCopyOfGlobalState();
+ this.injector =
+ new XcoreStandaloneSetup()
+ {
+ @Override
+ public Injector createInjector()
+ {
+ return Guice.createInjector(new org.eclipse.emf.ecore.xcore.XcoreRuntimeModule()
+ {
+ @Override
+ public Class<? extends XtextResource> bindXtextResource()
+ {
+ return InspectableXcoreResource.class;
+ }
+ });
+ }
+ }.createInjectorAndDoEMFRegistration();
+ stateAfterInjectorCreation = GlobalRegistries.makeCopyOfGlobalState();
+ }
+ return injector;
+ }
+
+ @Override
+ public void setupRegistry()
+ {
+ super.setupRegistry();
+ if (injector != null)
+ {
+ new XcoreStandaloneSetup().register(injector);
+ }
+ }
+ }
+
+ public static class InspectableXcoreResource extends XcoreResource
+ {
+
+ public EList<EObject> getContentsUnsafe()
+ {
+ return contents;
+ }
+
+ public boolean isFullyInitialized()
+ {
+ return fullyInitialized;
+ }
+
+ }
+
+ @Test
+ public void testSetup()
+ {
+ XtextResourceSet resourceSet = resourceSetProvider.get();
+ Resource resource = resourceSet.createResource(URI.createURI("foo.xcore"));
+ assertTrue(resource.toString(), resource instanceof InspectableXcoreResource);
+ assertNull(((InspectableXcoreResource)resource).getContentsUnsafe());
+ assertFalse(((InspectableXcoreResource)resource).isFullyInitialized());
+ }
+
+ @Test
+ public void testContentsWithoutDerived() throws IOException
+ {
+ XtextResourceSet resourceSet = resourceSetProvider.get();
+ Resource resource = resourceSet.createResource(URI.createURI("foo.xcore"));
+ resource.load(new StringInputStream("package foo.bar class Baz {}"), null);
+ assertEquals(1, ((InspectableXcoreResource)resource).getContentsUnsafe().size());
+ assertFalse(((InspectableXcoreResource)resource).isFullyInitialized());
+ }
+
+ @Test
+ public void testContentsWithDerived() throws IOException
+ {
+ XtextResourceSet resourceSet = resourceSetProvider.get();
+ Resource resource = resourceSet.createResource(URI.createURI("foo.xcore"));
+ resource.load(new StringInputStream("package foo.bar class Baz {}"), null);
+ assertTrue(1 < resource.getContents().size());
+ assertTrue(((InspectableXcoreResource)resource).isFullyInitialized());
+ }
+
+ public void testResourceDescriptionManagerDoesNotResolve() throws IOException
+ {
+ XtextResourceSet resourceSet = resourceSetProvider.get();
+ InspectableXcoreResource resource = (InspectableXcoreResource)resourceSet.createResource(URI.createURI("foo.xcore"));
+ resource.load(new StringInputStream("package foo.bar class Baz {}"), null);
+ Manager manager = resource.getResourceServiceProvider().getResourceDescriptionManager();
+ IResourceDescription resourceDescription = manager.getResourceDescription(resource);
+
+ Iterator<IEObjectDescription> eclass = resourceDescription.getExportedObjectsByType(EcorePackage.Literals.ECLASS).iterator();
+ Iterator<IEObjectDescription> genclass = resourceDescription.getExportedObjectsByType(GenModelPackage.Literals.GEN_CLASS).iterator();
+ Iterator<IEObjectDescription> jvmTypes = resourceDescription.getExportedObjectsByType(TypesPackage.Literals.JVM_GENERIC_TYPE).iterator();
+ final String expected = "foo.bar.Baz";
+ assertEquals(expected, eclass.next().getName().toString());
+ assertFalse(eclass.hasNext());
+ assertEquals(expected, genclass.next().getName().toString());
+ assertFalse(genclass.hasNext());
+ assertEquals(expected, jvmTypes.next().getName().toString());
+ assertEquals(expected + "Impl", jvmTypes.next().getName().toString());
+ assertFalse(genclass.hasNext());
+
+ assertEquals(1, resource.getContentsUnsafe().size());
+ assertFalse(resource.isFullyInitialized());
+ }
+
+}
diff --git a/tests/org.eclipse.emf.test.ecore.xcore/src/org/eclipse/emf/test/ecore/xcore/scoping/LinkingTest.xtend b/tests/org.eclipse.emf.test.ecore.xcore/src/org/eclipse/emf/test/ecore/xcore/scoping/LinkingTest.xtend
index 565e6c195..55c5d6fda 100644
--- a/tests/org.eclipse.emf.test.ecore.xcore/src/org/eclipse/emf/test/ecore/xcore/scoping/LinkingTest.xtend
+++ b/tests/org.eclipse.emf.test.ecore.xcore/src/org/eclipse/emf/test/ecore/xcore/scoping/LinkingTest.xtend
@@ -1,105 +1,105 @@
-/**
- * Copyright (c) 2011-2012 Eclipse contributors and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- */
-package org.eclipse.emf.test.ecore.xcore.scoping
-
-import static org.junit.Assert.*
-
-import org.junit.runner.RunWith
-import org.eclipse.xtext.junit4.XtextRunner
-import org.eclipse.xtext.junit4.InjectWith
-import org.eclipse.emf.ecore.xcore.XcoreInjectorProvider
-import org.junit.Test
-import com.google.inject.Inject
-import org.eclipse.xtext.junit4.util.ParseHelper
-import org.eclipse.emf.ecore.xcore.XPackage
-import org.eclipse.emf.ecore.xcore.XClass
-import org.eclipse.emf.ecore.xcore.XOperation
-import org.eclipse.xtext.xbase.XBlockExpression
-import org.eclipse.xtext.xbase.XVariableDeclaration
-import org.eclipse.xtext.xbase.XBinaryOperation
-
-@RunWith(typeof(XtextRunner))
-@InjectWith(typeof(XcoreInjectorProvider))
-class LinkingTest {
-
- @Inject
- ParseHelper<XPackage> parser
-
- @Test
- def void linkVoidReturnType() {
- val pack = parser.parse('''
- package foo
- class Bar {
- op void operation() {
- val int i = 0
- }
- }
- ''');
- val declaration = pack.firstVariableDeclaration
- val intType = declaration.type.type
- assertFalse(intType.eIsProxy)
- assertEquals('int', intType.qualifiedName)
- }
-
- @Test
- def void linkQualifiedStringType() {
- val pack = parser.parse('''
- package foo
- class Bar {
- op void operation() {
- val java.lang.String s = null
- }
- }
- ''');
- val declaration = pack.firstVariableDeclaration
- val stringType = declaration.type.type
- assertFalse(stringType.eIsProxy)
- assertEquals('java.lang.String', stringType.qualifiedName)
- }
-
- @Test
- def void linkInternalDefinedType() {
- val pack = parser.parse('''
- package foo
- class Bar {
- op void operation() {
- val Bar b = null
- }
- }
- ''');
- val declaration = pack.firstVariableDeclaration
- val stringType = declaration.type.type
- assertFalse(stringType.eIsProxy)
- assertEquals('foo.Bar', stringType.qualifiedName)
- }
-
- @Test
- def void linkFeatureCallType() {
- val pack = parser.parse('''
- package foo
- class Bar {
- op void operation() {
- val s = 'a' + 'b'
- }
- }
- ''');
- val declaration = pack.firstVariableDeclaration
- val binaryOperation = declaration.right as XBinaryOperation
- val feature = binaryOperation.feature
- assertFalse(feature.eIsProxy)
- assertEquals('operator_plus', feature.simpleName)
- }
-
- def firstVariableDeclaration(XPackage pack) {
- val clazz = pack.classifiers.head as XClass
- val operation = clazz.members.head as XOperation
- val block = operation.body as XBlockExpression
- val declaration = block.expressions.head as XVariableDeclaration
- declaration
- }
+/**
+ * Copyright (c) 2011-2012 Eclipse contributors and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ */
+package org.eclipse.emf.test.ecore.xcore.scoping
+
+import static org.junit.Assert.*
+
+import org.junit.runner.RunWith
+import org.eclipse.xtext.junit4.XtextRunner
+import org.eclipse.xtext.junit4.InjectWith
+import org.eclipse.emf.ecore.xcore.XcoreInjectorProvider
+import org.junit.Test
+import com.google.inject.Inject
+import org.eclipse.xtext.junit4.util.ParseHelper
+import org.eclipse.emf.ecore.xcore.XPackage
+import org.eclipse.emf.ecore.xcore.XClass
+import org.eclipse.emf.ecore.xcore.XOperation
+import org.eclipse.xtext.xbase.XBlockExpression
+import org.eclipse.xtext.xbase.XVariableDeclaration
+import org.eclipse.xtext.xbase.XBinaryOperation
+
+@RunWith(typeof(XtextRunner))
+@InjectWith(typeof(XcoreInjectorProvider))
+class LinkingTest {
+
+ @Inject
+ ParseHelper<XPackage> parser
+
+ @Test
+ def void linkVoidReturnType() {
+ val pack = parser.parse('''
+ package foo
+ class Bar {
+ op void operation() {
+ val int i = 0
+ }
+ }
+ ''');
+ val declaration = pack.firstVariableDeclaration
+ val intType = declaration.type.type
+ assertFalse(intType.eIsProxy)
+ assertEquals('int', intType.qualifiedName)
+ }
+
+ @Test
+ def void linkQualifiedStringType() {
+ val pack = parser.parse('''
+ package foo
+ class Bar {
+ op void operation() {
+ val java.lang.String s = null
+ }
+ }
+ ''');
+ val declaration = pack.firstVariableDeclaration
+ val stringType = declaration.type.type
+ assertFalse(stringType.eIsProxy)
+ assertEquals('java.lang.String', stringType.qualifiedName)
+ }
+
+ @Test
+ def void linkInternalDefinedType() {
+ val pack = parser.parse('''
+ package foo
+ class Bar {
+ op void operation() {
+ val Bar b = null
+ }
+ }
+ ''');
+ val declaration = pack.firstVariableDeclaration
+ val stringType = declaration.type.type
+ assertFalse(stringType.eIsProxy)
+ assertEquals('foo.Bar', stringType.qualifiedName)
+ }
+
+ @Test
+ def void linkFeatureCallType() {
+ val pack = parser.parse('''
+ package foo
+ class Bar {
+ op void operation() {
+ val s = 'a' + 'b'
+ }
+ }
+ ''');
+ val declaration = pack.firstVariableDeclaration
+ val binaryOperation = declaration.right as XBinaryOperation
+ val feature = binaryOperation.feature
+ assertFalse(feature.eIsProxy)
+ assertEquals('operator_plus', feature.simpleName)
+ }
+
+ def firstVariableDeclaration(XPackage pack) {
+ val clazz = pack.classifiers.head as XClass
+ val operation = clazz.members.head as XOperation
+ val block = operation.body as XBlockExpression
+ val declaration = block.expressions.head as XVariableDeclaration
+ declaration
+ }
} \ No newline at end of file
diff --git a/tests/org.eclipse.emf.test.ecore.xcore/src/org/eclipse/emf/test/ecore/xcore/scoping/XbaseScopingTest.xtend b/tests/org.eclipse.emf.test.ecore.xcore/src/org/eclipse/emf/test/ecore/xcore/scoping/XbaseScopingTest.xtend
index 368741fa1..0c3d95016 100644
--- a/tests/org.eclipse.emf.test.ecore.xcore/src/org/eclipse/emf/test/ecore/xcore/scoping/XbaseScopingTest.xtend
+++ b/tests/org.eclipse.emf.test.ecore.xcore/src/org/eclipse/emf/test/ecore/xcore/scoping/XbaseScopingTest.xtend
@@ -1,44 +1,44 @@
-/**
- * Copyright (c) 2011-2012 Eclipse contributors and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- */
-package org.eclipse.emf.test.ecore.xcore.scoping
-
-import org.junit.runner.RunWith
-import org.eclipse.xtext.junit4.XtextRunner
-import org.eclipse.xtext.junit4.InjectWith
-import org.eclipse.emf.ecore.xcore.XcoreInjectorProvider
-import com.google.inject.Inject
-import org.eclipse.xtext.junit4.util.ParseHelper
-import org.eclipse.emf.ecore.xcore.XPackage
-import org.eclipse.xtext.junit4.validation.ValidationTestHelper
-import org.junit.Test
-
-@RunWith(typeof(XtextRunner))
-@InjectWith(typeof(XcoreInjectorProvider))
-class XbaseScopingTest {
-
- @Inject
- ParseHelper<XPackage> parser
-
- @Inject
- ValidationTestHelper validator
-
- @Test
- def testLinkToThis() {
- val pack = parser.parse('''
- package foo.bar
-
- class X {
- op X foo(X x) {
- return this.foo(x)
- }
- }
- ''')
- validator.assertNoErrors(pack)
- }
-
+/**
+ * Copyright (c) 2011-2012 Eclipse contributors and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ */
+package org.eclipse.emf.test.ecore.xcore.scoping
+
+import org.junit.runner.RunWith
+import org.eclipse.xtext.junit4.XtextRunner
+import org.eclipse.xtext.junit4.InjectWith
+import org.eclipse.emf.ecore.xcore.XcoreInjectorProvider
+import com.google.inject.Inject
+import org.eclipse.xtext.junit4.util.ParseHelper
+import org.eclipse.emf.ecore.xcore.XPackage
+import org.eclipse.xtext.junit4.validation.ValidationTestHelper
+import org.junit.Test
+
+@RunWith(typeof(XtextRunner))
+@InjectWith(typeof(XcoreInjectorProvider))
+class XbaseScopingTest {
+
+ @Inject
+ ParseHelper<XPackage> parser
+
+ @Inject
+ ValidationTestHelper validator
+
+ @Test
+ def testLinkToThis() {
+ val pack = parser.parse('''
+ package foo.bar
+
+ class X {
+ op X foo(X x) {
+ return this.foo(x)
+ }
+ }
+ ''')
+ validator.assertNoErrors(pack)
+ }
+
} \ No newline at end of file
diff --git a/tests/org.eclipse.emf.test.ecore.xcore/src/org/eclipse/emf/test/ecore/xcore/scoping/XcoreScopingTest.java b/tests/org.eclipse.emf.test.ecore.xcore/src/org/eclipse/emf/test/ecore/xcore/scoping/XcoreScopingTest.java
index 739f03f72..8e5c2c71d 100644
--- a/tests/org.eclipse.emf.test.ecore.xcore/src/org/eclipse/emf/test/ecore/xcore/scoping/XcoreScopingTest.java
+++ b/tests/org.eclipse.emf.test.ecore.xcore/src/org/eclipse/emf/test/ecore/xcore/scoping/XcoreScopingTest.java
@@ -1,77 +1,77 @@
-/**
- * Copyright (c) 2011-2012 Eclipse contributors and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- */
-package org.eclipse.emf.test.ecore.xcore.scoping;
-
-
-import java.util.List;
-
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EReference;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.emf.ecore.xcore.XcoreInjectorProvider;
-import org.eclipse.xtext.junit4.InjectWith;
-import org.eclipse.xtext.junit4.parameterized.InjectParameter;
-import org.eclipse.xtext.junit4.parameterized.Offset;
-import org.eclipse.xtext.junit4.parameterized.ParameterSyntax;
-import org.eclipse.xtext.junit4.parameterized.ParameterizedXtextRunner;
-import org.eclipse.xtext.junit4.parameterized.ResourceURIs;
-import org.eclipse.xtext.junit4.parameterized.XpectCommaSeparatedValues;
-import org.eclipse.xtext.junit4.validation.ValidationTestHelper;
-import org.eclipse.xtext.resource.IEObjectDescription;
-import org.eclipse.xtext.resource.XtextResource;
-import org.eclipse.xtext.scoping.IScope;
-import org.eclipse.xtext.scoping.IScopeProvider;
-import org.eclipse.xtext.util.Pair;
-import org.junit.Assert;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-
-import com.google.common.collect.Lists;
-import com.google.inject.Inject;
-
-
-@SuppressWarnings("restriction")
-@InjectWith(XcoreInjectorProvider.class)
-@RunWith(ParameterizedXtextRunner.class)
-@ResourceURIs(baseDir = "src/org/eclipse/emf/test/ecore/xcore/scoping", fileExtensions = "xcore")
-public class XcoreScopingTest
-{
-
- @InjectParameter
- private XtextResource resource;
-
- @InjectParameter
- private Offset offset;
-
- @Inject
- private ValidationTestHelper validationHelper;
-
- @Inject
- private IScopeProvider scopeProvider;
-
- @Test
- public void noValidationIssues()
- {
- validationHelper.assertNoIssues(resource.getContents().get(0));
- }
-
- @XpectCommaSeparatedValues()
- @ParameterSyntax("'at' offset=OFFSET")
- public List<String> scopeAllElements()
- {
- Pair<EObject, EStructuralFeature> objAndFeature = offset.getEStructuralFeatureByParent();
- Assert.assertTrue(objAndFeature.getSecond() instanceof EReference);
- Assert.assertFalse(((EReference)objAndFeature.getSecond()).isContainment());
- IScope scope = scopeProvider.getScope(objAndFeature.getFirst(), (EReference)objAndFeature.getSecond());
- List<String> result = Lists.newArrayList();
- for (IEObjectDescription desc : scope.getAllElements())
- result.add(desc.getName().toString());
- return result;
- }
-
-}
+/**
+ * Copyright (c) 2011-2012 Eclipse contributors and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ */
+package org.eclipse.emf.test.ecore.xcore.scoping;
+
+
+import java.util.List;
+
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EReference;
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.emf.ecore.xcore.XcoreInjectorProvider;
+import org.eclipse.xtext.junit4.InjectWith;
+import org.eclipse.xtext.junit4.parameterized.InjectParameter;
+import org.eclipse.xtext.junit4.parameterized.Offset;
+import org.eclipse.xtext.junit4.parameterized.ParameterSyntax;
+import org.eclipse.xtext.junit4.parameterized.ParameterizedXtextRunner;
+import org.eclipse.xtext.junit4.parameterized.ResourceURIs;
+import org.eclipse.xtext.junit4.parameterized.XpectCommaSeparatedValues;
+import org.eclipse.xtext.junit4.validation.ValidationTestHelper;
+import org.eclipse.xtext.resource.IEObjectDescription;
+import org.eclipse.xtext.resource.XtextResource;
+import org.eclipse.xtext.scoping.IScope;
+import org.eclipse.xtext.scoping.IScopeProvider;
+import org.eclipse.xtext.util.Pair;
+import org.junit.Assert;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+import com.google.common.collect.Lists;
+import com.google.inject.Inject;
+
+
+@SuppressWarnings("restriction")
+@InjectWith(XcoreInjectorProvider.class)
+@RunWith(ParameterizedXtextRunner.class)
+@ResourceURIs(baseDir = "src/org/eclipse/emf/test/ecore/xcore/scoping", fileExtensions = "xcore")
+public class XcoreScopingTest
+{
+
+ @InjectParameter
+ private XtextResource resource;
+
+ @InjectParameter
+ private Offset offset;
+
+ @Inject
+ private ValidationTestHelper validationHelper;
+
+ @Inject
+ private IScopeProvider scopeProvider;
+
+ @Test
+ public void noValidationIssues()
+ {
+ validationHelper.assertNoIssues(resource.getContents().get(0));
+ }
+
+ @XpectCommaSeparatedValues()
+ @ParameterSyntax("'at' offset=OFFSET")
+ public List<String> scopeAllElements()
+ {
+ Pair<EObject, EStructuralFeature> objAndFeature = offset.getEStructuralFeatureByParent();
+ Assert.assertTrue(objAndFeature.getSecond() instanceof EReference);
+ Assert.assertFalse(((EReference)objAndFeature.getSecond()).isContainment());
+ IScope scope = scopeProvider.getScope(objAndFeature.getFirst(), (EReference)objAndFeature.getSecond());
+ List<String> result = Lists.newArrayList();
+ for (IEObjectDescription desc : scope.getAllElements())
+ result.add(desc.getName().toString());
+ return result;
+ }
+
+}
diff --git a/tests/org.eclipse.emf.test.ecore.xcore/src/org/eclipse/emf/test/ecore/xcore/smoketest/XcoreSmokeTest.xtend b/tests/org.eclipse.emf.test.ecore.xcore/src/org/eclipse/emf/test/ecore/xcore/smoketest/XcoreSmokeTest.xtend
index 2feae4553..7f3b34347 100644
--- a/tests/org.eclipse.emf.test.ecore.xcore/src/org/eclipse/emf/test/ecore/xcore/smoketest/XcoreSmokeTest.xtend
+++ b/tests/org.eclipse.emf.test.ecore.xcore/src/org/eclipse/emf/test/ecore/xcore/smoketest/XcoreSmokeTest.xtend
@@ -1,62 +1,62 @@
-/**
- * Copyright (c) 2011-2012 Eclipse contributors and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- */
-package org.eclipse.emf.test.ecore.xcore.smoketest
-
-import org.eclipse.xtext.junit4.smoketest.AbstractSmokeTest
-import org.eclipse.xtext.linking.lazy.LazyLinkingResource
-import com.google.inject.Inject
-import org.eclipse.emf.ecore.EObject
-import org.eclipse.xtext.junit4.XtextRunner
-import org.junit.runner.RunWith
-import org.eclipse.xtext.junit4.InjectWith
-import org.eclipse.emf.ecore.xcore.XcoreInjectorProvider
-import org.eclipse.xtext.junit4.util.ParseHelper
-import org.eclipse.xtext.junit4.validation.ValidationTestHelper
-
-@RunWith(typeof(XtextRunner))
-@InjectWith(typeof(XcoreInjectorProvider))
-class XcoreSmokeTest extends AbstractSmokeTest {
-
- @Inject extension ParseHelper<EObject> parser
- @Inject extension ValidationTestHelper validationTestHelper
-
- /**
- * The models don't neccessarily need to be proper Xcore models.
- */
- override Iterable<String> getSmokeTestModels() {
- newArrayList('''
- package foo
- import org.eclipse.emf.ecore.EObject
- import org.eclipse.emf.ecore.EEList
- class Stuff {
- String x
- contains OtherStuff otherStuff opposite parent keys x
- }
- class OtherStuff {
- container Stuff parent opposite otherStuff
- int x
- transient EEList<Integer> ints
- refers Stuff stuff
- refers EObject data
- op int bar() { x + 1 }
- }
- type ListOfStringArray wraps java.util.List<String[]>
- '''.toString)
- }
-
- override void processModel(String model) {
- model.parse.validate
- }
-
- override void processModelWithoutResourceSet(String model) {
-
- }
- override LazyLinkingResource createResource(String string) {
-
- }
+/**
+ * Copyright (c) 2011-2012 Eclipse contributors and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ */
+package org.eclipse.emf.test.ecore.xcore.smoketest
+
+import org.eclipse.xtext.junit4.smoketest.AbstractSmokeTest
+import org.eclipse.xtext.linking.lazy.LazyLinkingResource
+import com.google.inject.Inject
+import org.eclipse.emf.ecore.EObject
+import org.eclipse.xtext.junit4.XtextRunner
+import org.junit.runner.RunWith
+import org.eclipse.xtext.junit4.InjectWith
+import org.eclipse.emf.ecore.xcore.XcoreInjectorProvider
+import org.eclipse.xtext.junit4.util.ParseHelper
+import org.eclipse.xtext.junit4.validation.ValidationTestHelper
+
+@RunWith(typeof(XtextRunner))
+@InjectWith(typeof(XcoreInjectorProvider))
+class XcoreSmokeTest extends AbstractSmokeTest {
+
+ @Inject extension ParseHelper<EObject> parser
+ @Inject extension ValidationTestHelper validationTestHelper
+
+ /**
+ * The models don't neccessarily need to be proper Xcore models.
+ */
+ override Iterable<String> getSmokeTestModels() {
+ newArrayList('''
+ package foo
+ import org.eclipse.emf.ecore.EObject
+ import org.eclipse.emf.ecore.EEList
+ class Stuff {
+ String x
+ contains OtherStuff otherStuff opposite parent keys x
+ }
+ class OtherStuff {
+ container Stuff parent opposite otherStuff
+ int x
+ transient EEList<Integer> ints
+ refers Stuff stuff
+ refers EObject data
+ op int bar() { x + 1 }
+ }
+ type ListOfStringArray wraps java.util.List<String[]>
+ '''.toString)
+ }
+
+ override void processModel(String model) {
+ model.parse.validate
+ }
+
+ override void processModelWithoutResourceSet(String model) {
+
+ }
+ override LazyLinkingResource createResource(String string) {
+
+ }
} \ No newline at end of file
diff --git a/tests/org.eclipse.emf.test.ecore.xcore/src/org/eclipse/emf/test/ecore/xcore/validation/EClass-AtMostOneID.xcore b/tests/org.eclipse.emf.test.ecore.xcore/src/org/eclipse/emf/test/ecore/xcore/validation/EClass-AtMostOneID.xcore
index 2c2ba80f1..1ea421a81 100644
--- a/tests/org.eclipse.emf.test.ecore.xcore/src/org/eclipse/emf/test/ecore/xcore/validation/EClass-AtMostOneID.xcore
+++ b/tests/org.eclipse.emf.test.ecore.xcore/src/org/eclipse/emf/test/ecore/xcore/validation/EClass-AtMostOneID.xcore
@@ -1,19 +1,19 @@
-package foo
-
-/* XPECT validationIssues ---
-error at 'class C extends A, B { }' message 'The features 'id1' and 'id2' cannot both be IDs'
---- */
-
-class A
-{
- id String id1
-}
-
-class B
-{
- id String id2
-}
-
-class C extends A, B
-{
+package foo
+
+/* XPECT validationIssues ---
+error at 'class C extends A, B { }' message 'The features 'id1' and 'id2' cannot both be IDs'
+--- */
+
+class A
+{
+ id String id1
+}
+
+class B
+{
+ id String id2
+}
+
+class C extends A, B
+{
} \ No newline at end of file
diff --git a/tests/org.eclipse.emf.test.ecore.xcore/src/org/eclipse/emf/test/ecore/xcore/validation/EClass-ConsistentSuperTypesConflict.xcore b/tests/org.eclipse.emf.test.ecore.xcore/src/org/eclipse/emf/test/ecore/xcore/validation/EClass-ConsistentSuperTypesConflict.xcore
index 17551456f..bb5399d23 100644
--- a/tests/org.eclipse.emf.test.ecore.xcore/src/org/eclipse/emf/test/ecore/xcore/validation/EClass-ConsistentSuperTypesConflict.xcore
+++ b/tests/org.eclipse.emf.test.ecore.xcore/src/org/eclipse/emf/test/ecore/xcore/validation/EClass-ConsistentSuperTypesConflict.xcore
@@ -1,21 +1,21 @@
-package foo
-
-/* XPECT validationIssues ---
-error at 'class D extends B, C { }' message 'The generic super types instantiate 'foo.A' inconsistently'
---- */
-
-class A<T>
-{
-}
-
-class B extends A<String>
-{
-}
-
-class C extends A<Integer>
-{
-}
-
-class D extends B, C
-{
-}
+package foo
+
+/* XPECT validationIssues ---
+error at 'class D extends B, C { }' message 'The generic super types instantiate 'foo.A' inconsistently'
+--- */
+
+class A<T>
+{
+}
+
+class B extends A<String>
+{
+}
+
+class C extends A<Integer>
+{
+}
+
+class D extends B, C
+{
+}
diff --git a/tests/org.eclipse.emf.test.ecore.xcore/src/org/eclipse/emf/test/ecore/xcore/validation/EClass-ConsistentSuperTypesDuplicate.xcore b/tests/org.eclipse.emf.test.ecore.xcore/src/org/eclipse/emf/test/ecore/xcore/validation/EClass-ConsistentSuperTypesDuplicate.xcore
index 6e9ede673..de6a03023 100644
--- a/tests/org.eclipse.emf.test.ecore.xcore/src/org/eclipse/emf/test/ecore/xcore/validation/EClass-ConsistentSuperTypesDuplicate.xcore
+++ b/tests/org.eclipse.emf.test.ecore.xcore/src/org/eclipse/emf/test/ecore/xcore/validation/EClass-ConsistentSuperTypesDuplicate.xcore
@@ -1,13 +1,13 @@
-package foo
-
-/* XPECT validationIssues ---
-error at 'class B extends A, A { }' message 'The generic super types at index '1' and '0' must not be duplicates'
---- */
-
-class A
-{
-}
-
-class B extends A, A
-{
+package foo
+
+/* XPECT validationIssues ---
+error at 'class B extends A, A { }' message 'The generic super types at index '1' and '0' must not be duplicates'
+--- */
+
+class A
+{
+}
+
+class B extends A, A
+{
} \ No newline at end of file
diff --git a/tests/org.eclipse.emf.test.ecore.xcore/src/org/eclipse/emf/test/ecore/xcore/validation/EClass-DisjointFeatureAndOperationSignatures.xcore b/tests/org.eclipse.emf.test.ecore.xcore/src/org/eclipse/emf/test/ecore/xcore/validation/EClass-DisjointFeatureAndOperationSignatures.xcore
index 71abafcfe..c7e54b4b7 100644
--- a/tests/org.eclipse.emf.test.ecore.xcore/src/org/eclipse/emf/test/ecore/xcore/validation/EClass-DisjointFeatureAndOperationSignatures.xcore
+++ b/tests/org.eclipse.emf.test.ecore.xcore/src/org/eclipse/emf/test/ecore/xcore/validation/EClass-DisjointFeatureAndOperationSignatures.xcore
@@ -1,11 +1,11 @@
-package foo
-
-/* XPECT validationIssues ---
-error at 'class A { String a op String getA() }' message 'There may not be an operation 'foo.A.getA' with the same signature as an accessor method for feature 'foo.A.a''
---- */
-
-class A
-{
- String a
- op String getA()
+package foo
+
+/* XPECT validationIssues ---
+error at 'class A { String a op String getA() }' message 'There may not be an operation 'foo.A.getA' with the same signature as an accessor method for feature 'foo.A.a''
+--- */
+
+class A
+{
+ String a
+ op String getA()
} \ No newline at end of file
diff --git a/tests/org.eclipse.emf.test.ecore.xcore/src/org/eclipse/emf/test/ecore/xcore/validation/EClass-NoCircularSuperTypes.xcore b/tests/org.eclipse.emf.test.ecore.xcore/src/org/eclipse/emf/test/ecore/xcore/validation/EClass-NoCircularSuperTypes.xcore
index 352e55d4a..159afae9b 100644
--- a/tests/org.eclipse.emf.test.ecore.xcore/src/org/eclipse/emf/test/ecore/xcore/validation/EClass-NoCircularSuperTypes.xcore
+++ b/tests/org.eclipse.emf.test.ecore.xcore/src/org/eclipse/emf/test/ecore/xcore/validation/EClass-NoCircularSuperTypes.xcore
@@ -1,9 +1,9 @@
-package foo
-
-/* XPECT validationIssues ---
-error at 'class A extends A { }' message 'A class may not be a super type of itself'
---- */
-
-class A extends A
-{
-}
+package foo
+
+/* XPECT validationIssues ---
+error at 'class A extends A { }' message 'A class may not be a super type of itself'
+--- */
+
+class A extends A
+{
+}
diff --git a/tests/org.eclipse.emf.test.ecore.xcore/src/org/eclipse/emf/test/ecore/xcore/validation/EClass-UniqueFeatureNames.xcore b/tests/org.eclipse.emf.test.ecore.xcore/src/org/eclipse/emf/test/ecore/xcore/validation/EClass-UniqueFeatureNames.xcore
index bae231ec9..555a363a0 100644
--- a/tests/org.eclipse.emf.test.ecore.xcore/src/org/eclipse/emf/test/ecore/xcore/validation/EClass-UniqueFeatureNames.xcore
+++ b/tests/org.eclipse.emf.test.ecore.xcore/src/org/eclipse/emf/test/ecore/xcore/validation/EClass-UniqueFeatureNames.xcore
@@ -1,19 +1,19 @@
-package foo
-
-/* XPECT validationIssues ---
-error at 'class C extends A, B { }' message 'There may not be two features named 'a''
---- */
-
-class A
-{
- String a
-}
-
-class B
-{
- String a
-}
-
-class C extends A, B
-{
+package foo
+
+/* XPECT validationIssues ---
+error at 'class C extends A, B { }' message 'There may not be two features named 'a''
+--- */
+
+class A
+{
+ String a
+}
+
+class B
+{
+ String a
+}
+
+class C extends A, B
+{
} \ No newline at end of file
diff --git a/tests/org.eclipse.emf.test.ecore.xcore/src/org/eclipse/emf/test/ecore/xcore/validation/EClass-UniqueOperationSignatures.xcore b/tests/org.eclipse.emf.test.ecore.xcore/src/org/eclipse/emf/test/ecore/xcore/validation/EClass-UniqueOperationSignatures.xcore
index 26d6f3a2b..836a05095 100644
--- a/tests/org.eclipse.emf.test.ecore.xcore/src/org/eclipse/emf/test/ecore/xcore/validation/EClass-UniqueOperationSignatures.xcore
+++ b/tests/org.eclipse.emf.test.ecore.xcore/src/org/eclipse/emf/test/ecore/xcore/validation/EClass-UniqueOperationSignatures.xcore
@@ -1,11 +1,11 @@
-package foo
-
-/* XPECT validationIssues ---
-error at 'class A { op String a() op String a() }' message 'There may not be two operations 'foo.A.a' and 'foo.A.a' with the same signature'
---- */
-
-class A
-{
- op String a()
- op String a()
+package foo
+
+/* XPECT validationIssues ---
+error at 'class A { op String a() op String a() }' message 'There may not be two operations 'foo.A.a' and 'foo.A.a' with the same signature'
+--- */
+
+class A
+{
+ op String a()
+ op String a()
} \ No newline at end of file
diff --git a/tests/org.eclipse.emf.test.ecore.xcore/src/org/eclipse/emf/test/ecore/xcore/validation/EClass-WellformedMapEntryClass.xcore b/tests/org.eclipse.emf.test.ecore.xcore/src/org/eclipse/emf/test/ecore/xcore/validation/EClass-WellformedMapEntryClass.xcore
index 2d07d9878..8b407ccc9 100644
--- a/tests/org.eclipse.emf.test.ecore.xcore/src/org/eclipse/emf/test/ecore/xcore/validation/EClass-WellformedMapEntryClass.xcore
+++ b/tests/org.eclipse.emf.test.ecore.xcore/src/org/eclipse/emf/test/ecore/xcore/validation/EClass-WellformedMapEntryClass.xcore
@@ -1,10 +1,10 @@
-package foo
-
-/* XPECT validationIssues ---
-error at 'class A wraps java.util.Map$Entry { }' message 'A map entry class must have a feature called 'key''
-error at 'class A wraps java.util.Map$Entry { }' message 'A map entry class must have a feature called 'value''
---- */
-
-class A wraps java.util.Map$Entry
-{
-}
+package foo
+
+/* XPECT validationIssues ---
+error at 'class A wraps java.util.Map$Entry { }' message 'A map entry class must have a feature called 'key''
+error at 'class A wraps java.util.Map$Entry { }' message 'A map entry class must have a feature called 'value''
+--- */
+
+class A wraps java.util.Map$Entry
+{
+}
diff --git a/tests/org.eclipse.emf.test.ecore.xcore/src/org/eclipse/emf/test/ecore/xcore/validation/EClass-WellformedMapEntryNoInstanceClassName.xcore b/tests/org.eclipse.emf.test.ecore.xcore/src/org/eclipse/emf/test/ecore/xcore/validation/EClass-WellformedMapEntryNoInstanceClassName.xcore
index e5716ebd8..44dd4159f 100644
--- a/tests/org.eclipse.emf.test.ecore.xcore/src/org/eclipse/emf/test/ecore/xcore/validation/EClass-WellformedMapEntryNoInstanceClassName.xcore
+++ b/tests/org.eclipse.emf.test.ecore.xcore/src/org/eclipse/emf/test/ecore/xcore/validation/EClass-WellformedMapEntryNoInstanceClassName.xcore
@@ -1,15 +1,15 @@
-package foo
-
-/* XPECT validationIssues ---
-error at 'class B extends A { }' message 'A class that inherits from a map entry class must have instance class name 'java.util.Map$Entry''
---- */
-
-class A wraps java.util.Map$Entry
-{
- String key
- String value
-}
-
-class B extends A
-{
-}
+package foo
+
+/* XPECT validationIssues ---
+error at 'class B extends A { }' message 'A class that inherits from a map entry class must have instance class name 'java.util.Map$Entry''
+--- */
+
+class A wraps java.util.Map$Entry
+{
+ String key
+ String value
+}
+
+class B extends A
+{
+}
diff --git a/tests/org.eclipse.emf.test.ecore.xcore/src/org/eclipse/emf/test/ecore/xcore/validation/EClassifier-UniqueTypeParameterNames.xcore b/tests/org.eclipse.emf.test.ecore.xcore/src/org/eclipse/emf/test/ecore/xcore/validation/EClassifier-UniqueTypeParameterNames.xcore
index 6f4830fdd..a94827834 100644
--- a/tests/org.eclipse.emf.test.ecore.xcore/src/org/eclipse/emf/test/ecore/xcore/validation/EClassifier-UniqueTypeParameterNames.xcore
+++ b/tests/org.eclipse.emf.test.ecore.xcore/src/org/eclipse/emf/test/ecore/xcore/validation/EClassifier-UniqueTypeParameterNames.xcore
@@ -1,9 +1,9 @@
-package foo
-
-/* XPECT validationIssues ---
-error at 'class A<T, T> { }' message 'There may not be two type parameters named 'T''
---- */
-
-class A<T, T>
-{
-}
+package foo
+
+/* XPECT validationIssues ---
+error at 'class A<T, T> { }' message 'There may not be two type parameters named 'T''
+--- */
+
+class A<T, T>
+{
+}
diff --git a/tests/org.eclipse.emf.test.ecore.xcore/src/org/eclipse/emf/test/ecore/xcore/validation/EEnum-UniqueEnumeratorLiterals.xcore b/tests/org.eclipse.emf.test.ecore.xcore/src/org/eclipse/emf/test/ecore/xcore/validation/EEnum-UniqueEnumeratorLiterals.xcore
index 1ac698de9..758d88073 100644
--- a/tests/org.eclipse.emf.test.ecore.xcore/src/org/eclipse/emf/test/ecore/xcore/validation/EEnum-UniqueEnumeratorLiterals.xcore
+++ b/tests/org.eclipse.emf.test.ecore.xcore/src/org/eclipse/emf/test/ecore/xcore/validation/EEnum-UniqueEnumeratorLiterals.xcore
@@ -1,11 +1,11 @@
-package foo
-
-/* XPECT validationIssues ---
-error at 'A as 'x'' message 'There may not be two enumerators with literal value 'x''
---- */
-
-enum A
-{
- A as 'x'
- B as 'x'
-}
+package foo
+
+/* XPECT validationIssues ---
+error at 'A as 'x'' message 'There may not be two enumerators with literal value 'x''
+--- */
+
+enum A
+{
+ A as 'x'
+ B as 'x'
+}
diff --git a/tests/org.eclipse.emf.test.ecore.xcore/src/org/eclipse/emf/test/ecore/xcore/validation/EEnum-UniqueEnumeratorNames.xcore b/tests/org.eclipse.emf.test.ecore.xcore/src/org/eclipse/emf/test/ecore/xcore/validation/EEnum-UniqueEnumeratorNames.xcore
index 63ca5e7c3..708b444d4 100644
--- a/tests/org.eclipse.emf.test.ecore.xcore/src/org/eclipse/emf/test/ecore/xcore/validation/EEnum-UniqueEnumeratorNames.xcore
+++ b/tests/org.eclipse.emf.test.ecore.xcore/src/org/eclipse/emf/test/ecore/xcore/validation/EEnum-UniqueEnumeratorNames.xcore
@@ -1,11 +1,11 @@
-package foo
-
-/* XPECT validationIssues ---
-error at 'A ' message 'There may not be two enumerators named 'A''
---- */
-
-enum A
-{
- A
- A
-}
+package foo
+
+/* XPECT validationIssues ---
+error at 'A ' message 'There may not be two enumerators named 'A''
+--- */
+
+enum A
+{
+ A
+ A
+}
diff --git a/tests/org.eclipse.emf.test.ecore.xcore/src/org/eclipse/emf/test/ecore/xcore/validation/EGenericType-ClassNotPermitted.xcore b/tests/org.eclipse.emf.test.ecore.xcore/src/org/eclipse/emf/test/ecore/xcore/validation/EGenericType-ClassNotPermitted.xcore
index cfdc2250e..f4540db27 100644
--- a/tests/org.eclipse.emf.test.ecore.xcore/src/org/eclipse/emf/test/ecore/xcore/validation/EGenericType-ClassNotPermitted.xcore
+++ b/tests/org.eclipse.emf.test.ecore.xcore/src/org/eclipse/emf/test/ecore/xcore/validation/EGenericType-ClassNotPermitted.xcore
@@ -1,10 +1,10 @@
-package foo
-
-/* XPECT validationIssues ---
-error at 'A' message 'The generic attribute type must not refer to a class'
---- */
-
-class A
-{
- A a
-}
+package foo
+
+/* XPECT validationIssues ---
+error at 'A' message 'The generic attribute type must not refer to a class'
+--- */
+
+class A
+{
+ A a
+}
diff --git a/tests/org.eclipse.emf.test.ecore.xcore/src/org/eclipse/emf/test/ecore/xcore/validation/EGenericType-ConsistentArgumentNoneAllowed.xcore b/tests/org.eclipse.emf.test.ecore.xcore/src/org/eclipse/emf/test/ecore/xcore/validation/EGenericType-ConsistentArgumentNoneAllowed.xcore
index 4f9f97c65..d21e830ae 100644
--- a/tests/org.eclipse.emf.test.ecore.xcore/src/org/eclipse/emf/test/ecore/xcore/validation/EGenericType-ConsistentArgumentNoneAllowed.xcore
+++ b/tests/org.eclipse.emf.test.ecore.xcore/src/org/eclipse/emf/test/ecore/xcore/validation/EGenericType-ConsistentArgumentNoneAllowed.xcore
@@ -1,10 +1,10 @@
-package foo
-
-/* XPECT validationIssues ---
-error at 'A<?>' message 'The generic type associated with the 'A' classifier must not have 1 argument(s) when the classifier has 0 type parameter(s)'
---- */
-
-class A
-{
- refers A<?> a
-}
+package foo
+
+/* XPECT validationIssues ---
+error at 'A<?>' message 'The generic type associated with the 'A' classifier must not have 1 argument(s) when the classifier has 0 type parameter(s)'
+--- */
+
+class A
+{
+ refers A<?> a
+}
diff --git a/tests/org.eclipse.emf.test.ecore.xcore/src/org/eclipse/emf/test/ecore/xcore/validation/EGenericType-ConsistentArgumentsIncorrectNumber.xcore b/tests/org.eclipse.emf.test.ecore.xcore/src/org/eclipse/emf/test/ecore/xcore/validation/EGenericType-ConsistentArgumentsIncorrectNumber.xcore
index 6db4aed57..78226b81c 100644
--- a/tests/org.eclipse.emf.test.ecore.xcore/src/org/eclipse/emf/test/ecore/xcore/validation/EGenericType-ConsistentArgumentsIncorrectNumber.xcore
+++ b/tests/org.eclipse.emf.test.ecore.xcore/src/org/eclipse/emf/test/ecore/xcore/validation/EGenericType-ConsistentArgumentsIncorrectNumber.xcore
@@ -1,10 +1,10 @@
-package foo
-
-/* XPECT validationIssues ---
-error at 'A<String>' message 'The generic type associated with the 'A' classifier must not have 1 argument(s) when the classifier has 2 type parameter(s)'
---- */
-
-class A<T, U>
-{
- refers A<String> a
-}
+package foo
+
+/* XPECT validationIssues ---
+error at 'A<String>' message 'The generic type associated with the 'A' classifier must not have 1 argument(s) when the classifier has 2 type parameter(s)'
+--- */
+
+class A<T, U>
+{
+ refers A<String> a
+}
diff --git a/tests/org.eclipse.emf.test.ecore.xcore/src/org/eclipse/emf/test/ecore/xcore/validation/EGenericType-ConsistentArgumentsInvalidSubstitution.xcore b/tests/org.eclipse.emf.test.ecore.xcore/src/org/eclipse/emf/test/ecore/xcore/validation/EGenericType-ConsistentArgumentsInvalidSubstitution.xcore
index 931c0b642..957f7c104 100644
--- a/tests/org.eclipse.emf.test.ecore.xcore/src/org/eclipse/emf/test/ecore/xcore/validation/EGenericType-ConsistentArgumentsInvalidSubstitution.xcore
+++ b/tests/org.eclipse.emf.test.ecore.xcore/src/org/eclipse/emf/test/ecore/xcore/validation/EGenericType-ConsistentArgumentsInvalidSubstitution.xcore
@@ -1,19 +1,19 @@
-
-package foo
-
-/* XPECT validationIssues ---
-error at 'A<C>' message 'The generic type 'foo.C' is not a valid substitution for type parameter 'foo.A.T''
---- */
-
-class A<T extends B>
-{
- refers A<C> a
-}
-
-class B
-{
-}
-
-class C
-{
+
+package foo
+
+/* XPECT validationIssues ---
+error at 'A<C>' message 'The generic type 'foo.C' is not a valid substitution for type parameter 'foo.A.T''
+--- */
+
+class A<T extends B>
+{
+ refers A<C> a
+}
+
+class B
+{
+}
+
+class C
+{
} \ No newline at end of file
diff --git a/tests/org.eclipse.emf.test.ecore.xcore/src/org/eclipse/emf/test/ecore/xcore/validation/EGenericType-ConsistentArgumentsNone.xcore b/tests/org.eclipse.emf.test.ecore.xcore/src/org/eclipse/emf/test/ecore/xcore/validation/EGenericType-ConsistentArgumentsNone.xcore
index 61ed378b0..e401addf4 100644
--- a/tests/org.eclipse.emf.test.ecore.xcore/src/org/eclipse/emf/test/ecore/xcore/validation/EGenericType-ConsistentArgumentsNone.xcore
+++ b/tests/org.eclipse.emf.test.ecore.xcore/src/org/eclipse/emf/test/ecore/xcore/validation/EGenericType-ConsistentArgumentsNone.xcore
@@ -1,10 +1,10 @@
-package foo
-
-/* XPECT validationIssues ---
-warning at 'A' message 'The generic type associated with the 'A' classifier should have 1 type argument(s) to match the number of type parameter (s) of the classifier '
---- */
-
-class A<T>
-{
- refers A a
-}
+package foo
+
+/* XPECT validationIssues ---
+warning at 'A' message 'The generic type associated with the 'A' classifier should have 1 type argument(s) to match the number of type parameter (s) of the classifier '
+--- */
+
+class A<T>
+{
+ refers A a
+}
diff --git a/tests/org.eclipse.emf.test.ecore.xcore/src/org/eclipse/emf/test/ecore/xcore/validation/EGenericType-DataTypeNotPermitted.xcore b/tests/org.eclipse.emf.test.ecore.xcore/src/org/eclipse/emf/test/ecore/xcore/validation/EGenericType-DataTypeNotPermitted.xcore
index 0ccbd4b03..2cbb94619 100644
--- a/tests/org.eclipse.emf.test.ecore.xcore/src/org/eclipse/emf/test/ecore/xcore/validation/EGenericType-DataTypeNotPermitted.xcore
+++ b/tests/org.eclipse.emf.test.ecore.xcore/src/org/eclipse/emf/test/ecore/xcore/validation/EGenericType-DataTypeNotPermitted.xcore
@@ -1,10 +1,10 @@
-package foo
-
-/* XPECT validationIssues ---
-error at 'String' message 'The generic reference type must not refer to a data type'
---- */
-
-class A
-{
- refers String a
-}
+package foo
+
+/* XPECT validationIssues ---
+error at 'String' message 'The generic reference type must not refer to a data type'
+--- */
+
+class A
+{
+ refers String a
+}
diff --git a/tests/org.eclipse.emf.test.ecore.xcore/src/org/eclipse/emf/test/ecore/xcore/validation/EGenericType-NoClass.xcore b/tests/org.eclipse.emf.test.ecore.xcore/src/org/eclipse/emf/test/ecore/xcore/validation/EGenericType-NoClass.xcore
index 88fbcb09b..529398c90 100644
--- a/tests/org.eclipse.emf.test.ecore.xcore/src/org/eclipse/emf/test/ecore/xcore/validation/EGenericType-NoClass.xcore
+++ b/tests/org.eclipse.emf.test.ecore.xcore/src/org/eclipse/emf/test/ecore/xcore/validation/EGenericType-NoClass.xcore
@@ -1,10 +1,10 @@
-package foo
-
-/* XPECT validationIssues ---
-error at 'T' message 'A generic super type must refer to a class'
-error at 'String' message 'A generic super type must refer to a class'
---- */
-
-class A<T> extends T, String
-{
-}
+package foo
+
+/* XPECT validationIssues ---
+error at 'T' message 'A generic super type must refer to a class'
+error at 'String' message 'A generic super type must refer to a class'
+--- */
+
+class A<T> extends T, String
+{
+}
diff --git a/tests/org.eclipse.emf.test.ecore.xcore/src/org/eclipse/emf/test/ecore/xcore/validation/EGenericType-PrimitiveTypePermitted.xcore b/tests/org.eclipse.emf.test.ecore.xcore/src/org/eclipse/emf/test/ecore/xcore/validation/EGenericType-PrimitiveTypePermitted.xcore
index e224fe792..ad2c493a1 100644
--- a/tests/org.eclipse.emf.test.ecore.xcore/src/org/eclipse/emf/test/ecore/xcore/validation/EGenericType-PrimitiveTypePermitted.xcore
+++ b/tests/org.eclipse.emf.test.ecore.xcore/src/org/eclipse/emf/test/ecore/xcore/validation/EGenericType-PrimitiveTypePermitted.xcore
@@ -1,10 +1,10 @@
-package foo
-
-/* XPECT validationIssues ---
-error at 'int' message 'The primitive type 'int' can not be used in this context'
---- */
-
-class A<T>
-{
- refers A<int> a
-}
+package foo
+
+/* XPECT validationIssues ---
+error at 'int' message 'The primitive type 'int' can not be used in this context'
+--- */
+
+class A<T>
+{
+ refers A<int> a
+}
diff --git a/tests/org.eclipse.emf.test.ecore.xcore/src/org/eclipse/emf/test/ecore/xcore/validation/EObject-EveryMapEntryUnique.xcore b/tests/org.eclipse.emf.test.ecore.xcore/src/org/eclipse/emf/test/ecore/xcore/validation/EObject-EveryMapEntryUnique.xcore
index ddacf6afb..8de3716fe 100644
--- a/tests/org.eclipse.emf.test.ecore.xcore/src/org/eclipse/emf/test/ecore/xcore/validation/EObject-EveryMapEntryUnique.xcore
+++ b/tests/org.eclipse.emf.test.ecore.xcore/src/org/eclipse/emf/test/ecore/xcore/validation/EObject-EveryMapEntryUnique.xcore
@@ -1,12 +1,12 @@
-package foo
-
-/* XPECT validationIssues ---
-error at 'x='x'' message 'The feature 'details' has a map entry at index 1 with a key that collides with that of the map entry at index 0'
---- */
-
-annotation "Foo" as Foo
-
-@Foo(x='x', x='x')
-class A
-{
+package foo
+
+/* XPECT validationIssues ---
+error at 'x='x'' message 'The feature 'details' has a map entry at index 1 with a key that collides with that of the map entry at index 0'
+--- */
+
+annotation "Foo" as Foo
+
+@Foo(x='x', x='x')
+class A
+{
} \ No newline at end of file
diff --git a/tests/org.eclipse.emf.test.ecore.xcore/src/org/eclipse/emf/test/ecore/xcore/validation/EOperation-UniqueParameterNames.xcore b/tests/org.eclipse.emf.test.ecore.xcore/src/org/eclipse/emf/test/ecore/xcore/validation/EOperation-UniqueParameterNames.xcore
index 0a4d621b8..160a744ea 100644
--- a/tests/org.eclipse.emf.test.ecore.xcore/src/org/eclipse/emf/test/ecore/xcore/validation/EOperation-UniqueParameterNames.xcore
+++ b/tests/org.eclipse.emf.test.ecore.xcore/src/org/eclipse/emf/test/ecore/xcore/validation/EOperation-UniqueParameterNames.xcore
@@ -1,10 +1,10 @@
-package foo
-
-/* XPECT validationIssues ---
-error at ' op void foo(A a, A a)' message 'There may not be two parameters named 'a''
---- */
-
-class A
-{
- op void foo(A a, A a)
-}
+package foo
+
+/* XPECT validationIssues ---
+error at ' op void foo(A a, A a)' message 'There may not be two parameters named 'a''
+--- */
+
+class A
+{
+ op void foo(A a, A a)
+}
diff --git a/tests/org.eclipse.emf.test.ecore.xcore/src/org/eclipse/emf/test/ecore/xcore/validation/EOperation-UniqueTypeParameterNames.xcore b/tests/org.eclipse.emf.test.ecore.xcore/src/org/eclipse/emf/test/ecore/xcore/validation/EOperation-UniqueTypeParameterNames.xcore
index 1a5649355..c1e291b37 100644
--- a/tests/org.eclipse.emf.test.ecore.xcore/src/org/eclipse/emf/test/ecore/xcore/validation/EOperation-UniqueTypeParameterNames.xcore
+++ b/tests/org.eclipse.emf.test.ecore.xcore/src/org/eclipse/emf/test/ecore/xcore/validation/EOperation-UniqueTypeParameterNames.xcore
@@ -1,10 +1,10 @@
-package foo
-
-/* XPECT validationIssues ---
-error at ' op <T, T> void foo()' message 'There may not be two type parameters named 'T''
---- */
-
-class A
-{
- op <T, T> void foo()
-}
+package foo
+
+/* XPECT validationIssues ---
+error at ' op <T, T> void foo()' message 'There may not be two type parameters named 'T''
+--- */
+
+class A
+{
+ op <T, T> void foo()
+}
diff --git a/tests/org.eclipse.emf.test.ecore.xcore/src/org/eclipse/emf/test/ecore/xcore/validation/EPackage-UniqueClassifierNames.xcore b/tests/org.eclipse.emf.test.ecore.xcore/src/org/eclipse/emf/test/ecore/xcore/validation/EPackage-UniqueClassifierNames.xcore
index 019828ee3..9f1375eab 100644
--- a/tests/org.eclipse.emf.test.ecore.xcore/src/org/eclipse/emf/test/ecore/xcore/validation/EPackage-UniqueClassifierNames.xcore
+++ b/tests/org.eclipse.emf.test.ecore.xcore/src/org/eclipse/emf/test/ecore/xcore/validation/EPackage-UniqueClassifierNames.xcore
@@ -1,11 +1,11 @@
-package foo
-
-/* XPECT validationIssues ---
-error at 'class A { }' message 'There may not be two classifiers named 'A''
---- */
-
-class A
-{
-}
-
+package foo
+
+/* XPECT validationIssues ---
+error at 'class A { }' message 'There may not be two classifiers named 'A''
+--- */
+
+class A
+{
+}
+
type A wraps java.lang.String \ No newline at end of file
diff --git a/tests/org.eclipse.emf.test.ecore.xcore/src/org/eclipse/emf/test/ecore/xcore/validation/EReference-ConsistentContainer.xcore b/tests/org.eclipse.emf.test.ecore.xcore/src/org/eclipse/emf/test/ecore/xcore/validation/EReference-ConsistentContainer.xcore
index 85d743493..4dff5d6e9 100644
--- a/tests/org.eclipse.emf.test.ecore.xcore/src/org/eclipse/emf/test/ecore/xcore/validation/EReference-ConsistentContainer.xcore
+++ b/tests/org.eclipse.emf.test.ecore.xcore/src/org/eclipse/emf/test/ecore/xcore/validation/EReference-ConsistentContainer.xcore
@@ -1,22 +1,22 @@
-package foo
-
-/* XPECT validationIssues ---
-error at 'contains A a oppos it e b' message 'A containment reference of a type with a container feature foo.A.c that requires instances to be contained elsewhere cannot be populated'
-error at 'contains A a opposite c' message 'A containment reference of a type with a container feature foo.A.b that requires instances to be contained elsewhere cannot be populated'
---- */
-
-class A
-{
- container B [1] b opposite a
- container C [1] c opposite a
-}
-
-class B
-{
- contains A a opposite b
-}
-
-class C
-{
- contains A a opposite c
-}
+package foo
+
+/* XPECT validationIssues ---
+error at 'contains A a oppos it e b' message 'A containment reference of a type with a container feature foo.A.c that requires instances to be contained elsewhere cannot be populated'
+error at 'contains A a opposite c' message 'A containment reference of a type with a container feature foo.A.b that requires instances to be contained elsewhere cannot be populated'
+--- */
+
+class A
+{
+ container B [1] b opposite a
+ container C [1] c opposite a
+}
+
+class B
+{
+ contains A a opposite b
+}
+
+class C
+{
+ contains A a opposite c
+}
diff --git a/tests/org.eclipse.emf.test.ecore.xcore/src/org/eclipse/emf/test/ecore/xcore/validation/EReference-ConsistentOppositeBadTransient.xcore b/tests/org.eclipse.emf.test.ecore.xcore/src/org/eclipse/emf/test/ecore/xcore/validation/EReference-ConsistentOppositeBadTransient.xcore
index 2b5598a39..8d14198f0 100644
--- a/tests/org.eclipse.emf.test.ecore.xcore/src/org/eclipse/emf/test/ecore/xcore/validation/EReference-ConsistentOppositeBadTransient.xcore
+++ b/tests/org.eclipse.emf.test.ecore.xcore/src/org/eclipse/emf/test/ecore/xcore/validation/EReference-ConsistentOppositeBadTransient.xcore
@@ -1,11 +1,11 @@
-package foo
-
-/* XPECT validationIssues ---
-error at 'y' message 'The opposite of a transient reference must be transient if it is proxy resolving'
---- */
-
-class A
-{
- refers transient A x opposite y
- refers A y opposite x
-}
+package foo
+
+/* XPECT validationIssues ---
+error at 'y' message 'The opposite of a transient reference must be transient if it is proxy resolving'
+--- */
+
+class A
+{
+ refers transient A x opposite y
+ refers A y opposite x
+}
diff --git a/tests/org.eclipse.emf.test.ecore.xcore/src/org/eclipse/emf/test/ecore/xcore/validation/EReference-ConsistentOppositeBothContainment.xcore b/tests/org.eclipse.emf.test.ecore.xcore/src/org/eclipse/emf/test/ecore/xcore/validation/EReference-ConsistentOppositeBothContainment.xcore
index 6ba281027..e9c3532bf 100644
--- a/tests/org.eclipse.emf.test.ecore.xcore/src/org/eclipse/emf/test/ecore/xcore/validation/EReference-ConsistentOppositeBothContainment.xcore
+++ b/tests/org.eclipse.emf.test.ecore.xcore/src/org/eclipse/emf/test/ecore/xcore/validation/EReference-ConsistentOppositeBothContainment.xcore
@@ -1,12 +1,12 @@
-package foo
-
-/* XPECT validationIssues ---
-error at ' y' message 'The opposite of a containment reference must not be a containment reference'
-error at ' x' message 'The opposite of a containment reference must not be a containment reference'
---- */
-
-class A
-{
- contains A x opposite y
- contains A y opposite x
-}
+package foo
+
+/* XPECT validationIssues ---
+error at ' y' message 'The opposite of a containment reference must not be a containment reference'
+error at ' x' message 'The opposite of a containment reference must not be a containment reference'
+--- */
+
+class A
+{
+ contains A x opposite y
+ contains A y opposite x
+}
diff --git a/tests/org.eclipse.emf.test.ecore.xcore/src/org/eclipse/emf/test/ecore/xcore/validation/EReference-ConsistentOppositeNotMatching.xcore b/tests/org.eclipse.emf.test.ecore.xcore/src/org/eclipse/emf/test/ecore/xcore/validation/EReference-ConsistentOppositeNotMatching.xcore
index 33306aec5..67d332f1b 100644
--- a/tests/org.eclipse.emf.test.ecore.xcore/src/org/eclipse/emf/test/ecore/xcore/validation/EReference-ConsistentOppositeNotMatching.xcore
+++ b/tests/org.eclipse.emf.test.ecore.xcore/src/org/eclipse/emf/test/ecore/xcore/validation/EReference-ConsistentOppositeNotMatching.xcore
@@ -1,11 +1,11 @@
-package foo
-
-/* XPECT validationIssues ---
-error at ' y' message 'The opposite of the opposite may not be a reference different from this one'
---- */
-
-class A
-{
- refers A x opposite y
- refers A y
-}
+package foo
+
+/* XPECT validationIssues ---
+error at ' y' message 'The opposite of the opposite may not be a reference different from this one'
+--- */
+
+class A
+{
+ refers A x opposite y
+ refers A y
+}
diff --git a/tests/org.eclipse.emf.test.ecore.xcore/src/org/eclipse/emf/test/ecore/xcore/validation/EReference-SingleContainer.xcore b/tests/org.eclipse.emf.test.ecore.xcore/src/org/eclipse/emf/test/ecore/xcore/validation/EReference-SingleContainer.xcore
index 3260a0652..0e1b90680 100644
--- a/tests/org.eclipse.emf.test.ecore.xcore/src/org/eclipse/emf/test/ecore/xcore/validation/EReference-SingleContainer.xcore
+++ b/tests/org.eclipse.emf.test.ecore.xcore/src/org/eclipse/emf/test/ecore/xcore/validation/EReference-SingleContainer.xcore
@@ -1,11 +1,11 @@
-package foo
-
-/* XPECT validationIssues ---
-error at ' [*]' message 'A container reference must have upper bound of 1 not -1'
---- */
-
-class A
-{
- contains A x opposite y
- container A [*] y opposite x
-}
+package foo
+
+/* XPECT validationIssues ---
+error at ' [*]' message 'A container reference must have upper bound of 1 not -1'
+--- */
+
+class A
+{
+ contains A x opposite y
+ container A [*] y opposite x
+}
diff --git a/tests/org.eclipse.emf.test.ecore.xcore/src/org/eclipse/emf/test/ecore/xcore/validation/ETypedElement-ConsistentBounds.xcore b/tests/org.eclipse.emf.test.ecore.xcore/src/org/eclipse/emf/test/ecore/xcore/validation/ETypedElement-ConsistentBounds.xcore
index 2bacdd0a0..e927ce5a0 100644
--- a/tests/org.eclipse.emf.test.ecore.xcore/src/org/eclipse/emf/test/ecore/xcore/validation/ETypedElement-ConsistentBounds.xcore
+++ b/tests/org.eclipse.emf.test.ecore.xcore/src/org/eclipse/emf/test/ecore/xcore/validation/ETypedElement-ConsistentBounds.xcore
@@ -1,10 +1,10 @@
-package foo
-
-/* XPECT validationIssues ---
-error at '[2..1]' message 'The lower bound 2 must be less than or equal to the upper bound 1'
---- */
-
-class A
-{
- String [2..1] a
-}
+package foo
+
+/* XPECT validationIssues ---
+error at '[2..1]' message 'The lower bound 2 must be less than or equal to the upper bound 1'
+--- */
+
+class A
+{
+ String [2..1] a
+}
diff --git a/tests/org.eclipse.emf.test.ecore.xcore/src/org/eclipse/emf/test/ecore/xcore/validation/XcoreValidationTest.java b/tests/org.eclipse.emf.test.ecore.xcore/src/org/eclipse/emf/test/ecore/xcore/validation/XcoreValidationTest.java
index ab5fa7a7a..55c003fbb 100644
--- a/tests/org.eclipse.emf.test.ecore.xcore/src/org/eclipse/emf/test/ecore/xcore/validation/XcoreValidationTest.java
+++ b/tests/org.eclipse.emf.test.ecore.xcore/src/org/eclipse/emf/test/ecore/xcore/validation/XcoreValidationTest.java
@@ -1,96 +1,96 @@
-/**
- * Copyright (c) 2011-2012 Eclipse contributors and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- */
-package org.eclipse.emf.test.ecore.xcore.validation;
-
-
-import java.util.List;
-
-import org.eclipse.emf.ecore.util.EcoreValidator;
-import org.eclipse.emf.ecore.xcore.XcoreInjectorProvider;
-import org.eclipse.xtext.junit4.InjectWith;
-import org.eclipse.xtext.junit4.parameterized.InjectParameter;
-import org.eclipse.xtext.junit4.parameterized.ParameterizedXtextRunner;
-import org.eclipse.xtext.junit4.parameterized.ResourceURIs;
-import org.eclipse.xtext.junit4.parameterized.XpectLines;
-import org.eclipse.xtext.resource.XtextResource;
-import org.eclipse.xtext.util.CancelIndicator;
-import org.eclipse.xtext.validation.CheckMode;
-import org.eclipse.xtext.validation.IResourceValidator;
-import org.eclipse.xtext.validation.Issue;
-import org.junit.runner.RunWith;
-
-import com.google.common.collect.Lists;
-import com.google.inject.Inject;
-
-
-/**
- * There are cases not covered because the grammar doesn't allow it, i.e.,
- * {@link EcoreValidator#CONSISTENT_BOUNDS_NOT_ALLOWED},
- * {@link EcoreValidator#CONSISTENT_BOUNDS_NO_BOUNDS_WITH_TYPE_PARAMETER_OR_CLASSIFIER}
- * , {@link EcoreValidator#CONSISTENT_BOUNDS_NO_LOWER_AND_UPPER},
- * {@link EcoreValidator#CONSISTENT_TYPE_NO_TYPE_PARAMETER_AND_CLASSIFIER},
- * {@link EcoreValidator#CONSISTENT_TYPE_WILDCARD_NOT_PERMITTED},
- * {@link EcoreValidator#INTERFACE_IS_ABSTRACT},
- * {@link EcoreValidator#NO_REPEATING_VOID},
- * {@link EcoreValidator#UNIQUE_NS_URIS},
- * {@link EcoreValidator#UNIQUE_SUBPACKAGE_NAMES},
- * {@link EcoreValidator#VALID_LOWER_BOUND}, {@link EcoreValidator#VALID_TYPE},
- * {@link EcoreValidator#VALID_UPPER_BOUND},
- * {@link EcoreValidator#WELL_FORMED_INSTANCE_TYPE_NAME}, or the scoping rules
- * won't resolve that way, i.e., {@link EcoreValidator#CONSISTENT_KEYS},
- * {@link EcoreValidator#CONSISTENT_OPPOSITE_NOT_FROM_TYPE},
- * {@link EcoreValidator#CONSISTENT_TYPE_TYPE_PARAMETER_NOT_IN_SCOPE},
- * {@link EcoreValidator#WELL_FORMED_NAME}, or we don't set the flags yet, i.e.,
- * {@link EcoreValidator#CONSISTENT_TRANSIENT}, or we can't get into that state,
- * i.e., {@link EcoreValidator#VALID_DEFAULT_VALUE_LITERAL},
- * {@link EcoreValidator#CONSISTENT_UNIQUE}, or are TODO items
- * {@link EcoreValidator#WELL_FORMED_NS_PREFIX},
- * {@link EcoreValidator#WELL_FORMED_NS_URI},
- * {@link EcoreValidator#WELL_FORMED_SOURCE_URI},
- *
- */
-@SuppressWarnings("restriction")
-@InjectWith(XcoreInjectorProvider.class)
-@RunWith(ParameterizedXtextRunner.class)
-@ResourceURIs(baseDir = "src/org/eclipse/emf/test/ecore/xcore/validation", fileExtensions = "xcore")
-public class XcoreValidationTest
-{
-
- @InjectParameter
- private XtextResource resource;
-
- @Inject
- private IResourceValidator validator;
-
- protected String formatIssue(Issue issue)
- {
- StringBuilder result = new StringBuilder();
- result.append(issue.getSeverity().name().toLowerCase());
- if (issue.getOffset() != null && issue.getLength() != null)
- {
- result.append(" at '");
- result.append(resource.getParseResult().getRootNode().getText().substring(issue.getOffset(), issue.getOffset() + issue.getLength()));
- result.append("' ");
- }
- else
- result.append(" ");
- result.append("message '");
- result.append(issue.getMessage());
- result.append("'");
- return result.toString();
- }
-
- @XpectLines()
- public List<String> validationIssues()
- {
- List<String> result = Lists.newArrayList();
- for (Issue issue : validator.validate(resource, CheckMode.ALL, CancelIndicator.NullImpl))
- result.add(formatIssue(issue));
- return result;
- }
-}
+/**
+ * Copyright (c) 2011-2012 Eclipse contributors and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ */
+package org.eclipse.emf.test.ecore.xcore.validation;
+
+
+import java.util.List;
+
+import org.eclipse.emf.ecore.util.EcoreValidator;
+import org.eclipse.emf.ecore.xcore.XcoreInjectorProvider;
+import org.eclipse.xtext.junit4.InjectWith;
+import org.eclipse.xtext.junit4.parameterized.InjectParameter;
+import org.eclipse.xtext.junit4.parameterized.ParameterizedXtextRunner;
+import org.eclipse.xtext.junit4.parameterized.ResourceURIs;
+import org.eclipse.xtext.junit4.parameterized.XpectLines;
+import org.eclipse.xtext.resource.XtextResource;
+import org.eclipse.xtext.util.CancelIndicator;
+import org.eclipse.xtext.validation.CheckMode;
+import org.eclipse.xtext.validation.IResourceValidator;
+import org.eclipse.xtext.validation.Issue;
+import org.junit.runner.RunWith;
+
+import com.google.common.collect.Lists;
+import com.google.inject.Inject;
+
+
+/**
+ * There are cases not covered because the grammar doesn't allow it, i.e.,
+ * {@link EcoreValidator#CONSISTENT_BOUNDS_NOT_ALLOWED},
+ * {@link EcoreValidator#CONSISTENT_BOUNDS_NO_BOUNDS_WITH_TYPE_PARAMETER_OR_CLASSIFIER}
+ * , {@link EcoreValidator#CONSISTENT_BOUNDS_NO_LOWER_AND_UPPER},
+ * {@link EcoreValidator#CONSISTENT_TYPE_NO_TYPE_PARAMETER_AND_CLASSIFIER},
+ * {@link EcoreValidator#CONSISTENT_TYPE_WILDCARD_NOT_PERMITTED},
+ * {@link EcoreValidator#INTERFACE_IS_ABSTRACT},
+ * {@link EcoreValidator#NO_REPEATING_VOID},
+ * {@link EcoreValidator#UNIQUE_NS_URIS},
+ * {@link EcoreValidator#UNIQUE_SUBPACKAGE_NAMES},
+ * {@link EcoreValidator#VALID_LOWER_BOUND}, {@link EcoreValidator#VALID_TYPE},
+ * {@link EcoreValidator#VALID_UPPER_BOUND},
+ * {@link EcoreValidator#WELL_FORMED_INSTANCE_TYPE_NAME}, or the scoping rules
+ * won't resolve that way, i.e., {@link EcoreValidator#CONSISTENT_KEYS},
+ * {@link EcoreValidator#CONSISTENT_OPPOSITE_NOT_FROM_TYPE},
+ * {@link EcoreValidator#CONSISTENT_TYPE_TYPE_PARAMETER_NOT_IN_SCOPE},
+ * {@link EcoreValidator#WELL_FORMED_NAME}, or we don't set the flags yet, i.e.,
+ * {@link EcoreValidator#CONSISTENT_TRANSIENT}, or we can't get into that state,
+ * i.e., {@link EcoreValidator#VALID_DEFAULT_VALUE_LITERAL},
+ * {@link EcoreValidator#CONSISTENT_UNIQUE}, or are TODO items
+ * {@link EcoreValidator#WELL_FORMED_NS_PREFIX},
+ * {@link EcoreValidator#WELL_FORMED_NS_URI},
+ * {@link EcoreValidator#WELL_FORMED_SOURCE_URI},
+ *
+ */
+@SuppressWarnings("restriction")
+@InjectWith(XcoreInjectorProvider.class)
+@RunWith(ParameterizedXtextRunner.class)
+@ResourceURIs(baseDir = "src/org/eclipse/emf/test/ecore/xcore/validation", fileExtensions = "xcore")
+public class XcoreValidationTest
+{
+
+ @InjectParameter
+ private XtextResource resource;
+
+ @Inject
+ private IResourceValidator validator;
+
+ protected String formatIssue(Issue issue)
+ {
+ StringBuilder result = new StringBuilder();
+ result.append(issue.getSeverity().name().toLowerCase());
+ if (issue.getOffset() != null && issue.getLength() != null)
+ {
+ result.append(" at '");
+ result.append(resource.getParseResult().getRootNode().getText().substring(issue.getOffset(), issue.getOffset() + issue.getLength()));
+ result.append("' ");
+ }
+ else
+ result.append(" ");
+ result.append("message '");
+ result.append(issue.getMessage());
+ result.append("'");
+ return result.toString();
+ }
+
+ @XpectLines()
+ public List<String> validationIssues()
+ {
+ List<String> result = Lists.newArrayList();
+ for (Issue issue : validator.validate(resource, CheckMode.ALL, CancelIndicator.NullImpl))
+ result.add(formatIssue(issue));
+ return result;
+ }
+}

Back to the top