com.hp.hpl.mesa.rdf.jena.rdb
Class TestGenericDriver

java.lang.Object
  |
  +--junit.framework.Assert
        |
        +--junit.framework.TestCase
              |
              +--com.hp.hpl.mesa.rdf.jena.rdb.TestGenericDriver
All Implemented Interfaces:
junit.framework.Test

public class TestGenericDriver
extends junit.framework.TestCase

Unit tests for the generic database driver. The main tests are in TestStoreRDB - these were really bootstrap tests. Need to set appropriate java properties to define the database connection:

   jena.rdb.test.dbbase  - the database uri

 jena.rdb.test.user  - the username to login under

 jena.rdb.test.password  - the password for that user

 

Version:
$Revision: 1.4 $ on $Date: 2002/03/01 14:25:13 $
Author:
Dave Reynolds

Constructor Summary
TestGenericDriver(java.lang.String name, java.lang.String layout, java.lang.String database)
           
 
Method Summary
 void assertIteratorValues(java.util.Iterator it, java.lang.Object[] vals)
          Helper function test an iterator against a list of objects - order dependent
 void doTestLiteralAdd(DriverGenericGeneric driver)
          Test stored procedure for adding literals
 void doTestMuliModels(IRDBDriver driver)
          Test support for multiple models
 void doTestNamespaceAdd(DriverGenericGeneric driver)
          Test namespace manipulation
 void doTestResourceAdd(DriverGenericGeneric driver)
          Test stored procedure for adding resources
 void doTestStatementAdd(DriverGenericGeneric driver)
          Check statement creation - node valid for hash versions
 void listTable(java.lang.String tname, IRDBDriver driver)
          Helper function during debug - list a table
 void setUp()
           
 IRDBDriver setupDB()
          Support code - open a connection to a newly formatted database.
static junit.framework.TestSuite suite(java.lang.String layout, java.lang.String database)
          Return full test suite suitable for the given database type
 void tearDownDB(IRDBDriver driver)
          Support code - tear down the connection
 void testDBFormat()
          Test Database formating.
 void testDriver()
          Test driver functions.
 void testSQLCache()
          Test loading of sql definition files.
 
Methods inherited from class junit.framework.TestCase
countTestCases, getName, name, run, run, runBare, setName, 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, assertTrue, assertTrue, fail, fail
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TestGenericDriver

public TestGenericDriver(java.lang.String name,
                         java.lang.String layout,
                         java.lang.String database)
Method Detail

setUp

public void setUp()
           throws java.io.IOException

setupDB

public IRDBDriver setupDB()
                   throws RDFRDBException
Support code - open a connection to a newly formatted database.

tearDownDB

public void tearDownDB(IRDBDriver driver)
                throws java.sql.SQLException,
                       RDFRDBException
Support code - tear down the connection

testDBFormat

public void testDBFormat()
                  throws RDFRDBException,
                         java.io.IOException,
                         java.sql.SQLException
Test Database formating.

testSQLCache

public void testSQLCache()
                  throws java.io.IOException,
                         java.sql.SQLException
Test loading of sql definition files. Only works on dev code, not released code so scratched from normal regression.

testDriver

public void testDriver()
                throws java.sql.SQLException,
                       RDFException
Test driver functions. Done as one big test instead of lots of small ones so that the setup/teardown overhead is only incurred once

doTestNamespaceAdd

public void doTestNamespaceAdd(DriverGenericGeneric driver)
                        throws java.sql.SQLException,
                               RDFException
Test namespace manipulation

doTestResourceAdd

public void doTestResourceAdd(DriverGenericGeneric driver)
                       throws java.sql.SQLException,
                              RDFException
Test stored procedure for adding resources

doTestLiteralAdd

public void doTestLiteralAdd(DriverGenericGeneric driver)
                      throws java.sql.SQLException,
                             RDFException
Test stored procedure for adding literals

doTestStatementAdd

public void doTestStatementAdd(DriverGenericGeneric driver)
                        throws java.sql.SQLException,
                               RDFException
Check statement creation - node valid for hash versions

doTestMuliModels

public void doTestMuliModels(IRDBDriver driver)
                      throws RDFException,
                             java.sql.SQLException
Test support for multiple models

assertIteratorValues

public void assertIteratorValues(java.util.Iterator it,
                                 java.lang.Object[] vals)
Helper function test an iterator against a list of objects - order dependent

listTable

public void listTable(java.lang.String tname,
                      IRDBDriver driver)
               throws java.sql.SQLException,
                      RDFRDBException
Helper function during debug - list a table

suite

public static junit.framework.TestSuite suite(java.lang.String layout,
                                              java.lang.String database)
Return full test suite suitable for the given database type


Copyright © 2001 Hewlett-Packard. All Rights Reserved.