Class TearDownStack

java.lang.Object
com.google.common.testing.TearDownStack
All Implemented Interfaces:
TearDownAccepter

@GwtCompatible @NullMarked public class TearDownStack extends Object implements TearDownAccepter
A TearDownStack contains a stack of TearDown instances.

This class is thread-safe.

Since:
10.0
Author:
Kevin Bourrillion
  • Constructor Summary

    Constructors
    Constructor
    Description
    Constructs a new TearDownStack that does not suppress exceptions throw during teardown.
    TearDownStack(boolean suppressThrows)
    Constructs a new TearDownStack, specifying whether to suppress exceptions thrown during teardown.
  • Method Summary

    Modifier and Type
    Method
    Description
    final void
    Registers a TearDown implementor which will be run after the test proper.
    final void
    Causes teardown to execute.

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • TearDownStack

      public TearDownStack()
      Constructs a new TearDownStack that does not suppress exceptions throw during teardown.
    • TearDownStack

      public TearDownStack(boolean suppressThrows)
      Constructs a new TearDownStack, specifying whether to suppress exceptions thrown during teardown.
  • Method Details

    • addTearDown

      public final void addTearDown(TearDown tearDown)
      Description copied from interface: TearDownAccepter
      Registers a TearDown implementor which will be run after the test proper.

      In JUnit4 language, that means as an @After.

      In JUnit3 language, that means during the TestCase.tearDown() step.

      Specified by:
      addTearDown in interface TearDownAccepter
    • runTearDown

      public final void runTearDown()
      Causes teardown to execute.