本文整理汇总了Java中org.junit.platform.engine.ExecutionRequest类的典型用法代码示例。如果您正苦于以下问题:Java ExecutionRequest类的具体用法?Java ExecutionRequest怎么用?Java ExecutionRequest使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ExecutionRequest类属于org.junit.platform.engine包,在下文中一共展示了ExecutionRequest类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: execute
import org.junit.platform.engine.ExecutionRequest; //导入依赖的package包/类
/**
* Instance an engine and execute the test resources identified by the given {@code selectors} and
* wrap the response in a listener so that we can make sense of what happened. The listener
* exposes information about the test execution flow which the extension tests can assert against.
*
* @param selectors {@link DiscoverySelector} instances which will isolate test class or test
* methods
* @return a {@link RecordingExecutionListener} which encapsulates what the engine did
*/
public static RecordingExecutionListener execute(DiscoverySelector... selectors) {
// instance an engine
JupiterTestEngine testEngine = new JupiterTestEngine();
// discover the requested test resources
LauncherDiscoveryRequest discoveryRequest = request().selectors(selectors).build();
RecordingExecutionListener listener = new RecordingExecutionListener();
// execute the discovered test resources
TestDescriptor testDescriptor =
testEngine.discover(discoveryRequest, UniqueId.forEngine(testEngine.getId()));
testEngine.execute(
new ExecutionRequest(
testDescriptor, listener, discoveryRequest.getConfigurationParameters()));
return listener;
}
开发者ID:glytching,项目名称:junit-extensions,代码行数:28,代码来源:ExtensionTester.java
示例2: execute
import org.junit.platform.engine.ExecutionRequest; //导入依赖的package包/类
public static void execute(Class<?> testClass) throws Exception {
try {
JupiterTestEngine engine = new JupiterTestEngine();
TestClassEngineDiscoveryRequest discoveryRequest = new TestClassEngineDiscoveryRequest(testClass);
TestDescriptor testDescriptor = engine.discover(discoveryRequest, UniqueId.forEngine("foo-bar"));
EngineExecutionListener listener = new NoOpEngineExecutionListener();
ConfigurationParameters parameters = new NoConfigurationParameters();
engine.execute(new ExecutionRequest(testDescriptor, listener, parameters));
} catch (UndeclaredThrowableException e) {
Throwable cause = getFirstNonUndeclaredThrowableCause(e);
if (cause instanceof Error) {
throw ( Error ) cause;
} else if (cause instanceof RuntimeException) {
throw ( RuntimeException ) cause;
} else if (cause instanceof Exception) {
throw ( Exception ) cause;
} else {
throw e;
}
}
}
开发者ID:testIT-WebTester,项目名称:webtester2-core,代码行数:26,代码来源:TestClassExecutor.java
示例3: execute
import org.junit.platform.engine.ExecutionRequest; //导入依赖的package包/类
@Override
public void execute(ExecutionRequest request) {
// Use ExecutionRequest to execute TestDescriptor
TestDescriptor rootTestDescriptor = request.getRootTestDescriptor();
request.getEngineExecutionListener()
.executionStarted(rootTestDescriptor);
}
开发者ID:bonigarcia,项目名称:mastering-junit5,代码行数:8,代码来源:MyCustomEngine.java
示例4: executeTests
import org.junit.platform.engine.ExecutionRequest; //导入依赖的package包/类
private JupiterExecutionListener executeTests(LauncherDiscoveryRequest request) throws Exception {
TestDescriptor testDescriptor = createTestDescriptorForCucumber(
engine.discover(request, forEngine(engine.getId())), containers);
eventRecorder.reset();
engine.execute(new ExecutionRequest(testDescriptor, eventRecorder, request.getConfigurationParameters()));
return eventRecorder;
}
开发者ID:FaustXVI,项目名称:junit5-docker,代码行数:8,代码来源:JupiterTestEngineForTests.java
示例5: execute
import org.junit.platform.engine.ExecutionRequest; //导入依赖的package包/类
public static List<ExecutionEvent> execute(TestEngine testEngine, EngineDiscoveryRequest discoveryRequest) {
TestDescriptor engineTestDescriptor = testEngine.discover(discoveryRequest,
UniqueId.forEngine(testEngine.getId()));
ExecutionEventRecorder listener = new ExecutionEventRecorder();
testEngine.execute(
new ExecutionRequest(engineTestDescriptor, listener, discoveryRequest.getConfigurationParameters()));
return listener.getExecutionEvents();
}
开发者ID:junit-pioneer,项目名称:junit-pioneer,代码行数:9,代码来源:ExecutionEventRecorder.java
示例6: execute
import org.junit.platform.engine.ExecutionRequest; //导入依赖的package包/类
@Override
public void execute(ExecutionRequest request) {
TestDescriptor engine = request.getRootTestDescriptor();
EngineExecutionListener listener = request.getEngineExecutionListener();
listener.executionStarted(engine);
for (TestDescriptor child : engine.getChildren()) {
listener.executionStarted(child);
listener.executionFinished(child, TestExecutionResult.successful());
}
listener.executionFinished(engine, TestExecutionResult.successful());
}
开发者ID:junit-team,项目名称:junit5-samples,代码行数:12,代码来源:Machine.java
示例7: execute
import org.junit.platform.engine.ExecutionRequest; //导入依赖的package包/类
@Override
public void execute(ExecutionRequest request) {
Object engine = getEngine(request.getConfigurationParameters());
SimpleClojure.invoke(ENGINE_NS, "execute", engine, request);
}
开发者ID:ajoberstar,项目名称:jovial,代码行数:6,代码来源:BaseClojureEngine.java
示例8: execute
import org.junit.platform.engine.ExecutionRequest; //导入依赖的package包/类
@Override
public void execute(ExecutionRequest request) {
this.requestForExecution = request;
}
开发者ID:junit-pioneer,项目名称:junit-pioneer,代码行数:5,代码来源:TestEngineSpy.java
示例9: execute
import org.junit.platform.engine.ExecutionRequest; //导入依赖的package包/类
@Override
public void execute(ExecutionRequest request) {
}
开发者ID:junit-pioneer,项目名称:junit-pioneer,代码行数:4,代码来源:TestEngineStub.java
示例10: executeTests
import org.junit.platform.engine.ExecutionRequest; //导入依赖的package包/类
protected ExecutionEventRecorder executeTests(LauncherDiscoveryRequest request) {
TestDescriptor testDescriptor = discoverTests(request);
ExecutionEventRecorder eventRecorder = new ExecutionEventRecorder();
engine.execute(new ExecutionRequest(testDescriptor, eventRecorder, request.getConfigurationParameters()));
return eventRecorder;
}
开发者ID:junit-pioneer,项目名称:junit-pioneer,代码行数:7,代码来源:AbstractJupiterTestEngineTests.java
注:本文中的org.junit.platform.engine.ExecutionRequest类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论