Source code: com/chaoswg/xtc4y/test/classloaders/AbstractClassLoaderExample.java
1 //$Header: /cvsroot/xtc4y/xtc4y/src/com/chaoswg/xtc4y/test/classloaders/AbstractClassLoaderExample.java,v 1.1.1.1 2003/08/07 13:40:26 toggm Exp $
2 /******************************************************************************
3 * XTC4y - eXtreme Testing Collection 4 you *
4 * -------------------------------------------------------------------------- *
5 * URL: http://www.chaoswg.com/xtc4y *
6 * Author: Mike Toggweiler (2.dog@gmx.ch) *
7 * *
8 * Last Updated: $Date: 2003/08/07 13:40:26 $, by $Author: toggm $ *
9 * Version: $Revision: 1.1.1.1 $ *
10 * -------------------------------------------------------------------------- *
11 * COPYRIGHT: (c) 2003 by Mike Toggweiler *
12 * *
13 * This program is free software; you can redistribute it and/or modify *
14 * it under the terms of the GNU General Public License as published by *
15 * the Free Software Foundation; either version 2 of the License, or *
16 * (at your option) any later version. *
17 *****************************************************************************/
18 package com.chaoswg.xtc4y.test.classloaders;
19
20 import com.chaoswg.xtc4y.classloaders.AbstractClassLoader;
21
22 import java.lang.reflect.*;
23
24 /**
25 * Show that the AbstractClassLoader works :-)
26 * @author Mike Toggweiler
27 **/
28 public class AbstractClassLoaderExample {
29 public AbstractClassLoaderExample() throws Exception {
30 AbstractClassLoader loader =
31 new AbstractClassLoader(true);
32
33 String className = "com.chaoswg.xtc4y.test.classloaders.AbstractClass";
34 //Class cl = Class.forName(className, true, loader);
35 Class cl = loader.loadClass(className);
36
37 Object obj = cl.newInstance();
38 System.out.println("Instanciated object is:"+obj+":"+AbstractClass.class);
39 AbstractClass aclass = (AbstractClass)obj;
40 }
41
42 public static void main(String[] argv) throws Exception {
43 new AbstractClassLoaderExample();
44 }
45 }