org.junit.platform.engine.DiscoverySelector Java Examples

The following examples show how to use org.junit.platform.engine.DiscoverySelector. 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: EngineDiscoveryTestRequest.java    From ArchUnit with Apache License 2.0 6 votes vote down vote up
@Override
@SuppressWarnings("unchecked") // compatibility is explicitly checked
public <T extends DiscoverySelector> List<T> getSelectorsByType(Class<T> selectorType) {
    if (ClasspathRootSelector.class.equals(selectorType)) {
        return (List<T>) createClasspathRootSelectors(classpathRootsToDiscover);
    }
    if (PackageSelector.class.equals(selectorType)) {
        return (List<T>) createPackageSelectors(packagesToDiscover);
    }
    if (ClassSelector.class.equals(selectorType)) {
        return (List<T>) createClassSelectors(classesToDiscover);
    }
    if (MethodSelector.class.equals(selectorType)) {
        return (List<T>) createMethodSelectors(methodsToDiscover);
    }
    if (FieldSelector.class.equals(selectorType)) {
        return (List<T>) createFieldSelectors(fieldsToDiscover);
    }
    if (UniqueIdSelector.class.equals(selectorType)) {
        return (List<T>) createUniqueIdSelectors(idsToDiscover);
    }
    return emptyList();
}
 
Example #2
Source File: JupiterRunner.java    From sbt-jupiter-interface with Apache License 2.0 5 votes vote down vote up
private DiscoverySelector testSelector(String testClassName) {

            if (testClassName.contains("#")) {
                return selectMethod(testClassName);
            }

            return selectClass(testClassName);
        }
 
Example #3
Source File: TestClassExecutor.java    From webtester2-core with Apache License 2.0 5 votes vote down vote up
@Override
@SuppressWarnings("unchecked")
public <T extends DiscoverySelector> List<T> getSelectorsByType(Class<T> selectorType) {
    if (ClassSelector.class.equals(selectorType)) {
        List<T> list = new ArrayList<>();
        list.add(( T ) DiscoverySelectors.selectClass(testClass));
        return list;
    }
    return Collections.emptyList();
}