Search in sources :

Example 1 with TestErrorAcceptor

use of org.eclipse.xtext.tests.TestErrorAcceptor in project xtext-core by eclipse.

the class Xtext2EcoreTransformerTest method setUp.

@Override
public void setUp() throws Exception {
    super.setUp();
    TestErrorAcceptor _testErrorAcceptor = new TestErrorAcceptor();
    this.errorAcceptorMock = _testErrorAcceptor;
    this.with(XtextStandaloneSetup.class);
}
Also used : TestErrorAcceptor(org.eclipse.xtext.tests.TestErrorAcceptor)

Example 2 with TestErrorAcceptor

use of org.eclipse.xtext.tests.TestErrorAcceptor in project xtext-core by eclipse.

the class MetamodelTransformationErrorTest method setUp.

@Override
public void setUp() throws Exception {
    super.setUp();
    with(XtextStandaloneSetup.class);
    model = "grammar datatypetests with org.eclipse.xtext.common.Terminals\n" + "import 'http://www.eclipse.org/emf/2002/Ecore' as ecore\n" + "generate metamodel 'http://fooo'\n" + "Start:\n" + "  id=ValidId id2=ValidId2 failure1=FailureId failure2=Failure2;\n" + "ValidId returns ecore::EString: ID '.' ID;\n" + "ValidId2 returns ecore::EString: ID '.' ValidId;\n" + "FailureId returns ecore::EString: name=ID;\n" + "Failure2 returns ecore::EString: name=Start;";
    resource = getResourceFromStringAndExpect(model, 2);
    grammar = (Grammar) resource.getContents().get(0);
    transformer = new Xtext2EcoreTransformer(grammar);
    errorAcceptor = new TestErrorAcceptor();
    transformer.setErrorAcceptor(errorAcceptor);
}
Also used : Xtext2EcoreTransformer(org.eclipse.xtext.xtext.ecoreInference.Xtext2EcoreTransformer) TestErrorAcceptor(org.eclipse.xtext.tests.TestErrorAcceptor)

Aggregations

TestErrorAcceptor (org.eclipse.xtext.tests.TestErrorAcceptor)2 Xtext2EcoreTransformer (org.eclipse.xtext.xtext.ecoreInference.Xtext2EcoreTransformer)1