public abstract class

ConditionalTestCase

extends TestCase
java.lang.Object
   ↳ junit.framework.Assert
     ↳ junit.framework.TestCase
       ↳ org.springframework.test.ConditionalTestCase
Known Direct Subclasses
Known Indirect Subclasses

This class is deprecated.
as of Spring 3.0, in favor of using the listener-based test context framework (AbstractJUnit38SpringContextTests)

Class Overview

Superclass for JUnit 3.8 based tests that allows conditional test execution at the individual test method level. The isDisabledInThisEnvironment() method is invoked before the execution of each test method. Subclasses can override that method to return whether or not the given test should be executed. Note that the tests will still appear to have executed and passed; however, log output will show that the test was not executed.

Summary

Fields
protected final Log logger Logger available to subclasses
Public Constructors
ConditionalTestCase()
Default constructor for ConditionalTestCase.
ConditionalTestCase(String name)
Constructor for ConditionalTestCase with a JUnit name.
Public Methods
static int getDisabledTestCount()
Return the number of tests disabled in this environment.
void runBare()
Protected Methods
boolean isDisabledInThisEnvironment(String testMethodName)
Should this test run?
int recordDisabled()
Record a disabled test.
[Expand]
Inherited Methods
From class junit.framework.TestCase
From class junit.framework.Assert
From class java.lang.Object
From interface junit.framework.Test

Fields

protected final Log logger

Logger available to subclasses

Public Constructors

public ConditionalTestCase ()

Default constructor for ConditionalTestCase.

public ConditionalTestCase (String name)

Constructor for ConditionalTestCase with a JUnit name.

Public Methods

public static int getDisabledTestCount ()

Return the number of tests disabled in this environment.

public void runBare ()

Throws
Throwable

Protected Methods

protected boolean isDisabledInThisEnvironment (String testMethodName)

Should this test run?

Parameters
testMethodName name of the test method
Returns
  • whether the test should execute in the current environment

protected int recordDisabled ()

Record a disabled test.

Returns
  • the current disabled test count