Package org.eclipse.swtbot.swt.finder.widgets

Examples of org.eclipse.swtbot.swt.finder.widgets.SWTBotTable


  @Test
  public void testCheckOut() throws Exception {
    Repository repo = lookupRepository(repoFile);
    assertEquals(Constants.MASTER, repo.getBranch());

    final SWTBotTable table = getHistoryViewTable(PROJ1);
    // check out the second line
    final RevCommit[] commit = checkoutLine(table, 1);
    assertEquals(commit[0].getId().name(), repo.getBranch());
  }
View Full Code Here


  }

  @Test
  public void testShowAllBranches() throws Exception {
    toggleShowAllBranchesButton(true);
    final SWTBotTable table = getHistoryViewTable(PROJ1);
    int commits = getHistoryViewTable(PROJ1).rowCount();
    checkoutLine(table, 1);

    toggleShowAllBranchesButton(false);
    assertEquals("Wrong number of commits", commits - 1,
View Full Code Here

  @Test
  public void testRevertFailure() throws Exception {
    touchAndSubmit(null);
    setTestFileContent("dirty in working directory"
        + System.currentTimeMillis());
    final SWTBotTable table = getHistoryViewTable(PROJ1);
    assertTrue(table.rowCount() > 0);
    table.getTableItem(0).select();
    final RevCommit[] commit = new RevCommit[1];

    Display.getDefault().syncExec(new Runnable() {

      public void run() {
View Full Code Here

  public void testOpenOfDeletedFile() throws Exception {
    Git git = Git.wrap(lookupRepository(repoFile));
    git.rm().addFilepattern(FILE1_PATH).call();
    RevCommit commit = git.commit().setMessage("Delete file").call();

    SWTBotTable commitsTable = getHistoryViewTable(PROJ1);
    assertEquals(commitCount + 1, commitsTable.rowCount());
    commitsTable.select(0);

    SWTBot viewBot = getHistoryViewBot();
    SWTBotTable fileDiffTable = viewBot.table(1);
    assertEquals(1, fileDiffTable.rowCount());

    fileDiffTable.select(0);
    assertFalse(fileDiffTable.contextMenu(
        UIText.CommitFileDiffViewer_OpenInEditorMenuLabel).isEnabled());
    fileDiffTable.contextMenu(
        UIText.CommitFileDiffViewer_OpenPreviousInEditorMenuLabel)
        .click();

    // Editor for old file version should be opened
    bot.editorByTitle(FILE1 + " " + commit.getParent(0).getName());
View Full Code Here

        editorRef.set(CommitEditor.openQuiet(repoCommit));
      }
    });
    assertNotNull(editorRef.get());
    SWTBotEditor commitEditor = bot.activeEditor();
    SWTBotTable table = commitEditor.bot().table(0);
    assertTrue(table.rowCount() > 0);
    table.select(0);
    ContextMenuHelper.clickContextMenuSync(table,
        UIText.CommitFileDiffViewer_ShowAnnotationsMenuLabel);
    TestUtil.joinJobs(JobFamilies.BLAME);
    assertFalse(commitEditor.getReference().equals(
        bot.activeEditor().getReference()));
View Full Code Here

  @Test
  public void tablesEmptyByDefault() {
    IncludesView view = new IncludesView( parent, SWT.NONE, project );

    SWTBotTable includeTable = findIncludeTable( view );
    SWTBotTable excludeTable = findExcludeTable( view );
    assertEquals( 0, includeTable.rowCount() );
    assertEquals( 0, excludeTable.rowCount() );
  }
View Full Code Here

  }

  @Test
  public void loadDefaults() {
    IncludesView view = new IncludesView( parent, SWT.NONE, project );
    SWTBotTable includeTable = findIncludeTable( view );
    SWTBotTable excludeTable = findExcludeTable( view );
    new TableItem( includeTable.widget, SWT.NONE ).setText( "/foo/" );
    new TableItem( excludeTable.widget, SWT.NONE ).setText( "/bar/" );

    view.loadDefaults();

    assertEquals( 0, includeTable.rowCount() );
    assertEquals( 0, excludeTable.rowCount() );
  }
View Full Code Here

    preferences.setIncludePatterns( list( "/foo/" ) );
    preferences.setExcludePatterns( list( "/bar/" ) );

    view.loadPreferences( preferences );

    SWTBotTable includeTable = findIncludeTable( view );
    SWTBotTable excludeTable = findExcludeTable( view );
    assertEquals( 1, includeTable.rowCount() );
    assertEquals( 1, excludeTable.rowCount() );
    assertEquals( "/foo/", includeTable.getTableItem( 0 ).getText() );
    assertEquals( "/bar/", excludeTable.getTableItem( 0 ).getText() );
  }
View Full Code Here

    view.loadPreferences( preferences );

    preferences.setIncludePatterns( list( "/bar/" ) );
    view.loadPreferences( preferences );

    SWTBotTable table = findIncludeTable( view );
    assertEquals( 1, table.rowCount() );
    assertEquals( "/bar/", table.getTableItem( 0 ).getText() );
  }
View Full Code Here

  }

  @Test
  public void storePreferences() {
    IncludesView view = new IncludesView( parent, SWT.NONE, project );
    SWTBotTable includeTable = findIncludeTable( view );
    SWTBotTable excludeTable = findExcludeTable( view );
    new TableItem( includeTable.widget, SWT.NONE ).setText( "/foo/" );
    new TableItem( excludeTable.widget, SWT.NONE ).setText( "/bar/" );

    view.storePreferences( preferences );
View Full Code Here

TOP

Related Classes of org.eclipse.swtbot.swt.finder.widgets.SWTBotTable

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.