Author: jgargula
Date: 2012-01-11 09:40:14 -0500 (Wed, 11 Jan 2012)
New Revision: 37767
Modified:
trunk/build/aggregate/bottests-site/tests/org.jboss.tools.drools.ui.bot.test/src/org/jboss/tools/drools/ui/bot/test/smoke/GuvnorRepositoriesTest.java
trunk/build/aggregate/bottests-site/tests/org.jboss.tools.drools.ui.bot.test/src/org/jboss/tools/drools/ui/bot/test/smoke/ManageDroolsProject.java
trunk/build/aggregate/bottests-site/tests/org.jboss.tools.drools.ui.bot.test/src/org/jboss/tools/drools/ui/bot/test/smoke/ManageDroolsRules.java
Log:
Made some changes for improving tests stability.
Modified:
trunk/build/aggregate/bottests-site/tests/org.jboss.tools.drools.ui.bot.test/src/org/jboss/tools/drools/ui/bot/test/smoke/GuvnorRepositoriesTest.java
===================================================================
---
trunk/build/aggregate/bottests-site/tests/org.jboss.tools.drools.ui.bot.test/src/org/jboss/tools/drools/ui/bot/test/smoke/GuvnorRepositoriesTest.java 2012-01-11
14:29:20 UTC (rev 37766)
+++
trunk/build/aggregate/bottests-site/tests/org.jboss.tools.drools.ui.bot.test/src/org/jboss/tools/drools/ui/bot/test/smoke/GuvnorRepositoriesTest.java 2012-01-11
14:40:14 UTC (rev 37767)
@@ -143,8 +143,8 @@
IDELabel.Menu.OPEN_GUVNOR_CONSOLE, false)).click();
bot.sleep(Timing.time5S());
SWTBotBrowserExt browser =
bot.browserByTitle(IDELabel.GuvnorConsole.GUVNOR_CONSOLE_TITLE);
- browser.setInputTextViaJavaScript(GuvnorRepositoriesTest.GUVNOR_USER_NAME, 0, bot);
- browser.setInputTextViaJavaScript(GuvnorRepositoriesTest.GUVNOR_PASSWORD, 1, bot);
+ browser.setInputTextViaJavaScript(GuvnorRepositoriesTest.GUVNOR_USER_NAME, 1, bot);
+ browser.setInputTextViaJavaScript(GuvnorRepositoriesTest.GUVNOR_PASSWORD, 2, bot);
browser.clickOnButtonViaJavaScript(0, bot);
browser.clickOnButtonViaJavaScript(IDELabel.GuvnorConsole.BUTTON_YES_INSTALL_SAMPLES,
bot);
bot.sleep(Timing.time1S());
@@ -213,8 +213,7 @@
SWTBotTreeItem tiDroolRuleDir =
packageExplorer.selectTreeItem(DroolsAllBotTests.SRC_MAIN_RULES_TREE_NODE,
new String[] {DroolsAllBotTests.DROOLS_PROJECT_NAME});
DragAndDropHelper.dragAndDropOnTo(tiGuvnorFile.widget,tiDroolRuleDir.widget);
- bot.sleep(Timing.time5S());
- bot.shell(IDELabel.Shell.COPY_FILE_FROM_GUVNOR_TO_PACKAGE_EXPLORER).activate();
+
bot.waitForShell(IDELabel.Shell.COPY_FILE_FROM_GUVNOR_TO_PACKAGE_EXPLORER).activate();
bot.button(IDELabel.Button.OK).click();
SWTBotTree packageExplorerTree = packageExplorerBot.tree();
// File is renamed because there is appended Guvnor info to Tree Item Label
Modified:
trunk/build/aggregate/bottests-site/tests/org.jboss.tools.drools.ui.bot.test/src/org/jboss/tools/drools/ui/bot/test/smoke/ManageDroolsProject.java
===================================================================
---
trunk/build/aggregate/bottests-site/tests/org.jboss.tools.drools.ui.bot.test/src/org/jboss/tools/drools/ui/bot/test/smoke/ManageDroolsProject.java 2012-01-11
14:29:20 UTC (rev 37766)
+++
trunk/build/aggregate/bottests-site/tests/org.jboss.tools.drools.ui.bot.test/src/org/jboss/tools/drools/ui/bot/test/smoke/ManageDroolsProject.java 2012-01-11
14:40:14 UTC (rev 37767)
@@ -41,41 +41,46 @@
private static final String RENAMED_DROOLS_PROJECT =
DroolsAllBotTests.DROOLS_PROJECT_NAME + "-renamed";
@Test
public void testManageDroolsProject() {
- createDroolsProject (DroolsAllBotTests.DROOLS_PROJECT_NAME);
+ createDroolsProjectTest (DroolsAllBotTests.DROOLS_PROJECT_NAME);
runNewDroolsProject (DroolsAllBotTests.DROOLS_PROJECT_NAME);
renameDroolsProject (DroolsAllBotTests.DROOLS_PROJECT_NAME,
ManageDroolsProject.RENAMED_DROOLS_PROJECT);
deleteDroolsProject (ManageDroolsProject.RENAMED_DROOLS_PROJECT);
- createDroolsProject (DroolsAllBotTests.DROOLS_PROJECT_NAME);
+ createDroolsProjectTest (DroolsAllBotTests.DROOLS_PROJECT_NAME);
}
+
+ public static void createDroolsProject(String droolsProjectName) {
+ eclipse.showView(ViewType.PACKAGE_EXPLORER);
+ eclipse.createNew(EntityType.DROOLS_PROJECT);
+ bot.textWithLabel(IDELabel.NewDroolsProjectDialog.NAME).setText(droolsProjectName);
+ bot.button(IDELabel.Button.NEXT).click();
+ // check all buttons
+ int index = 0;
+ boolean checkBoxExists = true;
+ while (checkBoxExists){
+ try{
+ SWTBotCheckBox checkBox = bot.checkBox(index);
+ if (!checkBox.isChecked()){
+ checkBox.click();
+ }
+ index++;
+ }catch (WidgetNotFoundException wnfe){
+ checkBoxExists = false;
+ }catch (IndexOutOfBoundsException ioobe){
+ checkBoxExists = false;
+ }
+ }
+ bot.button(IDELabel.Button.NEXT).click();
+
bot.comboBoxWithLabel(IDELabel.NewDroolsProjectDialog.GENERATE_CODE_COMPATIBLE_WITH_COMBO_BOX_LABEL)
+ .setSelection(IDELabel.NewDroolsProjectDialog.CODE_COMPATIBLE_WITH_50_DROOLS);
+ bot.button(IDELabel.Button.FINISH).click();
+ }
+
/**
* Creates new Drools project
* @param droolsProjectName
*/
- private void createDroolsProject(String droolsProjectName){
- eclipse.showView(ViewType.PACKAGE_EXPLORER);
- eclipse.createNew(EntityType.DROOLS_PROJECT);
- bot.textWithLabel(IDELabel.NewDroolsProjectDialog.NAME).setText(droolsProjectName);
- bot.button(IDELabel.Button.NEXT).click();
- // check all buttons
- int index = 0;
- boolean checkBoxExists = true;
- while (checkBoxExists){
- try{
- SWTBotCheckBox checkBox = bot.checkBox(index);
- if (!checkBox.isChecked()){
- checkBox.click();
- }
- index++;
- }catch (WidgetNotFoundException wnfe){
- checkBoxExists = false;
- }catch (IndexOutOfBoundsException ioobe){
- checkBoxExists = false;
- }
- }
- bot.button(IDELabel.Button.NEXT).click();
-
bot.comboBoxWithLabel(IDELabel.NewDroolsProjectDialog.GENERATE_CODE_COMPATIBLE_WITH_COMBO_BOX_LABEL)
- .setSelection(IDELabel.NewDroolsProjectDialog.CODE_COMPATIBLE_WITH_50_DROOLS);
- bot.button(IDELabel.Button.FINISH).click();
+ private void createDroolsProjectTest(String droolsProjectName){
+ createDroolsProject(droolsProjectName);
SWTTestExt.util.waitForAll(30*1000L);
bot.sleep(Timing.time10S());
assertTrue("Project "
@@ -138,12 +143,13 @@
IDELabel.Shell.RENAME_JAVA_PROJECT);
assertNull(checkResult,checkResult);
}
+
/**
* Deletes Drools project and check result
* @param droolsProjectName
*/
private void deleteDroolsProject(String droolsProjectName){
-
+
packageExplorer.deleteProject(droolsProjectName, true);
boolean notFound = false;
try{
Modified:
trunk/build/aggregate/bottests-site/tests/org.jboss.tools.drools.ui.bot.test/src/org/jboss/tools/drools/ui/bot/test/smoke/ManageDroolsRules.java
===================================================================
---
trunk/build/aggregate/bottests-site/tests/org.jboss.tools.drools.ui.bot.test/src/org/jboss/tools/drools/ui/bot/test/smoke/ManageDroolsRules.java 2012-01-11
14:29:20 UTC (rev 37766)
+++
trunk/build/aggregate/bottests-site/tests/org.jboss.tools.drools.ui.bot.test/src/org/jboss/tools/drools/ui/bot/test/smoke/ManageDroolsRules.java 2012-01-11
14:40:14 UTC (rev 37767)
@@ -99,7 +99,6 @@
DroolsAllBotTests.COM_SAMPLE_TREE_NODE});
console.clearConsole();
eclipse.debugTreeItemAsDroolsApplication(tiDroolsTest);
- bot.sleep(Timing.time10S());
eclipse.closeConfirmPerspectiveSwitchShellIfOpened(false);
String consoleText = console.getConsoleText(3*1000L,3*1000L,true);
assertTrue("Drools Rule was not debuged properly.\nConsole content should have
been empty but is:\n" + consoleText,
Show replies by date