KickJava   Java API By Example, From Geeks To Geeks.

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


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

19 public class JavaMagnetTest extends TestCase {
20
21   public static void main(String JavaDoc[] args) {
22     TestRunner.run(JavaMagnetTest.class);
23   }
24
25   public JavaMagnetTest(String JavaDoc aName) {
26     super(aName);
27   }
28
29   public void testSystemMagnet() throws Exception JavaDoc {
30     StringBuffer JavaDoc aName = new StringBuffer JavaDoc().
31           append(System.getProperty("user.dir")).
32           append(java.io.File.separator).append("etc").
33           append(java.io.File.separator).append("helloMagnet.xml");
34
35     for (int i = 0; i < 1; i++) {
36       if (i % 3 == 0)
37         MagnetRunner.main(new String JavaDoc[]
38       { "-magnetfile", aName.toString(), "-info", "english" } );
39       else if (i % 3 == 1)
40         MagnetRunner.main(new String JavaDoc[]
41               { "-magnetfile", aName.toString(), "-debug", "spanish" } );
42       else
43         MagnetRunner.main(new String JavaDoc[]
44               { "-magnetfile", aName.toString(), "-debug", "french" } );
45     }
46   }
47
48   public void testSystemMagnet_NoProfile() throws Exception JavaDoc {
49     StringBuffer JavaDoc aName = new StringBuffer JavaDoc().
50           append(System.getProperty("user.dir")).
51           append(java.io.File.separator).append("etc").
52           append(java.io.File.separator).append("helloMagnet.xml");
53
54     MagnetRunner.main(new String JavaDoc[]
55         { "-magnetfile", aName.toString() } );
56
57   }
58 }
Popular Tags