KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > sapia > magnet > test > MagnetRunnerTest


1 package org.sapia.magnet.test;
2
3 import junit.framework.TestCase;
4 import junit.textui.TestRunner;
5 import org.sapia.magnet.MagnetRunner;
6
7 /**
8  * @author Jean-Cedric Desrochers
9  *
10  * <dl>
11  * <dt><b>Copyright:</b><dd>Copyright &#169; 2002-2003 <a HREF="http://www.sapia-oss.org">Sapia Open Source Software</a>. All Rights Reserved.</dd></dt>
12  * <dt><b>License:</b><dd>Read the license.txt file of the jar or visit the
13  * <a HREF="http://www.sapia-oss.org/license.html" target="sapia-license">license page</a> at the Sapia OSS web site</dd></dt>
14  * </dl>
15  */

16 public class MagnetRunnerTest extends TestCase {
17
18   public static void main(String JavaDoc[] args) {
19     TestRunner.run(MagnetRunnerTest.class);
20   }
21
22   public MagnetRunnerTest(String JavaDoc aName) {
23     super(aName);
24   }
25
26   public void testVersion() throws Exception JavaDoc {
27     MagnetRunner.main(new String JavaDoc[] {"-version"});
28   }
29
30   public void testHelp() throws Exception JavaDoc {
31     MagnetRunner.main(new String JavaDoc[] {"-help"});
32   }
33
34   public void testMagnetFile() throws Exception JavaDoc {
35     MagnetRunner.main(new String JavaDoc[] {"-magnetfile", "Corus.xml", "dev", "whatever"});
36   }
37
38   public void testDefaultMagnet() throws Exception JavaDoc {
39     MagnetRunner.main(new String JavaDoc[] {"dev"});
40   }
41
42   public void testDefaultProfile() throws Exception JavaDoc {
43     MagnetRunner.main(new String JavaDoc[] {"-file", "myMagnet.xml"});
44   }
45
46   public void testUnknownOption() throws Exception JavaDoc {
47     MagnetRunner.main(new String JavaDoc[] {"-unknown"});
48   }
49
50   public void testSystemLauncher() throws Exception JavaDoc {
51     MagnetRunner.runFile("../systemMagnet.xml","dev");
52   }
53 }
Popular Tags