Author: jpeterka
Date: 2012-03-28 09:30:17 -0400 (Wed, 28 Mar 2012)
New Revision: 39889
Added:
trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/src/org/jboss/tools/hb/ui/bot/test/view/PackageInfoTest.java
Modified:
trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/src/org/jboss/tools/hb/ui/bot/suite/ViewSuite.java
Log:
Initial version for hb ui bot test package-info test added
Modified:
trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/src/org/jboss/tools/hb/ui/bot/suite/ViewSuite.java
===================================================================
---
trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/src/org/jboss/tools/hb/ui/bot/suite/ViewSuite.java 2012-03-28
13:28:28 UTC (rev 39888)
+++
trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/src/org/jboss/tools/hb/ui/bot/suite/ViewSuite.java 2012-03-28
13:30:17 UTC (rev 39889)
@@ -1,12 +1,13 @@
package org.jboss.tools.hb.ui.bot.suite;
-import org.jboss.tools.hb.ui.bot.test.view.JPADetailViewTest;
+import org.jboss.tools.hb.ui.bot.test.view.PackageInfoTest;
import org.jboss.tools.ui.bot.ext.RequirementAwareSuite;
import org.junit.runner.RunWith;
import org.junit.runners.Suite.SuiteClasses;
@RunWith(RequirementAwareSuite.class)
-(a)SuiteClasses({JPADetailViewTest.class})
+//(a)SuiteClasses({JPADetailViewTest.class})
+(a)SuiteClasses({PackageInfoTest.class})
public class ViewSuite {
}
Added:
trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/src/org/jboss/tools/hb/ui/bot/test/view/PackageInfoTest.java
===================================================================
---
trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/src/org/jboss/tools/hb/ui/bot/test/view/PackageInfoTest.java
(rev 0)
+++
trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/src/org/jboss/tools/hb/ui/bot/test/view/PackageInfoTest.java 2012-03-28
13:30:17 UTC (rev 39889)
@@ -0,0 +1,63 @@
+package org.jboss.tools.hb.ui.bot.test.view;
+
+import static org.eclipse.swtbot.swt.finder.matchers.WidgetMatcherFactory.withLabel;
+import static org.eclipse.swtbot.swt.finder.waits.Conditions.waitForWidget;
+
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swtbot.eclipse.finder.widgets.SWTBotEditor;
+import org.eclipse.swtbot.eclipse.finder.widgets.SWTBotView;
+import org.eclipse.swtbot.swt.finder.widgets.SWTBotTable;
+import org.jboss.tools.hb.ui.bot.common.ProjectExplorer;
+import org.jboss.tools.hb.ui.bot.test.HibernateBaseTest;
+import org.jboss.tools.ui.bot.ext.gen.ActionItem;
+import org.jboss.tools.ui.bot.ext.helper.StringHelper;
+import org.jboss.tools.ui.bot.ext.parts.SWTBotTwistie;
+import org.junit.Test;
+
+public class PackageInfoTest extends HibernateBaseTest {
+ final String prj = "jpatest40";
+ final String pkg = "org.packageinfo";
+ final String pkginfo = "package-info.java";
+ final String entity = "Table.java";
+
+ @Test
+ public void jpaDetailsViewTest() {
+ importTestProject("/resources/prj/hibernatelib");
+ importTestProject("/resources/prj/jpatest40");
+
+ checkGeneratorInPackageInJPADetailsView();
+ }
+
+
+ private void checkGeneratorInPackageInJPADetailsView() {
+
+ SWTBotView jd = open.viewOpen(ActionItem.View.JPAJPADetails.LABEL);
+ ProjectExplorer.open(prj, "src", pkg, pkginfo);
+ jd.show();
+
+ SWTBotEditor editor = bot.editorByTitle(pkginfo);
+ StringHelper sh = new StringHelper(editor.toTextEditor().getText());
+ String str = "@GenericGenerator";
+ Point pos = sh.getPositionBefore(str);
+ editor.setFocus();
+ editor.toTextEditor().selectRange(pos.y, pos.x, 0);
+
+ String label = "Details are not available for the current selection.";
+ jd.bot().waitWhile(waitForWidget(withLabel(label)));
+
+ SWTBotTwistie twistie = bot.twistieByLabel("Generic Generators");
+ while (!twistie.isExpanded()) {
+ twistie.toggle();
+ }
+
+ final String genname = "myuuidgen";
+ final String strategy = "uuid";
+ SWTBotTable table = jd.bot().table(0);
+ assertTrue(table.containsItem(genname));
+ table.getTableItem(genname).click();
+
+ assertTrue(bot.textWithLabel("Name:").getText().equals(genname));
+ assertTrue(bot.textWithLabel("Stragegy:").getText().equals(strategy));
+ }
+
+}
Property changes on:
trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/src/org/jboss/tools/hb/ui/bot/test/view/PackageInfoTest.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Show replies by date