@Test public void feedbackAnswerSubmitterCallsErrorHandlerAndReturnsFalseOnException() { Mockito.doThrow(new RuntimeException("Error message here")).when(submitter).submitFeedback(answers, url); assertEquals(BackgroundTask.RETURN_FAILURE, task.start(mock(TaskStatusMonitor.class))); verify(invoker, times(1)).raiseVisibleException( "An error occured while submitting feedback:\nError message here"); }
@Override public int start(TaskStatusMonitor progress) { progress.startProgress(this.getDescription(), 1); try { submitter.submitFeedback(answers, feedbackUrl); progress.incrementProgress(1); } catch (Exception ex) { invoker.raiseVisibleException("An error occured while submitting feedback:\n" + ex.getMessage()); return BackgroundTask.RETURN_FAILURE; } return BackgroundTask.RETURN_SUCCESS; }
FeedbackSubmissionTask extends BackgroundTask { @Override public int start(TaskStatusMonitor progress) { progress.startProgress(this.getDescription(), 1); try { submitter.submitFeedback(answers, feedbackUrl); progress.incrementProgress(1); } catch (Exception ex) { invoker.raiseVisibleException("An error occured while submitting feedback:\n" + ex.getMessage()); return BackgroundTask.RETURN_FAILURE; } return BackgroundTask.RETURN_SUCCESS; } }
FeedbackSubmissionTask extends BackgroundTask { @Override public int start(TaskStatusMonitor progress) { progress.startProgress(this.getDescription(), 1); try { submitter.submitFeedback(answers, feedbackUrl); progress.incrementProgress(1); } catch (Exception ex) { invoker.raiseVisibleException("An error occured while submitting feedback:\n" + ex.getMessage()); return BackgroundTask.RETURN_FAILURE; } return BackgroundTask.RETURN_SUCCESS; } FeedbackSubmissionTask(FeedbackAnswerSubmitter submitter, List<FeedbackAnswer> answers, String feedbackUrl,
            IdeUIInvoker invoker); }
FeedbackSubmissionTask extends BackgroundTask { @Override public int start(TaskStatusMonitor progress) { progress.startProgress(this.getDescription(), 1); try { submitter.submitFeedback(answers, feedbackUrl); progress.incrementProgress(1); } catch (Exception ex) { invoker.raiseVisibleException("An error occured while submitting feedback:\n" + ex.getMessage()); return BackgroundTask.RETURN_FAILURE; } return BackgroundTask.RETURN_SUCCESS; } FeedbackSubmissionTask(FeedbackAnswerSubmitter submitter, List<FeedbackAnswer> answers, String feedbackUrl,
            IdeUIInvoker invoker); @Override int start(TaskStatusMonitor progress); @Override void stop(); }
FeedbackSubmissionTask extends BackgroundTask { @Override public int start(TaskStatusMonitor progress) { progress.startProgress(this.getDescription(), 1); try { submitter.submitFeedback(answers, feedbackUrl); progress.incrementProgress(1); } catch (Exception ex) { invoker.raiseVisibleException("An error occured while submitting feedback:\n" + ex.getMessage()); return BackgroundTask.RETURN_FAILURE; } return BackgroundTask.RETURN_SUCCESS; } FeedbackSubmissionTask(FeedbackAnswerSubmitter submitter, List<FeedbackAnswer> answers, String feedbackUrl,
            IdeUIInvoker invoker); @Override int start(TaskStatusMonitor progress); @Override void stop();  }