1 /*
2  *  CVS: $Id: AllTests.java,v 1.5 2004/07/16 16:22:33 marcus Exp $
3  * 
4  *  This file is part of JZuul.
5  *
6  *  JZuul is free software; you can redistribute it and/or modify
7  *  it under the terms of the GNU General Public License as published by
8  *  the Free Software Foundation; either version 2 of the License, or
9  *  (at your option) any later version.
10 *
11 *  JZuul is distributed in the hope that it will be useful,
12 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
13 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14 *  GNU General Public License for more details.
15 *
16 *  You should have received a copy of the GNU General Public License
17 *  along with Zuul; if not, write to the Free Software
18 *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
19 * 
20 *  Copyrigth 2004 by marcus, leh
21 * 
22 */
23
24package org.jzuul.engine.test;
25
26import junit.framework.Test;
27import junit.framework.TestSuite;
28
29
30/**
31 * 
32  */
33public class AllTests  {
34
35    /**
36     * Lässt alle Tests laufen
37     * 
38     * @param args  die Kommandozeilenparameter
39     */
40    public static void main(String[] args) {
41        
42        if ((args.length == 0) || (args[0].equals("-swing"))) {
43            junit.swingui.TestRunner.run(AllTests.class);
44        } else if (args[0].equals("-text")) {
45            junit.textui.TestRunner.run(suite());
46        } else if (args[0].equals("-awt")) {
47        junit.awtui.TestRunner.run(AllTests.class);
48        } else { 
49            System.out.println("Only -text, -swing and -awt are allowed options");
50        }
51    }
52
53    /**
54     * Erstellt eine Test Objekt aus allen existierenden Tests
55     * 
56     * @return  ein Test objekt.
57     */
58    public static Test suite() {
59        TestSuite suite = new TestSuite("Tests for JZuul");
60        
61        suite.addTest(new TestSuite(PlayerTest.class));
62        suite.addTest(new TestSuite(InventoryTest.class));
63        suite.addTest(new TestSuite(GameFileReaderTest.class));
64        
65        
66        // EventListener Implementations:
67        suite.addTest(new TestSuite(ItemEventListenerTest.class));
68        suite.addTest(new TestSuite(CharacterEventListenerTest.class));
69        suite.addTest(new TestSuite(PlayerEventListenerTest.class));
70        suite.addTest(new TestSuite(RoomEventListenerTest.class));          
71        
72        //GameObject methods in Item and Character:
73        suite.addTest(new TestSuite(ItemGameObjectTest.class));
74        suite.addTest(new TestSuite(CharacterGameObjectTest.class));
75        
76        return suite;
77    }
78    
79}
80