@Test public void testRunScheduledTask() { context.checking(new Expectations() { { oneOf(target).size(); } }); taskRunner.runTransactionalTask(); context.assertIsSatisfied(); }
@Transactional public void runTransactionalTask() { Date start = new Date(); try { long startTime = start.getTime(); method.invoke(target); Date end = new Date(); long endTime = end.getTime(); String message = "Method " + method.getName() + " started at " + start + " and finished at " + end + " taking " + ((endTime - startTime)) / MILLIS_TO_SECONDS + " seconds"; log.info(message); } catch (IllegalArgumentException e) { String message = "Method " + method.getName() + " started at " + start; log.error(message); log.error(e.toString()); } catch (IllegalAccessException e) { String message = "Method " + method.getName() + " started at " + start; log.error(message); log.error(e.toString()); } catch (InvocationTargetException e) { String message = "Method " + method.getName() + " started at " + start; log.error(message); log.error(e.toString()); } }
TransactionalTaskRunner { @Transactional public void runTransactionalTask() { Date start = new Date(); try { long startTime = start.getTime(); method.invoke(target); Date end = new Date(); long endTime = end.getTime(); String message = "Method " + method.getName() + " started at " + start + " and finished at " + end + " taking " + ((endTime - startTime)) / MILLIS_TO_SECONDS + " seconds"; log.info(message); } catch (IllegalArgumentException e) { String message = "Method " + method.getName() + " started at " + start; log.error(message); log.error(e.toString()); } catch (IllegalAccessException e) { String message = "Method " + method.getName() + " started at " + start; log.error(message); log.error(e.toString()); } catch (InvocationTargetException e) { String message = "Method " + method.getName() + " started at " + start; log.error(message); log.error(e.toString()); } } }
TransactionalTaskRunner { @Transactional public void runTransactionalTask() { Date start = new Date(); try { long startTime = start.getTime(); method.invoke(target); Date end = new Date(); long endTime = end.getTime(); String message = "Method " + method.getName() + " started at " + start + " and finished at " + end + " taking " + ((endTime - startTime)) / MILLIS_TO_SECONDS + " seconds"; log.info(message); } catch (IllegalArgumentException e) { String message = "Method " + method.getName() + " started at " + start; log.error(message); log.error(e.toString()); } catch (IllegalAccessException e) { String message = "Method " + method.getName() + " started at " + start; log.error(message); log.error(e.toString()); } catch (InvocationTargetException e) { String message = "Method " + method.getName() + " started at " + start; log.error(message); log.error(e.toString()); } } TransactionalTaskRunner();  TransactionalTaskRunner(final Object inTarget, final String methodName); }
TransactionalTaskRunner { @Transactional public void runTransactionalTask() { Date start = new Date(); try { long startTime = start.getTime(); method.invoke(target); Date end = new Date(); long endTime = end.getTime(); String message = "Method " + method.getName() + " started at " + start + " and finished at " + end + " taking " + ((endTime - startTime)) / MILLIS_TO_SECONDS + " seconds"; log.info(message); } catch (IllegalArgumentException e) { String message = "Method " + method.getName() + " started at " + start; log.error(message); log.error(e.toString()); } catch (IllegalAccessException e) { String message = "Method " + method.getName() + " started at " + start; log.error(message); log.error(e.toString()); } catch (InvocationTargetException e) { String message = "Method " + method.getName() + " started at " + start; log.error(message); log.error(e.toString()); } } TransactionalTaskRunner();  TransactionalTaskRunner(final Object inTarget, final String methodName); @Transactional void runTransactionalTask(); }
TransactionalTaskRunner { @Transactional public void runTransactionalTask() { Date start = new Date(); try { long startTime = start.getTime(); method.invoke(target); Date end = new Date(); long endTime = end.getTime(); String message = "Method " + method.getName() + " started at " + start + " and finished at " + end + " taking " + ((endTime - startTime)) / MILLIS_TO_SECONDS + " seconds"; log.info(message); } catch (IllegalArgumentException e) { String message = "Method " + method.getName() + " started at " + start; log.error(message); log.error(e.toString()); } catch (IllegalAccessException e) { String message = "Method " + method.getName() + " started at " + start; log.error(message); log.error(e.toString()); } catch (InvocationTargetException e) { String message = "Method " + method.getName() + " started at " + start; log.error(message); log.error(e.toString()); } } TransactionalTaskRunner();  TransactionalTaskRunner(final Object inTarget, final String methodName); @Transactional void runTransactionalTask(); static final double MILLIS_TO_SECONDS; }