Search in sources :

Example 1 with SequencerTestLanguageSemanticSequencer

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;
}
Also used : SequencerTestLanguageSemanticSequencer(org.eclipse.xtext.serializer.serializer.SequencerTestLanguageSemanticSequencer) EObject(org.eclipse.emf.ecore.EObject) DebugSequenceAcceptor(org.eclipse.xtext.testing.serializer.DebugSequenceAcceptor) ISemanticSequencer(org.eclipse.xtext.serializer.sequencer.ISemanticSequencer)

Aggregations

EObject (org.eclipse.emf.ecore.EObject)1 ISemanticSequencer (org.eclipse.xtext.serializer.sequencer.ISemanticSequencer)1 SequencerTestLanguageSemanticSequencer (org.eclipse.xtext.serializer.serializer.SequencerTestLanguageSemanticSequencer)1 DebugSequenceAcceptor (org.eclipse.xtext.testing.serializer.DebugSequenceAcceptor)1