|
JBoss Test 1.1.9.GA-redhat-2 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjunit.framework.Assert
junit.framework.TestCase
org.jboss.test.AbstractTestCase
public abstract class AbstractTestCase
An abstract Test Case.
Constructor Summary | |
---|---|
AbstractTestCase(String name)
Create a new abstract test case |
Method Summary | ||
---|---|---|
protected void |
assertEmpty(Collection c)
Asserts a collection is empty |
|
protected static void |
assertEmpty(Object[] array)
Assert an array is empty or null |
|
protected void |
assertEmpty(String context,
Collection c)
Asserts a collection is empty |
|
protected void |
assertEquals(double one,
double two)
Assert two double values are equal |
|
protected void |
assertEquals(float one,
float two)
Assert two float values are equal |
|
protected void |
assertEquals(Object[] expected,
Object[] actual)
Assert two arrays are equal |
|
protected void |
assertEquals(String context,
Object[] expected,
Object[] actual)
Assert two arrays are equal |
|
protected
|
assertInstanceOf(Object o,
Class<T> expectedType)
Check we have the expected type |
|
protected
|
assertInstanceOf(Object o,
Class<T> expectedType,
boolean allowNull)
Check we have the expected type |
|
static void |
checkDeepThrowable(Class<? extends Throwable> expected,
Throwable throwable)
Check we have the expected deep exception |
|
static void |
checkDeepThrowableRethrow(Class<? extends Throwable> expected,
Throwable throwable)
Check a deep throwable and rethrow if it doesn't match |
|
static void |
checkThrowable(Class<? extends Throwable> expected,
Throwable throwable)
Check we have the expected exception |
|
static void |
checkThrowableRethrow(Class<? extends Throwable> expected,
Throwable throwable)
Check a throwable and rethrow if it doesn't match |
|
protected void |
configureLogging()
Callback for configuring logging at the start of the test |
|
protected Object |
deserialize(byte[] bytes)
Serialize an object |
|
protected abstract void |
enableTrace(String name)
Enable trace for a logging category |
|
protected void |
failure(String reason,
Throwable cause)
Raise an assertion failed error for an error |
|
static URL |
findResource(Class clazz,
String name)
|
|
abstract org.jboss.logging.Logger |
getLog()
Get the log for this test |
|
URL |
getResource(String name)
|
|
protected byte[] |
serialize(Serializable object)
Serialize an object |
|
protected
|
serializeDeserialize(Serializable value,
Class<T> expected)
Serialize/deserialize |
|
protected void |
setUp()
|
|
protected void |
tearDown()
|
Methods inherited from class junit.framework.TestCase |
---|
countTestCases, createResult, getName, run, run, runBare, runTest, setName, 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 |
Constructor Detail |
---|
public AbstractTestCase(String name)
name
- the test nameMethod Detail |
---|
public abstract org.jboss.logging.Logger getLog()
public URL getResource(String name)
public static URL findResource(Class clazz, String name)
protected void setUp() throws Exception
setUp
in class junit.framework.TestCase
Exception
protected void tearDown() throws Exception
tearDown
in class junit.framework.TestCase
Exception
protected void configureLogging()
protected abstract void enableTrace(String name)
name
- the logging categoryprotected void assertEquals(float one, float two)
one
- the expected valuetwo
- the actual valueprotected void assertEquals(double one, double two)
one
- the expected valuetwo
- the actual valueprotected void assertEquals(Object[] expected, Object[] actual)
expected
- the expected arrayactual
- the actual arrayprotected void assertEquals(String context, Object[] expected, Object[] actual)
context
- the contextexpected
- the expected arrayactual
- the actual arrayprotected void assertEmpty(Collection c)
c
- the collectionprotected void assertEmpty(String context, Collection c)
context
- the contextc
- the collectionprotected static void assertEmpty(Object[] array)
array
- the arraypublic static void checkThrowable(Class<? extends Throwable> expected, Throwable throwable)
expected
- the excepted class of the exceptionthrowable
- the real exceptionpublic static void checkThrowableRethrow(Class<? extends Throwable> expected, Throwable throwable) throws Exception
expected
- the expected throwablethrowable
- the throwable
Exception
- the thrown exceptionpublic static void checkDeepThrowable(Class<? extends Throwable> expected, Throwable throwable)
expected
- the excepted class of the exceptionthrowable
- the real exceptionpublic static void checkDeepThrowableRethrow(Class<? extends Throwable> expected, Throwable throwable) throws Exception
expected
- the expected throwablethrowable
- the throwable
Exception
- the thrown exceptionprotected byte[] serialize(Serializable object) throws Exception
object
- the object
Exception
- for any errorprotected Object deserialize(byte[] bytes) throws Exception
bytes
- - the raw serialzied object data
Exception
- for any errorprotected <T> T serializeDeserialize(Serializable value, Class<T> expected) throws Exception
T
- the expected typevalue
- the valueexpected
- the expected type
Exception
- for any problemprotected <T> T assertInstanceOf(Object o, Class<T> expectedType)
T
- the expected typeo
- the objectexpectedType
- the excepted class of the exception
protected <T> T assertInstanceOf(Object o, Class<T> expectedType, boolean allowNull)
T
- the expected typeo
- the objectexpectedType
- the excepted class of the exceptionallowNull
- whether the object can be null
protected void failure(String reason, Throwable cause)
reason
- the reasoncause
- the cause
|
JBoss Test 1.1.9.GA-redhat-2 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |