net.sf.saffron.test
Class SaffronTestCase

java.lang.Object
  |
  +--junit.framework.Assert
        |
        +--junit.framework.TestCase
              |
              +--net.sf.saffron.test.SaffronTestCase
All Implemented Interfaces:
Test
Direct Known Subclasses:
BufferedIterator.Test, ThreadIterator.Test

public abstract class SaffronTestCase
extends TestCase


Field Summary
protected  OJStatement.Argument[] arguments
           
(package private) static OJStatement.Argument[] emptyArguments
           
protected static String[] emptyStringArray
           
protected static String nl
           
 
Fields inherited from class junit.framework.TestCase
 
Constructor Summary
SaffronTestCase(String s)
           
 
Method Summary
protected  void assertEquals(Iterator iterator, Object[] a)
          Checks that an iterator returns the same objects as the contents of an array.
protected  void assertEquals(List list, Object[] a)
          Checks that a list has the same contents as an array.
protected  void assertEquals(Object[] expected, Object actual)
           
protected  void assertEquals(Object[] expected, Object[] actual)
          Checks that two arrays are equal.
protected static void assertEqualsDeep(Object o, Object o2)
           
protected  void assertSynthetic(Object o, int rows, String[] columnNames)
          Checks that o is a result set with a given number of rows, a list of columns with given names, and every row is the same type.
protected  void assertSynthetic(Object o, int rows, String[] columnNames, Class[] columnClasses)
          Checks that o is a result set with a given number of rows, a list of columns with given names and types, and every row is the same type.
protected  void assertThrowableContains(Throwable throwable, String pattern)
          Fails if throwable is null, or if its message does not contain the string pattern.
 SaffronConnection getConnection()
           
static Iterator makeIterator(Object[] a)
          Returns an iterator over the elements of an array.
protected  Object runQuery(String query)
          Runs a query, using the default arguments, and returns the result.
protected  Object runQuery(String query, OJStatement.Argument[] arguments)
          Runs a query and returns the result.
protected  Throwable runQueryCatch(String query)
          Runs a query, and returns any exception.
protected  void setUp()
           
protected  void tearDown()
           
protected static List toList(Enumeration enumeration)
          Converts an enumeration to a list.
protected static List toList(Iterator iterator)
          Converts an iterator to a list.
 
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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

emptyArguments

static final OJStatement.Argument[] emptyArguments

nl

protected static final String nl

emptyStringArray

protected static final String[] emptyStringArray

arguments

protected OJStatement.Argument[] arguments
Constructor Detail

SaffronTestCase

public SaffronTestCase(String s)
                throws Exception
Method Detail

assertEqualsDeep

protected static void assertEqualsDeep(Object o,
                                       Object o2)

assertSynthetic

protected void assertSynthetic(Object o,
                               int rows,
                               String[] columnNames)
Checks that o is a result set with a given number of rows, a list of columns with given names, and every row is the same type.


assertSynthetic

protected void assertSynthetic(Object o,
                               int rows,
                               String[] columnNames,
                               Class[] columnClasses)
Checks that o is a result set with a given number of rows, a list of columns with given names and types, and every row is the same type.


assertThrowableContains

protected void assertThrowableContains(Throwable throwable,
                                       String pattern)
Fails if throwable is null, or if its message does not contain the string pattern.


makeIterator

public static Iterator makeIterator(Object[] a)
Returns an iterator over the elements of an array.


getConnection

public SaffronConnection getConnection()

runQuery

protected Object runQuery(String query,
                          OJStatement.Argument[] arguments)
Runs a query and returns the result.


runQuery

protected Object runQuery(String query)
Runs a query, using the default arguments, and returns the result.


runQueryCatch

protected Throwable runQueryCatch(String query)
Runs a query, and returns any exception.


toList

protected static List toList(Iterator iterator)
Converts an iterator to a list.


toList

protected static List toList(Enumeration enumeration)
Converts an enumeration to a list.


setUp

protected void setUp()
              throws Exception
Overrides:
setUp in class TestCase
Exception

assertEquals

protected void assertEquals(Iterator iterator,
                            Object[] a)
Checks that an iterator returns the same objects as the contents of an array.


assertEquals

protected void assertEquals(List list,
                            Object[] a)
Checks that a list has the same contents as an array.


assertEquals

protected void assertEquals(Object[] expected,
                            Object[] actual)
Checks that two arrays are equal.


assertEquals

protected void assertEquals(Object[] expected,
                            Object actual)

tearDown

protected void tearDown()
                 throws Exception
Overrides:
tearDown in class TestCase
Exception

SourceForge.net_Logo