com.google.common.testing
Class SloppyTearDown

java.lang.Object
  extended by com.google.common.testing.SloppyTearDown
All Implemented Interfaces:
TearDown

public abstract class SloppyTearDown
extends java.lang.Object
implements TearDown

Simple utility for when you want to create a TearDown that may throw an exception but should not fail a test when it does. Use it just like a TearDown, except override sloppyTearDown() instead.

Author:
Luiz-Otavio Zorzella

Field Summary
static java.util.logging.Logger logger
           
 
Constructor Summary
SloppyTearDown()
           
 
Method Summary
abstract  void sloppyTearDown()
           
 void tearDown()
          Performs a single tear-down operation.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

public static final java.util.logging.Logger logger
Constructor Detail

SloppyTearDown

public SloppyTearDown()
Method Detail

tearDown

public final void tearDown()
Description copied from interface: TearDown
Performs a single tear-down operation. See TearDownTestCase and TearDownTestCase for example.

If you want to not fail a test when a TearDown throws an exception, you should implement a SloppyTearDown instead.

Note that, for backwards compatibility, JUnit 3's TearDownTestCase currently does not fail a test when an exception is thrown from one of its TearDowns, but this is subject to change. Also, Junit 4's TearDownTestCase will.

Specified by:
tearDown in interface TearDown

sloppyTearDown

public abstract void sloppyTearDown()
                             throws java.lang.Exception
Throws:
java.lang.Exception


Copyright © 2011 Google. All Rights Reserved.