@Test // (Test Cases for 1.8) test case 6 public void testNtNumericCacheSizeOKPressed() throws Exception { Utility.createProject(Messages.projCache); SWTBotShell propShell = Utility.selCacheUsingCnxtMenu(Messages.projCache, Messages.role1); wabot.checkBox().select(); // Cache size = alphabet // typeText and setting focus on OK is IMP. wabot.textWithLabel(Messages.cachScaleLbl).setText(""); wabot.textWithLabel(Messages.cachScaleLbl).typeText("ab"); wabot.button("OK").setFocus(); wabot.button("OK").click(); SWTBotShell errorShell = wabot.shell(Messages.cachPerErrTtl).activate(); Boolean alphabtErr = errorShell.getText().equals(Messages.cachPerErrTtl); wabot.button("OK").click(); // Cache size = special character wabot.textWithLabel(Messages.cachScaleLbl).setText(""); wabot.textWithLabel(Messages.cachScaleLbl).typeText("#*"); wabot.button("OK").setFocus(); wabot.button("OK").click(); errorShell = wabot.shell(Messages.cachPerErrTtl).activate(); Boolean splCharErr = errorShell.getText().equals(Messages.cachPerErrTtl); wabot.button("OK").click(); assertTrue("testNtNumericCacheSizeOKPressed", alphabtErr && splCharErr); propShell.close(); }
/** * Creates new Server within Server View when Wizard for new Project is called * * @param bot * @param serverGroup * @param serverType */ public static void addServerToServerViewOnWizardPage( SWTWorkbenchBot bot, String serverGroup, String serverType) { // Check if there is defined Application Server if not create one if (!SWTJBTExt.isServerDefinedInWebWizardPage(bot)) { // Specify Application Server for Deployment bot.button(IDELabel.Button.NEW, 1).click(); bot.shell(IDELabel.Shell.NEW_SERVER).activate(); bot.tree().select(serverGroup); bot.tree().expandNode(serverGroup).select(serverType); bot.button(IDELabel.Button.FINISH).click(); } }
@Test // (Test Cases for 1.8) test case 1 public void testCachingPagePresent() throws Exception { Utility.createProject(Messages.projCache); SWTBotShell propShell = Utility.selCacheUsingCnxtMenu(Messages.projCache, Messages.role1); assertTrue( "testCachingPagePresent", wabot.checkBox().isEnabled() && !wabot.checkBox().isChecked() && wabot.button("OK").isEnabled() && wabot.button("Cancel").isEnabled()); propShell.close(); }
@Test // (Test Cases for 1.8) test case 3 public void testDisableCaching() throws Exception { Utility.createProject(Messages.projCache); SWTBotShell propShell = Utility.selCacheUsingCnxtMenu(Messages.projCache, Messages.role1); // check wabot.checkBox().select(); /* * To avoid missing storage account error, * type some value. Requires typeText only. */ wabot.textWithLabel(Messages.keyLbl).typeText("a"); wabot.textWithLabel(Messages.nameLbl).typeText("a"); Utility.selEndPtPage(); Boolean endPtPresent = wabot .table() .cell(1, 0) .equals(String.format("%s%s", Messages.cachEndPtName, Messages.dfltCachName)) && wabot.table().cell(1, 1).equals(Messages.typeIntrnl) && wabot.table().cell(1, 3).equals("11211"); Utility.selLclStrPage(Messages.role1); Boolean LclStrPresent = wabot.table().cell(0, 0).equals(Messages.cachLclStr) && wabot.table().cell(0, 1).equals("20000"); Utility.selCachePage(Messages.role1); // un-check wabot.checkBox().click(); Boolean isDisabled = !wabot.checkBox().isChecked() && !wabot.label(Messages.cachScaleLbl).isEnabled() && !wabot.label(Messages.hostLbl).isEnabled() && !wabot.button(Messages.roleAddBtn).isEnabled() && !wabot.button(Messages.roleEditBtn).isEnabled() && !wabot.label(Messages.keyLbl).isEnabled() && !wabot.label(Messages.nameLbl).isEnabled() && !wabot.table().isEnabled() && !wabot.textWithLabel(Messages.cachScaleLbl).isEnabled() && !wabot.scale().isEnabled(); // Once caching disabled, no storage account warning Utility.selEndPtPage(); Boolean endPtRmv = !wabot .table() .containsItem(String.format("%s%s", Messages.cachEndPtName, Messages.dfltCachName)); propShell = Utility.selLclStrPage(Messages.role1); Boolean lclStrRmv = !wabot.table().containsItem(Messages.cachLclStr); assertTrue( "testDisableCaching", endPtPresent && LclStrPresent && isDisabled && endPtRmv && lclStrRmv); propShell.close(); }
public void create(String projectId) { bot.menu().menu("File").menu("New").menu("Project...").click(); SWTBotShell shell = bot.shell("New Project"); shell.activate(); bot.tree().expandNode("SWTBot", "SWTBot Test Plug-in").select(); bot.button("Next >").click(); bot.textWithLabel("Plug-in Name:").setText(projectId); bot.textWithLabel("Plug-in id:").setText(projectId); bot.textWithLabel("Provider:").setText("ACME Corp."); bot.button("Finish").click(); bot.waitUntil(shellCloses(shell)); }
private void importFinish() { SWTBotShell shell = fBot.activeShell(); final SWTBotButton finishButton = fBot.button("Finish"); finishButton.click(); fBot.waitUntil(Conditions.shellCloses(shell)); SWTBotUtils.waitForJobs(); }
/** * Returns string representing version of defined Server Runtime on rowIndex position in Defined * Server Runtime table * * @param bot * @param rowIndex * @return null when no server runtime is specified, "unknown when not possible to determine * server runtime version" or server runtime version */ public static String getDefinedServerRuntimeVersion(SWTWorkbenchBot bot, int rowIndex) { String result = null; bot.menu(IDELabel.Menu.WINDOW).menu(IDELabel.Menu.PREFERENCES).click(); bot.shell(IDELabel.Shell.PREFERENCES).activate(); bot.tree() .expandNode(IDELabel.PreferencesDialog.SERVER_GROUP) .select(PreferencesDialog.RUNTIME_ENVIRONMENTS); SWTBotTable serverRuntimesTable = bot.table(); if (serverRuntimesTable.rowCount() > rowIndex) { String[] splitServerRuntimeType = serverRuntimesTable.cell(rowIndex, 1).split(" "); int index = 0; while (index < splitServerRuntimeType.length && result == null) { if (splitServerRuntimeType[index].length() > 0 && splitServerRuntimeType[index].charAt(0) >= '0' && splitServerRuntimeType[index].charAt(0) <= '9') { result = splitServerRuntimeType[index].trim(); } else { index++; } } } bot.button(IDELabel.Button.OK).click(); return result; }
/** * Returns true if runtimeName Server Runtime is defined * * @param bot * @param runtimeName * @return */ public static boolean isServerRuntimeDefined(SWTWorkbenchBot bot, String runtimeName) { boolean serverRuntimeNotDefined = true; bot.menu(IDELabel.Menu.WINDOW).menu(IDELabel.Menu.PREFERENCES).click(); bot.shell(IDELabel.Shell.PREFERENCES).activate(); bot.tree() .expandNode(IDELabel.PreferencesDialog.SERVER_GROUP) .select(PreferencesDialog.RUNTIME_ENVIRONMENTS); SWTBotTable tbRuntimeEnvironments = bot.table(); int numRows = tbRuntimeEnvironments.rowCount(); if (numRows > 0) { int currentRow = 0; while (serverRuntimeNotDefined && currentRow < numRows) { if (tbRuntimeEnvironments.cell(currentRow, 0).equalsIgnoreCase(runtimeName)) { serverRuntimeNotDefined = false; } else { currentRow++; } } } bot.button(IDELabel.Button.OK).click(); return !serverRuntimeNotDefined; }
@Test // (Test Cases for 1.8) test case 5 public void testInvalidCacheSizeOKToLeave() throws Exception { Utility.createProject(Messages.projCache); SWTBotShell propShell = Utility.selCacheUsingCnxtMenu(Messages.projCache, Messages.role1); wabot.checkBox().select(); /* * To avoid missing storage account error, * type some value. Requires typeText only. */ wabot.textWithLabel(Messages.keyLbl).typeText("a"); wabot.textWithLabel(Messages.nameLbl).typeText("a"); // Cache size = 0 wabot.textWithLabel(Messages.cachScaleLbl).setText(""); wabot.textWithLabel(Messages.cachScaleLbl).typeText("0"); SWTBotTree properties = propShell.bot().tree(); properties.getTreeItem(Messages.roleTreeRoot).getNode(Messages.endptPage).select(); SWTBotShell errorShell = wabot.shell(String.format("%s%s", Messages.okToLeaveTtl, " ")).activate(); Boolean zeroErr = errorShell.getText().equals(String.format("%s%s", Messages.okToLeaveTtl, " ")); wabot.button("OK").click(); // Cache size < 0 i.e. Negative wabot.textWithLabel(Messages.cachScaleLbl).setText(""); wabot.textWithLabel(Messages.cachScaleLbl).typeText("-2"); properties = propShell.bot().tree(); properties.getTreeItem(Messages.roleTreeRoot).getNode(Messages.endptPage).select(); errorShell = wabot.shell(String.format("%s%s", Messages.okToLeaveTtl, " ")).activate(); Boolean negErr = errorShell.getText().equals(String.format("%s%s", Messages.okToLeaveTtl, " ")); wabot.button("OK").click(); // Cache size > 100 wabot.textWithLabel(Messages.cachScaleLbl).setText(""); wabot.textWithLabel(Messages.cachScaleLbl).typeText("105%"); properties = propShell.bot().tree(); properties.getTreeItem(Messages.roleTreeRoot).getNode(Messages.endptPage).select(); errorShell = wabot.shell(String.format("%s%s", Messages.okToLeaveTtl, " ")).activate(); Boolean grtErr = errorShell.getText().equals(String.format("%s%s", Messages.okToLeaveTtl, " ")); wabot.button("OK").click(); assertTrue("testInvalidCacheSizeOKToLeave", zeroErr && negErr && grtErr); propShell.close(); }
@Test // (Test Cases for 1.8) test case 4 public void testInvalidCacheSizeOKPressed() throws Exception { Utility.createProject(Messages.projCache); SWTBotShell propShell = Utility.selCacheUsingCnxtMenu(Messages.projCache, Messages.role1); wabot.checkBox().select(); // Cache size = 0 // typeText and setting focus on OK is IMP. wabot.textWithLabel(Messages.cachScaleLbl).setText(""); wabot.textWithLabel(Messages.cachScaleLbl).typeText("0"); wabot.button("OK").setFocus(); wabot.button("OK").click(); SWTBotShell errorShell = wabot.shell(Messages.cachPerErrTtl).activate(); Boolean zeroErr = errorShell.getText().equals(Messages.cachPerErrTtl); wabot.button("OK").click(); // Cache size < 0 i.e. Negative wabot.textWithLabel(Messages.cachScaleLbl).setText(""); wabot.textWithLabel(Messages.cachScaleLbl).typeText("-2"); wabot.button("OK").setFocus(); wabot.button("OK").click(); errorShell = wabot.shell(Messages.cachPerErrTtl).activate(); Boolean negErr = errorShell.getText().equals(Messages.cachPerErrTtl); wabot.button("OK").click(); // Cache size > 100 wabot.textWithLabel(Messages.cachScaleLbl).setText(""); wabot.textWithLabel(Messages.cachScaleLbl).typeText("105%"); wabot.button("OK").setFocus(); wabot.button("OK").click(); errorShell = wabot.shell(Messages.cachPerErrTtl).activate(); Boolean grtErr = errorShell.getText().equals(Messages.cachPerErrTtl); wabot.button("OK").click(); assertTrue("testInvalidCacheSizeOKPressed", zeroErr && negErr && grtErr); propShell.close(); }
@Test public void createProject() throws Exception { String projectName = "prjBot-001"; bot.menu("File").menu("New").click(); SWTBotShell shell = bot.shell("New"); shell.activate(); // From menu open File > New dialog, verify whether the dialog has been opened. bot.tree().select("Project"); SWTBotAssert.assertEnabled(bot.button("Next >")); // After selecting Project, the Next button should be enabled. bot.button("Next >").click(); bot.textWithLabel("Project name:").setText(projectName); SWTBotAssert.assertEnabled(bot.button("Finish")); // Enter the Project Name, then Finish button should be enabled. bot.button("Finish").click(); SWTBotAssert.assertVisible(bot.tree().select(projectName)); // Click Finish button and verify whether the project's been successfully created. }
/** * Returns true if any Server Runtime is defined * * @param bot * @return */ public static boolean isServerRuntimeDefined(SWTWorkbenchBot bot) { bot.menu(IDELabel.Menu.WINDOW).menu(IDELabel.Menu.PREFERENCES).click(); bot.shell(IDELabel.Shell.PREFERENCES).activate(); bot.tree() .expandNode(IDELabel.PreferencesDialog.SERVER_GROUP) .select(PreferencesDialog.RUNTIME_ENVIRONMENTS); boolean isServerRuntimeDefined = bot.table().rowCount() > 0; bot.button(IDELabel.Button.OK).click(); return isServerRuntimeDefined; }
/** * Delete Project from workspace * * @param projectName */ public void deleteProject(String projectName) { removeProjectFromServers(projectName); SWTBot packageExplorer = eclipse.showView(ViewType.PACKAGE_EXPLORER); delay(); SWTBotTree tree = packageExplorer.tree(); delay(); ContextMenuHelper.prepareTreeItemForContextMenu(tree, tree.getTreeItem(projectName)); new SWTBotMenu(ContextMenuHelper.getContextMenu(tree, IDELabel.Menu.DELETE, false)).click(); bot.shell(IDELabel.Shell.DELETE_RESOURCES).activate(); bot.button(IDELabel.Button.OK).click(); new SWTUtilExt(bot).waitForNonIgnoredJobs(); }
/** * Remove Project from all Servers * * @param projectName * @param stringToContain */ public void removeProjectFromServers(String projectName, String stringToContain) { eclipse.showView(ViewType.SERVERS); delay(); try { SWTBotTree serverTree = bot.viewByTitle(IDELabel.View.SERVERS).bot().tree(); delay(); // Expand All for (SWTBotTreeItem serverTreeItem : serverTree.getAllItems()) { serverTreeItem.expand(); // if JSF Test Project is deployed to server remove it SWTBotTreeItem[] serverTreeItemChildren = serverTreeItem.getItems(); if (serverTreeItemChildren != null && serverTreeItemChildren.length > 0) { int itemIndex = 0; boolean found = false; String treeItemlabel = null; do { treeItemlabel = serverTreeItemChildren[itemIndex].getText(); found = treeItemlabel.startsWith(projectName) && (stringToContain == null || treeItemlabel.indexOf(stringToContain) >= 0); } while (!found && ++itemIndex < serverTreeItemChildren.length); // Server Tree Item has Child with Text equal to JSF TEst Project if (found) { log.info("Found project to be removed from server: " + treeItemlabel); ContextMenuHelper.prepareTreeItemForContextMenu( serverTree, serverTreeItemChildren[itemIndex]); new SWTBotMenu( ContextMenuHelper.getContextMenu(serverTree, IDELabel.Menu.REMOVE, false)) .click(); bot.shell("Server").activate(); bot.button(IDELabel.Button.OK).click(); log.info("Removed project from server: " + treeItemlabel); bot.sleep(10 * 1000L); } } } delay(); } catch (WidgetNotFoundException wnfe) { // do nothing it means there is no server defined } }
/** * Choose Run On Server menu for specified project * * @param bot * @param projectName */ public static void runProjectOnServer(SWTWorkbenchBot bot, String projectName) { SWTBotTree packageExplorerTree = eclipse.showView(ViewType.PACKAGE_EXPLORER).tree(); packageExplorerTree.setFocus(); SWTBotTreeItem packageExplorerTreeItem = packageExplorerTree.getTreeItem(projectName); packageExplorerTreeItem.select(); packageExplorerTreeItem.click(); // Search for Menu Item with Run on Server substring within label final SWTBotMenu menuRunAs = bot.menu(IDELabel.Menu.RUN).menu(IDELabel.Menu.RUN_AS); final MenuItem menuItem = UIThreadRunnable.syncExec( new WidgetResult<MenuItem>() { public MenuItem run() { int menuItemIndex = 0; MenuItem menuItem = null; final MenuItem[] menuItems = menuRunAs.widget.getMenu().getItems(); while (menuItem == null && menuItemIndex < menuItems.length) { if (menuItems[menuItemIndex].getText().indexOf("Run on Server") > -1) { menuItem = menuItems[menuItemIndex]; } else { menuItemIndex++; } } return menuItem; } }); if (menuItem != null) { new SWTBotMenu(menuItem).click(); bot.shell(IDELabel.Shell.RUN_ON_SERVER).activate(); bot.button(IDELabel.Button.FINISH).click(); SWTUtilExt swtUtil = new SWTUtilExt(bot); swtUtil.waitForAll(10 * 1000L); } else { throw new WidgetNotFoundException("Unable to find Menu Item with Label 'Run on Server'"); } }
public static void continueInstall(final SWTWorkbenchBot bot, final String shellTitle) throws InstallFailureException { try { bot.radio(0).click(); bot.button("Finish").click(); // wait for Security pop-up, or install finished. final SWTBotShell shell = bot.shell(shellTitle); bot.waitWhile( new ICondition() { @Override public boolean test() throws Exception { return shell.isActive(); } @Override public void init(SWTBot bot) {} @Override public String getFailureMessage() { return null; } }, installationTimeout); if (bot.activeShell().getText().equals("Security Warning")) { bot.button("OK").click(); System.err.println("OK clicked"); bot.waitUntil( new ICondition() { @Override public boolean test() throws Exception { try { boolean stillOpen = bot.shell(shellTitle).isOpen(); System.err.println("still open? " + stillOpen); return !stillOpen; } catch (WidgetNotFoundException ex) { System.err.println("no shell"); // Shell already closed return true; } } @Override public void init(SWTBot bot) {} @Override public String getFailureMessage() { return null; } }, installationTimeout); // 15 more minutes } SWTBot restartShellBot = bot.shell("Software Updates").bot(); // Don't restart in test, test executor will do it. try { // Eclipse 4.2 => "No" restartShellBot.button("No").click(); } catch (WidgetNotFoundException ex) { // Eclipse 3.7.x => "Not now" restartShellBot.button("Not Now").click(); } } catch (Exception ex) { String installDesc = bot.text().getText(); if (installDesc == null || installDesc.isEmpty()) { throw new RuntimeException("Internal error", ex); } throw new InstallFailureException(installDesc); } }
@Test // (Test Cases for 1.8) test case 2 public void testEnableCaching() throws Exception { Utility.createProject(Messages.projCache); SWTBotShell propShell = Utility.selCacheUsingCnxtMenu(Messages.projCache, Messages.role1); wabot.checkBox().select(); Boolean isEnabled = wabot.checkBox().isChecked() && wabot.label(Messages.cachScaleLbl).isEnabled() && wabot.label(Messages.hostLbl).isEnabled() && wabot.button(Messages.roleAddBtn).isEnabled() && !wabot.button(Messages.roleEditBtn).isEnabled() && wabot.label(Messages.keyLbl).isEnabled() && wabot.label(Messages.nameLbl).isEnabled() && wabot.table().isEnabled(); Boolean cacheSizeVal = wabot.textWithLabel(Messages.cachScaleLbl).getText().equals(Messages.dfltSizeVal) && (wabot.scale().getValue() == 30); Boolean dfltCacheVal = wabot.table().containsItem(Messages.dfltCachName) && wabot.table().cell(0, 1).equals(Messages.cachBckNo) && wabot.table().cell(0, 2).equals(Messages.expPolAbs) && wabot.table().cell(0, 3).equals("10") && wabot.table().cell(0, 4).equals("11211"); Boolean hostNmVal = wabot .textWithLabel(Messages.hostLbl) .getText() .equals(String.format("%s%s", Messages.hostNm, Messages.role1.toLowerCase())); Boolean StorageVal = wabot.textWithLabel(Messages.keyLbl).getText().equals("") && wabot.textWithLabel(Messages.nameLbl).getText().equals(""); /* * To avoid missing storage account error, * set some value */ wabot.textWithLabel(Messages.keyLbl).setText("a"); wabot.textWithLabel(Messages.nameLbl).setText("a"); Utility.selEndPtPage(); Boolean endPtPresent = wabot .table() .cell(1, 0) .equals(String.format("%s%s", Messages.cachEndPtName, Messages.dfltCachName)) && wabot.table().cell(1, 1).equals(Messages.typeIntrnl) && wabot.table().cell(1, 3).equals("11211"); propShell = Utility.selLclStrPage(Messages.role1); Boolean LclStrPresent = wabot.table().cell(0, 0).equals(Messages.cachLclStr) && wabot.table().cell(0, 1).equals("20000"); assertTrue( "testEnableCaching", isEnabled && cacheSizeVal && dfltCacheVal && hostNmVal && StorageVal && endPtPresent && LclStrPresent); propShell.close(); }
public void login(String user, String password) { bot.textWithLabel(UIText.LoginDialog_user).setText(user); bot.textWithLabel(UIText.LoginDialog_password).setText(password); bot.checkBoxWithLabel(UIText.LoginDialog_storeInSecureStore).deselect(); bot.button(IDialogConstants.OK_LABEL).click(); }
public void closeDialog() { bot.button(IDialogConstants.OK_LABEL).click(); }
/** * test opening a trace, importing * * @throws IOException won't happen */ @Test public void test() throws IOException { File f = File.createTempFile("temp", ".xml").getCanonicalFile(); try (FileWriter fw = new FileWriter(f)) { fw.write(TRACE_CONTENT); } File exportPackage = new File(EXPORT_LOCATION); if (exportPackage.exists()) { exportPackage.delete(); } assertFalse( "File: " + EXPORT_LOCATION + " already present, aborting test", exportPackage.exists()); assertTrue("Trace :" + f.getAbsolutePath() + " does not exist, aborting test", f.exists()); SWTBotUtils.createProject(PROJECT_NAME); SWTBotUtils.openTrace(PROJECT_NAME, f.getAbsolutePath(), XMLSTUB_ID); WaitUtils.waitForJobs(); ITmfTrace trace = TmfTraceManager.getInstance().getActiveTrace(); assertNotNull(trace); assertEquals( "Incorrect opened trace!", f.getAbsolutePath(), (new File(trace.getPath())).getAbsolutePath()); SWTBotView projectExplorerBot = fBot.viewByTitle(PROJECT_EXPLORER); assertNotNull("Cannot find " + PROJECT_EXPLORER, projectExplorerBot); projectExplorerBot.show(); SWTBotTreeItem treeItem = SWTBotUtils.selectTracesFolder(fBot, PROJECT_NAME); treeItem.contextMenu(EXPORT_TRACE_PACKAGE).click(); fBot.waitUntil(Conditions.shellIsActive(EXPORT_TRACE_PACKAGE_TITLE)); SWTBot shellBot = fBot.activeShell().bot(); shellBot.button(DESELECT_ALL).click(); SWTBotTreeItem[] items = fBot.tree().getAllItems(); for (SWTBotTreeItem item : items) { assertEquals(item.isChecked(), false); } shellBot.button(SELECT_ALL).click(); for (SWTBotTreeItem item : items) { assertEquals(item.isChecked(), true); } shellBot.radio(SAVE_IN_TAR_FORMAT).click(); shellBot.radio(SAVE_IN_ZIP_FORMAT).click(); shellBot.checkBox(COMPRESS_THE_CONTENTS_OF_THE_FILE).click(); shellBot.checkBox(COMPRESS_THE_CONTENTS_OF_THE_FILE).click(); shellBot.comboBox().setText(EXPORT_LOCATION); SWTBotShell shell = fBot.activeShell(); shellBot.button(FINISH).click(); // finished exporting WaitUtils.waitForJobs(); fBot.waitUntil(Conditions.shellCloses(shell)); fBot = new SWTWorkbenchBot(); exportPackage = new File(EXPORT_LOCATION); assertTrue("Exported package", exportPackage.exists()); // Fixme: determine why exportPackageSize is different on different machines // assertEquals("Exported package size check", PACKAGE_SIZE, exportPackage.length()); // import treeItem = SWTBotUtils.selectTracesFolder(fBot, PROJECT_NAME); treeItem.contextMenu(IMPORT_TRACE_PACKAGE).click(); fBot.waitUntil(Conditions.shellIsActive(IMPORT_TRACE_PACKAGE_TITLE)); shellBot = fBot.activeShell().bot(); shellBot.comboBox().setText(EXPORT_LOCATION); shellBot.comboBox().typeText("\n"); shellBot.button(SELECT_ALL).click(); shell = fBot.activeShell(); shellBot.button(FINISH).click(); fBot.button("Yes To All").click(); fBot.waitUntil(Conditions.shellCloses(shell)); fBot = new SWTWorkbenchBot(); SWTBotUtils.openEditor(fBot, PROJECT_NAME, new Path(f.getName())); trace = TmfTraceManager.getInstance().getActiveTrace(); assertNotNull(trace); assertEquals("Test if import matches", f.getName(), trace.getName()); assertFalse("Test if import files don't match", f.getAbsolutePath().equals(trace.getPath())); SWTBotUtils.deleteProject(PROJECT_NAME, fBot); WaitUtils.waitForJobs(); }
/** * Deletes Application Server in Server View on position specified by index * * @param bot * @param index - zero based Position of Server within Server Tree */ public static void deleteApplicationServer(SWTWorkbenchBot bot, int index) { SWTJBTExt.chooseServerPopupMenu(bot, index, IDELabel.Menu.DELETE, 10 * 1000L); bot.shell(IDELabel.Shell.DELETE_SERVER).activate(); bot.button(IDELabel.Button.OK).click(); }