Пример #1
0
  public void testLoad() throws Exception {
    Class clz = cloader.loadClass("net.ion.bleujin.SayHello");
    Object ins = clz.newInstance();

    Method m = clz.getMethod("hello");
    Object result = m.invoke(ins);

    assertEquals("hello", result);
  }
Пример #2
0
  public void testSayHi() throws Exception {
    Class clz = cloader.loadClass("net.ion.bleujin.SayHi");
    Constructor cons = clz.getDeclaredConstructor(String.class);
    cons.setAccessible(true);

    Object ins = cons.newInstance("bleujin");
    Method m = clz.getMethod("hi");

    Object result = m.invoke(ins);
    assertEquals("hi bleujin", result);
  }
Пример #3
0
 public void testGreeting() throws Exception {
   Class clz = cloader.loadClass("net.ion.bleujin.SayGreeting");
   Greeting ins = (Greeting) clz.newInstance();
   assertEquals("gombangwa", ins.greeting());
 }
Пример #4
0
 @Override
 protected void setUp() throws Exception {
   super.setUp();
   this.cloader = DirClassLoader.create("./lib_source/");
 }