本文整理汇总了Java中org.junit.platform.engine.EngineDiscoveryRequest类的典型用法代码示例。如果您正苦于以下问题:Java EngineDiscoveryRequest类的具体用法?Java EngineDiscoveryRequest怎么用?Java EngineDiscoveryRequest使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
EngineDiscoveryRequest类属于org.junit.platform.engine包,在下文中一共展示了EngineDiscoveryRequest类的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: selectingByNamespace
import org.junit.platform.engine.EngineDiscoveryRequest; //导入依赖的package包/类
@Test
public void selectingByNamespace() {
EngineDiscoveryRequest request = LauncherDiscoveryRequestBuilder.request()
.selectors(selectNamespace("sample.other-test"))
.build();
UniqueId root = UniqueId.root("sample", "test");
List<UniqueId> expectedIds = Stream.of(
root.append("namespace", "sample.other-test"),
root.append("namespace", "sample.other-test").append("name", "my-other-works"),
root.append("namespace", "sample.other-test").append("name", "my-other-fails"),
root.append("namespace", "sample.other-test").append("name", "my-other-error")
).collect(Collectors.toList());
TestDescriptor descriptor = new ClojureTestEngine().discover(request, root);
List<UniqueId> actualIds = descriptor.getAllDescendants().stream()
.map(TestDescriptor::getUniqueId)
.collect(Collectors.toList());
assertEquals(expectedIds, actualIds);
}
开发者ID:ajoberstar,项目名称:jovial,代码行数:22,代码来源:ClojureTestEngineTest.java
示例2: selectingByVar
import org.junit.platform.engine.EngineDiscoveryRequest; //导入依赖的package包/类
@Test
public void selectingByVar() {
EngineDiscoveryRequest request = LauncherDiscoveryRequestBuilder.request()
.selectors(selectVar("sample.other-test", "my-other-works"))
.build();
UniqueId root = UniqueId.root("sample", "test");
List<UniqueId> expectedIds = Stream.of(
root.append("namespace", "sample.other-test"),
root.append("namespace", "sample.other-test").append("name", "my-other-works")
).collect(Collectors.toList());
TestDescriptor descriptor = new ClojureTestEngine().discover(request, root);
List<UniqueId> actualIds = descriptor.getAllDescendants().stream()
.map(TestDescriptor::getUniqueId)
.collect(Collectors.toList());
assertEquals(expectedIds, actualIds);
}
开发者ID:ajoberstar,项目名称:jovial,代码行数:20,代码来源:ClojureTestEngineTest.java
示例3: filteringByNamespace
import org.junit.platform.engine.EngineDiscoveryRequest; //导入依赖的package包/类
@Test
public void filteringByNamespace() {
Set<File> roots = Arrays.stream(System.getProperty("classpath.roots").split(File.pathSeparator))
.map(File::new)
.collect(Collectors.toSet());
EngineDiscoveryRequest request = LauncherDiscoveryRequestBuilder.request()
.selectors(selectClasspathRoots(roots))
.filters(includeNamespacePattern(".*other.*"))
.build();
UniqueId root = UniqueId.root("sample", "test");
List<UniqueId> expectedIds = Stream.of(
root.append("namespace", "sample.other-test"),
root.append("namespace", "sample.other-test").append("name", "my-other-works"),
root.append("namespace", "sample.other-test").append("name", "my-other-fails"),
root.append("namespace", "sample.other-test").append("name", "my-other-error")
).collect(Collectors.toList());
TestDescriptor descriptor = new ClojureTestEngine().discover(request, root);
List<UniqueId> actualIds = descriptor.getAllDescendants().stream()
.map(TestDescriptor::getUniqueId)
.collect(Collectors.toList());
assertEquals(expectedIds, actualIds);
}
开发者ID:ajoberstar,项目名称:jovial,代码行数:27,代码来源:ClojureTestEngineTest.java
示例4: getsTagsFromMetadata
import org.junit.platform.engine.EngineDiscoveryRequest; //导入依赖的package包/类
@Test
public void getsTagsFromMetadata() {
Set<File> roots = Arrays.stream(System.getProperty("classpath.roots").split(File.pathSeparator))
.map(File::new)
.collect(Collectors.toSet());
EngineDiscoveryRequest request = LauncherDiscoveryRequestBuilder.request()
.selectors(selectClasspathRoots(roots))
.build();
UniqueId root = UniqueId.root("sample", "test");
Map<UniqueId, Set<TestTag>> expectedTags = new HashMap<>();
expectedTags.put(root.append("namespace", "sample.core-test"), tags("integration"));
expectedTags.put(root.append("namespace", "sample.other-test"), tags());
expectedTags.put(root.append("namespace", "sample.core-test").append("name", "my-sample-works"), tags("integration"));
expectedTags.put(root.append("namespace", "sample.core-test").append("name", "my-sample-fails"), tags());
expectedTags.put(root.append("namespace", "sample.other-test").append("name", "my-other-works"), tags("unit"));
expectedTags.put(root.append("namespace", "sample.other-test").append("name", "my-other-fails"), tags());
expectedTags.put(root.append("namespace", "sample.other-test").append("name", "my-other-error"), tags("integration"));
TestDescriptor descriptor = new ClojureTestEngine().discover(request, root);
Map<UniqueId, Set<TestTag>> actualTags = descriptor.getAllDescendants().stream()
.collect(Collectors.toMap(TestDescriptor::getUniqueId, TestDescriptor::getTags));
assertEquals(expectedTags, actualTags);
}
开发者ID:ajoberstar,项目名称:jovial,代码行数:27,代码来源:ClojureTestEngineTest.java
示例5: discover
import org.junit.platform.engine.EngineDiscoveryRequest; //导入依赖的package包/类
@Override
public TestDescriptor discover(EngineDiscoveryRequest discoveryRequest,
UniqueId uniqueId) {
// Discover test(s) and return a TestDescriptor object
TestDescriptor testDescriptor = new EngineDescriptor(uniqueId,
"My test");
return testDescriptor;
}
开发者ID:bonigarcia,项目名称:mastering-junit5,代码行数:9,代码来源:MyCustomEngine.java
示例6: selectingByClasspathDir
import org.junit.platform.engine.EngineDiscoveryRequest; //导入依赖的package包/类
@Test
public void selectingByClasspathDir() {
Set<File> roots = Arrays.stream(System.getProperty("classpath.roots").split(File.pathSeparator))
.map(File::new)
.collect(Collectors.toSet());
EngineDiscoveryRequest request = LauncherDiscoveryRequestBuilder.request()
.selectors(selectClasspathRoots(roots))
.build();
UniqueId root = UniqueId.root("sample", "test");
List<UniqueId> expectedIds = Stream.of(
root.append("namespace", "sample.core-test"),
root.append("namespace", "sample.other-test"),
root.append("namespace", "sample.core-test").append("name", "my-sample-works"),
root.append("namespace", "sample.core-test").append("name", "my-sample-fails"),
root.append("namespace", "sample.other-test").append("name", "my-other-works"),
root.append("namespace", "sample.other-test").append("name", "my-other-fails"),
root.append("namespace", "sample.other-test").append("name", "my-other-error")
).collect(Collectors.toList());
TestDescriptor descriptor = new ClojureTestEngine().discover(request, root);
List<UniqueId> actualIds = descriptor.getAllDescendants().stream()
.map(TestDescriptor::getUniqueId)
.collect(Collectors.toList());
assertEquals(expectedIds, actualIds);
}
开发者ID:ajoberstar,项目名称:jovial,代码行数:29,代码来源:ClojureTestEngineTest.java
示例7: discover
import org.junit.platform.engine.EngineDiscoveryRequest; //导入依赖的package包/类
@Override
public TestDescriptor discover(EngineDiscoveryRequest discoveryRequest, UniqueId uniqueId) {
this.discoveryRequestForDiscovery = discoveryRequest;
this.uniqueIdForDiscovery = uniqueId;
UniqueId engineUniqueId = UniqueId.forEngine(ID);
TestDescriptorStub engineDescriptor = new TestDescriptorStub(engineUniqueId, ID);
TestDescriptorStub testDescriptor = new TestDescriptorStub(engineUniqueId.append("test", "test"), "test");
engineDescriptor.addChild(testDescriptor);
return engineDescriptor;
}
开发者ID:junit-pioneer,项目名称:junit-pioneer,代码行数:12,代码来源:TestEngineSpy.java
示例8: execute
import org.junit.platform.engine.EngineDiscoveryRequest; //导入依赖的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
示例9: discover
import org.junit.platform.engine.EngineDiscoveryRequest; //导入依赖的package包/类
@Override
public TestDescriptor discover(EngineDiscoveryRequest discoveryRequest, UniqueId uniqueId) {
TestDescriptor engine = new EngineDescriptor(uniqueId, getCaption());
for (int i = 0; i < getScoops(discoveryRequest, 5); i++) {
engine.addChild(new Scoop(engine.getUniqueId(), i, Flavor.random()));
}
return engine;
}
开发者ID:junit-team,项目名称:junit5-samples,代码行数:9,代码来源:Machine.java
示例10: discover
import org.junit.platform.engine.EngineDiscoveryRequest; //导入依赖的package包/类
@Override
public TestDescriptor discover(EngineDiscoveryRequest request, UniqueId uniqueId) {
Object engine = getEngine(request.getConfigurationParameters());
return (TestDescriptor) SimpleClojure.invoke(ENGINE_NS, "discover", engine, request, uniqueId);
}
开发者ID:ajoberstar,项目名称:jovial,代码行数:6,代码来源:BaseClojureEngine.java
示例11: discover
import org.junit.platform.engine.EngineDiscoveryRequest; //导入依赖的package包/类
@Override
public TestDescriptor discover(EngineDiscoveryRequest discoveryRequest, UniqueId uniqueId) {
return new TestDescriptorStub(UniqueId.forEngine(getId()), getId());
}
开发者ID:junit-pioneer,项目名称:junit-pioneer,代码行数:5,代码来源:TestEngineStub.java
示例12: getScoops
import org.junit.platform.engine.EngineDiscoveryRequest; //导入依赖的package包/类
/**
* Extract amount of scoops to generate.
*/
int getScoops(EngineDiscoveryRequest discoveryRequest, int defaultScoops) {
ConfigurationParameters parameters = discoveryRequest.getConfigurationParameters();
String scoops = parameters.get("scoops").orElse(Integer.toString(defaultScoops));
return Integer.valueOf(scoops);
}
开发者ID:junit-team,项目名称:junit5-samples,代码行数:9,代码来源:Machine.java
注:本文中的org.junit.platform.engine.EngineDiscoveryRequest类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论