Author: jpeterka
Date: 2012-01-17 04:36:24 -0500 (Tue, 17 Jan 2012)
New Revision: 37890
Added:
trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/src/org/jboss/tools/hibernate/helper/
trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/src/org/jboss/tools/hibernate/helper/ConsoleHelper.java
Modified:
trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/src/org/jboss/tools/hibernate/ui/bot/testcase/CodeGenerationLauncherTest.java
trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/src/org/jboss/tools/hibernate/ui/bot/testcase/ConsoleTest.java
trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/src/org/jboss/tools/hibernate/ui/bot/testcase/MappingsDiagramTest.java
Log:
[hbbot] bot tests update, multiple consoles fix
Added:
trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/src/org/jboss/tools/hibernate/helper/ConsoleHelper.java
===================================================================
---
trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/src/org/jboss/tools/hibernate/helper/ConsoleHelper.java
(rev 0)
+++
trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/src/org/jboss/tools/hibernate/helper/ConsoleHelper.java 2012-01-17
09:36:24 UTC (rev 37890)
@@ -0,0 +1,27 @@
+package org.jboss.tools.hibernate.helper;
+
+import org.apache.log4j.Logger;
+import org.eclipse.swtbot.eclipse.finder.widgets.SWTBotView;
+import org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem;
+import org.jboss.tools.ui.bot.ext.SWTBotExt;
+import org.jboss.tools.ui.bot.ext.SWTOpenExt;
+import org.jboss.tools.ui.bot.ext.gen.ActionItem;
+
+public class ConsoleHelper {
+
+ static Logger log = Logger.getLogger(ConsoleHelper.class);
+
+ public static boolean consoleExists(String console) {
+ SWTOpenExt open = new SWTOpenExt(new SWTBotExt());
+ SWTBotView view =
open.viewOpen(ActionItem.View.HibernateHibernateConfigurations.LABEL);
+
+ SWTBotTreeItem[] items = view.bot().tree().getAllItems();
+
+ for (SWTBotTreeItem item : items) {
+ log.info("Console found:" + item.getText());
+ if (item.getText().equals(console)) return true;
+ }
+ return false;
+ }
+
+}
Property changes on:
trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/src/org/jboss/tools/hibernate/helper/ConsoleHelper.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Modified:
trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/src/org/jboss/tools/hibernate/ui/bot/testcase/CodeGenerationLauncherTest.java
===================================================================
---
trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/src/org/jboss/tools/hibernate/ui/bot/testcase/CodeGenerationLauncherTest.java 2012-01-17
08:46:57 UTC (rev 37889)
+++
trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/src/org/jboss/tools/hibernate/ui/bot/testcase/CodeGenerationLauncherTest.java 2012-01-17
09:36:24 UTC (rev 37890)
@@ -44,7 +44,9 @@
eclipse.closeView(IDELabel.View.WELCOME);
prepareProject();
- prepareConsole();
+ ConsoleTest consoleTest = new ConsoleTest();
+ consoleTest.createConsole();
+
util.waitForNonIgnoredJobs();
}
Modified:
trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/src/org/jboss/tools/hibernate/ui/bot/testcase/ConsoleTest.java
===================================================================
---
trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/src/org/jboss/tools/hibernate/ui/bot/testcase/ConsoleTest.java 2012-01-17
08:46:57 UTC (rev 37889)
+++
trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/src/org/jboss/tools/hibernate/ui/bot/testcase/ConsoleTest.java 2012-01-17
09:36:24 UTC (rev 37890)
@@ -11,9 +11,9 @@
package org.jboss.tools.hibernate.ui.bot.testcase;
import org.eclipse.swtbot.swt.finder.SWTBot;
-import org.eclipse.swtbot.swt.finder.exceptions.WidgetNotFoundException;
import org.eclipse.swtbot.swt.finder.widgets.SWTBotShell;
import org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem;
+import org.jboss.tools.hibernate.helper.ConsoleHelper;
import org.jboss.tools.hibernate.ui.bot.test.util.DataHolder;
import org.jboss.tools.hibernate.ui.bot.testsuite.HibernateTest;
import org.jboss.tools.hibernate.ui.bot.testsuite.Project;
@@ -52,7 +52,7 @@
*/
@Test
public void createConsole() {
- if (consoleCreated) return;
+ if (ConsoleHelper.consoleExists(Project.PROJECT_NAME)) return;
log.info("HB Console creation STARTED");
@@ -239,4 +239,6 @@
SWTBotTreeItem item = SWTEclipseExt.selectTreeLocation(viewBot, Project.PROJECT_NAME);
item.doubleClick();
}
+
+
}
Modified:
trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/src/org/jboss/tools/hibernate/ui/bot/testcase/MappingsDiagramTest.java
===================================================================
---
trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/src/org/jboss/tools/hibernate/ui/bot/testcase/MappingsDiagramTest.java 2012-01-17
08:46:57 UTC (rev 37889)
+++
trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/src/org/jboss/tools/hibernate/ui/bot/testcase/MappingsDiagramTest.java 2012-01-17
09:36:24 UTC (rev 37890)
@@ -34,7 +34,8 @@
eclipse.closeView(IDELabel.View.WELCOME);
prepareProject();
- prepareConsole();
+ ConsoleTest test = new ConsoleTest();
+ test.createConsole();
util.waitForNonIgnoredJobs();
}
Show replies by date