01: /*
02: * Copyright (C) 1999-2004 <A href="http://www-ist.massey.ac.nz/JBDietrich" target="_top">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: package test.org.mandarax.xkb;
19:
20: import org.mandarax.kernel.KnowledgeBase;
21: import org.mandarax.kernel.Query;
22: import org.mandarax.xkb.XKBDriver;
23:
24: /**
25: * Generic test case for XKB drivers using knowledge bases containing only queries.
26: * @author <A href="http://www-ist.massey.ac.nz/JBDietrich" target="_top">Jens Dietrich</A>
27: * @version 3.4 <7 March 05>
28: * @since 1.6
29: */
30: public class XKBTestCase4Queries extends XKBTestCase {
31:
32: private KnowledgeBase kb = null;
33:
34: /**
35: * Construct a test case with the name for an XKB driver.
36: * @param aDriver the driver to be tested
37: * @param descr a description of the test case
38: * @param q a query
39: * @param xmlFileName the name of the file where to output the generated xml, null means no
40: * output
41: */
42: public XKBTestCase4Queries(XKBDriver aDriver, Query q,
43: String descr, String xmlFileName) {
44: super (aDriver, xmlFileName);
45: description = descr;
46: kb = new org.mandarax.reference.AdvancedKnowledgeBase();
47: kb.addQuery(q);
48: }
49:
50: /**
51: * Construct a test case with the name for an XKB driver.
52: * @param aDriver the driver to be tested
53: * @param descr a description of the test case
54: * @param q1 a query
55: * @param q2 a query
56: * @param xmlFileName the name of the file where to output the generated xml, null means no
57: * output
58: */
59: public XKBTestCase4Queries(XKBDriver aDriver, Query q1, Query q2,
60: String descr, String xmlFileName) {
61: super (aDriver, xmlFileName);
62: description = descr;
63: kb = new org.mandarax.reference.AdvancedKnowledgeBase();
64: kb.addQuery(q1);
65: kb.addQuery(q2);
66: }
67:
68: /**
69: * Construct a test case with the name for an XKB driver.
70: * @param aDriver the driver to be tested
71: * @param descr a description of the test case
72: * @param q a query to be tested
73: */
74: public XKBTestCase4Queries(XKBDriver aDriver, Query q, String descr) {
75: this (aDriver, q, descr, null);
76: }
77:
78: /**
79: * Construct a test case with the name for an XKB driver.
80: * @param aDriver the driver to be tested
81: * @param descr a description of the test case
82: * @param q1 a query
83: * @param q2 a query
84: */
85: public XKBTestCase4Queries(XKBDriver aDriver, Query q1, Query q2,
86: String descr) {
87: this (aDriver, q1, q2, descr, null);
88: }
89:
90: /**
91: * Get the knowledge base used as test data.
92: * @return a knowledge base
93: */
94: public KnowledgeBase getKB() {
95: return kb;
96: }
97: }
|