org.eclipse.xtext.testing.smoketest.ScenarioProcessor Java Examples

The following examples show how to use org.eclipse.xtext.testing.smoketest.ScenarioProcessor. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: AbstractScenarioRunner.java    From xtext-core with Eclipse Public License 2.0 6 votes vote down vote up
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();
		}
	}
}
 
Example #2
Source File: AbstractParallelScenarioRunner.java    From xtext-core with Eclipse Public License 2.0 5 votes vote down vote up
@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);
}
 
Example #3
Source File: ParallelCompleteInputScenarioRunner.java    From xtext-core with Eclipse Public License 2.0 5 votes vote down vote up
@Override
protected void doProcess(String data, ScenarioProcessor processor) throws Exception {
	if (processor instanceof DeltaScenarioProcessor) {
		((DeltaScenarioProcessor) processor).processFile(data, data, 0, 0, "");
	} else {
		processor.processFile(data);
	}
}
 
Example #4
Source File: CompleteInputScenarioRunner.java    From xtext-core with Eclipse Public License 2.0 5 votes vote down vote up
@Override
protected void doProcess(String data, ScenarioProcessor processor) throws Exception {
	if (processor instanceof DeltaScenarioProcessor) {
		((DeltaScenarioProcessor) processor).processFile(data, data, 0, 0, "");
	} else {
		processor.processFile(data);
	}
}
 
Example #5
Source File: AbstractParallelScenarioRunner.java    From xtext-core with Eclipse Public License 2.0 4 votes vote down vote up
public AbstractParallelScenarioRunner(Class<?> klass, Class<? extends ScenarioProcessor> processorClass)
		throws InitializationError {
	super(klass, processorClass);
	testData = new ConcurrentHashMap<FrameworkMethod, String>();
	setScheduler(new ParallelRunnerScheduler());
}
 
Example #6
Source File: AbstractScenarioRunner.java    From xtext-core with Eclipse Public License 2.0 4 votes vote down vote up
public AbstractScenarioRunner(Class<?> klass, Class<? extends ScenarioProcessor> processorClass) throws InitializationError {
	super(klass);
	this.processorClass = processorClass;
}
 
Example #7
Source File: AbstractScenarioRunner.java    From xtext-core with Eclipse Public License 2.0 4 votes vote down vote up
protected Class<? extends ScenarioProcessor> getProcessorClass() {
	return processorClass;
}
 
Example #8
Source File: ParallelCompleteInputScenarioRunner.java    From xtext-core with Eclipse Public License 2.0 4 votes vote down vote up
public ParallelCompleteInputScenarioRunner(Class<?> klass, Class<? extends ScenarioProcessor> processorClass)
		throws InitializationError {
	super(klass, processorClass);
}
 
Example #9
Source File: ParallelPermutingScenarioRunner.java    From xtext-core with Eclipse Public License 2.0 4 votes vote down vote up
public ParallelPermutingScenarioRunner(Class<?> klass, Scenario scenario, Class<? extends ScenarioProcessor> processorClass) throws InitializationError {
	super(klass, processorClass);
	this.scenario = scenario;
}
 
Example #10
Source File: ParallelPermutingScenarioRunner.java    From xtext-core with Eclipse Public License 2.0 4 votes vote down vote up
@Override
protected void doProcess(String data, ScenarioProcessor processor) throws Exception {
	scenario.processInput(data, processor);
}
 
Example #11
Source File: PermutingScenarioRunner.java    From xtext-core with Eclipse Public License 2.0 4 votes vote down vote up
public PermutingScenarioRunner(Class<?> klass, Class<? extends ScenarioProcessor> processorClass, Scenario scenario) throws InitializationError {
	super(klass, processorClass);
	this.scenario = scenario;
}
 
Example #12
Source File: PermutingScenarioRunner.java    From xtext-core with Eclipse Public License 2.0 4 votes vote down vote up
@Override
protected void doProcess(String data, ScenarioProcessor processor) throws Exception {
	scenario.processInput(data, processor);
}
 
Example #13
Source File: CompleteInputScenarioRunner.java    From xtext-core with Eclipse Public License 2.0 4 votes vote down vote up
public CompleteInputScenarioRunner(Class<?> klass, Class<? extends ScenarioProcessor> processorClass)
		throws InitializationError {
	super(klass, processorClass);
}
 
Example #14
Source File: AbstractScenarioRunner.java    From xtext-core with Eclipse Public License 2.0 votes vote down vote up
protected abstract void doProcess(String data, ScenarioProcessor processor) throws Exception;