KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > sapia > util > test > TestApp


1 package org.sapia.util.test;
2
3 /**
4  *
5  *
6  * @author Jean-Cedric Desrochers
7  *
8  * <dl>
9  * <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>
10  * <dt><b>License:</b><dd>Read the license.txt file of the jar or visit the
11  * <a HREF="http://www.sapia-oss.org/license.html">license page</a> at the Sapia OSS web site</dd></dt>
12  * </dl>
13  */

14 public class TestApp {
15   public static void main(String JavaDoc[] args) {
16     long aStart = System.currentTimeMillis();
17     try {
18       StringBuffer JavaDoc aBuffer = new StringBuffer JavaDoc();
19       aBuffer.append(System.currentTimeMillis()-aStart).append(" [").
20               append(Thread.currentThread().getName()).append("] ").
21               append("Excuting the TestApp.main() method");
22       System.out.println(aBuffer.toString());
23
24       aBuffer = new StringBuffer JavaDoc();
25       aBuffer.append(System.currentTimeMillis()-aStart).append(" [").
26               append(Thread.currentThread().getName()).append("] ").
27               append("With the arguments: ");
28       if (args.length == 0) {
29         aBuffer.append("[]");
30       } else {
31         for (int i = 0 ; i < args.length; i++) {
32           aBuffer.append("[").append(args[i]).append("] ");
33         }
34       }
35       System.out.println(aBuffer.toString());
36
37       aBuffer = new StringBuffer JavaDoc();
38       aBuffer.append(System.currentTimeMillis()-aStart).append(" [").
39               append(Thread.currentThread().getName()).append("] ").
40               append("TestApp was loaded from the classloader ").append(TestApp.class.getClassLoader());
41       System.out.println(aBuffer.toString());
42
43       aBuffer = new StringBuffer JavaDoc();
44       aBuffer.append(System.currentTimeMillis()-aStart).append(" [").
45               append(Thread.currentThread().getName()).append("] ").
46               append("The context class loader of the thread is ").append(Thread.currentThread().getContextClassLoader());
47       System.out.println(aBuffer.toString());
48     } catch (Exception JavaDoc e) {
49       e.printStackTrace();
50     }
51   }
52 }
Popular Tags