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


Java RunAfters类代码示例

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


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

示例1: withAfterClasses

import org.junit.internal.runners.statements.RunAfters; //导入依赖的package包/类
@Override
protected Statement withAfterClasses(
		Statement statement ) {
	try {
		Statement newStatement = super.withAfterClasses(statement);
		final Method tearDownMethod = GeoWaveITSuiteRunner.class.getDeclaredMethod("tearDown");
		tearDownMethod.setAccessible(true);
		return new RunAfters(
				newStatement,
				Collections.singletonList(new FrameworkMethod(
						tearDownMethod)),
				this);
	}
	catch (NoSuchMethodException | SecurityException e) {
		LOGGER.warn(
				"Unable to find tearDown method",
				e);
	}
	return super.withAfterClasses(statement);
}
 
开发者ID:locationtech,项目名称:geowave,代码行数:21,代码来源:GeoWaveITSuiteRunner.java

示例2: withAfterClasses

import org.junit.internal.runners.statements.RunAfters; //导入依赖的package包/类
@Override
protected Statement withAfterClasses(
		final Statement statement ) {
	// add test environment tear down
	try {
		final Statement newStatement = super.withAfterClasses(statement);
		final Method tearDownMethod = GeoWaveITRunner.class.getDeclaredMethod("tearDown");
		tearDownMethod.setAccessible(true);
		return new RunAfters(
				newStatement,
				Collections.singletonList(new FrameworkMethod(
						tearDownMethod)),
				this);
	}
	catch (NoSuchMethodException | SecurityException e) {
		LOGGER.warn(
				"Unable to find tearDown method",
				e);
	}
	return super.withAfterClasses(statement);
}
 
开发者ID:locationtech,项目名称:geowave,代码行数:22,代码来源:GeoWaveITRunner.java

示例3: withAfters

import org.junit.internal.runners.statements.RunAfters; //导入依赖的package包/类
/**
 * Adds any @AfterAll methods to be run after the normal @After annotated methods for the last test method only.
 * <p>
 * {@inheritDoc}
 */
@Override
protected Statement withAfters(final FrameworkMethod method, final Object target, final Statement stmt) {
  ensureInitialized();
  Statement statement = super.withAfters(method, target, stmt); // NOPMD.CloseResource
  if (method.equals(Iterables.getLast(expectedMethods))) {
    final List<FrameworkMethod> afters = getTestClass().getAnnotatedMethods(AfterAll.class);
    statement = afters.isEmpty() ? statement : new RunAfters(statement, afters, target);
  }
  return statement;
}
 
开发者ID:dsldevkit,项目名称:dsl-devkit,代码行数:16,代码来源:ClassRunner.java

示例4: withAfters

import org.junit.internal.runners.statements.RunAfters; //导入依赖的package包/类
@Override
protected synchronized Statement withAfters(FrameworkMethod method, Object target, Statement statement)
{
    // We now to need to search in the class from the custom loader.
    //We also need to search with the annotation loaded by the custom class loader or otherwise we don't find any method.
    List<FrameworkMethod> afters =
        testClassFromClassLoader
            .getAnnotatedMethods((Class<? extends Annotation>) afterFromClassLoader);

    return new RunAfters(statement, afters, target);
}
 
开发者ID:bitstrings,项目名称:junit-clptr,代码行数:12,代码来源:ClassLoaderPerTestRunner.java

示例5: withAfters

import org.junit.internal.runners.statements.RunAfters; //导入依赖的package包/类
/**
 * Returns a {@link Statement}: run all non-overridden {@code @After}
 * methods on this class and superclasses before running {@code next}; all
 * After methods are always executed: exceptions thrown by previous steps
 * are combined, if necessary, with exceptions from After methods into a
 * {@link MultipleFailureException}.
 */
protected Statement withAfters(FrameworkMethod method, Object target,
        Statement statement) {
    List<FrameworkMethod> afters = getTestClass().getAnnotatedMethods(
            After.class);
    return afters.isEmpty() ? statement : new RunAfters(statement, afters,
            target);
}
 
开发者ID:DIVERSIFY-project,项目名称:sosiefier,代码行数:15,代码来源:BlockJUnit4ClassRunner.java

示例6: withAfters

import org.junit.internal.runners.statements.RunAfters; //导入依赖的package包/类
/**
 * Returns a {@link Statement}: run all non-overridden {@code @After}
 * methods on this class and superclasses before running {@code next}; all
 * After methods are always executed: exceptions thrown by previous steps
 * are combined, if necessary, with exceptions from After methods into a
 * {@link MultipleFailureException}.
 * 
 * @deprecated Will be private soon: use Rules instead
 */
@Override
protected Statement withAfters(FrameworkMethod method, Object target,
		Statement statement) {
	List<FrameworkMethod> afters= getTestClass().getAnnotatedMethods(
			After.class);
	afters = convert(afters);
	return afters.isEmpty() ? statement : new RunAfters(statement, afters,
			target);
}
 
开发者ID:lithiumtech,项目名称:multiverse-test,代码行数:19,代码来源:UnfinalizingTestRunner.java

示例7: withAfterClasses

import org.junit.internal.runners.statements.RunAfters; //导入依赖的package包/类
@Override
protected Statement withAfterClasses(Statement statement) {
	List<FrameworkMethod> afters = getTestClass().getAnnotatedMethods(AfterClass.class);
	afters = convert(afters);
	return afters.isEmpty() ? statement :
		new RunAfters(statement, afters, null);
}
 
开发者ID:lithiumtech,项目名称:multiverse-test,代码行数:8,代码来源:UnfinalizingTestRunner.java

示例8: givenTestClassWithAfterClassAnnotatedMethods_returnsRunAfterStatement

import org.junit.internal.runners.statements.RunAfters; //导入依赖的package包/类
@Test
public void givenTestClassWithAfterClassAnnotatedMethods_returnsRunAfterStatement() throws Exception {
    List<FrameworkMethod> afters = Arrays.asList(method1, method2);
    when(testClass.getAnnotatedMethods(AfterClass.class)).thenReturn(afters);

    Statement actual = builder.createStatement(testClass, next, description, notifier);
    assertThat(actual, is(instanceOf(RunAfters.class)));
}
 
开发者ID:bechte,项目名称:junit-hierarchicalcontextrunner,代码行数:9,代码来源:AfterClassStatementBuilderTest.java

示例9: withAfterClasses

import org.junit.internal.runners.statements.RunAfters; //导入依赖的package包/类
@Override
@SneakyThrows(NoSuchMethodException.class)
protected Statement withAfterClasses(Statement statement) {
	final FrameworkMethod fm = new FrameworkMethod(XTFTestSuite.class.getDeclaredMethod("afterSuite"));
	return new RunAfters(statement, join(fm, getTestClass().getAnnotatedMethods(AfterClass.class), false), null);
}
 
开发者ID:xtf-cz,项目名称:xtf,代码行数:7,代码来源:XTFTestSuite.java

示例10: withAfterClasses

import org.junit.internal.runners.statements.RunAfters; //导入依赖的package包/类
@Override
protected Statement withAfterClasses(Statement statement) {
	Class<? extends Annotation> afterClass = loadClassFromClassLoader(AfterClass.class, cl);
       List<FrameworkMethod> afters = testClass.getAnnotatedMethods(afterClass);
       return afters.isEmpty() ? statement : new RunAfters(statement, afters, null);
   }
 
开发者ID:david-888,项目名称:aspectj-junit-runner,代码行数:7,代码来源:AspectJUnit4Runner.java

示例11: withAfters

import org.junit.internal.runners.statements.RunAfters; //导入依赖的package包/类
@Override
protected Statement withAfters(FrameworkMethod method, Object target, Statement statement) {
	Class<? extends Annotation> after = loadClassFromClassLoader(After.class, cl);
       List<FrameworkMethod> afters = getTestClass().getAnnotatedMethods(after);
       return afters.isEmpty() ? statement : new RunAfters(statement, afters, target);
   }
 
开发者ID:david-888,项目名称:aspectj-junit-runner,代码行数:7,代码来源:AspectJUnit4Runner.java

示例12: create

import org.junit.internal.runners.statements.RunAfters; //导入依赖的package包/类
public static RunAftersContiPerfAdapter create(RunAfters runBefores, Statement next)
        throws NoSuchFieldException, SecurityException, IllegalArgumentException, IllegalAccessException {
    List<FrameworkMethod> befores = ReflectionUtils.getObjectByField(runBefores, runBefores.getClass(), "afters");
    Object target = ReflectionUtils.getObjectByField(runBefores, runBefores.getClass(), "target");
    return new RunAftersContiPerfAdapter(next, befores, target);
}
 
开发者ID:Talend,项目名称:components,代码行数:7,代码来源:RunAftersContiPerfAdapter.java

示例13: prepareAfterClasses

import org.junit.internal.runners.statements.RunAfters; //导入依赖的package包/类
protected Statement prepareAfterClasses(TestClass extension, Statement base) {
    return new RunAfters(
            base, extension.getAnnotatedMethods(AfterClass.class), null);
}
 
开发者ID:lightblue-platform,项目名称:lightblue-client,代码行数:5,代码来源:BeforeAfterTestRule.java

示例14: prepareAfters

import org.junit.internal.runners.statements.RunAfters; //导入依赖的package包/类
protected Statement prepareAfters(TestClass extension, Statement base, Object target) {
    return new RunAfters(
            base, extension.getAnnotatedMethods(After.class), target);
}
 
开发者ID:lightblue-platform,项目名称:lightblue-client,代码行数:5,代码来源:BeforeAfterTestRule.java

示例15: withAfterClasses

import org.junit.internal.runners.statements.RunAfters; //导入依赖的package包/类
@Override
protected Statement withAfterClasses(Statement statement) {
    List<FrameworkMethod> afters= getTestClass().getAnnotatedMethods(AfterPinpointPluginTest.class);
    return afters.isEmpty() ? statement : new RunAfters(statement, afters, null);
}
 
开发者ID:naver,项目名称:pinpoint,代码行数:6,代码来源:AbstractPinpointPluginTestSuite.java


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