当前位置: 首页>>代码示例>>Java>>正文


Java UniqueId.root方法代码示例

本文整理汇总了Java中org.junit.platform.engine.UniqueId.root方法的典型用法代码示例。如果您正苦于以下问题:Java UniqueId.root方法的具体用法?Java UniqueId.root怎么用?Java UniqueId.root使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.junit.platform.engine.UniqueId的用法示例。


在下文中一共展示了UniqueId.root方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: selectingByNamespace

import org.junit.platform.engine.UniqueId; //导入方法依赖的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.UniqueId; //导入方法依赖的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.UniqueId; //导入方法依赖的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.UniqueId; //导入方法依赖的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: createDescriptor

import org.junit.platform.engine.UniqueId; //导入方法依赖的package包/类
private PropertyMethodDescriptor createDescriptor(String methodName, long seed, int tries, int maxDiscardRatio,
		ShrinkingMode shrinking) {
	UniqueId uniqueId = UniqueId.root("test", "i dont care");
	Method method = TestHelper.getMethod(PropertyExamples.class, methodName);
	PropertyConfiguration propertyConfig = new PropertyConfiguration("Property", seed, tries, maxDiscardRatio, shrinking, ReportingMode.MINIMAL);
	return new PropertyMethodDescriptor(uniqueId, method, PropertyExamples.class, propertyConfig);
}
 
开发者ID:jlink,项目名称:jqwik,代码行数:8,代码来源:CheckedPropertyFactoryTests.java

示例6: selectingByClasspathDir

import org.junit.platform.engine.UniqueId; //导入方法依赖的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


注:本文中的org.junit.platform.engine.UniqueId.root方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。