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


Java RunBefores类代码示例

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


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

示例1: withBeforeClasses

import org.junit.internal.runners.statements.RunBefores; //导入依赖的package包/类
@Override
protected Statement withBeforeClasses(
		final Statement statement ) {
	// add test environment setup
	try {
		final Method setupMethod = GeoWaveITRunner.class.getDeclaredMethod("setup");
		setupMethod.setAccessible(true);
		return super.withBeforeClasses(new RunBefores(
				statement,
				Collections.singletonList(new FrameworkMethod(
						setupMethod)),
				this));
	}
	catch (NoSuchMethodException | SecurityException e) {
		LOGGER.warn(
				"Unable to find setup method",
				e);
	}

	return super.withBeforeClasses(statement);
}
 
开发者ID:locationtech,项目名称:geowave,代码行数:22,代码来源:GeoWaveITRunner.java

示例2: withEnvironment

import org.junit.internal.runners.statements.RunBefores; //导入依赖的package包/类
private Statement withEnvironment(Statement statement) {
    List<FrameworkMethod> environment = super.getTestClass().getAnnotatedMethods(Environment.class);
    if (environment.isEmpty()) {
        log.error("@Environment annotation not used for system test , {}", getTestClass().getName());
        return statement;
    } else {
        return new RunBefores(statement, environment, null);
    }
}
 
开发者ID:pravega,项目名称:pravega,代码行数:10,代码来源:SystemTestRunner.java

示例3: withBefores

import org.junit.internal.runners.statements.RunBefores; //导入依赖的package包/类
/**
 * Adds any @BeforeAll methods to be run before the normal @Before annotated methods for the first test method only.
 * <p>
 * {@inheritDoc}
 */
@Override
protected Statement withBefores(final FrameworkMethod method, final Object target, final Statement stmt) {
  ensureInitialized();
  Statement statement = super.withBefores(method, target, stmt); // NOPMD.CloseResource
  if (method.equals(expectedMethods.get(0))) {
    // reverse BeforeAll method order to get a 'runs top to bottom' order
    final List<FrameworkMethod> befores = Lists.reverse(getTestClass().getAnnotatedMethods(BeforeAll.class));
    statement = befores.isEmpty() ? statement : new RunBefores(statement, befores, target);
  }
  return statement;
}
 
开发者ID:dsldevkit,项目名称:dsl-devkit,代码行数:17,代码来源:ClassRunner.java

示例4: withBeforeClasses

import org.junit.internal.runners.statements.RunBefores; //导入依赖的package包/类
/**
 * Returns a {@link org.junit.runners.model.Statement}: run all non-overridden {@code @BeforeClass} methods on this class
 * and superclasses before executing {@code statement}; if any throws an
 * Exception, stop execution and pass the exception on.
 */
protected Statement withBeforeClasses(Statement statement) {
    List<FrameworkMethod> befores = getTestClass()
            .getAnnotatedMethods(BeforeClass.class);
    return befores.isEmpty() ? statement :
            new RunBefores(statement, befores, null);
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:12,代码来源:LoadTimeWeavableTestRunner.java

示例5: withBefores

import org.junit.internal.runners.statements.RunBefores; //导入依赖的package包/类
/**
 * Returns a {@link org.junit.runners.model.Statement}: run all non-overridden {@code @Before}
 * methods on this class and superclasses before running {@code next}; if
 * any throws an Exception, stop execution and pass the exception on.
 *
 * @deprecated Will be private soon: use Rules instead
 */
@Deprecated
protected Statement withBefores(FrameworkMethod method, Object target,
        Statement statement) {
    List<FrameworkMethod> befores = getTestClass().getAnnotatedMethods(Before.class);
    return befores.isEmpty() ? statement : new RunBefores(statement,
            befores, target);
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:15,代码来源:LoadTimeWeavableTestRunner.java

示例6: withBefores

import org.junit.internal.runners.statements.RunBefores; //导入依赖的package包/类
@Override
protected synchronized Statement withBefores(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> befores =
        testClassFromClassLoader
            .getAnnotatedMethods((Class<? extends Annotation>) beforeFromClassLoader);

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

示例7: withBeforeClasses

import org.junit.internal.runners.statements.RunBefores; //导入依赖的package包/类
/**
 * Returns a {@link Statement}: run all non-overridden {@code @BeforeClass} methods on this class
 * and superclasses before executing {@code statement}; if any throws an
 * Exception, stop execution and pass the exception on.
 */
protected Statement withBeforeClasses(Statement statement) {
	List<FrameworkMethod> befores= fTestClass
			.getAnnotatedMethods(BeforeClass.class);
	return befores.isEmpty() ? statement :
		new RunBefores(statement, befores, null);
}
 
开发者ID:Sellegit,项目名称:j2objc,代码行数:12,代码来源:ParentRunner.java

示例8: withBefores

import org.junit.internal.runners.statements.RunBefores; //导入依赖的package包/类
/**
 * Returns a {@link Statement}: run all non-overridden {@code @Before}
 * methods on this class and superclasses before running {@code next}; if
 * any throws an Exception, stop execution and pass the exception on.
 */
protected Statement withBefores(FrameworkMethod method, Object target,
        Statement statement) {
    List<FrameworkMethod> befores = getTestClass().getAnnotatedMethods(
            Before.class);
    return befores.isEmpty() ? statement : new RunBefores(statement,
            befores, target);
}
 
开发者ID:DIVERSIFY-project,项目名称:sosiefier,代码行数:13,代码来源:BlockJUnit4ClassRunner.java

示例9: withBeforeClasses

import org.junit.internal.runners.statements.RunBefores; //导入依赖的package包/类
/**
 * Returns a {@link Statement}: run all non-overridden {@code @BeforeClass} methods on this class
 * and superclasses before executing {@code statement}; if any throws an
 * Exception, stop execution and pass the exception on.
 */
protected Statement withBeforeClasses(Statement statement) {
    List<FrameworkMethod> befores = fTestClass
            .getAnnotatedMethods(BeforeClass.class);
    return befores.isEmpty() ? statement :
            new RunBefores(statement, befores, null);
}
 
开发者ID:DIVERSIFY-project,项目名称:sosiefier,代码行数:12,代码来源:ParentRunner.java

示例10: withBefores

import org.junit.internal.runners.statements.RunBefores; //导入依赖的package包/类
/**
 * Returns a {@link Statement}: run all non-overridden {@code @Before}
 * methods on this class and superclasses before running {@code next}; if
 * any throws an Exception, stop execution and pass the exception on.
 *
 * @deprecated Will be private soon: use Rules instead
 */
@Deprecated
protected Statement withBefores(FrameworkMethod method, Object target,
        Statement statement) {
    List<FrameworkMethod> befores = getTestClass().getAnnotatedMethods(
            Before.class);
    return befores.isEmpty() ? statement : new RunBefores(statement,
            befores, target);
}
 
开发者ID:lcm-proj,项目名称:lcm,代码行数:16,代码来源:BlockJUnit4ClassRunner.java

示例11: withBefores

import org.junit.internal.runners.statements.RunBefores; //导入依赖的package包/类
/**
 * Returns a {@link Statement}: run all non-overridden {@code @Before}
 * methods on this class and superclasses before running {@code next}; if
 * any throws an Exception, stop execution and pass the exception on.
 * 
 * @deprecated Will be private soon: use Rules instead
 */
@Override
protected Statement withBefores(FrameworkMethod method, Object target,
		Statement statement) {
	List<FrameworkMethod> befores= getTestClass().getAnnotatedMethods(
			Before.class);
	befores = convert(befores);
	return befores.isEmpty() ? statement : new RunBefores(statement,
			befores, target);
}
 
开发者ID:lithiumtech,项目名称:multiverse-test,代码行数:17,代码来源:UnfinalizingTestRunner.java

示例12: withBeforeClasses

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

示例13: givenTestClassWithBeforeClassAnnotatedMethods_returnsRunBeforeStatement

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

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

示例14: withBeforeClasses

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

示例15: withBeforeClasses

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


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