コード例 #1
0
 /** Test configuration and constructor. */
 public void testInvoke() {
   Map<String, String> config = JVMQueryPojoCases.getReflectConfig();
   try {
     PojoInvoker pojoInvoker = new PojoInvoker(config);
     pojoInvoker.invoke(null, "string");
   } catch (ProxyInvokerException e) {
     assertEquals("java.lang.IllegalArgumentException: argument type mismatch", e.getMessage());
   }
   try {
     Locale.setDefault(Locale.FRANCE);
     PojoInvoker pojoInvoker = new PojoInvoker(config);
     Object reply = pojoInvoker.invoke(null, JvmqueryCases.getJavaObjectRequest());
     assertTrue(reply instanceof JVMQueryReply);
     JvmqueryCases.checkJavaObjectReplyFrance((JVMQueryReply) reply);
   } catch (ProxyInvokerException e) {
     fail(e.getMessage());
   }
 }
コード例 #2
0
 /** {@inheritDoc} */
 public void run() {
   try {
     Object reply =
         _invoker.invoke(
             Thread.currentThread().getName() + "#" + Thread.currentThread().getId(),
             JvmqueryCases.getJavaObjectRequest());
     assertTrue(reply instanceof JVMQueryReply);
     JvmqueryCases.checkJavaObjectReplyFrance((JVMQueryReply) reply);
   } catch (Exception e) {
     e.printStackTrace();
     _exception = e;
   }
 }