use of org.eclipse.xtext.diagnostics.ExceptionDiagnostic in project xtext-core by eclipse.
the class Xtext2EcoreTransformerTest method testNoException_02.
@Test
public void testNoException_02() throws Exception {
StringConcatenation _builder = new StringConcatenation();
_builder.append("grammar test with org.eclipse.xtext.common.Terminals generate test \'http://test\'");
_builder.newLine();
_builder.append("Model: (children+=Element)*;");
_builder.newLine();
_builder.append("Element returns Type: Item ( { Item.items+=current } items+=Item );");
_builder.newLine();
_builder.append("Item returns Type:\t{ T");
String grammar = _builder.toString();
final XtextResource resource = this.getResourceFromStringAndExpect(grammar, 1);
EList<Resource.Diagnostic> _errors = resource.getErrors();
for (final Resource.Diagnostic d : _errors) {
Assert.assertFalse((d instanceof ExceptionDiagnostic));
}
}
use of org.eclipse.xtext.diagnostics.ExceptionDiagnostic in project xtext-core by eclipse.
the class Xtext2EcoreTransformerTest method testBug_272566_3.
@Test
public void testBug_272566_3() throws Exception {
StringConcatenation _builder = new StringConcatenation();
_builder.append("grammar test with org.eclipse.xtext.common.Terminals");
_builder.newLine();
_builder.append("generate test \'http://test\'");
_builder.newLine();
_builder.append("Model:");
_builder.newLine();
_builder.append(" ");
_builder.append("test=Test");
_builder.newLine();
_builder.append(";");
_builder.newLine();
_builder.newLine();
_builder.append("Test:");
_builder.newLine();
_builder.append(" ");
_builder.append("\"keyword\" MyEnum name=ID");
_builder.newLine();
_builder.append(";");
_builder.newLine();
_builder.append("enum MyEnum:");
_builder.newLine();
_builder.append("\t");
_builder.append("A | B;");
_builder.newLine();
String grammar = _builder.toString();
final XtextResource resource = this.getResourceFromStringAndExpect(grammar, 1);
Assert.assertFalse(resource.getErrors().toString(), resource.getErrors().isEmpty());
EList<Resource.Diagnostic> _errors = resource.getErrors();
for (final Resource.Diagnostic d : _errors) {
Assert.assertFalse((d instanceof ExceptionDiagnostic));
}
}
Aggregations