Author: jpeterka
Date: 2011-03-15 11:23:13 -0400 (Tue, 15 Mar 2011)
New Revision: 29792
Modified:
trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/src/org/jboss/tools/hibernate/ui/bot/testcase/ConsoleTest.java
Log:
hibernatebot: reading to db content added
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 2011-03-15
15:21:50 UTC (rev 29791)
+++
trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/src/org/jboss/tools/hibernate/ui/bot/testcase/ConsoleTest.java 2011-03-15
15:23:13 UTC (rev 29792)
@@ -13,6 +13,7 @@
import org.eclipse.swtbot.swt.finder.SWTBot;
import org.eclipse.swtbot.swt.finder.widgets.SWTBotShell;
import org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem;
+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;
import org.jboss.tools.ui.bot.ext.SWTEclipseExt;
@@ -67,6 +68,9 @@
bot.button(IDELabel.Button.FINISH).click();
util.waitForNonIgnoredJobs();
+
+ expandDatabaseInConsole();
+
log.info("HB Console creation FINISHED");
consoleCreated = true;
@@ -86,6 +90,7 @@
eclipse.selectTreeLocation(Project.PROJECT_NAME, "src");
bot.button(IDELabel.Button.NEXT).click();
+ // Dialect, driver, jdbc
String dialect =
DatabaseHelper.getDialect(TestConfigurator.currentConfig.getDB().dbType);
bot.comboBoxWithLabel(IDELabel.HBConsoleWizard.DATABASE_DIALECT).setSelection(dialect);
String drvClass =
DatabaseHelper.getDriverClass(TestConfigurator.currentConfig.getDB().dbType);
@@ -93,6 +98,12 @@
String jdbc = TestConfigurator.currentConfig.getDB().jdbcString;
bot.comboBoxWithLabel(IDELabel.HBConsoleWizard.CONNECTION_URL).setText(jdbc);
+ // Username, password
+ String username = TestConfigurator.currentConfig.getDB().username;
+ bot.textWithLabel("Username:").setText(username);
+ String password = TestConfigurator.currentConfig.getDB().password;
+ bot.textWithLabel("Password:").setText(password);
+
SWTBotShell shell = bot.activeShell();
bot.button(IDELabel.Button.FINISH).click();
eclipse.waitForClosedShell(shell);
@@ -144,6 +155,24 @@
bot.sleep(TIME_1S);
}
+
+ private void expandDatabaseInConsole() {
+ SWTBot viewBot =
open.viewOpen(ActionItem.View.HibernateHibernateConfigurations.LABEL).bot();
+ SWTBotTreeItem console = viewBot.tree().expandNode(Project.PROJECT_NAME);
+ bot.sleep(TIME_500MS);
+ SWTBotTreeItem db = console.expandNode("Database").select();
+ bot.sleep(TIME_500MS);
+ SWTBotTreeItem pub = db.expandNode("public").select();
+ bot.sleep(TIME_500MS);
+
+ // Workaround, DB content isn't correcly expanded (SWTBot 2.0.3)
+ pub.doubleClick();
+ bot.sleep(TIME_500MS);
+ pub.doubleClick();
+ bot.sleep(TIME_500MS);
+ DataHolder.tables = pub.getNodes();
+ }
+
/**
* TC 16 - open console, change several values, apply changes and check changes if they
were store correctly
*/
Show replies by date