Search in sources :

Example 1 with ScenarioProcessor

use of org.eclipse.xtext.junit4.smoketest.ScenarioProcessor in project xtext-eclipse 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.junit4.smoketest.ScenarioProcessor) IInjectorProvider(org.eclipse.xtext.junit4.IInjectorProvider) AssumptionViolatedException(org.junit.AssumptionViolatedException)

Example 2 with ScenarioProcessor

use of org.eclipse.xtext.junit4.smoketest.ScenarioProcessor in project xtext-eclipse 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.junit4.smoketest.ScenarioProcessor) IInjectorProvider(org.eclipse.xtext.junit4.IInjectorProvider) AssumptionViolatedException(org.junit.AssumptionViolatedException) IRegistryConfigurator(org.eclipse.xtext.junit4.IRegistryConfigurator)

Aggregations

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