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 java.util.Comparator;
21:
22: import org.mandarax.kernel.ExtendedKnowledgeBase;
23: import org.mandarax.kernel.KnowledgeBase;
24: import org.mandarax.reference.AdvancedKnowledgeBase;
25: import org.mandarax.zkb.ObjectPersistencyService;
26: import org.mandarax.zkb.ZKBDriver;
27:
28: /**
29: * Generic test case for ZKB drivers/ OPSs using kbs with a comparator.
30: * @author <A href="http://www-ist.massey.ac.nz/JBDietrich" target="_top">Jens Dietrich</A>
31: * @version 3.4 <7 March 05>
32: * @since 2.2
33: */
34: public class ZKBTestCase4Comparators extends ZKBTestCase {
35:
36: private KnowledgeBase kb = null;
37:
38: /**
39: * Constructor.
40: * @param driver the zkb driver
41: * @param ops the object persistency service.
42: * @param comp an comparator
43: * @param name the name of the test
44: * @param zipOrFolder whether the zkb is stored in a zip file or folder true - zip, false - folder
45: */
46: public ZKBTestCase4Comparators(ZKBDriver driver,
47: ObjectPersistencyService ops, Comparator comp, String name,
48: boolean zipOrFolder) {
49: super (driver, ops, name, zipOrFolder);
50: kb = new AdvancedKnowledgeBase();
51: ((ExtendedKnowledgeBase) kb).setComparator(comp);
52:
53: }
54:
55: /**
56: * Get the knowledge base used as test data.
57: * @return a knowledge base
58: */
59: public KnowledgeBase getKB() {
60: return kb;
61: }
62: }
|