Class AbstractTestOdbc
- java.lang.Object
-
- junit.framework.Assert
-
- junit.framework.TestCase
-
- org.hsqldb.test.AbstractTestOdbc
-
- All Implemented Interfaces:
- junit.framework.Test
- Direct Known Subclasses:
- TestOdbcService, TestOdbcTypes
public abstract class AbstractTestOdbc extends junit.framework.TestCaseBase test class for ODBC testing with JUnit 3.x. Provides utility testrunner method, plus sets up and runs a HyperSQL listener.You MUST have a native (non-Java) ODBC DSN configured with the HyperSQL ODBC driver, DSN name "HSQLDB_UTEST", DSN database "/", port "9797". The user name and password don't matter. We use the word query how it is used in the JDBC API, to mean a SELECT statement, not in the more general way as used in the ODBC API.
The DSN name and port may be changed from these defaults by setting Java system properties "test.hsqlodbc.dsnname" and/or "test.hsqlodbc.port".
This class badly needs JUnit 4.x. Test runs take about 50x as long as they should because JUnit 3.x does not have a way to do one-time-per-class setUp and tearDown. We should instantiate and start up the Server one time, and repopulate the catalog contents in the traditional setUp().
-
-
Constructor Summary
Constructors Constructor and Description AbstractTestOdbc()AbstractTestOdbc(java.lang.String s)Accommodate JUnit's test-runner conventions.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method and Description static voidstaticRunner(java.lang.Class c, java.lang.String[] sa)This method allows to easily run this unit test independent of the other unit tests, and without dealing with Ant or unrelated test suites.-
Methods inherited from class junit.framework.TestCase
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, countTestCases, fail, fail, failNotEquals, failNotSame, failSame, format, getName, run, run, runBare, setName, toString
-
-
-
-
Constructor Detail
-
AbstractTestOdbc
public AbstractTestOdbc()
-
AbstractTestOdbc
public AbstractTestOdbc(java.lang.String s)
Accommodate JUnit's test-runner conventions.
-
-
Method Detail
-
staticRunner
public static void staticRunner(java.lang.Class c, java.lang.String[] sa)This method allows to easily run this unit test independent of the other unit tests, and without dealing with Ant or unrelated test suites. Invoke like this:
, but give your subclass name in place ofpublic static void main(String[] sa) { staticRunner(TestOdbcService.class, sa); }TestOdbcService
-
-
DataMelt 3.0 © DataMelt by jWork.ORG