com.workingdogs.village
Class TestMySQL

java.lang.Object
  |
  +--com.workingdogs.village.TestMySQL

public class TestMySQL
extends java.lang.Object

This class is used for testing the functionality of this product. While creating this code, I have closed many potential bugs, but I'm sure that others still exist. Thus, if you find a bug in Village, please add to this test suite so that the bug will be sure to be fixed in future versions.

In order to do the testing, you will need to be able to connect via JDBC to your database. Since I use MySQL http://www.mysql.com/ , this testing suite is best for that database. I also use the mm MySQL drivers http://www.worldserver.com/mm.mysql/ because it is the best driver that I have found for MySQL.

Note that Village should work with any JDBC compliant driver.

Here is the schema that this test expects ( you should be able to copy and paste it into your MySQL database that you want to use ):

CREATE TABLE test
(
a TINYINT null,
b SMALLINT null,
c MEDIUMINT null,
d INT null,
e INTEGER null,
f BIGINT null,
g REAL null,
h DOUBLE null,
i FLOAT null,
j DECIMAL(8,1) null,
k NUMERIC(8,1) null,
l CHAR(255) null,
m VARCHAR(255) null,
n DATE null,
o TIME null,
p TIMESTAMP null,
q DATETIME null,
r TINYBLOB null,
s BLOB null,
t MEDIUMBLOB null,
u LONGBLOB null,
v TINYTEXT null,
w TEXT null,
x MEDIUMTEXT null
);

Version:
$Revision: 1.9 $
Author:
Jon S. Stevens jon@latchkey.com

Field Summary
(package private) static java.sql.Connection conn
          The database connection
private static java.lang.String DB_CONNECTION
          mm MySQL Driver setup
private static java.lang.String DB_DRIVER
          mm MySQL Driver setup
private static java.lang.String DB_HOST
          This is the name of the machine that is hosting the MySQL server
private static java.lang.String DB_NAME
          This is the name of the database.
private static java.lang.String DB_PASS
          the password for the user
private static java.lang.String DB_TABLE
          This is the name of the table in the DB_NAME
private static java.lang.String DB_USER
          This is the user to log into the database as.
private static boolean debugging
          used for debugging
private static int FAILED
          used for debugging
private static int num
          used for debugging
private static int PASSED
          used for debugging
private static int QDS
          used for debugging
private static int TDS
          used for debugging
private static int testCount
          used for debugging
 
Constructor Summary
TestMySQL()
           
 
Method Summary
static void debug(int type, java.lang.Exception e)
           
static void debug(int type, java.lang.String method)
           
static void debug(int type, java.lang.String method, int value)
           
static void debug(int type, java.lang.String method, java.lang.String value)
           
static void getConnection()
           
static void main(java.lang.String[] argv)
           
static void test(int type, int test, int value)
           
static void test(int type, java.lang.String test, java.lang.String value)
           
static void testDeleteSomeRecords()
          This test verifies that deleting multiple records actually works. after execution, there should be no more records in the database.
static void testQueryDataSet()
           
static void testRemoveRecord()
          This test will throw a DataSetException.
static void testTableDataSet()
           
static void testTableDataSet2()
           
static void testTableDataSet3()
           
static void testTableDataSet4()
           
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

conn

static java.sql.Connection conn
The database connection

DB_NAME

private static java.lang.String DB_NAME
This is the name of the database. Created with mysqladmin create

DB_TABLE

private static java.lang.String DB_TABLE
This is the name of the table in the DB_NAME

DB_HOST

private static java.lang.String DB_HOST
This is the name of the machine that is hosting the MySQL server

DB_USER

private static java.lang.String DB_USER
This is the user to log into the database as. For this test, the user must have insert/update/delete access to the database.

DB_PASS

private static java.lang.String DB_PASS
the password for the user

DB_DRIVER

private static java.lang.String DB_DRIVER
mm MySQL Driver setup

DB_CONNECTION

private static java.lang.String DB_CONNECTION
mm MySQL Driver setup

debugging

private static boolean debugging
used for debugging

num

private static int num
used for debugging

testCount

private static int testCount
used for debugging

TDS

private static int TDS
used for debugging

QDS

private static int QDS
used for debugging

PASSED

private static int PASSED
used for debugging

FAILED

private static int FAILED
used for debugging
Constructor Detail

TestMySQL

public TestMySQL()
Method Detail

main

public static void main(java.lang.String[] argv)

testDeleteSomeRecords

public static void testDeleteSomeRecords()
This test verifies that deleting multiple records actually works. after execution, there should be no more records in the database.

testRemoveRecord

public static void testRemoveRecord()
This test will throw a DataSetException. The first getRecord will succeed and the second one will fail.

testTableDataSet2

public static void testTableDataSet2()

testTableDataSet3

public static void testTableDataSet3()

testTableDataSet4

public static void testTableDataSet4()

testTableDataSet

public static void testTableDataSet()

testQueryDataSet

public static void testQueryDataSet()

getConnection

public static void getConnection()

debug

public static void debug(int type,
                         java.lang.Exception e)

debug

public static void debug(int type,
                         java.lang.String method)

debug

public static void debug(int type,
                         java.lang.String method,
                         int value)

test

public static void test(int type,
                        int test,
                        int value)

test

public static void test(int type,
                        java.lang.String test,
                        java.lang.String value)

debug

public static void debug(int type,
                         java.lang.String method,
                         java.lang.String value)


Copyright © 1999-2002 Share.Whichever.com All Rights Reserved.