@Test public void testCatchSahiCommandExcecutionErrors() throws Exception { SakuliExceptionHandler exceptionHandler = BeanLoader.loadBean(SakuliExceptionHandler.class); try { Utils.executeAndGetProcess(new String[]{"testcommand", "arg1", "arg2"}); } catch (Exception e) { } verify(exceptionHandler).handleException(any(SakuliInitException.class)); }
@AfterThrowing(pointcut = "execution(* net.sf.sahi.util.Utils.execute*(..))", throwing = "error") public void catchSahiCommandExcecutionErrors(JoinPoint joinPoint, Exception error) { String argString = printArgs(joinPoint, true); if (!argString.contains("keytool")) { BeanLoader.loadBaseActionLoader().getExceptionHandler().handleException(new SakuliInitException(error, "Error executing command " + argString)); } }
SahiCommandExecutionAspect extends BaseSakuliAspect { @AfterThrowing(pointcut = "execution(* net.sf.sahi.util.Utils.execute*(..))", throwing = "error") public void catchSahiCommandExcecutionErrors(JoinPoint joinPoint, Exception error) { String argString = printArgs(joinPoint, true); if (!argString.contains("keytool")) { BeanLoader.loadBaseActionLoader().getExceptionHandler().handleException(new SakuliInitException(error, "Error executing command " + argString)); } } }
SahiCommandExecutionAspect extends BaseSakuliAspect { @AfterThrowing(pointcut = "execution(* net.sf.sahi.util.Utils.execute*(..))", throwing = "error") public void catchSahiCommandExcecutionErrors(JoinPoint joinPoint, Exception error) { String argString = printArgs(joinPoint, true); if (!argString.contains("keytool")) { BeanLoader.loadBaseActionLoader().getExceptionHandler().handleException(new SakuliInitException(error, "Error executing command " + argString)); } }  }
SahiCommandExecutionAspect extends BaseSakuliAspect { @AfterThrowing(pointcut = "execution(* net.sf.sahi.util.Utils.execute*(..))", throwing = "error") public void catchSahiCommandExcecutionErrors(JoinPoint joinPoint, Exception error) { String argString = printArgs(joinPoint, true); if (!argString.contains("keytool")) { BeanLoader.loadBaseActionLoader().getExceptionHandler().handleException(new SakuliInitException(error, "Error executing command " + argString)); } }  @Around("execution(* net.sf.sahi.util.Utils.getCommandTokens(..)) && args(commandString)") String[] getCommandTokens(ProceedingJoinPoint joinPoint, String commandString); @AfterThrowing(pointcut = "execution(* net.sf.sahi.util.Utils.execute*(..))", throwing = "error") void catchSahiCommandExcecutionErrors(JoinPoint joinPoint, Exception error); @Before("execution(* net.sf.sahi.util.Utils.execute*(..))") void logSahiCommandExection(JoinPoint joinPoint); }
SahiCommandExecutionAspect extends BaseSakuliAspect { @AfterThrowing(pointcut = "execution(* net.sf.sahi.util.Utils.execute*(..))", throwing = "error") public void catchSahiCommandExcecutionErrors(JoinPoint joinPoint, Exception error) { String argString = printArgs(joinPoint, true); if (!argString.contains("keytool")) { BeanLoader.loadBaseActionLoader().getExceptionHandler().handleException(new SakuliInitException(error, "Error executing command " + argString)); } }  @Around("execution(* net.sf.sahi.util.Utils.getCommandTokens(..)) && args(commandString)") String[] getCommandTokens(ProceedingJoinPoint joinPoint, String commandString); @AfterThrowing(pointcut = "execution(* net.sf.sahi.util.Utils.execute*(..))", throwing = "error") void catchSahiCommandExcecutionErrors(JoinPoint joinPoint, Exception error); @Before("execution(* net.sf.sahi.util.Utils.execute*(..))") void logSahiCommandExection(JoinPoint joinPoint);  }