@Test public void wrapsRuntimeExceptionThrownByDestroyMethodWithInternalException() { thrown.expect(lifecycleMethodInvocationExceptionMatcher("destroy fails")); lifecycleMethodStrategy.invokeDestroyMethods(new LifeCycleMethodsThrowsRuntimeException()); }
@Override public void invokeDestroyMethods(Object o) { final Class<?> aClass = o.getClass(); Method[] destroyMethods = null; try { destroyMethods = destroyMethodsCache.get(aClass); } catch (ExecutionException e) { Throwables.propagate(e); } if (destroyMethods != null && destroyMethods.length > 0) { doInvokeLifecycleMethods(o, destroyMethods); } }
AnnotatedLifecycleMethodStrategy implements LifecycleMethodStrategy { @Override public void invokeDestroyMethods(Object o) { final Class<?> aClass = o.getClass(); Method[] destroyMethods = null; try { destroyMethods = destroyMethodsCache.get(aClass); } catch (ExecutionException e) { Throwables.propagate(e); } if (destroyMethods != null && destroyMethods.length > 0) { doInvokeLifecycleMethods(o, destroyMethods); } } }
AnnotatedLifecycleMethodStrategy implements LifecycleMethodStrategy { @Override public void invokeDestroyMethods(Object o) { final Class<?> aClass = o.getClass(); Method[] destroyMethods = null; try { destroyMethods = destroyMethodsCache.get(aClass); } catch (ExecutionException e) { Throwables.propagate(e); } if (destroyMethods != null && destroyMethods.length > 0) { doInvokeLifecycleMethods(o, destroyMethods); } } AnnotatedLifecycleMethodStrategy(); }
AnnotatedLifecycleMethodStrategy implements LifecycleMethodStrategy { @Override public void invokeDestroyMethods(Object o) { final Class<?> aClass = o.getClass(); Method[] destroyMethods = null; try { destroyMethods = destroyMethodsCache.get(aClass); } catch (ExecutionException e) { Throwables.propagate(e); } if (destroyMethods != null && destroyMethods.length > 0) { doInvokeLifecycleMethods(o, destroyMethods); } } AnnotatedLifecycleMethodStrategy(); @Override void invokeInitializeMethods(Object o); @Override void invokeDestroyMethods(Object o); }
AnnotatedLifecycleMethodStrategy implements LifecycleMethodStrategy { @Override public void invokeDestroyMethods(Object o) { final Class<?> aClass = o.getClass(); Method[] destroyMethods = null; try { destroyMethods = destroyMethodsCache.get(aClass); } catch (ExecutionException e) { Throwables.propagate(e); } if (destroyMethods != null && destroyMethods.length > 0) { doInvokeLifecycleMethods(o, destroyMethods); } } AnnotatedLifecycleMethodStrategy(); @Override void invokeInitializeMethods(Object o); @Override void invokeDestroyMethods(Object o);  }