@After
  public void canDeleteEWSApp() {
    SWTBotView openshiftExplorer = open.viewOpen(OpenShiftUI.Explorer.iView);

    SWTBotTreeItem account =
        openshiftExplorer.bot().tree().getAllItems()[0].doubleClick(); // expand account

    bot.waitWhile(new NonSystemJobRunsCondition(), TIME_60S * 2, TIME_1S);

    account
        .getNode(EWS_APP_NAME + " " + OpenShiftUI.AppType.JBOSS_EWS)
        .contextMenu(OpenShiftUI.Labels.EXPLORER_DELETE_APP)
        .click();

    bot.waitForShell(OpenShiftUI.Shell.DELETE_APP);

    bot.button(IDELabel.Button.OK).click();
    bot.waitWhile(new NonSystemJobRunsCondition(), TIME_60S * 2, TIME_1S);

    assertTrue(
        "Application still present in the OpenShift Explorer!", account.getItems().length == 0);

    projectExplorer.show();
    projectExplorer.deleteAllProjects();

    assertFalse("The project still exists!", bot.tree().getAllItems().length > 0);

    servers.show();
    servers.deleteServer(EWS_APP_NAME + " at OpenShift");
  }
Beispiel #2
0
 protected static boolean isProjectCreated(final String name) {
   try {
     final SWTBotView packageExplorer = getNavigator();
     final SWTBotTree tree = packageExplorer.bot().tree();
     tree.getTreeItem(name);
     return true;
   } catch (final WidgetNotFoundException e) {
     return false;
   }
 }
  /** Import a gzip trace */
  @Test
  public void testGzipImport() {
    final String traceType = "Test trace : TMF Tests";
    final String tracesNode = "Traces [1]";

    /*
     * Actual importing
     */
    openImportWizard();
    selectImportFromArchive(fGzipTrace.getAbsolutePath());
    selectFolder(ROOT_FOLDER);
    SWTBotCheckBox checkBox = fBot.checkBox(Messages.ImportTraceWizard_CreateLinksInWorkspace);
    assertFalse(checkBox.isEnabled());
    SWTBotCombo comboBox = fBot.comboBoxWithLabel(Messages.ImportTraceWizard_TraceType);
    comboBox.setSelection(traceType);
    importFinish();
    /*
     * Remove .gz extension
     */
    assertNotNull(fGzipTrace);
    String name = fGzipTrace.getName();
    assertNotNull(name);
    assertTrue(name.length() > 3);
    String traceName = name.substring(0, name.length() - 3);
    assertNotNull(traceName);
    assertFalse(traceName.isEmpty());

    /*
     * Open trace
     */
    SWTBotView projectExplorer = fBot.viewById(IPageLayout.ID_PROJECT_EXPLORER);
    projectExplorer.setFocus();
    final SWTBotTree tree = projectExplorer.bot().tree();
    /*
     * This appears to be problematic due to the length of the file name and
     * the resolution in our CI.
     */
    tree.expandNode(PROJECT_NAME, true);
    SWTBotTreeItem treeItem = tree.getTreeItem(PROJECT_NAME);
    fBot.waitUntil(ConditionHelpers.IsTreeChildNodeAvailable(tracesNode, treeItem));
    treeItem = treeItem.getNode(tracesNode);
    fBot.waitUntil(ConditionHelpers.IsTreeChildNodeAvailable(traceName, treeItem));
    treeItem = treeItem.getNode(traceName);
    treeItem.doubleClick();
    SWTBotUtils.waitForJobs();
    /*
     * Check results
     */
    SWTBotTable editor = fBot.activeEditor().bot().table();
    String c22 = editor.cell(2, 2);
    String c10 = editor.cell(1, 0);
    assertEquals("Type-1", c22);
    assertEquals("", c10);
  }
  @Test
  public void shouldShowViolationsForSelectionAndChildren() throws Exception {
    SwtBotUtils.openPerspective(bot, ISonarConstants.PERSPECTIVE_ID);

    SWTBotView view = bot.viewById(ViolationsView.ID);
    view.show();

    assertThat(view.bot().tree().hasItems(), is(false));

    new ImportProjectBot().setPath(getProjectPath(PROJECT_NAME)).finish();
    // Enable Sonar nature
    ProjectUtils.configureProject(PROJECT_NAME);

    new PackageExplorerBot()
        .expandAndSelect(
            PROJECT_NAME, "src/main/java", "(default package)", "ClassOnDefaultPackage.java");

    bot.sleep(5000);

    assertThat(view.bot().tree().hasItems(), is(true));
  }
  @Test
  public void canCreateEWSApp() {
    // open OpenShift Explorer
    SWTBotView openshiftExplorer = open.viewOpen(OpenShiftUI.Explorer.iView);

    openshiftExplorer
        .bot()
        .tree()
        .getAllItems()[0] // get 1st account in
        // OpenShift Explorer
        .contextMenu(OpenShiftUI.Labels.EXPLORER_NEW_APP)
        .click();

    bot.waitForShell(OpenShiftUI.Shell.NEW_APP);
    bot.waitWhile(new NonSystemJobRunsCondition(), TIME_20S, TIME_1S);

    // fill app info
    bot.textInGroup("New application", 0).typeText(EWS_APP_NAME);

    log.info("*** OpenShift SWTBot Tests: Application name set. ***");

    bot.comboBoxInGroup("New application").setSelection(OpenShiftUI.AppType.JBOSS_EWS);

    log.info("*** OpenShift SWTBot Tests: Application type selected. ***");

    bot.waitUntil(Conditions.widgetIsEnabled(bot.button(IDELabel.Button.FINISH)));
    bot.button(IDELabel.Button.FINISH).click();

    log.info("*** OpenShift SWTBot Tests: Application creation started. ***");

    // only for the 1st time - with known_hosts deleting it will appear
    // every time
    // add to known_hosts
    bot.waitForShell("Question", TIME_60S * 4);
    bot.button(IDELabel.Button.YES).click();

    // create known_hosts since it does not exists any more
    SWTBotShell khShell = bot.waitForShell("Question");
    if (khShell != null) {
      bot.button(IDELabel.Button.YES).click();
    }

    bot.waitWhile(new NonSystemJobRunsCondition(), TIME_60S * 10, TIME_1S);

    servers.show();
    assertTrue(servers.serverExists(EWS_APP_NAME + " at OpenShift"));

    log.info("*** OpenShift SWTBot Tests: OpenShift Server Adapter created. ***");
  }
  /**
   * Create a new Form and save it
   *
   * @param bot
   * @param gmfEditor
   * @param nameOfStepOnwhichCreateTheForm
   * @return
   */
  public static SWTBotEditor createFormWhenOnAProcessWithStep1(
      final SWTGefBot bot,
      final SWTBotGefEditor gmfEditor,
      final String nameOfStepOnwhichCreateTheForm) {
    final SWTBotGefEditPart part = gmfEditor.getEditPart(nameOfStepOnwhichCreateTheForm);
    if (part != null) {
      System.out.println("wow part is not null" + part.toString());
    } else {
      System.out.println("part is null");
    }

    try {
      System.out.println(
          "tosting is:"
              + part.toString()
              + "source size is:"
              + part.sourceConnections().size()
              + "target size is:"
              + part.targetConnections().size()
              + "parent"
              + part.parent().toString());
    } catch (final Exception e) {
      System.out.println("Exception is:" + e.getMessage());
    }

    part.click();

    // part.focus();

    bot.viewById("org.bonitasoft.studio.views.properties.application").show();
    bot.viewById("org.bonitasoft.studio.views.properties.application").setFocus();

    SWTBotTestUtil.selectTabbedPropertyView(bot, "Pageflow");
    final SWTBotView properties = bot.viewById(SWTBotTestUtil.VIEWS_PROPERTIES_APPLICATION);
    properties.bot().button("Add...").click();
    bot.waitUntil(Conditions.shellIsActive("Add form..."));
    bot.button(IDialogConstants.NEXT_LABEL).click();

    bot.button("Unselect all").click();

    bot.button(IDialogConstants.FINISH_LABEL).click();
    final SWTBotEditor activeEditor = bot.activeEditor();
    activeEditor.save();
    return activeEditor;
  }
  /** Test show type action on VSM and hide type action. */
  public void testShowHideTypeAction() {
    SWTBotView projectExplorer = bot.viewByTitle("Model Explorer");
    projectExplorer.setFocus();
    projectExplorer.bot().tree().expandNode(getProjectName()).expandNode(VSM_FILE).doubleClick();
    SWTBotEditor activeEditor = bot.activeEditor();
    activeEditor.setFocus();

    String nodeLabel = "platform:/resource/" + getProjectName() + "/" + VSM_FILE;
    SWTBotMenu contextualMenu =
        activeEditor
            .bot()
            .tree()
            .expandNode(nodeLabel)
            .expandNode(GROUP)
            .expandNode(VIEWPOINT_NAME)
            .expandNode(REPRESENTATION_NAME)
            .contextMenu(SHOW_TYPE);
    contextualMenu.click();
    contextualMenu =
        activeEditor
            .bot()
            .tree()
            .expandNode(nodeLabel)
            .expandNode(TYPED_GROUP)
            .expandNode(TYPED_VIEWPOINT_NAME)
            .expandNode(TYPED_REPRESENTATION_NAME)
            .contextMenu(HIDE_TYPE);
    contextualMenu.click();
    contextualMenu =
        activeEditor
            .bot()
            .tree()
            .expandNode(nodeLabel)
            .expandNode(GROUP)
            .expandNode(VIEWPOINT_NAME)
            .expandNode(REPRESENTATION_NAME)
            .contextMenu(SHOW_TYPE);
  }
 public void setInsertChangeId(boolean insertChangeId) {
   SWTBotToolbarToggleButton button =
       stagingView.bot().toolbarToggleButtonWithTooltip(UIText.StagingView_Add_Change_ID);
   selectToolbarToggle(button, insertChangeId);
 }
 public String getCommitMessage() {
   return stagingView.bot().styledTextWithLabel(UIText.StagingView_CommitMessage).getText();
 }
 /** Open the VSM */
 private void openVSM() {
   SWTBotView projectExplorer = bot.viewByTitle("Model Explorer");
   projectExplorer.setFocus();
   SWTBot projectExplorerBot = projectExplorer.bot();
   projectExplorerBot.tree().expandNode(getProjectName()).expandNode(VSM_FILE).doubleClick();
 }
 /** Test color by making all events yellow */
 @Test
 public void testYellow() {
   SWTBotView viewBot = fBot.viewById(ColorsView.ID);
   viewBot.setFocus();
   final String insert = "Insert new color setting";
   final String increasePriority = "Increase priority";
   final String decreasePriority = "Decrease priority";
   final String delete = "Delete color setting";
   viewBot.toolbarButton(insert).click();
   viewBot.toolbarButton(insert).click();
   viewBot.toolbarButton(insert).click();
   viewBot.toolbarButton(insert).click();
   viewBot.toolbarButton(increasePriority).click();
   viewBot.toolbarButton(decreasePriority).click();
   viewBot.toolbarButton(delete).click();
   viewBot.bot().label(0).setFocus();
   viewBot.toolbarButton(delete).click();
   viewBot.bot().label(0).setFocus();
   viewBot.toolbarButton(delete).click();
   final RGB foreground = new RGB(0, 0, 0);
   final RGB background = new RGB(255, 255, 0);
   // Simulate the side effects of picking a color because we cannot
   // control native Color picker dialog in SWTBot.
   final ColorSetting[] cs = new ColorSetting[1];
   UIThreadRunnable.syncExec(
       new VoidResult() {
         @Override
         public void run() {
           cs[0] = new ColorSetting(foreground, background, foreground, new PassAll());
           ColorSettingsManager.setColorSettings(cs);
         }
       });
   final SWTBotTable eventsEditor = SWTBotUtils.activeEventsEditor(fBot).bot().table();
   // should fix race condition of loading the trace
   SWTBotUtils.waitForJobs();
   eventsEditor.select(2);
   final SWTBotTableItem tableItem = eventsEditor.getTableItem(2);
   RGB fgc =
       UIThreadRunnable.syncExec(
           new Result<RGB>() {
             @Override
             public RGB run() {
               return tableItem.widget.getForeground().getRGB();
             }
           });
   RGB bgc =
       UIThreadRunnable.syncExec(
           new Result<RGB>() {
             @Override
             public RGB run() {
               return tableItem.widget.getBackground().getRGB();
             }
           });
   assertEquals("Fg", foreground, fgc);
   assertEquals("Bg", background, bgc);
   // reset color settings
   UIThreadRunnable.syncExec(
       new VoidResult() {
         @Override
         public void run() {
           ColorSettingsManager.setColorSettings(new ColorSetting[0]);
         }
       });
 }
 public void setAuthor(String author) {
   stagingView.bot().textWithLabel(UIText.StagingView_Author).setText(author);
 }
  /** Test tool bar buttons "Follow CPU Forward" and "Follow CPU Backward" */
  @Test
  public void testToolBarFollowCPUForwardBackward() {
    /* change window range to 10 ms */
    TmfTimeRange range =
        new TmfTimeRange(
            START_TIME, START_TIME.normalize(10000000L, ITmfTimestamp.NANOSECOND_SCALE));
    TmfSignalManager.dispatchSignal(new TmfWindowRangeUpdatedSignal(this, range));
    fBot.waitUntil(ConditionHelpers.windowRange(range));

    /* set selection to trace start time */
    TmfSignalManager.dispatchSignal(new TmfSelectionRangeUpdatedSignal(this, START_TIME));
    fBot.waitUntil(ConditionHelpers.selectionRange(new TmfTimeRange(START_TIME, START_TIME)));

    /* select first item */
    final SWTBotTree tree = fViewBot.bot().tree();
    tree.pressShortcut(Keystrokes.HOME);

    /* set focus on time graph */
    final TimeGraphControl timegraph =
        fViewBot.bot().widget(WidgetOfType.widgetOfType(TimeGraphControl.class));
    UIThreadRunnable.syncExec(
        new VoidResult() {
          @Override
          public void run() {
            timegraph.setFocus();
          }
        });

    /* click "Follow CPU Forward" 3 times */
    timeGraphIsReadyCondition(new TmfTimeRange(START_TIME, START_TIME));
    fViewBot.toolbarButton(FOLLOW_CPU_FORWARD).click();
    timeGraphIsReadyCondition(new TmfTimeRange(TID1_TIME1, TID1_TIME1));
    fViewBot.toolbarButton(FOLLOW_CPU_FORWARD).click();
    timeGraphIsReadyCondition(new TmfTimeRange(TID2_TIME1, TID2_TIME1));
    fViewBot.toolbarButton(FOLLOW_CPU_FORWARD).click();
    timeGraphIsReadyCondition(new TmfTimeRange(TID2_TIME2, TID2_TIME2));
    fBot.waitUntil(ConditionHelpers.selectionRange(new TmfTimeRange(TID2_TIME2, TID2_TIME2)));
    fBot.waitUntil(ConditionHelpers.treeSelectionContains(tree, 1, "2"));
    assertTrue(
        TmfTraceManager.getInstance()
            .getCurrentTraceContext()
            .getWindowRange()
            .contains(TID2_TIME2));

    /* shift-click "Follow CPU Forward" 3 times */
    fViewBot.toolbarButton(FOLLOW_CPU_FORWARD).click(SWT.SHIFT);
    timeGraphIsReadyCondition(new TmfTimeRange(TID2_TIME2, TID2_TIME3));
    fViewBot.toolbarButton(FOLLOW_CPU_FORWARD).click(SWT.SHIFT);
    timeGraphIsReadyCondition(new TmfTimeRange(TID2_TIME2, TID2_TIME4));
    fViewBot.toolbarButton(FOLLOW_CPU_FORWARD).click(SWT.SHIFT);
    timeGraphIsReadyCondition(new TmfTimeRange(TID2_TIME2, TID2_TIME4));
    fBot.waitUntil(ConditionHelpers.selectionRange(new TmfTimeRange(TID2_TIME2, TID5_TIME1)));
    fBot.waitUntil(ConditionHelpers.treeSelectionContains(tree, 1, "5"));
    assertTrue(
        TmfTraceManager.getInstance()
            .getCurrentTraceContext()
            .getWindowRange()
            .contains(TID5_TIME1));

    /* shift-click "Follow CPU Backward" 4 times */
    fViewBot.toolbarButton(FOLLOW_CPU_BACKWARD).click(SWT.SHIFT);
    timeGraphIsReadyCondition(new TmfTimeRange(TID2_TIME2, TID2_TIME4));
    fViewBot.toolbarButton(FOLLOW_CPU_BACKWARD).click(SWT.SHIFT);
    timeGraphIsReadyCondition(new TmfTimeRange(TID2_TIME2, TID2_TIME3));
    fViewBot.toolbarButton(FOLLOW_CPU_BACKWARD).click(SWT.SHIFT);
    timeGraphIsReadyCondition(new TmfTimeRange(TID2_TIME2, TID2_TIME2));
    fViewBot.toolbarButton(FOLLOW_CPU_BACKWARD).click(SWT.SHIFT);
    timeGraphIsReadyCondition(new TmfTimeRange(TID2_TIME2, TID2_TIME1));
    fBot.waitUntil(ConditionHelpers.selectionRange(new TmfTimeRange(TID2_TIME2, TID2_TIME1)));
    fBot.waitUntil(ConditionHelpers.treeSelectionContains(tree, 1, "2"));
    assertTrue(
        TmfTraceManager.getInstance()
            .getCurrentTraceContext()
            .getWindowRange()
            .contains(TID2_TIME1));

    /* click "Follow CPU Forward" 2 times */
    fViewBot.toolbarButton(FOLLOW_CPU_FORWARD).click();
    timeGraphIsReadyCondition(new TmfTimeRange(TID2_TIME2, TID2_TIME2));
    fViewBot.toolbarButton(FOLLOW_CPU_FORWARD).click();
    timeGraphIsReadyCondition(new TmfTimeRange(TID2_TIME3, TID2_TIME3));
    fBot.waitUntil(ConditionHelpers.selectionRange(new TmfTimeRange(TID2_TIME3, TID2_TIME3)));
    fBot.waitUntil(ConditionHelpers.treeSelectionContains(tree, 1, "2"));
    assertTrue(
        TmfTraceManager.getInstance()
            .getCurrentTraceContext()
            .getWindowRange()
            .contains(TID2_TIME3));

    /* shift-click "Follow CPU Backward" 3 times */
    fViewBot.toolbarButton(FOLLOW_CPU_BACKWARD).click(SWT.SHIFT);
    timeGraphIsReadyCondition(new TmfTimeRange(TID2_TIME3, TID2_TIME2));
    fViewBot.toolbarButton(FOLLOW_CPU_BACKWARD).click(SWT.SHIFT);
    timeGraphIsReadyCondition(new TmfTimeRange(TID2_TIME3, TID2_TIME1));
    fViewBot.toolbarButton(FOLLOW_CPU_BACKWARD).click(SWT.SHIFT);
    timeGraphIsReadyCondition(new TmfTimeRange(TID2_TIME3, TID1_TIME1));
    fBot.waitUntil(ConditionHelpers.selectionRange(new TmfTimeRange(TID2_TIME3, TID1_TIME1)));
    fBot.waitUntil(ConditionHelpers.treeSelectionContains(tree, 1, "1"));
    assertTrue(
        TmfTraceManager.getInstance()
            .getCurrentTraceContext()
            .getWindowRange()
            .contains(TID1_TIME1));

    /* shift-click "Follow CPU Forward" 4 times */
    fViewBot.toolbarButton(FOLLOW_CPU_FORWARD).click(SWT.SHIFT);
    timeGraphIsReadyCondition(new TmfTimeRange(TID2_TIME3, TID2_TIME1));
    fViewBot.toolbarButton(FOLLOW_CPU_FORWARD).click(SWT.SHIFT);
    timeGraphIsReadyCondition(new TmfTimeRange(TID2_TIME3, TID2_TIME2));
    fViewBot.toolbarButton(FOLLOW_CPU_FORWARD).click(SWT.SHIFT);
    timeGraphIsReadyCondition(new TmfTimeRange(TID2_TIME3, TID2_TIME3));
    fViewBot.toolbarButton(FOLLOW_CPU_FORWARD).click(SWT.SHIFT);
    timeGraphIsReadyCondition(new TmfTimeRange(TID2_TIME3, TID2_TIME4));
    fBot.waitUntil(ConditionHelpers.selectionRange(new TmfTimeRange(TID2_TIME3, TID2_TIME4)));
    fBot.waitUntil(ConditionHelpers.treeSelectionContains(tree, 1, "2"));
    assertTrue(
        TmfTraceManager.getInstance()
            .getCurrentTraceContext()
            .getWindowRange()
            .contains(TID2_TIME4));

    /* click "Follow CPU Backward" 5 times */
    fViewBot.toolbarButton(FOLLOW_CPU_BACKWARD).click();
    timeGraphIsReadyCondition(new TmfTimeRange(TID2_TIME3, TID2_TIME3));
    fViewBot.toolbarButton(FOLLOW_CPU_BACKWARD).click();
    timeGraphIsReadyCondition(new TmfTimeRange(TID2_TIME2, TID2_TIME2));
    fViewBot.toolbarButton(FOLLOW_CPU_BACKWARD).click();
    timeGraphIsReadyCondition(new TmfTimeRange(TID2_TIME1, TID2_TIME1));
    fViewBot.toolbarButton(FOLLOW_CPU_BACKWARD).click();
    timeGraphIsReadyCondition(new TmfTimeRange(TID1_TIME1, TID1_TIME1));
    fViewBot.toolbarButton(FOLLOW_CPU_BACKWARD).click();
    timeGraphIsReadyCondition(new TmfTimeRange(START_TIME, START_TIME));
    fBot.waitUntil(ConditionHelpers.selectionRange(new TmfTimeRange(START_TIME, START_TIME)));
    assertTrue(
        TmfTraceManager.getInstance()
            .getCurrentTraceContext()
            .getWindowRange()
            .contains(START_TIME));
  }
  /**
   * Link with editor, both ways
   *
   * @throws Exception
   */
  @Test
  @Ignore("'Link with Selection' does not activate editor on selection change (bug 409722).")
  public void testLinkWithSelectionEditor() throws Exception {
    deleteAllProjects();
    shareProjects(repositoryFile);
    SWTBotTree tree = getOrOpenView().bot().tree();
    myRepoViewUtil.getRootItem(tree, repositoryFile).select();
    // the selection should be root
    assertTrue(tree.selection().get(0, 0).startsWith(REPO1));

    SWTBotView view = TestUtil.showExplorerView();
    SWTBotTree projectExplorerTree = view.bot().tree();

    SWTBotTreeItem item =
        getProjectItem(projectExplorerTree, PROJ1).expand().getNode(FOLDER).expand().getNode(FILE1);
    view.show();
    item.doubleClick();

    item =
        getProjectItem(projectExplorerTree, PROJ1).expand().getNode(FOLDER).expand().getNode(FILE2);
    view.show();
    item.doubleClick();
    // now we should have two editors

    // the selection should be still be root
    assertTrue(tree.selection().get(0, 0).startsWith(REPO1));

    // activate the link with selection
    toggleLinkWithSelection();

    bot.editorByTitle(FILE2).show();
    // the selection should have changed to the latest editor
    TestUtil.waitUntilTreeHasSelectedNodeWithText(bot, tree, FILE2, 10000);

    bot.editorByTitle(FILE1).show();
    // selection should have changed
    TestUtil.waitUntilTreeHasSelectedNodeWithText(bot, tree, FILE1, 10000);

    // deactivate the link with editor
    toggleLinkWithSelection();

    bot.editorByTitle(FILE2).show();
    // the selection should be still be test.txt
    TestUtil.waitUntilTreeHasSelectedNodeWithText(bot, tree, FILE1, 10000);

    bot.editorByTitle(FILE1).show();

    myRepoViewUtil
        .getWorkdirItem(tree, repositoryFile)
        .expand()
        .getNode(PROJ1)
        .expand()
        .getNode(FOLDER)
        .expand()
        .getNode(FILE2)
        .select();

    // the editor should still be test.txt
    assertEquals(FILE1, bot.activeEditor().getTitle());

    // activate again
    toggleLinkWithSelection();

    // make sure focus is here
    // tried to remove this waitInUI but failed.
    // tried setting focus, waiting for focus, joining RepositoriesView
    // refresh job
    waitInUI();
    myRepoViewUtil
        .getWorkdirItem(tree, repositoryFile)
        .expand()
        .getNode(PROJ1)
        .expand()
        .getNode(FOLDER)
        .expand()
        .getNode(FILE2)
        .select();
    TestUtil.waitUntilEditorIsActive(bot, bot.editorByTitle(FILE2), 10000);

    myRepoViewUtil
        .getWorkdirItem(tree, repositoryFile)
        .expand()
        .getNode(PROJ1)
        .expand()
        .getNode(FOLDER)
        .expand()
        .getNode(FILE1)
        .select();
    TestUtil.waitUntilEditorIsActive(bot, bot.editorByTitle(FILE1), 10000);

    // deactivate the link with editor
    toggleLinkWithSelection();

    myRepoViewUtil
        .getWorkdirItem(tree, repositoryFile)
        .expand()
        .getNode(PROJ1)
        .expand()
        .getNode(FOLDER)
        .expand()
        .getNode(FILE2)
        .select();
    TestUtil.waitUntilEditorIsActive(bot, bot.editorByTitle(FILE1), 10000);
  }
 public boolean getSignedOff() {
   SWTBotToolbarToggleButton button =
       stagingView.bot().toolbarToggleButtonWithTooltip(UIText.StagingView_Add_Signed_Off_By);
   return button.isChecked();
 }
  private void testNextPreviousEvent(
      Runnable selectNext,
      Runnable shiftSelectNext,
      Runnable selectPrevious,
      Runnable shiftSelectPrevious) {
    /* change window range to 10 ms */
    TmfTimeRange range =
        new TmfTimeRange(
            START_TIME, START_TIME.normalize(10000000L, ITmfTimestamp.NANOSECOND_SCALE));
    TmfSignalManager.dispatchSignal(new TmfWindowRangeUpdatedSignal(this, range));
    fBot.waitUntil(ConditionHelpers.windowRange(range));

    /* set selection to trace start time */
    TmfSignalManager.dispatchSignal(new TmfSelectionRangeUpdatedSignal(this, START_TIME));
    timeGraphIsReadyCondition(new TmfTimeRange(START_TIME, START_TIME));

    /* select first item */
    final SWTBotTree tree = fViewBot.bot().tree();
    tree.pressShortcut(Keystrokes.HOME);

    /* set focus on time graph */
    final TimeGraphControl timegraph =
        fViewBot.bot().widget(WidgetOfType.widgetOfType(TimeGraphControl.class));
    UIThreadRunnable.syncExec(
        new VoidResult() {
          @Override
          public void run() {
            timegraph.setFocus();
          }
        });

    /* click "Select Next Event" 3 times */
    selectNext.run();
    timeGraphIsReadyCondition(new TmfTimeRange(TID1_TIME1, TID1_TIME1));
    selectNext.run();
    timeGraphIsReadyCondition(new TmfTimeRange(TID1_TIME2, TID1_TIME2));
    selectNext.run();
    timeGraphIsReadyCondition(new TmfTimeRange(TID1_TIME3, TID1_TIME3));
    fBot.waitUntil(ConditionHelpers.selectionRange(new TmfTimeRange(TID1_TIME3, TID1_TIME3)));
    assertTrue(
        TmfTraceManager.getInstance()
            .getCurrentTraceContext()
            .getWindowRange()
            .contains(TID1_TIME3));

    /* shift-click "Select Next Event" 3 times */
    shiftSelectNext.run();
    timeGraphIsReadyCondition(new TmfTimeRange(TID1_TIME3, TID1_TIME4));
    shiftSelectNext.run();
    timeGraphIsReadyCondition(new TmfTimeRange(TID1_TIME3, TID1_TIME5));
    shiftSelectNext.run();
    timeGraphIsReadyCondition(new TmfTimeRange(TID1_TIME3, TID1_TIME6));
    fBot.waitUntil(ConditionHelpers.selectionRange(new TmfTimeRange(TID1_TIME3, TID1_TIME6)));
    assertTrue(
        TmfTraceManager.getInstance()
            .getCurrentTraceContext()
            .getWindowRange()
            .contains(TID1_TIME6));

    /* shift-click "Select Previous Event" 4 times */
    shiftSelectPrevious.run();
    timeGraphIsReadyCondition(new TmfTimeRange(TID1_TIME3, TID1_TIME5));
    shiftSelectPrevious.run();
    timeGraphIsReadyCondition(new TmfTimeRange(TID1_TIME3, TID1_TIME4));
    shiftSelectPrevious.run();
    timeGraphIsReadyCondition(new TmfTimeRange(TID1_TIME3, TID1_TIME3));
    shiftSelectPrevious.run();
    timeGraphIsReadyCondition(new TmfTimeRange(TID1_TIME3, TID1_TIME2));
    fBot.waitUntil(ConditionHelpers.selectionRange(new TmfTimeRange(TID1_TIME3, TID1_TIME2)));
    assertTrue(
        TmfTraceManager.getInstance()
            .getCurrentTraceContext()
            .getWindowRange()
            .contains(TID1_TIME2));

    /* click "Select Next Event" 2 times */
    selectNext.run();
    timeGraphIsReadyCondition(new TmfTimeRange(TID1_TIME3, TID1_TIME3));
    selectNext.run();
    timeGraphIsReadyCondition(new TmfTimeRange(TID1_TIME4, TID1_TIME4));
    fBot.waitUntil(ConditionHelpers.selectionRange(new TmfTimeRange(TID1_TIME4, TID1_TIME4)));
    assertTrue(
        TmfTraceManager.getInstance()
            .getCurrentTraceContext()
            .getWindowRange()
            .contains(TID1_TIME4));

    /* shift-click "Select Previous Event" 3 times */
    shiftSelectPrevious.run();
    timeGraphIsReadyCondition(new TmfTimeRange(TID1_TIME4, TID1_TIME3));
    shiftSelectPrevious.run();
    timeGraphIsReadyCondition(new TmfTimeRange(TID1_TIME4, TID1_TIME2));
    shiftSelectPrevious.run();
    timeGraphIsReadyCondition(new TmfTimeRange(TID1_TIME4, TID1_TIME1));
    fBot.waitUntil(ConditionHelpers.selectionRange(new TmfTimeRange(TID1_TIME4, TID1_TIME1)));
    assertTrue(
        TmfTraceManager.getInstance()
            .getCurrentTraceContext()
            .getWindowRange()
            .contains(TID1_TIME1));

    /* shift-click "Select Next Event" 4 times */
    shiftSelectNext.run();
    timeGraphIsReadyCondition(new TmfTimeRange(TID1_TIME4, TID1_TIME2));
    shiftSelectNext.run();
    timeGraphIsReadyCondition(new TmfTimeRange(TID1_TIME4, TID1_TIME3));
    shiftSelectNext.run();
    timeGraphIsReadyCondition(new TmfTimeRange(TID1_TIME4, TID1_TIME4));
    shiftSelectNext.run();
    timeGraphIsReadyCondition(new TmfTimeRange(TID1_TIME4, TID1_TIME5));
    fBot.waitUntil(ConditionHelpers.selectionRange(new TmfTimeRange(TID1_TIME4, TID1_TIME5)));
    assertTrue(
        TmfTraceManager.getInstance()
            .getCurrentTraceContext()
            .getWindowRange()
            .contains(TID1_TIME5));

    /* click "Select Previous Event" 5 times */
    selectPrevious.run();
    timeGraphIsReadyCondition(new TmfTimeRange(TID1_TIME4, TID1_TIME4));
    selectPrevious.run();
    timeGraphIsReadyCondition(new TmfTimeRange(TID1_TIME3, TID1_TIME3));
    selectPrevious.run();
    timeGraphIsReadyCondition(new TmfTimeRange(TID1_TIME2, TID1_TIME2));
    selectPrevious.run();
    timeGraphIsReadyCondition(new TmfTimeRange(TID1_TIME1, TID1_TIME1));
    selectPrevious.run();
    timeGraphIsReadyCondition(new TmfTimeRange(START_TIME, START_TIME));
    fBot.waitUntil(ConditionHelpers.selectionRange(new TmfTimeRange(START_TIME, START_TIME)));
    assertTrue(
        TmfTraceManager.getInstance()
            .getCurrentTraceContext()
            .getWindowRange()
            .contains(START_TIME));
  }
 public boolean getInsertChangeId() {
   SWTBotToolbarToggleButton button =
       stagingView.bot().toolbarToggleButtonWithTooltip(UIText.StagingView_Add_Change_ID);
   return button.isChecked();
 }
 public void setSignedOff(boolean signedOff) {
   SWTBotToolbarToggleButton button =
       stagingView.bot().toolbarToggleButtonWithTooltip(UIText.StagingView_Add_Signed_Off_By);
   selectToolbarToggle(button, signedOff);
 }
 public void setCommitter(String committer) {
   stagingView.bot().textWithLabel(UIText.StagingView_Committer).setText(committer);
 }
 public boolean getAmend() {
   SWTBotToolbarToggleButton button =
       stagingView.bot().toolbarToggleButtonWithTooltip(UIText.StagingView_Ammend_Previous_Commit);
   return button.isChecked();
 }
 public void setAmend(boolean amend) {
   SWTBotToolbarToggleButton button =
       stagingView.bot().toolbarToggleButtonWithTooltip(UIText.StagingView_Ammend_Previous_Commit);
   selectToolbarToggle(button, amend);
 }
 public void commit() throws Exception {
   stagingView.bot().button(UIText.StagingView_Commit).click();
   // wait until commit is completed
   Job.getJobManager().join(JobFamilies.COMMIT, null);
 }
 public void setCommitMessage(String message) {
   stagingView.bot().styledTextWithLabel(UIText.StagingView_CommitMessage).setText(message);
 }