Esempio n. 1
0
  @Test
  public void shouldUpdateRunnerWithStatusDone() {
    when(runner.getStatus()).thenReturn(Runner.Status.DONE);
    when(css.blueColor()).thenReturn(TEXT);

    runnerWidget.update(runner);

    verify(css).greenColor();

    shouldUpdateItemWidgetParameter();
  }
Esempio n. 2
0
  @Test
  public void shouldUpdateRunnerWithStatusTimeOut() {
    when(runner.getStatus()).thenReturn(Runner.Status.TIMEOUT);
    when(css.blueColor()).thenReturn(TEXT);

    runnerWidget.update(runner);

    verify(css).whiteColor();

    shouldUpdateItemWidgetParameter();
  }
Esempio n. 3
0
  @Test
  public void shouldUpdateRunnerWithStatusStopped() {
    when(runner.getStatus()).thenReturn(Runner.Status.STOPPED);
    when(css.blueColor()).thenReturn(TEXT);

    runnerWidget.update(runner);

    verify(css).redColor();

    shouldUpdateItemWidgetParameter();
  }
Esempio n. 4
0
  @Test
  public void shouldUpdateRunnerWithStatusInProgress() {
    when(runner.getStatus()).thenReturn(IN_PROGRESS);
    when(css.blueColor()).thenReturn(TEXT);

    runnerWidget.update(runner);

    verify(css).blueColor();

    shouldUpdateItemWidgetParameter();
  }
Esempio n. 5
0
  @Test
  public void shouldUpdateRunnerWithStatusQueue() {
    when(runner.getStatus()).thenReturn(Runner.Status.IN_QUEUE);
    when(css.blueColor()).thenReturn(TEXT);

    runnerWidget.update(runner);

    verify(css).yellowColor();

    shouldUpdateItemWidgetParameter();
  }
Esempio n. 6
0
  @Test
  public void clickEventShouldBePerformedWhenRunnerStatusIsNotFailedOrStopped() throws Exception {
    when(runner.getStatus()).thenReturn(DONE);
    runnerWidget.update(runner);
    reset(itemWidget);

    verify(imagePanel).addDomHandler(clickCaptor.capture(), eq(ClickEvent.getType()));

    clickCaptor.getValue().onClick(clickEvent);

    verify(delegate, never()).removeRunnerWidget(runner);
  }
Esempio n. 7
0
  @Test
  public void onMouseOutEventShouldBePerformed() throws Exception {
    when(runner.getStatus()).thenReturn(IN_PROGRESS);
    runnerWidget.update(runner);
    reset(itemWidget);

    verify(imagePanel).addDomHandler(mouseOutCaptor.capture(), eq(MouseOutEvent.getType()));

    mouseOutCaptor.getValue().onMouseOut(mouseOutEvent);

    verify(itemWidget).setImage(any(SVGImage.class));
  }
Esempio n. 8
0
  @Test
  public void imageShouldNotBeSetWhenStatusIsNotFailedOrStopped() throws Exception {
    when(runner.getStatus()).thenReturn(DONE);

    runnerWidget.update(runner);
    reset(itemWidget);

    verify(imagePanel).addDomHandler(mouseOverCaptor.capture(), eq(MouseOverEvent.getType()));

    mouseOverCaptor.getValue().onMouseOver(mouseOverEvent);

    verify(itemWidget, never()).setImage(any(SVGImage.class));
  }
 private void changeURLDependingOnState(@NotNull Runner runner) {
   switch (runner.getStatus()) {
     case IN_PROGRESS:
       view.setApplicationURl(locale.uplAppWaitingForBoot());
       break;
     case IN_QUEUE:
       view.setApplicationURl(locale.uplAppWaitingForBoot());
       break;
     case STOPPED:
       view.setApplicationURl(locale.urlAppRunnerStopped());
       break;
     case FAILED:
       view.setApplicationURl(null);
       break;
     default:
       String url = runner.getApplicationURL();
       view.setApplicationURl(url == null ? locale.urlAppRunning() : url);
       setDebugPort(runner);
   }
 }
Esempio n. 10
0
  @Test
  public void clickEventShouldBePerformedWhenRunnerStatusIsStopped() throws Exception {
    when(runner.getStatus()).thenReturn(STOPPED);

    verifyClickEvent();
  }
Esempio n. 11
0
  @Test
  public void onMouseOverEventShouldBePerformedWhenRunnerStatusIsFailed() throws Exception {
    when(runner.getStatus()).thenReturn(FAILED);

    verifyMouseOverEvent();
  }