com.bm.testsuite
Class BaseTest

java.lang.Object
  extended by junit.framework.Assert
      extended by junit.framework.TestCase
          extended by org.jmock.core.VerifyingTestCase
              extended by org.jmock.core.MockObjectSupportTestCase
                  extended by org.jmock.MockObjectTestCase
                      extended by com.bm.testsuite.BaseTest
All Implemented Interfaces:
junit.framework.Test
Direct Known Subclasses:
BaseEntityFixture, BaseSessionBeanFixture, MockedSessionBeanFixture, PoJoFixture

public class BaseTest
extends org.jmock.MockObjectTestCase

Superclass of all EJB3unit methods. An extension of junit.framework.TestCase that adds those methods that we really wish were part of JUnit.

Since:
09.02.2006
Author:
Daniel Wiese

Field Summary
 
Fields inherited from class org.jmock.core.MockObjectSupportTestCase
ANYTHING, NOT_NULL, NULL
 
Constructor Summary
BaseTest()
          Default costructor.
BaseTest(java.lang.String name)
          Create an instance.
 
Method Summary
<T> void
assertCollectionsEqual(java.util.Collection<? extends T> a, java.util.Collection<? extends T> b)
          Assert that the two collections are the same irrespective of order.
static void assertFalse(boolean condition)
          Assert that the specified condition is false.
static void assertFalse(java.lang.String description, boolean condition)
          Assert that the specified condition is false.
<T> void
assertInstanceOf(java.lang.String label, T object, java.lang.Class<? extends T> clazz)
          Assert that the specified object is an instance of this class.
<T> void
assertInstanceOf(T object, java.lang.Class<? extends T> clazz)
          Assert that the specified object is an instance of this class.
protected  void setValueForField(java.lang.Object forObject, java.lang.String fieldName, java.lang.Object toSet)
          Sets a value for a field in the tested-bean instance.
 void testNothing()
          We don´t want that test fails because htey have no test method.
 
Methods inherited from class org.jmock.MockObjectTestCase
atLeastOnce, defaultMockNameForType, mock, mock, never, newCoreMock, once, onConsecutiveCalls, onConsecutiveCalls, onConsecutiveCalls, returnValue, returnValue, returnValue, returnValue, returnValue, returnValue, returnValue, returnValue, returnValue, throwException
 
Methods inherited from class org.jmock.core.MockObjectSupportTestCase
and, eq, eq, eq, eq, eq, eq, eq, eq, eq, eq, isA, newDummy, newDummy, newDummy, not, or, same, stringContains
 
Methods inherited from class org.jmock.core.VerifyingTestCase
registerToVerify, runBare, unregisterToVerify, verify
 
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, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, fail, fail
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

BaseTest

public BaseTest(java.lang.String name)
Create an instance.

Parameters:
name - The name of the test

BaseTest

public BaseTest()
Default costructor.

Method Detail

assertCollectionsEqual

public <T> void assertCollectionsEqual(java.util.Collection<? extends T> a,
                                       java.util.Collection<? extends T> b)
Assert that the two collections are the same irrespective of order.

Type Parameters:
T - - the type of the collection
Parameters:
a - The first collection
b - The second collection

assertFalse

public static void assertFalse(java.lang.String description,
                               boolean condition)
Assert that the specified condition is false. Older versions of junit have assertTrue() but not assertFalse so we add it here to be sure that it is present.

Parameters:
description - The failure message to be used if the condition is not false.
condition - The value to check.

assertFalse

public static void assertFalse(boolean condition)
Assert that the specified condition is false. Older versions of junit have assertTrue() but not assertFalse so we add it here to be sure that it is present.

Parameters:
condition - The value to check.

assertInstanceOf

public <T> void assertInstanceOf(java.lang.String label,
                                 T object,
                                 java.lang.Class<? extends T> clazz)
Assert that the specified object is an instance of this class.

Type Parameters:
T - - the type of the object
Parameters:
label - A description of the test
object - The object to test
clazz - The class

assertInstanceOf

public <T> void assertInstanceOf(T object,
                                 java.lang.Class<? extends T> clazz)
Assert that the specified object is an instance of this class.

Type Parameters:
T - - the type of the object
Parameters:
object - The object to test
clazz - The class

testNothing

public void testNothing()
We don´t want that test fails because htey have no test method.

Since:
23.04.2006

setValueForField

protected void setValueForField(java.lang.Object forObject,
                                java.lang.String fieldName,
                                java.lang.Object toSet)
Sets a value for a field in the tested-bean instance.

Parameters:
fieldName - - the name of the field
toSet - - the value to set
Since:
02.05.2006


Copyright © 2008. All Rights Reserved.