gate.db
Class TestDB

java.lang.Object
  |
  +--junit.framework.Assert
        |
        +--junit.framework.TestCase
              |
              +--gate.db.TestDB
All Implemented Interfaces:
junit.framework.Test

public class TestDB
extends junit.framework.TestCase


Field Summary
private static boolean DEBUG
          Debug flag
private  OracleDataStore ods
           
private  PostgresDataStore pgds
           
 
Fields inherited from class junit.framework.TestCase
fName
 
Constructor Summary
TestDB(String name)
          Construction
 
Method Summary
 void doTestCorpus(Database db)
          Creates a new transient corpus; Creates a new transient document and adds it to the newcorpus; Creates a persistent corpus starting from the transient one; Closes the database connection; Re-opens the database connection; Retrieves the previuosly created corpus and checks its contents.
 void doTestDatabase(Database db)
          Checks whether the provided database complies with Gate2 requirements
static void main(String[] args)
           
 void setUp()
          Connect to the DataStoreImpl
static junit.framework.Test suite()
          Test suite routine for the test runner
 void tearDown()
          Close the db connections
 void testCorpus()
           
 void testDatabase()
           
 void testObjectWriter()
          tests the functionality of gate.util.ObjectWriter
 
Methods inherited from class junit.framework.TestCase
countTestCases, createResult, name, run, run, runBare, runTest, toString
 
Methods inherited from class junit.framework.Assert
assert, assert, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertNotNull, assertNotNull, assertNull, assertNull, assertSame, assertSame, fail, fail, failNotEquals, failNotSame
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, wait, wait, wait
 

Field Detail

DEBUG

private static final boolean DEBUG
Debug flag

ods

private OracleDataStore ods

pgds

private PostgresDataStore pgds
Constructor Detail

TestDB

public TestDB(String name)
Construction
Method Detail

setUp

public void setUp()
           throws SQLException
Connect to the DataStoreImpl
Overrides:
setUp in class junit.framework.TestCase

tearDown

public void tearDown()
              throws OpenTransactionsException
Close the db connections
Overrides:
tearDown in class junit.framework.TestCase

doTestDatabase

public void doTestDatabase(Database db)
Checks whether the provided database complies with Gate2 requirements

doTestCorpus

public void doTestCorpus(Database db)
                  throws IOException,
                         SQLException,
                         GateException,
                         OpenTransactionsException
Creates a new transient corpus; Creates a new transient document and adds it to the newcorpus; Creates a persistent corpus starting from the transient one; Closes the database connection; Re-opens the database connection; Retrieves the previuosly created corpus and checks its contents.

testObjectWriter

public void testObjectWriter()
                      throws IOException,
                             ClassNotFoundException
tests the functionality of gate.util.ObjectWriter

testDatabase

public void testDatabase()

testCorpus

public void testCorpus()
                throws IOException,
                       SQLException,
                       GateException,
                       OpenTransactionsException

suite

public static junit.framework.Test suite()
Test suite routine for the test runner

main

public static void main(String[] args)