aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorszarnekow2009-04-01 10:19:42 (EDT)
committersefftinge2009-04-01 10:19:42 (EDT)
commit0caa23142f076ca70911127932f1c428aed09b0a (patch)
treee516c98de15e22b7735ffbc8a5d1703fa04b2482
parent3ca543850bdb601c0faf4fc998bf61b9c6c2b975 (diff)
downloadorg.eclipse.xtext-0caa23142f076ca70911127932f1c428aed09b0a.zip
org.eclipse.xtext-0caa23142f076ca70911127932f1c428aed09b0a.tar.gz
org.eclipse.xtext-0caa23142f076ca70911127932f1c428aed09b0a.tar.bz2
fix: bug #270773 - ClassCastException with EEnums
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src/org/eclipse/xtext/xtext/ExceptionTest.java18
1 files changed, 14 insertions, 4 deletions
diff --git a/tests/org.eclipse.xtext.generator.tests/src/org/eclipse/xtext/xtext/ExceptionTest.java b/tests/org.eclipse.xtext.generator.tests/src/org/eclipse/xtext/xtext/ExceptionTest.java
index e003074..94a9372 100644
--- a/tests/org.eclipse.xtext.generator.tests/src/org/eclipse/xtext/xtext/ExceptionTest.java
+++ b/tests/org.eclipse.xtext.generator.tests/src/org/eclipse/xtext/xtext/ExceptionTest.java
@@ -47,10 +47,7 @@ public class ExceptionTest extends AbstractGeneratorTest {
"Keyword : \n" +
" value=STRING \n" +
";\n";
- Resource r = getResourceFromString(model);
- Iterable<Diagnostic> filtered = CollectionUtils.filter(r.getErrors(), Filter.Util.<Diagnostic>instanceOf(ExceptionDiagnostic.class));
- assertNotNull(filtered);
- assertFalse(filtered.iterator().hasNext());
+ assertNoException(model);
}
public void testFirstAssignmentWithoutLeftSide() throws Exception {
@@ -58,6 +55,19 @@ public class ExceptionTest extends AbstractGeneratorTest {
"grammar test with org.eclipse.xtext.common.Terminals\n" +
"generate test \"test\"\n" +
"Numbers: =INT n2=INT ;";
+ assertNoException(model);
+ }
+
+ public void testBug_270773() throws Exception {
+ String model =
+ "grammar test with org.eclipse.xtext.common.Terminals\n" +
+ "import \"http://www.eclipse.org/emf/2002/Ecore\" as ecore\n" +
+ "generate test \"test\"\n" +
+ "enum Foo returns ecore::EString: Zonk ;";
+ assertNoException(model);
+ }
+
+ private void assertNoException(String model) throws Exception {
Resource r = getResourceFromString(model);
Iterable<Diagnostic> filtered = CollectionUtils.filter(r.getErrors(), Filter.Util.<Diagnostic>instanceOf(ExceptionDiagnostic.class));
assertNotNull(filtered);