public abstract class

AbstractJUnit38SpringContextTests

extends TestCase
implements ApplicationContextAware
java.lang.Object
   ↳ junit.framework.Assert
     ↳ junit.framework.TestCase
       ↳ org.springframework.test.context.junit38.AbstractJUnit38SpringContextTests
Known Direct Subclasses

Class Overview

Abstract base TestCase which integrates the Spring TestContext Framework and explicit ApplicationContext testing support in a JUnit 3.8 environment.

Concrete subclasses:

The following list constitutes all annotations currently supported directly by AbstractJUnit38SpringContextTests. (Note that additional annotations may be supported by various TestExecutionListeners)

JUnit 3.8 does not support before class or after class lifecycle callbacks. The following TestExecutionListener methods are therefore unsupported in a JUnit 3.8 environment:

Summary

Fields
protected ApplicationContext applicationContext The ApplicationContext that was injected into this test instance via setApplicationContext(ApplicationContext).
protected final Log logger Logger available to subclasses.
protected final ProfileValueSource profileValueSource ProfileValueSource available to subclasses but primarily intended for internal use to provide support for @IfProfileValue.
Public Constructors
AbstractJUnit38SpringContextTests()
Constructs a new AbstractJUnit38SpringContextTests instance; initializes the internal TestContextManager for the current test; and retrieves the configured (or default) ProfileValueSource.
AbstractJUnit38SpringContextTests(String name)
Constructs a new AbstractJUnit38SpringContextTests instance with the supplied name; initializes the internal TestContextManager for the current test; and retrieves the configured (or default) ProfileValueSource.
Public Methods
static int getDisabledTestCount()
Return the number of tests disabled in this environment.
void runBare()
Runs the Spring TestContext Framework test sequence.
final void setApplicationContext(ApplicationContext applicationContext)
Sets the ApplicationContext to be used by this test instance, provided via ApplicationContextAware semantics.
Protected Methods
void recordDisabled(Method testMethod)
Records the supplied test method as disabled in the current environment by incrementing the total number of disabled tests and logging a debug message.
[Expand]
Inherited Methods
From class junit.framework.TestCase
From class junit.framework.Assert
From class java.lang.Object
From interface junit.framework.Test
From interface org.springframework.context.ApplicationContextAware

Fields

protected ApplicationContext applicationContext

The ApplicationContext that was injected into this test instance via setApplicationContext(ApplicationContext).

protected final Log logger

Logger available to subclasses.

protected final ProfileValueSource profileValueSource

ProfileValueSource available to subclasses but primarily intended for internal use to provide support for @IfProfileValue.

Public Constructors

public AbstractJUnit38SpringContextTests ()

Constructs a new AbstractJUnit38SpringContextTests instance; initializes the internal TestContextManager for the current test; and retrieves the configured (or default) ProfileValueSource.

public AbstractJUnit38SpringContextTests (String name)

Constructs a new AbstractJUnit38SpringContextTests instance with the supplied name; initializes the internal TestContextManager for the current test; and retrieves the configured (or default) ProfileValueSource.

Parameters
name the name of the current test to execute

Public Methods

public static int getDisabledTestCount ()

Return the number of tests disabled in this environment.

public void runBare ()

Runs the Spring TestContext Framework test sequence.

In addition to standard runBare() semantics, this implementation performs the following:

Throws
Throwable

public final void setApplicationContext (ApplicationContext applicationContext)

Sets the ApplicationContext to be used by this test instance, provided via ApplicationContextAware semantics.

Parameters
applicationContext the ApplicationContext object to be used by this object

Protected Methods

protected void recordDisabled (Method testMethod)

Records the supplied test method as disabled in the current environment by incrementing the total number of disabled tests and logging a debug message.

Parameters
testMethod the test method that is disabled.