KickJava   Java API By Example, From Geeks To Geeks.

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


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 SystemMagnetTest extends TestCase {
20
21   public static void main(String JavaDoc[] args) {
22     org.apache.log4j.BasicConfigurator.configure();
23     TestRunner.run(SystemMagnetTest.class);
24   }
25
26   public SystemMagnetTest(String JavaDoc aName) {
27     super(aName);
28   }
29
30   public void testSystemMagnet() throws Exception JavaDoc {
31     StringBuffer JavaDoc aName = new StringBuffer JavaDoc().
32           append(System.getProperty("user.dir")).
33           append(java.io.File.separator).append("etc").
34           append(java.io.File.separator).append("systemMagnet.xml");
35
36     for (int i = 0; i < 1; i++) {
37       if (i % 3 == 0)
38         MagnetRunner.main(new String JavaDoc[]
39 // { "-magnetfile", aName.toString(), "dev" } );
40
{ "-magnetfile", aName.toString(), "-info", "dev" } );
41       else if (i % 3 == 1)
42         MagnetRunner.main(new String JavaDoc[]
43               { "-magnetfile", aName.toString(), "-debug", "test" } );
44       else
45         MagnetRunner.main(new String JavaDoc[]
46               { "-magnetfile", aName.toString(), "-debug", "prod" } );
47         
48 // Thread.sleep(1000);
49
}
50   }
51 }
Popular Tags