本文整理匯總了Java中org.junit.runner.manipulation.Filter.ALL屬性的典型用法代碼示例。如果您正苦於以下問題:Java Filter.ALL屬性的具體用法?Java Filter.ALL怎麽用?Java Filter.ALL使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在類org.junit.runner.manipulation.Filter
的用法示例。
在下文中一共展示了Filter.ALL屬性的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: getDescription
/**
* The defines the tree of tests that will be run.
*/
@Override
public Description getDescription() {
ensureInit();
if (filter != Filter.ALL || sorter != null) {
suiteDescription = rebuildDescriptionByFilter(suiteDescription);
}
return suiteDescription;
}
示例2: ensureInit
/**
* Initialise all data members. Needed as a lot of work gets done before
* constructor completes.
*/
private void ensureInit() {
if (suiteDescription == null) {
suiteDescription = Description.createSuiteDescription(getTestClass().getJavaClass());
descriptions = new IdentityHashMap<>();
checksByMethod = new ConcurrentHashMap<>();
finder = new PotentialAssignmentFinder(getTestClass());
constraints = new ConstraintFinder(getTestClass(), this::reportError);
filter = Filter.ALL;
}
}
示例3: addTestSuite
private void addTestSuite(TestSuiteNode parentSuite, Description suiteDescription) {
TestSuiteNode suite = new TestSuiteNode(suiteDescription);
for (Description childDesc : suiteDescription.getChildren()) {
if (childDesc.isTest()) {
addTestCase(suite, childDesc);
} else {
addTestSuite(suite, childDesc);
}
}
// Empty suites are pruned when sharding.
if (shardingFilter == Filter.ALL || !suite.getChildren().isEmpty()) {
parentSuite.addTestSuite(suite);
testsMap.put(suiteDescription, suite);
}
}
示例4: testFilterShould
@Test
public void testFilterShould() throws Exception {
// Given:
Filter filter = Filter.ALL;
// When:
underTest.filter(filter);
// Then:
assertThat(underTest.getDescription().getChildren().size()).isGreaterThan(0);
}
示例5: and
/**
* Returns a filter that evaluates to {@code true} if both of its
* components evaluates to {@code true}. The filters are evaluated in
* order, and evaluation will be "short-circuited" if the first filter
* returns {@code false}.
*/
public static Filter and(Filter delegate1, Filter delegate2) {
return delegate1 == Filter.ALL ? delegate2
: (delegate2 == Filter.ALL ? delegate1
: new AndFilter(delegate1, delegate2));
}