01: /*
02: * Copyright (C) 1999-2004 <a href="mailto:mandarax@jbdietrich.com">Jens Dietrich</a>
03: *
04: * This library is free software; you can redistribute it and/or
05: * modify it under the terms of the GNU Lesser General Public
06: * License as published by the Free Software Foundation; either
07: * version 2 of the License, or (at your option) any later version.
08: *
09: * This library is distributed in the hope that it will be useful,
10: * but WITHOUT ANY WARRANTY; without even the implied warranty of
11: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12: * Lesser General Public License for more details.
13: *
14: * You should have received a copy of the GNU Lesser General Public
15: * License along with this library; if not, write to the Free Software
16: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17: */
18:
19: package test.org.mandarax.jdbc;
20:
21: import junit.framework.TestCase;
22:
23: /**
24: * Abstract query test case.
25: * @author <A HREF="mailto:mandarax@jbdietrich.com">Jens Dietrich</A>
26: * @version 3.3.2 <29 December 2004>
27: * @since 3.0
28: */
29:
30: public abstract class AbstractQueryTestCase extends TestCase {
31: protected String url = null;
32: protected String sql = null;
33: private static boolean initialized = false;
34:
35: /**
36: * Constructor.
37: * @param url the kb url
38: * @param sql the sql statement
39: */
40: public AbstractQueryTestCase(String url, String sql) {
41: super ("test");
42: this .url = url;
43: this .sql = sql;
44: }
45:
46: /**
47: * Constructor.
48: * @param url the kb url
49: */
50: public AbstractQueryTestCase(String url) {
51: super ("test");
52: this .url = url;
53: }
54:
55: /**
56: * Perform the test.
57: */
58: public abstract void test() throws Exception;
59:
60: /**
61: * Prepare the test case.
62: */
63: public void setUp() throws Exception {
64: super .setUp();
65: if (!initialized) {
66: Class.forName("org.mandarax.jdbc.DriverImpl");
67: TestKB.setup();
68: initialized = true;
69: }
70: }
71: }
|