Class AbstractTester<G>
- java.lang.Object
-
- junit.framework.Assert
-
- junit.framework.TestCase
-
- com.google.common.collect.testing.AbstractTester<G>
-
- Type Parameters:
G- the type of the test generator required by this tester. An instance of G should somehow provide an instance of the class under test, plus any other information required to parameterize the test.
- All Implemented Interfaces:
junit.framework.Test
- Direct Known Subclasses:
AbstractContainerTester
@GwtCompatible(emulated=true) public class AbstractTester<G> extends junit.framework.TestCase
This abstract base class for testers allows the framework to inject needed information after JUnit constructs the instances.This class is emulated in GWT.
- Author:
- George van den Driessche
-
-
Constructor Summary
Constructors Constructor Description AbstractTester()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static voidassertNull(String message, Object object)Asserts that the given object is non-null, with a better failure message thanTestCase.assertNull(String, Object).StringgetName()GgetSubjectGenerator()StringgetTestMethodName()Returns the name of the test method invoked by this test instance.voidinit(G subjectGenerator, String suiteName)voidinit(G subjectGenerator, String suiteName, @Nullable Runnable setUp, @Nullable Runnable tearDown)voidsetUp()voidtearDown()-
Methods inherited from class junit.framework.TestCase
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, assertSame, assertSame, assertTrue, assertTrue, countTestCases, createResult, fail, fail, failNotEquals, failNotSame, failSame, format, run, run, runBare, runTest, setName, toString
-
-
-
-
Constructor Detail
-
AbstractTester
public AbstractTester()
-
-
Method Detail
-
setUp
public void setUp() throws Exception
- Overrides:
setUpin classjunit.framework.TestCase- Throws:
Exception
-
tearDown
public void tearDown() throws Exception
- Overrides:
tearDownin classjunit.framework.TestCase- Throws:
Exception
-
init
public final void init(G subjectGenerator, String suiteName, @Nullable Runnable setUp, @Nullable Runnable tearDown)
-
getSubjectGenerator
public G getSubjectGenerator()
-
getTestMethodName
@GwtIncompatible public final String getTestMethodName()
Returns the name of the test method invoked by this test instance.
-
getName
@GwtIncompatible public String getName()
- Overrides:
getNamein classjunit.framework.TestCase
-
assertNull
public static void assertNull(String message, Object object)
Asserts that the given object is non-null, with a better failure message thanTestCase.assertNull(String, Object).The
TestCaseversion (which is from JUnit 3) produces a failure message that does not include the value of the object.- Since:
- 33.4.0
-
-