use of org.eclipse.xtext.serializer.serializer.SequencerTestLanguageSemanticSequencer in project xtext-core by eclipse.
the class AbstractSemanticSequencerTest method testSequence.
private EObject testSequence(String stringModel) throws Exception {
DebugSequenceAcceptor genericActual = new DebugSequenceAcceptor();
DebugSequenceAcceptor generatedActual = new DebugSequenceAcceptor();
DebugSequenceAcceptor expected = new DebugSequenceAcceptor();
ISemanticSequencer generatedSequencer = generatedSequencerProvider.get();
ISemanticSequencer genericSequencer = getGenericSemanticSequencer();
assertTrue(generatedSequencer instanceof SequencerTestLanguageSemanticSequencer);
generatedSequencer.init(generatedActual, ISerializationDiagnostic.STDERR_ACCEPTOR);
genericSequencer.init(genericActual, ISerializationDiagnostic.STDERR_ACCEPTOR);
nmSequencer.init(expected, ISerializationDiagnostic.STDERR_ACCEPTOR);
EObject model = getModel(stringModel).eContents().get(0);
ISerializationContext context = nmSequencer.findContexts(model, true, null).iterator().next();
generatedSequencer.createSequence(context, model);
genericSequencer.createSequence(context, model);
nmSequencer.createSequence(context, model);
assertEquals(expected.toString(), genericActual.toString());
assertEquals(expected.toString(), generatedActual.toString());
return model;
}
Aggregations