private final void execute() throws GoalConfigurationException, GoalExecutionException { // Execute the goal and measure execution time try { this.start(); this.executeTasks(); this.stop(); } // Throw as is catch(GoalConfigurationException gce) { this.stop(gce); this.skipGoalUpload(); // Do not upload in case of configuration problems throw gce; } // Throw as is catch(GoalExecutionException gee) { this.stop(gee); throw gee; } // Embedd in GoalExecutionException catch(Exception e) { this.stop(e); throw new GoalExecutionException(e); } finally { if(this.goalUploadEnabled) this.upload(); } }
public void stopGoal() { if(this.exe!=null) { this.exe.stop(); // Add instrumentation stats (if any) exe.addGoalStats("test", InstrumentationControl.getOverallStatistics()); final List<IInstrumentor> instrumentorList = InstrumentorFactory.getInstrumentors(); final Iterator<IInstrumentor> iter = instrumentorList.iterator(); while(iter.hasNext()){ final IInstrumentor i = iter.next(); exe.addGoalStats("test." + i.getClass().getSimpleName(), i.getStatistics()); } this.exe.upload(); } }