Code example for InvocationHandler

Methods: invoke

0
      Object proxy = null;
      // just make sure method is not null 
      Method method = InvocationTestCase.class.getDeclaredMethod("testInvocation");
      Date now = new Date();
      Object args[] = { now };
      Object result = handler.invoke(proxy, method, args);
      assertEquals("Hi " + now, result);
   } 
    
   @Test 
   public void testIllegalEndpoint() 
   { 
      Endpoint endpoint = null;
      Serializable session = null;
      Class<?> invokedBusinessInterface = null;
      try 
      { 
         new EndpointInvocationHandler(endpoint, session, invokedBusinessInterface);
         fail("Should have thrown AssertionError (or run with -ea)"); 
      } 
      catch(AssertionError e)