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.*;
21: import org.mandarax.kernel.validation.*;
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 test cases.
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 3.4
31: */
32: public class ZKBTestCase4Testcases 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 tc the test case 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 ZKBTestCase4Testcases(ZKBDriver driver,
45: ObjectPersistencyService ops, TestCase tc, String name,
46: boolean zipOrFolder) {
47: super (driver, ops, name, zipOrFolder);
48: kb = new AdvancedKnowledgeBase();
49: kb.addTestCase(tc);
50: }
51:
52: /**
53: * Constructor.
54: * @param driver the zkb driver
55: * @param ops the object persistency service.
56: * @param tc1 the first test case
57: * @param tc2 the second test case
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 ZKBTestCase4Testcases(ZKBDriver driver,
62: ObjectPersistencyService ops, TestCase tc1, TestCase tc2,
63: String name, boolean zipOrFolder) {
64: super (driver, ops, name, zipOrFolder);
65: kb = new AdvancedKnowledgeBase();
66: kb.addTestCase(tc1);
67: kb.addTestCase(tc2);
68: }
69:
70: /**
71: * Get the knowledge base used as test data.
72: * @return a knowledge base
73: */
74: public KnowledgeBase getKB() {
75: return kb;
76: }
77: }
|