Search in sources :

Example 1 with ScenarioProcessor

use of org.eclipse.xtext.testing.smoketest.ScenarioProcessor in project xtext-core by eclipse.

the class AbstractScenarioRunner method process.

protected void process(String data) throws Exception {
    IInjectorProvider delegate = getOrCreateInjectorProvider().getDelegate();
    if (delegate instanceof IRegistryConfigurator) {
        IRegistryConfigurator registryConfigurator = (IRegistryConfigurator) delegate;
        registryConfigurator.setupRegistry();
        try {
            ScenarioProcessor processor = delegate.getInjector().getInstance(processorClass);
            String preProcessed = processor.preProcess(data);
            if (preProcessed == null) {
                throw new AssumptionViolatedException("Input is filtered by the pre processing step: " + data);
            }
            doProcess(preProcessed, processor);
        } finally {
            registryConfigurator.restoreRegistry();
        }
    }
}
Also used : ScenarioProcessor(org.eclipse.xtext.testing.smoketest.ScenarioProcessor) IInjectorProvider(org.eclipse.xtext.testing.IInjectorProvider) AssumptionViolatedException(org.junit.AssumptionViolatedException) IRegistryConfigurator(org.eclipse.xtext.testing.IRegistryConfigurator)

Example 2 with ScenarioProcessor

use of org.eclipse.xtext.testing.smoketest.ScenarioProcessor in project xtext-core by eclipse.

the class AbstractParallelScenarioRunner method process.

@Override
protected void process(String data) throws Exception {
    IInjectorProvider delegate = getOrCreateInjectorProvider().getDelegate();
    ScenarioProcessor processor = delegate.getInjector().getInstance(getProcessorClass());
    String preProcessed = processor.preProcess(data);
    if (preProcessed == null) {
        throw new AssumptionViolatedException("Input is filtered by the pre processing step: " + data);
    }
    doProcess(preProcessed, processor);
}
Also used : ScenarioProcessor(org.eclipse.xtext.testing.smoketest.ScenarioProcessor) IInjectorProvider(org.eclipse.xtext.testing.IInjectorProvider) AssumptionViolatedException(org.junit.AssumptionViolatedException)

Aggregations

IInjectorProvider (org.eclipse.xtext.testing.IInjectorProvider)2 ScenarioProcessor (org.eclipse.xtext.testing.smoketest.ScenarioProcessor)2 AssumptionViolatedException (org.junit.AssumptionViolatedException)2 IRegistryConfigurator (org.eclipse.xtext.testing.IRegistryConfigurator)1