@SuppressWarnings( "unchecked" ) @Test public void testHandlerCallOnException() throws Throwable { when( repositoryService.getUsers() ).thenThrow( KettleRepositoryLostException.class ); Method method = RepositorySecurityManager.class.getMethod( "getUsers" ); metaStoresessionTimeoutHandler.invoke( mock( Proxy.class ), method, new Object[0] ); verify( sessionTimeoutHandler ).handle( any(), any(), any(), any() ); }
@Override public Object invoke( Object proxy, Method method, Object[] args ) throws Throwable { try { return method.invoke( repositoryService, args ); } catch ( InvocationTargetException ex ) { return sessionTimeoutHandler.handle( repositoryService, ex.getCause(), method, args ); } }
RepositoryServiceSessionTimeoutHandler implements InvocationHandler { @Override public Object invoke( Object proxy, Method method, Object[] args ) throws Throwable { try { return method.invoke( repositoryService, args ); } catch ( InvocationTargetException ex ) { return sessionTimeoutHandler.handle( repositoryService, ex.getCause(), method, args ); } } }
RepositoryServiceSessionTimeoutHandler implements InvocationHandler { @Override public Object invoke( Object proxy, Method method, Object[] args ) throws Throwable { try { return method.invoke( repositoryService, args ); } catch ( InvocationTargetException ex ) { return sessionTimeoutHandler.handle( repositoryService, ex.getCause(), method, args ); } } RepositoryServiceSessionTimeoutHandler( IRepositoryService repositoryService,
      SessionTimeoutHandler sessionTimeoutHandler ); }
RepositoryServiceSessionTimeoutHandler implements InvocationHandler { @Override public Object invoke( Object proxy, Method method, Object[] args ) throws Throwable { try { return method.invoke( repositoryService, args ); } catch ( InvocationTargetException ex ) { return sessionTimeoutHandler.handle( repositoryService, ex.getCause(), method, args ); } } RepositoryServiceSessionTimeoutHandler( IRepositoryService repositoryService,
      SessionTimeoutHandler sessionTimeoutHandler ); @Override Object invoke( Object proxy, Method method, Object[] args ); }
RepositoryServiceSessionTimeoutHandler implements InvocationHandler { @Override public Object invoke( Object proxy, Method method, Object[] args ) throws Throwable { try { return method.invoke( repositoryService, args ); } catch ( InvocationTargetException ex ) { return sessionTimeoutHandler.handle( repositoryService, ex.getCause(), method, args ); } } RepositoryServiceSessionTimeoutHandler( IRepositoryService repositoryService,
      SessionTimeoutHandler sessionTimeoutHandler ); @Override Object invoke( Object proxy, Method method, Object[] args );  }