예제 #1
0
  public RunTestsLocallyAction() {
    this.settings = TmcSettings.getDefault();
    this.courseDb = CourseDb.getInstance();
    this.projectMediator = ProjectMediator.getInstance();
    this.resultDisplayer = TestResultDisplayer.getInstance();
    this.dialogDisplayer = ConvenientDialogDisplayer.getDefault();
    this.submitAction = new SubmitExerciseAction();
    this.eventBus = TmcEventBus.getDefault();

    putValue("noIconInMenu", Boolean.TRUE);
  }
예제 #2
0
 private void handleTestResults(final TmcProjectInfo projectInfo, File resultsFile) {
   List<TestCaseResult> results;
   try {
     String resultJson = FileUtils.readFileToString(resultsFile, "UTF-8");
     results = parseTestResults(resultJson);
   } catch (Exception ex) {
     log.log(Level.WARNING, "Failed to read test results: {0}", ex.getStackTrace());
     dialogDisplayer.displayError("Failed to read test results", ex);
     return;
   }
   boolean canSubmit = submitAction.enable(projectInfo.getProject());
   resultDisplayer.showLocalRunResult(
       results,
       canSubmit,
       new Runnable() {
         @Override
         public void run() {
           submitAction.performAction(projectInfo.getProject());
         }
       });
 }