示例#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());
 }