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:
19: package org.mandarax.examples.crm.ui;
20:
21: import org.mandarax.examples.crm.KBLoader;
22: import org.mandarax.kernel.KnowledgeBase;
23: import org.mandarax.reference.validation.KB2TestSuite;
24:
25: import junit.framework.*;
26:
27: /**
28: * Starts validator using the swing based JUnit test runner.
29: * @author <A href="http://www-ist.massey.ac.nz/JBDietrich" target="_top">Jens Dietrich</A>
30: * @version 3.4 <7 March 05>
31: * @since 3.4
32: */
33: public class KnowledgeBaseValidator {
34: /**
35: * Main method.
36: * @param args runtime arguments
37: */
38: public static void main(String[] args) {
39: String[] params = new String[] {
40: KnowledgeBaseValidator.class.getName(), "-noloading" }; // this class is the test suite
41: junit.swingui.TestRunner.main(params);
42: }
43:
44: /**
45: * Load the knowledge base, extract the test cases and return them as test suite.
46: * @return an array of test cases
47: */
48: public static Test suite() throws Exception {
49: KnowledgeBase kb = KBLoader.getKB();
50: return KB2TestSuite.suite(kb);
51: }
52: }
|