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


Java NoTestsRemainException类代码示例

本文整理汇总了Java中org.junit.runner.manipulation.NoTestsRemainException的典型用法代码示例。如果您正苦于以下问题:Java NoTestsRemainException类的具体用法?Java NoTestsRemainException怎么用?Java NoTestsRemainException使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: registerOptOuts

import org.junit.runner.manipulation.NoTestsRemainException; //导入依赖的package包/类
private void registerOptOuts(final Class<? extends Graph> graphClass,
                             final Optional<GraphProvider.Descriptor> graphProviderDescriptor,
                             final TraversalEngine.Type traversalEngineType) throws InitializationError {
    final Graph.OptOut[] optOuts = graphClass.getAnnotationsByType(Graph.OptOut.class);

    if (optOuts != null && optOuts.length > 0) {
        // validate annotation - test class and reason must be set
        if (!Arrays.stream(optOuts).allMatch(ignore -> ignore.test() != null && ignore.reason() != null && !ignore.reason().isEmpty()))
            throw new InitializationError("Check @IgnoreTest annotations - all must have a 'test' and 'reason' set");

        try {
            filter(new OptOutTestFilter(optOuts, graphProviderDescriptor, traversalEngineType));
        } catch (NoTestsRemainException ex) {
            throw new InitializationError(ex);
        }
    }
}
 
开发者ID:PKUSilvester,项目名称:LiteGraph,代码行数:18,代码来源:AbstractGremlinSuite.java

示例2: filter

import org.junit.runner.manipulation.NoTestsRemainException; //导入依赖的package包/类
@Override
public void filter(final Filter raw) throws NoTestsRemainException {
	super.filter(new Filter() {
		@Override
		public boolean shouldRun(Description description) {
			String testDisplay = StringUtils.substringBefore(description.getDisplayName(), " ");
			if (testDisplay != description.getDisplayName()) {
				description = Description.createTestDescription(description.getTestClass(), testDisplay);
			}
			return raw.shouldRun(description);
		}

		@Override
		public String describe() {
			return raw.describe();
		}
	});
}
 
开发者ID:GeeQuery,项目名称:ef-orm,代码行数:19,代码来源:JefJUnit4DatabaseTestRunner.java

示例3: filterIfRequired

import org.junit.runner.manipulation.NoTestsRemainException; //导入依赖的package包/类
private void filterIfRequired(final ResultCollector rc, final Runner runner) {
  if (this.filter.hasSome()) {
    if (!(runner instanceof Filterable)) {
      LOG.warning("Not able to filter " + runner.getDescription()
          + ". Mutation may have prevented JUnit from constructing test");
      return;
    }
    final Filterable f = (Filterable) runner;
    try {
      f.filter(this.filter.value());
    } catch (final NoTestsRemainException e1) {
      rc.notifySkipped(this.getDescription());
      return;
    }
  }
}
 
开发者ID:hcoles,项目名称:pitest,代码行数:17,代码来源:AdaptedJUnitTestUnit.java

示例4: runEnabledTests

import org.junit.runner.manipulation.NoTestsRemainException; //导入依赖的package包/类
private void runEnabledTests(RunNotifier nested) {
    if (enabledTests.isEmpty()) {
        return;
    }

    Runner runner;
    try {
        runner = createExecutionRunner();
    } catch (Throwable t) {
        runner = new CannotExecuteRunner(getDisplayName(), target, t);
    }

    try {
        if (!disabledTests.isEmpty()) {
            ((Filterable) runner).filter(new Filter() {
                @Override
                public boolean shouldRun(Description description) {
                    return !disabledTests.contains(description);
                }

                @Override
                public String describe() {
                    return "disabled tests";
                }
            });
        }
    } catch (NoTestsRemainException e) {
        return;
    }

    runner.run(nested);
}
 
开发者ID:lxxlxx888,项目名称:Reer,代码行数:33,代码来源:AbstractMultiTestRunner.java

示例5: getFilter

import org.junit.runner.manipulation.NoTestsRemainException; //导入依赖的package包/类
public Filter getFilter() {
    return new Filter() {
        @Override
        public boolean shouldRun(Description description) {
            return Boolean.TRUE.equals(context.get(description));
        }

        @Override
        public String describe() {
            return "RTest Filter";
        }

        @Override
        public void apply(Object child) throws NoTestsRemainException {
            if(child instanceof Filterable) {
                Filterable filterableChild = (Filterable) child;
                filterableChild.filter(this);
            }
        }
    };
    //return Filter.matchMethodDescription(desiredDescription);
       /*return new Filter() {
           @Override
           public boolean shouldRun(Description description) {
               return (toRun.contains(description));

           }

           @Override
           public String describe() {
               return "RTest methods filter";
           }
       };*/

}
 
开发者ID:MarkBramnik,项目名称:rtest,代码行数:36,代码来源:FilterData.java

示例6: addFilter

import org.junit.runner.manipulation.NoTestsRemainException; //导入依赖的package包/类
private void addFilter(Filter filter) {
  try {
    filter(filter);
  } catch (NoTestsRemainException ex) {
    System.out.println("No tests remain exception: " + ex);
  }
}
 
开发者ID:google,项目名称:wycheproof,代码行数:8,代码来源:WycheproofRunner.java

示例7: initializeFilter

import org.junit.runner.manipulation.NoTestsRemainException; //导入依赖的package包/类
/**
 * Initializes the test filter.
 *
 * @param parentRunner
 *          the {@link ParentRunner} to initialize, must not be {@code null}
 */
public static void initializeFilter(final ParentRunner<?> parentRunner) {
  try {
    parentRunner.filter(INSTANCE);
  } catch (NoTestsRemainException e) {
    // we ignore the case where no children are left
  }
}
 
开发者ID:dsldevkit,项目名称:dsl-devkit,代码行数:14,代码来源:FilterRegistry.java

示例8: filterByCategory

import org.junit.runner.manipulation.NoTestsRemainException; //导入依赖的package包/类
private void filterByCategory(Class category) throws InitializationError {
  if (category != null) {
    try {
      final Categories.CategoryFilter categoryFilter = Categories.CategoryFilter.include(category);
      filter(categoryFilter);
    } catch (NoTestsRemainException e) {
      throw new RuntimeException(e);
    }
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:11,代码来源:IdeaSuite48.java

示例9: applyMethodFilter

import org.junit.runner.manipulation.NoTestsRemainException; //导入依赖的package包/类
private void applyMethodFilter() throws InitializationError {
    for (Runner r : getChildren()) {
        try {
            if (r instanceof ParentRunner<?>) {
                ((ParentRunner<?>) r).filter(methodFilter);
            }
        } catch (NoTestsRemainException e) {
            throw new InitializationError(e);
        }
    }
}
 
开发者ID:aafuks,项目名称:aaf-junit,代码行数:12,代码来源:ConcurrentDependsOnClasspathSuite.java

示例10: PowerMockJUnit4LegacyRunnerDelegateImpl

import org.junit.runner.manipulation.NoTestsRemainException; //导入依赖的package包/类
public PowerMockJUnit4LegacyRunnerDelegateImpl(Class<?> klass, String[] methodsToRun,
		PowerMockTestListener[] listeners) throws InitializationError, NoTestsRemainException {
	super(klass, new PowerMockJUnit4LegacyTestClassMethodsRunner(klass,
			listeners == null ? new PowerMockTestListener[0] : listeners));
	filter(new PowerMockJUnit4LegacyFilter(methodsToRun));

	testCount = methodsToRun.length;
}
 
开发者ID:awenblue,项目名称:powermock,代码行数:9,代码来源:PowerMockJUnit4LegacyRunnerDelegateImpl.java

示例11: getRunner

import org.junit.runner.manipulation.NoTestsRemainException; //导入依赖的package包/类
@Override
public Runner getRunner() {
    try {
        Runner runner = mRequest.getRunner();
        mFilter.apply(runner);
        return runner;
    } catch (NoTestsRemainException e) {
        // don't treat filtering out all tests as an error
        return new BlankRunner();
    }
}
 
开发者ID:mg6maciej,项目名称:android-groovy-dagger-espresso-demo,代码行数:12,代码来源:SpockTestRequestBuilder.java

示例12: execute

import org.junit.runner.manipulation.NoTestsRemainException; //导入依赖的package包/类
public static Result execute(final Class<?> classOfspecToRun, final String methodName) throws InitializationError, NoTestsRemainException {

        final Result testResult = new Result();

        Sputnik spockRunner = new Sputnik(classOfspecToRun);
        if(methodName != null && !methodName.equals("")) {
            SpockSpecificationFilter filter = new SpockSpecificationFilter(spockRunner, methodName);
            spockRunner.filter(filter);
        }

        runTest(spockRunner, testResult);

        return testResult;
    }
 
开发者ID:gabehamilton,项目名称:jmeter-spock-sampler,代码行数:15,代码来源:SpockSpecRunner.java

示例13: Categories

import org.junit.runner.manipulation.NoTestsRemainException; //导入依赖的package包/类
public Categories(Class<?> klass, RunnerBuilder builder) throws InitializationError {
    super(klass, builder);
    try {
        Set<Class<?>> included= getIncludedCategory(klass);
        Set<Class<?>> excluded= getExcludedCategory(klass);
        boolean isAnyIncluded= isAnyIncluded(klass);
        boolean isAnyExcluded= isAnyExcluded(klass);

        filter(CategoryFilter.categoryFilter(isAnyIncluded, included, isAnyExcluded, excluded));
    } catch (NoTestsRemainException e) {
        throw new InitializationError(e);
    }
    assertNoCategorizedDescendentsOfUncategorizeableParents(getDescription());
}
 
开发者ID:DIVERSIFY-project,项目名称:sosiefier,代码行数:15,代码来源:Categories.java

示例14: getRunner

import org.junit.runner.manipulation.NoTestsRemainException; //导入依赖的package包/类
@Override
public Runner getRunner() {
    try {
        Runner runner = fRequest.getRunner();
        fFilter.apply(runner);
        return runner;
    } catch (NoTestsRemainException e) {
        return new ErrorReportingRunner(Filter.class, new Exception(String
                .format("No tests found matching %s from %s", fFilter
                        .describe(), fRequest.toString())));
    }
}
 
开发者ID:DIVERSIFY-project,项目名称:sosiefier,代码行数:13,代码来源:FilterRequest.java

示例15: categoryFilterLeavesOnlyMatchingMethods

import org.junit.runner.manipulation.NoTestsRemainException; //导入依赖的package包/类
@Test
public void categoryFilterLeavesOnlyMatchingMethods()
        throws InitializationError, NoTestsRemainException {
    CategoryFilter filter = CategoryFilter.include(SlowTests.class);
    BlockJUnit4ClassRunner runner = new BlockJUnit4ClassRunner(A.class);
    filter.apply(runner);
    assertEquals(1, runner.testCount());
}
 
开发者ID:DIVERSIFY-project,项目名称:sosiefier,代码行数:9,代码来源:CategoryTest.java


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