Base class to help file bug reports for Connector/J.
MySQL AB
appreciates repeatable testcases when reporting bugs, so we're giving you
this class to make that job a bit easier (and standarized).
To create a testcase, create a class that inherits from this class
(com.mysql.jdbc.util.BaseBugReport), and override the methods 'setUp',
'tearDown' and 'runTest'.
In the 'setUp' method, create code that creates your tables, and populates
them with any data needed to demonstrate the bug.
In the 'runTest' method, create code that demonstrates the bug using the
tables and data you created in the 'setUp' method.
In the 'tearDown' method, drop any tables you created in the 'setUp' method.
In any of the above three methods, you should use one of the variants of the
'getConnection' method to create a JDBC connection to MySQL, which will use
the default JDBC URL of 'jdbc:mysql:///test'.
If you need to use a JDBC URL that is different than 'jdbc:mysql:///test',
then override the method 'getUrl' as well.
Use the 'assertTrue' methods to create conditions that must be met in your
testcase demonstrating the behavior you are expecting (vs. the behavior you
are observing, which is why you are most likely filing a bug report).
Finally, create a 'main' method that creates a new instance of your testcase,
and calls the 'run' method:
public static void main(String[] args) throws Exception {
new MyBugReport().run();
}
When filing a potential bug with MySQL Connector/J at http://bugs.mysql.com/
or on the bugs mailing list, please include the code that you have just
written using this class.
author: Mark Matthews version: $Id: BaseBugReport.java 3726 2005-05-19 15:52:24Z mmatthews $ |