Esempio n. 1
0
 /**
  * Open (expand, file->editor, branch->checkout)
  *
  * @throws Exception
  */
 @Test
 public void testOpen() throws Exception {
   // expand first level
   SWTBotTree tree = getOrOpenView().bot().tree();
   SWTBotTreeItem item = myRepoViewUtil.getRootItem(tree, repositoryFile);
   item.collapse();
   refreshAndWait();
   item = myRepoViewUtil.getRootItem(tree, repositoryFile);
   assertTrue("Item should not be expanded", !item.isExpanded());
   item.doubleClick();
   assertTrue("Item should be expanded", item.isExpanded());
   // open a file in editor
   item = myRepoViewUtil.getWorkdirItem(tree, repositoryFile).expand();
   SWTBotTreeItem fileiItem =
       item.getNode(PROJ1).expand().getNode(FOLDER).expand().getNode(FILE1).select();
   fileiItem.doubleClick();
   assertTrue(bot.activeEditor().getTitle().equals(FILE1));
   bot.activeEditor().close();
   // open a branch (checkout)
   checkoutWithDoubleClick(tree, "master");
   String contentMaster = getTestFileContent();
   checkoutWithDoubleClick(tree, "stable");
   TestUtil.joinJobs(JobFamilies.CHECKOUT);
   String contentStable = getTestFileContent();
   assertNotEquals("Content of master and stable should differ", contentMaster, contentStable);
 }