Author: jpeterka
Date: 2010-04-15 04:08:52 -0400 (Thu, 15 Apr 2010)
New Revision: 21487
Modified:
trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/
trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/.project
trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/META-INF/MANIFEST.MF
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/testsuite/Project.java
Log:
MANIFEST.MF updated for missing bot spy package
Hibernate console editation testcase added
Property changes on: trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test
___________________________________________________________________
Name: svn:ignore
- screenshots
test-output
+ screenshots
test-output
mydb.script
mydb.properties
Modified: trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/.project
===================================================================
--- trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/.project 2010-04-15
08:03:03 UTC (rev 21486)
+++ trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/.project 2010-04-15
08:08:52 UTC (rev 21487)
@@ -6,6 +6,11 @@
</projects>
<buildSpec>
<buildCommand>
+ <name>org.eclipse.wst.common.project.facet.core.builder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
@@ -24,5 +29,6 @@
<natures>
<nature>org.eclipse.pde.PluginNature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
+ <nature>org.eclipse.wst.common.project.facet.core.nature</nature>
</natures>
</projectDescription>
Modified:
trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/META-INF/MANIFEST.MF
===================================================================
---
trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/META-INF/MANIFEST.MF 2010-04-15
08:03:03 UTC (rev 21486)
+++
trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/META-INF/MANIFEST.MF 2010-04-15
08:08:52 UTC (rev 21487)
@@ -12,7 +12,6 @@
org.eclipse.jdt.ui,
org.eclipse.swtbot.eclipse.core;bundle-version="2.0.0",
org.eclipse.swtbot.eclipse.finder;bundle-version="2.0.0",
- org.eclipse.swtbot.eclipse.spy;bundle-version="2.0.0",
org.eclipse.swtbot.eclipse.ui;bundle-version="2.0.0",
org.eclipse.swtbot.junit4_x;bundle-version="2.0.0",
org.eclipse.swtbot.swt.finder;bundle-version="2.0.0",
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 2010-04-15
08:03:03 UTC (rev 21486)
+++
trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/src/org/jboss/tools/hibernate/ui/bot/testcase/ConsoleTest.java 2010-04-15
08:08:52 UTC (rev 21487)
@@ -10,10 +10,13 @@
******************************************************************************/
package org.jboss.tools.hibernate.ui.bot.testcase;
+import org.eclipse.swtbot.swt.finder.SWTBot;
import org.eclipse.swtbot.swt.finder.junit.SWTBotJunit4ClassRunner;
import org.eclipse.swtbot.swt.finder.widgets.SWTBotShell;
+import org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem;
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.gen.ActionItem;
import org.jboss.tools.ui.bot.ext.types.EntityType;
import org.jboss.tools.ui.bot.ext.types.IDELabel;
import org.jboss.tools.ui.bot.ext.types.ViewType;
@@ -33,17 +36,18 @@
@AfterClass
public static void tearDownTest() {
HibernateTest.clean();
+ bot.sleep(TIME_5S);
}
private SWTBotShell mainShell;
- private static boolean done = false;
+ private static boolean consoleCreated = false;
/**
* Create console TestCases TC03 - TC16
*/
@Test
public void createConsole() {
- if (done) return;
+ if (consoleCreated) return;
log.info("HB Console creation STARTED");
@@ -62,7 +66,7 @@
util.waitForNonIgnoredJobs();
log.info("HB Console creation FINISHED");
- done = true;
+ consoleCreated = true;
}
/**
@@ -134,11 +138,61 @@
}
/**
- * TC 16
+ * TC 16 - open console, change serveral value, apply changes and check changes if they
were store correctly
*/
@Test
public void editConsole() {
- // TODO impl.
+ // prereq
+ createConsole();
+
+ // open console
+ openConsoleConfiguration();
+ editConsoleValues();
+
+ // open console again
+ openConsoleConfiguration();
+ checkConsoleValues();
}
-
+
+ private void editConsoleValues() {
+ // perform change on
+ // - Main page
+ bot.cTabItem(IDELabel.HBConsoleWizard.MAIN_TAB).activate();
+ bot.radioInGroup("Type:",1).click();
+ bot.sleep(TIME_1S);
+ // - Option
+ bot.cTabItem(IDELabel.HBConsoleWizard.OPTIONS_TAB).activate();
+ bot.comboBoxInGroup("Database dialect:").setSelection("MySQL");
+ bot.sleep(TIME_1S);
+ // - Classpath
+ bot.cTabItem(IDELabel.HBConsoleWizard.CLASSPATH_TAB).activate();
+ bot.sleep(TIME_1S);
+ // - Mapping
+ bot.cTabItem(IDELabel.HBConsoleWizard.MAPPINGS_TAB).activate();
+ bot.sleep(TIME_1S);
+ // - Common
+ bot.cTabItem(IDELabel.HBConsoleWizard.COMMON_TAB).activate();
+ bot.sleep(TIME_1S);
+ // apply
+ bot.clickButton(IDELabel.Button.APPLY);
+ }
+
+ private void checkConsoleValues() {
+ // perform change on
+ // - Main page
+ bot.cTabItem(IDELabel.HBConsoleWizard.MAIN_TAB).activate();
+ assertTrue(bot.radioInGroup("Type:",1).isSelected());
+ // - Option
+ bot.cTabItem(IDELabel.HBConsoleWizard.OPTIONS_TAB).activate();
+ assertEquals("MySQL", bot.comboBoxInGroup("Database
dialect:").getText());
+ bot.clickButton(IDELabel.Button.OK);
+
+ log.info("Changed console value checked");
+ }
+
+ private void openConsoleConfiguration() {
+ SWTBot viewBot =
open.viewOpen(ActionItem.View.HibernateHibernateConfigurations.LABEL).bot();
+ SWTBotTreeItem item = eclipse.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/testsuite/Project.java
===================================================================
---
trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/src/org/jboss/tools/hibernate/ui/bot/testsuite/Project.java 2010-04-15
08:03:03 UTC (rev 21486)
+++
trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/src/org/jboss/tools/hibernate/ui/bot/testsuite/Project.java 2010-04-15
08:08:52 UTC (rev 21487)
@@ -31,6 +31,6 @@
// JPA Project
public static final String JPA_PRJ_NAME = "jpatest1";
public static final String DDL_OUTPUT = "src";
- public static final String DDL_FILENAME = "test_schema.dll";
+ public static final String DDL_FILENAME = "test_schema.ddl";
public static final String ENTITIES_PACKAGE = "org.entities";
}
Show replies by date