com.ashridgetech.prevdb.test
Class BaseTest

java.lang.Object
  |
  +--junit.framework.Assert
        |
        +--junit.framework.TestCase
              |
              +--com.ashridgetech.prevdb.test.BaseTest
All Implemented Interfaces:
junit.framework.Test
Direct Known Subclasses:
PersistentManagerTest, PersistentObjectTest, PrevDbTest, RefTest, TransactionTest

public class BaseTest
extends junit.framework.TestCase

Common facilities for tests on the Prevdb classes.


Field Summary
protected  BigDecimal balance
           
protected  BigDecimal balance2
           
protected  List checkTextIgnorePrefixes
           
protected  int creditLimit
           
protected  int creditLimit2
           
protected  String desc
           
protected  String desc2
           
static Integer ELEVEN
           
static Integer FOUR
           
protected  org.apache.log4j.Logger log
           
protected  String name
           
protected  String name2
           
static Integer ONE
           
protected  PrevDb prevDb
           
protected  Date startDate
           
protected  Date startDate2
           
protected  TestSystemStore systemStore
           
static Integer TEN
           
static Integer THREE
           
static Integer TWO
           
 
Constructor Summary
BaseTest(String name)
          Standard constructor required by subclasses of TestCase
 
Method Summary
protected static void assertContains(Collection c, Object o)
          Test that c contains an object equal to o.
protected static void assertContainsAsString(Collection c, String s)
          Test that c contains an object whose getDescription method gives a value equal to s.
protected static void assertContainsOnly(Collection c, Object o)
          Test that c contains an object equal to o and nothing else.
protected static void assertContainsOnly(Collection c, Object o1, Object o2)
          Test that c contains objects equal to o1 and o2 and nothing else.
protected static void assertContainsOnly(Collection c, Object o1, Object o2, Object o3)
          Test that c contains objects equal to o1, o2 and o3 and nothing else.
protected static void assertContainsOnly(Collection c, Object o1, Object o2, Object o3, Object o4)
          Test that c contains objects equal to o1, o2, o4 and o4 and nothing else.
protected static void assertEmpty(Collection c)
          Test that c is empty
protected static void assertNotContainsAsString(Collection c, String s)
          Test that c does not contain an object whose toString method gives a value equal to s.
protected  void checkEquals(String expected, String actual)
          Check two Strings for equality, and dump characters if they differ.
protected  void checkEquals(String message, String expected, String actual)
          Check two Strings for equality, and dump characters if they differ.
protected  void checkText(String expected, String actual)
          Check the current text.
protected  void checkText(String expected, String actual, boolean dumpOnFail)
          Check the current text.
protected  boolean checkTextIgnore(String expectedLine, String actualLine)
           
protected  PrevDb createPrevDb(SystemStore store)
           
 void setUp()
           
 
Methods inherited from class junit.framework.TestCase
countTestCases, createResult, getName, run, run, runBare, runTest, setName, 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, assertFalse, assertFalse, 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
 

Field Detail

log

protected org.apache.log4j.Logger log

ONE

public static final Integer ONE

TWO

public static final Integer TWO

THREE

public static final Integer THREE

FOUR

public static final Integer FOUR

TEN

public static final Integer TEN

ELEVEN

public static final Integer ELEVEN

name

protected final String name
See Also:
Constant Field Values

startDate

protected final Date startDate

creditLimit

protected final int creditLimit
See Also:
Constant Field Values

balance

protected final BigDecimal balance

desc

protected final String desc
See Also:
Constant Field Values

name2

protected final String name2
See Also:
Constant Field Values

startDate2

protected final Date startDate2

creditLimit2

protected final int creditLimit2
See Also:
Constant Field Values

balance2

protected final BigDecimal balance2

desc2

protected final String desc2
See Also:
Constant Field Values

prevDb

protected PrevDb prevDb

systemStore

protected TestSystemStore systemStore

checkTextIgnorePrefixes

protected List checkTextIgnorePrefixes
Constructor Detail

BaseTest

public BaseTest(String name)
Standard constructor required by subclasses of TestCase

Parameters:
name - name
Method Detail

setUp

public void setUp()
Overrides:
setUp in class junit.framework.TestCase

createPrevDb

protected PrevDb createPrevDb(SystemStore store)

assertEmpty

protected static void assertEmpty(Collection c)
Test that c is empty


assertContains

protected static void assertContains(Collection c,
                                     Object o)
Test that c contains an object equal to o.


assertContainsOnly

protected static void assertContainsOnly(Collection c,
                                         Object o)
Test that c contains an object equal to o and nothing else.


assertContainsOnly

protected static void assertContainsOnly(Collection c,
                                         Object o1,
                                         Object o2)
Test that c contains objects equal to o1 and o2 and nothing else.


assertContainsOnly

protected static void assertContainsOnly(Collection c,
                                         Object o1,
                                         Object o2,
                                         Object o3)
Test that c contains objects equal to o1, o2 and o3 and nothing else.


assertContainsOnly

protected static void assertContainsOnly(Collection c,
                                         Object o1,
                                         Object o2,
                                         Object o3,
                                         Object o4)
Test that c contains objects equal to o1, o2, o4 and o4 and nothing else.


assertContainsAsString

protected static void assertContainsAsString(Collection c,
                                             String s)
Test that c contains an object whose getDescription method gives a value equal to s.

Parameters:
c - the objects to check

assertNotContainsAsString

protected static void assertNotContainsAsString(Collection c,
                                                String s)
Test that c does not contain an object whose toString method gives a value equal to s.


checkEquals

protected void checkEquals(String message,
                           String expected,
                           String actual)
Check two Strings for equality, and dump characters if they differ.

Parameters:
message - the message
expected - the expected text
actual - the actual text

checkEquals

protected void checkEquals(String expected,
                           String actual)
Check two Strings for equality, and dump characters if they differ.

Parameters:
expected - the expected text
actual - the actual text

checkText

protected void checkText(String expected,
                         String actual)
Check the current text.

Parameters:
expected - the expected text

checkText

protected void checkText(String expected,
                         String actual,
                         boolean dumpOnFail)
Check the current text.

Parameters:
expected - the expected text
dumpOnFail - if true, print the actual text if it fails

checkTextIgnore

protected boolean checkTextIgnore(String expectedLine,
                                  String actualLine)


Copyright © 2003 Ashridge Technologies Ltd. All Rights Reserved.