本文整理了Java中org.junit.runner.manipulation.Filter.matchMethodDescription()
方法的一些代码示例,展示了Filter.matchMethodDescription()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Filter.matchMethodDescription()
方法的具体详情如下:
包路径:org.junit.runner.manipulation.Filter
类名称:Filter
方法名:matchMethodDescription
[英]Returns a Filter that only runs the single method described by desiredDescription
[中]返回仅运行desiredDescription描述的单个方法的筛选器
代码示例来源:origin: junit-team/junit4
/**
* Returns a Request that only runs tests whose {@link Description}
* matches the given description.
*
* <p>Returns an empty {@code Request} if {@code desiredDescription} is not a single test and filters all but the single
* test if {@code desiredDescription} is a single test.</p>
*
* @param desiredDescription {@code Description} of those tests that should be run
* @return the filtered Request
*/
public Request filterWith(Description desiredDescription) {
return filterWith(Filter.matchMethodDescription(desiredDescription));
}
代码示例来源:origin: google/j2objc
/**
* Returns a Request that only runs contains tests whose {@link Description}
* equals <code>desiredDescription</code>
*
* @param desiredDescription {@link Description} of those tests that should be run
* @return the filtered Request
*/
public Request filterWith(final Description desiredDescription) {
return filterWith(Filter.matchMethodDescription(desiredDescription));
}
代码示例来源:origin: camunda/camunda-bpm-platform
/**
* Returns a Request that only runs contains tests whose {@link Description}
* equals <code>desiredDescription</code>
*
* @param desiredDescription {@link Description} of those tests that should be run
* @return the filtered Request
*/
public Request filterWith(final Description desiredDescription) {
return filterWith(Filter.matchMethodDescription(desiredDescription));
}
代码示例来源:origin: com.impetus.fabric/fabric-jdbc-driver-shaded
/**
* Returns a Request that only runs contains tests whose {@link Description}
* equals <code>desiredDescription</code>
*
* @param desiredDescription {@link Description} of those tests that should be run
* @return the filtered Request
*/
public Request filterWith(final Description desiredDescription) {
return filterWith(Filter.matchMethodDescription(desiredDescription));
}
代码示例来源:origin: com.oracle/truffle-tck
/**
* Returns a Request that only runs contains tests whose {@link Description}
* equals <code>desiredDescription</code>
*
* @param desiredDescription {@link Description} of those tests that should be run
* @return the filtered Request
*/
public Request filterWith(final Description desiredDescription) {
return filterWith(Filter.matchMethodDescription(desiredDescription));
}
代码示例来源:origin: org.junit/com.springsource.org.junit
/**
* Returns a Request that only runs contains tests whose {@link Description}
* equals <code>desiredDescription</code>
*
* @param desiredDescription {@link Description} of those tests that should be run
* @return the filtered Request
*/
public Request filterWith(final Description desiredDescription) {
return filterWith(Filter.matchMethodDescription(desiredDescription));
}
代码示例来源:origin: org.ops4j.pax.tipi/org.ops4j.pax.tipi.junit
/**
* Returns a Request that only runs contains tests whose {@link Description}
* equals <code>desiredDescription</code>
*
* @param desiredDescription {@link Description} of those tests that should be run
* @return the filtered Request
*/
public Request filterWith(final Description desiredDescription) {
return filterWith(Filter.matchMethodDescription(desiredDescription));
}
代码示例来源:origin: david-schuler/javalanche
public static Runner getRunner(final Description desc)
throws ClassNotFoundException, InitializationError,
NoTestsRemainException {
if (runners.containsKey(desc)) {
Runner runner = runners.get(desc);
if (runner != null) {
return runner;
}
}
Runner r = Junit4Util.getRunner();
Filter f = Filter.matchMethodDescription(desc);
((Filterable) r).filter(f);
// runners.put(desc, r);
return r;
}
代码示例来源:origin: sebastianbenz/Jnario
public ExampleRunner(final Class<?> testClass,
List<ExtensionClass> extensions, final FrameworkMethod method,
NameProvider nameProvider, SpecCreator testBuilder)
throws InitializationError, NoTestsRemainException {
super(testClass);
this.extensions = extensions;
this.method = method;
this.nameProvider = nameProvider;
this.testBuilder = testBuilder;
filter(matchMethodDescription(getDescription()));
}
代码示例来源:origin: org.junit/junit4-engine
@Override
void resolve(MethodSelector selector, TestClassCollector collector) {
Class<?> testClass = selector.getTestClass();
Method testMethod = selector.getTestMethod();
Description methodDescription = Description.createTestDescription(testClass, testMethod.getName());
collector.addFiltered(testClass, adapter(matchMethodDescription(methodDescription)));
}
代码示例来源:origin: com.github.jjYBdx4IL/github-test-utils
BlockJUnit4ClassRunner r = new BlockJUnit4ClassRunner(Thread.currentThread().getContextClassLoader().loadClass(klass.getName()));
Description method = Description.createTestDescription(klass, getMethodName());
r.filter(Filter.matchMethodDescription(method));
r.run(notifier);
代码示例来源:origin: com.github.jjYBdx4IL.utils/junit4-utils
BlockJUnit4ClassRunner r = new BlockJUnit4ClassRunner(Thread.currentThread().getContextClassLoader().loadClass(klass.getName()));
Description method = Description.createTestDescription(klass, getMethodName());
r.filter(Filter.matchMethodDescription(method));
r.run(notifier);
代码示例来源:origin: com.uphyca/android-junit4
testCaseClasses.add(desc.getTestClass());
if (desc.isTest() || desc.isSuite()) {
Filter newFilter = (desc.getMethodName() != null) ? Filter.matchMethodDescription(desc) : Filters.matchSuiteDescription(desc);
if (filters == null) {
filters = newFilter;
代码示例来源:origin: esmasui/AndroidJUnit4
testCaseClasses.add(desc.getTestClass());
if (desc.isTest() || desc.isSuite()) {
Filter newFilter = (desc.getMethodName() != null) ? Filter.matchMethodDescription(desc) : Filters.matchSuiteDescription(desc);
if (filters == null) {
filters = newFilter;
代码示例来源:origin: ops4j/org.ops4j.pax.exam2
private void runSuite(OutputStream os, Class<?> clazz, String methodName, String indexName)
throws IOException {
InjectorFactory injectorFactory = ServiceProviderFinder
.loadUniqueServiceProvider(InjectorFactory.class);
injectorFactory.setContext(getServletContext());
Injector injector = injectorFactory.createInjector();
Integer index = null;
if (indexName != null) {
index = Integer.parseInt(indexName);
}
try {
ParentRunner<?> runner = createRunner(clazz, injector, index);
if (methodName != null) {
Description method = Description.createTestDescription(clazz, methodName);
runner.filter(Filter.matchMethodDescription(method));
}
ObjectOutputStream oos = new ObjectOutputStream(os);
JUnitCore junit = new JUnitCore();
junit.addListener(new ContainerTestListener(oos));
junit.run(runner);
}
catch (InitializationError | NoTestsRemainException exc) {
throw Exceptions.unchecked(exc);
}
}
代码示例来源:origin: ops4j/org.ops4j.pax.exam2
private void runTestWithJUnit(TestDescription description, TestListener listener) {
try {
ParentRunner<?> runner = createRunner(description);
if (description.getMethodName() != null) {
Description methodName = Description
.createTestDescription(description.getClassName(), description.getMethodName());
runner.filter(Filter.matchMethodDescription(methodName));
}
JUnitCore junit = new JUnitCore();
junit.addListener(new ProbeRunListener(listener));
junit.run(runner);
}
catch (InitializationError | NoTestsRemainException exc) {
throw Exceptions.unchecked(exc);
}
}
内容来源于网络,如有侵权,请联系作者删除!