@Override protected void doEvaluation(TestRunnerFacade facade, TestRunnerContext context) throws Throwable { TestRunnerAnnotationHandler handler = new TestRunnerAnnotationHandler(method, description, context); // Run the pre actions SystemPropertyTempSetter tempSetter = facade.runPreTestActionsInEjbContext(handler); try { // Run the test statement first. We'll only run the verifiers if the test statement succeeds testStatement.evaluate(); // Run the verifiers now facade.runPostTestActionsInEjbContext(handler); } finally { logger.debug("Cleaning up test run for context: " + handler.getUuid()); facade.cleanupTestRun(handler, tempSetter); } } }
/** * Runs a parameterless method in an EJB context and returns the result of the method. * @param className Class name that contains the method * @param methodName Method name * @return Result value of the method */ protected final <T> T runMethodInEjbContext(String className, String methodName) { try { @SuppressWarnings("unchecked") T res = (T) testRunnerFacade.runMethodInEjbContext(className, methodName, new Class<?>[] {}, new Object[] {}); return res; } catch (Exception ex) { throw new JuRuntimeException("Couldn't run method in EjbContext", ex); } }
@Override protected void doEvaluation(TestRunnerFacade facade, TestRunnerContext context) throws Throwable { facade.runTestMethodInEjbContext(new TestRunnerAnnotationHandler(method, description, context)); // facade.runTestMethodInEjbContext(method.getDeclaringClass().getName(), method.getName(), context); } }
@Override protected void doEvaluation(TestRunnerFacade facade, TestRunnerContext context) throws Throwable { TestRunnerAnnotationHandler handler = new TestRunnerAnnotationHandler(method, description, context); // Run the pre actions SystemPropertyTempSetter tempSetter = facade.runPreTestActionsInEjbContext(handler); try { // Run the test statement first. We'll only run the verifiers if the test statement succeeds testStatement.evaluate(); // Run the verifiers now facade.runPostTestActionsInEjbContext(handler); } finally { logger.debug("Cleaning up test run for context: " + handler.getUuid()); facade.cleanupTestRun(handler, tempSetter); } } }
/** * Runs a parameterless method in an EJB context and returns the result of the method. * @param className Class name that contains the method * @param methodName Method name * @return Result value of the method */ protected final <T> T runMethodInEjbContext(String className, String methodName) { try { @SuppressWarnings("unchecked") T res = (T) testRunnerFacade.runMethodInEjbContext(className, methodName, new Class<?>[] {}, new Object[] {}); return res; } catch (Exception ex) { throw new JuRuntimeException("Couldn't run method in EjbContext", ex); } }
@Override protected void doEvaluation(TestRunnerFacade facade, TestRunnerContext context) throws Throwable { facade.runTestMethodInEjbContext(new TestRunnerAnnotationHandler(method, description, context)); // facade.runTestMethodInEjbContext(method.getDeclaringClass().getName(), method.getName(), context); } }
/** * Runs an arbitrary method in an EJB context and returns the result of the method. * @param className Class name that contains the method * @param methodName Method name * @param parameterTypes Array of argument types * @param args Array of arguments * @return Result value of the method */ protected final <T> T runMethodInEjbContext(String className, String methodName, Class<?> parameterTypes[], Object args[]) { try { @SuppressWarnings("unchecked") T res = (T) testRunnerFacade.runMethodInEjbContext(className, methodName, parameterTypes, args); return res; } catch (Exception ex) { Throwable actualThrowable = RemoteUtils.getActualThrowable(ex); throw new JuRuntimeException("Couldn't run method in EJB context: %s" , actualThrowable , actualThrowable == null ? null : actualThrowable.getMessage()); } }
/** * Runs an arbitrary method in an EJB context and returns the result of the method. * @param className Class name that contains the method * @param methodName Method name * @param parameterTypes Array of argument types * @param args Array of arguments * @return Result value of the method */ protected final <T> T runMethodInEjbContext(String className, String methodName, Class<?> parameterTypes[], Object args[]) { try { @SuppressWarnings("unchecked") T res = (T) testRunnerFacade.runMethodInEjbContext(className, methodName, parameterTypes, args); return res; } catch (Exception ex) { Throwable actualThrowable = RemoteUtils.getActualThrowable(ex); throw new JuRuntimeException("Couldn't run method in EJB context: %s" , actualThrowable , actualThrowable == null ? null : actualThrowable.getMessage()); } }