use of org.junit.AssumptionViolatedException 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);
}
use of org.junit.AssumptionViolatedException in project xtext-eclipse by eclipse.
the class AbstractScenarioRunner method methodBlock.
@Override
protected Statement methodBlock(final FrameworkMethod method) {
IInjectorProvider injectorProvider = getOrCreateInjectorProvider();
final IRegistryConfigurator registryConfigurator = (IRegistryConfigurator) injectorProvider;
registryConfigurator.setupRegistry();
final Statement methodBlock = superMethodBlock(method);
return new Statement() {
@Override
public void evaluate() throws Throwable {
try {
try {
methodBlock.evaluate();
throw new AssumptionViolatedException("Method " + method.getName() + " did parse any input");
} finally {
registryConfigurator.restoreRegistry();
}
} catch (TestDataCarrier testData) {
process(testData.getData());
}
}
};
}
use of org.junit.AssumptionViolatedException 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();
}
}
}
use of org.junit.AssumptionViolatedException in project iaf by ibissource.
the class StreamingPipeTestBase method doPipe.
@Override
protected PipeRunResult doPipe(P pipe, Message input, PipeLineSession session) throws PipeRunException {
PipeRunResult prr = null;
// TODO: CapProvider should not be provided as argument to provideOutputStream, because that is not used there.
// Instead, it must be the next pipe in the pipeline. When it is called, the forward of that pipe
// must be the result of the streaming operation.
// CapProvider capProvider = writeOutputToStream?new CapProvider(null):null;
// TODO: must replace with capProvider, to monitor proper pass through
IPipe nextPipe = null;
if (provideStreamForInput) {
// Object result;
try (MessageOutputStream target = pipe.provideOutputStream(session, nextPipe)) {
assumeNotNull(target);
if (input.isBinary()) {
try (OutputStream stream = target.asStream()) {
stream.write(input.asByteArray());
}
} else {
try (Writer writer = target.asWriter()) {
writer.write(input.asString());
}
}
prr = target.getPipeRunResult();
} catch (AssumptionViolatedException e) {
throw e;
} catch (Exception e) {
throw new PipeRunException(pipe, "cannot convert input", e);
}
} else {
// if (classic) {
prr = pipe.doPipe(input, session);
// } else {
// prr = pipe.doPipe(input, session, nextPipe);
// }
}
assertNotNull(prr);
assertNotNull(prr.getPipeForward());
// }
return prr;
}
use of org.junit.AssumptionViolatedException in project robolectric by robolectric.
the class RobolectricTestRunner method getSandbox.
@Override
@Nonnull
protected AndroidSandbox getSandbox(FrameworkMethod method) {
RobolectricFrameworkMethod roboMethod = (RobolectricFrameworkMethod) method;
Sdk sdk = roboMethod.getSdk();
InstrumentationConfiguration classLoaderConfig = createClassLoaderConfig(method);
ResourcesMode resourcesMode = roboMethod.getResourcesMode();
if (resourcesMode == ResourcesMode.LEGACY && sdk.getApiLevel() > Build.VERSION_CODES.P) {
throw new AssumptionViolatedException("Robolectric doesn't support legacy mode after P");
}
LooperMode.Mode looperMode = roboMethod.configuration == null ? Mode.LEGACY : roboMethod.configuration.get(LooperMode.Mode.class);
sdk.verifySupportedSdk(method.getDeclaringClass().getName());
return sandboxManager.getAndroidSandbox(classLoaderConfig, sdk, resourcesMode, looperMode);
}
Aggregations