/** * 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); } }
/** * 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); } }
/** * 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()); } }