Author: jjankovi
Date: 2012-04-24 04:35:18 -0400 (Tue, 24 Apr 2012)
New Revision: 40439
Modified:
trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/utils/ProjectHelper.java
Log:
method for configuration default runtime and jdk for project
Modified:
trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/utils/ProjectHelper.java
===================================================================
---
trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/utils/ProjectHelper.java 2012-04-24
08:34:11 UTC (rev 40438)
+++
trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/utils/ProjectHelper.java 2012-04-24
08:35:18 UTC (rev 40439)
@@ -169,4 +169,55 @@
}
+ /**
+ * Set system default jdk in the project
+ * @param projectName
+ */
+ public void addDefaultJDKIntoProject(String projectName) {
+
+ projectExplorer.selectProject(projectName);
+ bot.menu(IDELabel.Menu.FILE).menu(
+ IDELabel.Menu.PROPERTIES).click();
+ bot.waitForShell(IDELabel.Shell.PROPERTIES_FOR + " " + projectName);
+ SWTBotShell propertiesShell = bot.shell(
+ IDELabel.Shell.PROPERTIES_FOR + " " + projectName);
+ propertiesShell.activate();
+ SWTBotTreeItem item = bot.tree().getTreeItem(
+ IDELabel.JavaBuildPathPropertiesEditor.
+ JAVA_BUILD_PATH_TREE_ITEM_LABEL);
+ item.select();
+ bot.tabItem(IDELabel.JavaBuildPathPropertiesEditor.
+ LIBRARIES_TAB_LABEL).activate();
+ SWTBotTree librariesTree = bot.treeWithLabel(
+ "JARs and class folders on the build path:");
+ /** remove jdk currently configured on project */
+ for (int i = 0; i < librariesTree.rowCount(); i++) {
+ SWTBotTreeItem libraryItem = librariesTree.
+ getAllItems()[i];
+ if (libraryItem.getText().contains("JRE") ||
+ libraryItem.getText().contains("jdk")) {
+ libraryItem.select();
+ break;
+ }
+ }
+ bot.button(IDELabel.Button.REMOVE).click();
+
+ /** add default jdk of system */
+ bot.button(IDELabel.Button.ADD_LIBRARY).click();
+ bot.waitForShell(IDELabel.Shell.ADD_LIBRARY);
+ SWTBotShell libraryShell = bot.shell(
+ IDELabel.Shell.ADD_LIBRARY);
+ libraryShell.activate();
+ bot.list().select("JRE System Library");
+ bot.button(IDELabel.Button.NEXT).click();
+ bot.radio(2).click();
+ bot.button(IDELabel.Button.FINISH).click();
+ bot.waitWhile(new ShellIsActiveCondition(libraryShell),
+ TaskDuration.LONG.getTimeout());
+ bot.button(IDELabel.Button.OK).click();
+ bot.waitWhile(new ShellIsActiveCondition(propertiesShell),
+ TaskDuration.LONG.getTimeout());
+
+ }
+
}
Show replies by date