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.zkb;
19:
20: import org.mandarax.kernel.KnowledgeBase;
21: import org.mandarax.kernel.Query;
22: import org.mandarax.reference.AdvancedKnowledgeBase;
23: import org.mandarax.zkb.ObjectPersistencyService;
24: import org.mandarax.zkb.ZKBDriver;
25:
26: /**
27: * Generic test case for ZKB drivers using knowledge bases containing only queries.
28: * @author <A href="http://www-ist.massey.ac.nz/JBDietrich" target="_top">Jens Dietrich</A>
29: * @version 3.4 <7 March 05>
30: * @since 2.2
31: */
32: public class ZKBTestCase4Queries extends ZKBTestCase {
33:
34: private KnowledgeBase kb = null;
35:
36: /**
37: * Constructor.
38: * @param driver the zkb driver
39: * @param ops the object persistency service.
40: * @param q the query to be tested
41: * @param name the name of the test case
42: * @param zipOrFolder whether the zkb is stored in a zip file or folder true - zip, false - folder
43: */
44: public ZKBTestCase4Queries(ZKBDriver driver,
45: ObjectPersistencyService ops, Query q, String name,
46: boolean zipOrFolder) {
47: super (driver, ops, name, zipOrFolder);
48: kb = new AdvancedKnowledgeBase();
49: kb.addQuery(q);
50: }
51:
52: /**
53: * Constructor.
54: * @param driver the zkb driver
55: * @param ops the object persistency service.
56: * @param q1 the first query
57: * @param q2 the second query
58: * @param name the name of the test case
59: * @param zipOrFolder whether the zkb is stored in a zip file or folder true - zip, false - folder
60: */
61: public ZKBTestCase4Queries(ZKBDriver driver,
62: ObjectPersistencyService ops, Query q1, Query q2,
63: String name, boolean zipOrFolder) {
64: super (driver, ops, name, zipOrFolder);
65: kb = new AdvancedKnowledgeBase();
66: kb.addQuery(q1);
67: kb.addQuery(q2);
68:
69: }
70:
71: /**
72: * Get the knowledge base used as test data.
73: * @return a knowledge base
74: */
75: public KnowledgeBase getKB() {
76: return kb;
77: }
78: }
|