예제 #1
0
 private void runTest() {
   if (ddTestRunner == null) return;
   displayView.startTest();
   createRuntime(
       ddTestRunner.getScriptText(), ddTestRunner.getConsole(), MarathonMode.PLAYING.getMode());
   script =
       runtime.createScript(ddTestRunner.getScriptText(), displayView.getFilePath(), false, true);
   script.setDataVariables(ddTestRunner.getDataVariables());
   player = script.getPlayer(this, playbackResultProvider.get());
   player.setAcceptCheckList(acceptingChecklists);
   boolean shouldRunFixture = state.isStoppedWithAppClosed();
   setState(State.PLAYING);
   displayView.startInserting();
   player.play(shouldRunFixture);
 }
예제 #2
0
 public void stop() {
   if (state.isRecording()) {
     try {
       runtime.stopRecording();
     } catch (MarathonRuntimeException e) {
       setState(State.STOPPED_WITH_APP_CLOSED);
       destroyRuntime();
       throw e;
     } finally {
       displayView.stopInserting();
     }
     stopApplicationIfNecessary();
     displayView.updateOMapFile();
   } else if (state.isPlaying()) {
     try {
       player.halt();
     } catch (MarathonRuntimeException e) {
       reportException(e);
     } finally {
       playbackStopped = true;
       playbackFinished(playbackResultProvider.get(), false);
     }
   } else {
     throw new IllegalStateException("must be recording or playing to stop, not '" + state + "'");
   }
 }