KickJava   Java API By Example, From Geeks To Geeks.

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


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 /**
9  * @author Jean-Cedric Desrochers
10  *
11  * <dl>
12  * <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>
13  * <dt><b>License:</b><dd>Read the license.txt file of the jar or visit the
14  * <a HREF="http://www.sapia-oss.org/license.html" target="sapia-license">license page</a> at the Sapia OSS web site</dd></dt>
15  * </dl>
16  */

17 public class MainMagnetTest extends TestCase {
18
19   public static void main(String JavaDoc[] args) {
20     org.apache.log4j.BasicConfigurator.configure();
21     TestRunner.run(MainMagnetTest.class);
22   }
23
24   public MainMagnetTest(String JavaDoc aName) {
25     super(aName);
26   }
27
28   public void testSystemMagnet() throws Exception JavaDoc {
29     try {
30       StringBuffer JavaDoc aName = new StringBuffer JavaDoc().
31             append(System.getProperty("user.dir")).append(java.io.File.separator).
32             append(java.io.File.separator).append("etc").
33             append(java.io.File.separator).append("mainMagnet.xml");
34       for (int i = 0; i < 1; i++) {
35         MagnetRunner.main(new String JavaDoc[]
36         { "-magnetfile", aName.toString(), "dev" } );
37       }
38     } catch (Exception JavaDoc e) {
39     }
40   }
41
42   public void testSystemMagnet_NoProfile() throws Exception JavaDoc {
43     try {
44       StringBuffer JavaDoc aName = new StringBuffer JavaDoc().
45             append(System.getProperty("user.dir")).append(java.io.File.separator).
46             append(java.io.File.separator).append("etc").
47             append(java.io.File.separator).append("mainMagnet.xml");
48       for (int i = 0; i < 1; i++) {
49         MagnetRunner.main(new String JavaDoc[]
50         { "-magnetfile", aName.toString()} );
51       }
52     } catch (Exception JavaDoc e) {
53     }
54   }
55 }
Popular Tags