ConditionalTestCase (Spring Framework 3.2.1.RELEASE API)
Date: 2013-01-24

org.springframework.test

## Class ConditionalTestCase

- java.lang.Object
- - junit.framework.Assert
  - - junit.framework.TestCase
    - - org.springframework.test.ConditionalTestCase

- All Implemented Interfaces:
    junit.framework.Test
  Direct Known Subclasses:
    AbstractSpringContextTests

  Deprecated.
  as of Spring 3.0, in favor of using the listener-based test context framework (`AbstractJUnit4SpringContextTests`)

      @Deprecated
      public abstract class ConditionalTestCase
      extends junit.framework.TestCase

  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.
  Since:
    2.0
  Author:
    Rod Johnson
  See Also:
    `isDisabledInThisEnvironment(java.lang.String)`

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected Log` | `logger` Deprecated. Logger available to subclasses

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `ConditionalTestCase()` Deprecated. Default constructor for ConditionalTestCase.
    `ConditionalTestCase(String name)` Deprecated. Constructor for ConditionalTestCase with a JUnit name.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `static int` | `getDisabledTestCount()` Deprecated. Return the number of tests disabled in this environment.
    `protected boolean` | `isDisabledInThisEnvironment(String testMethodName)` Deprecated. Should this test run?
    `protected int` | `recordDisabled()` Deprecated. Record a disabled test.
    `void` | `runBare()` Deprecated.

    - ### Methods inherited from class junit.framework.TestCase

      `countTestCases, createResult, getName, run, run, runTest, setName, setUp, tearDown, toString`

    - ### Methods inherited from class junit.framework.Assert

      `assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, fail, fail, failNotEquals, failNotSame, failSame, format`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Field Detail

    - #### logger

          protected final Log logger

      Deprecated.
      Logger available to subclasses

  - ### Constructor Detail

    - #### ConditionalTestCase

          public ConditionalTestCase()

      Deprecated.
      Default constructor for ConditionalTestCase.

    - #### ConditionalTestCase

          public ConditionalTestCase(String name)

      Deprecated.
      Constructor for ConditionalTestCase with a JUnit name.

  - ### Method Detail

    - #### getDisabledTestCount

          public static int getDisabledTestCount()

      Deprecated.
      Return the number of tests disabled in this environment.

    - #### runBare

          public void runBare()
                       throws Throwable

      Deprecated.
      Overrides:
        `runBare` in class `junit.framework.TestCase`
      Throws:
        `Throwable`

    - #### isDisabledInThisEnvironment

          protected boolean isDisabledInThisEnvironment(String testMethodName)

      Deprecated.
      Should this test run?
      Parameters:
        `testMethodName` - name of the test method
      Returns:
        whether the test should execute in the current environment

    - #### recordDisabled

          protected int recordDisabled()

      Deprecated.
      Record a disabled test.
      Returns:
        the current disabled test count