[jbosstools-commits] JBoss Tools SVN: r39605 - in trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test: src/org/jboss/tools/hb/ui/bot/suite and 2 other directories.

jbosstools-commits at lists.jboss.org jbosstools-commits at lists.jboss.org
Mon Mar 19 03:43:53 EDT 2012


Author: jpeterka
Date: 2012-03-19 03:43:52 -0400 (Mon, 19 Mar 2012)
New Revision: 39605

Added:
   trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/launcher/CodeGeneration.launch
   trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/src/org/jboss/tools/hb/ui/bot/suite/CodeGenerationSuite.java
   trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/src/org/jboss/tools/hb/ui/bot/test/generation/
   trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/src/org/jboss/tools/hb/ui/bot/test/generation/CreateCodeGenerationConfiguration.java
Log:
Isolated create code generation ui bot test added

Added: trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/launcher/CodeGeneration.launch
===================================================================
--- trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/launcher/CodeGeneration.launch	                        (rev 0)
+++ trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/launcher/CodeGeneration.launch	2012-03-19 07:43:52 UTC (rev 39605)
@@ -0,0 +1,43 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<launchConfiguration type="org.eclipse.swtbot.eclipse.ui.launcher.JunitLaunchConfig">
+<booleanAttribute key="append.args" value="true"/>
+<booleanAttribute key="askclear" value="false"/>
+<booleanAttribute key="automaticAdd" value="true"/>
+<booleanAttribute key="automaticValidate" value="false"/>
+<stringAttribute key="bootstrap" value=""/>
+<stringAttribute key="checked" value="[NONE]"/>
+<booleanAttribute key="clearConfig" value="true"/>
+<booleanAttribute key="clearws" value="true"/>
+<booleanAttribute key="clearwslog" value="false"/>
+<stringAttribute key="configLocation" value="${workspace_loc}/.metadata/.plugins/org.eclipse.pde.core/pde-junit"/>
+<booleanAttribute key="default" value="true"/>
+<booleanAttribute key="includeOptional" value="true"/>
+<stringAttribute key="location" value="${workspace_loc}/../junit-workspace"/>
+<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
+<listEntry value="/org.jboss.tools.hibernate.ui.bot.test/src/org/jboss/tools/hb/ui/bot/suite/CodeGenerationSuite.java"/>
+</listAttribute>
+<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
+<listEntry value="1"/>
+</listAttribute>
+<mapAttribute key="org.eclipse.debug.core.environmentVariables">
+<mapEntry key="DISPLAY" value=":1"/>
+</mapAttribute>
+<stringAttribute key="org.eclipse.jdt.junit.CONTAINER" value=""/>
+<booleanAttribute key="org.eclipse.jdt.junit.KEEPRUNNING_ATTR" value="false"/>
+<stringAttribute key="org.eclipse.jdt.junit.TESTNAME" value=""/>
+<stringAttribute key="org.eclipse.jdt.junit.TEST_KIND" value="org.eclipse.jdt.junit.loader.junit4"/>
+<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="org.jboss.tools.hb.ui.bot.suite.CodeGenerationSuite"/>
+<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="-os ${target.os} -ws ${target.ws} -arch ${target.arch} -nl ${target.nl} -consoleLog"/>
+<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="org.jboss.tools.hibernate.ui.bot.test"/>
+<stringAttribute key="org.eclipse.jdt.launching.SOURCE_PATH_PROVIDER" value="org.eclipse.pde.ui.workbenchClasspathProvider"/>
+<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Dosgi.requiredJavaVersion=1.5 -XX:MaxPermSize=256m -Xms40m -Xmx512m -Xmx1024M -XX:PermSize=128M -XX:MaxPermSize=256M -Dusage_reporting_enabled=false -Dtest.configurations.dir=/home/jpeterka/etc/hb"/>
+<stringAttribute key="pde.version" value="3.3"/>
+<stringAttribute key="product" value="com.jboss.jbds.product.product"/>
+<booleanAttribute key="show_selected_only" value="false"/>
+<stringAttribute key="templateConfig" value="${target_home}/configuration/config.ini"/>
+<booleanAttribute key="tracing" value="false"/>
+<booleanAttribute key="useCustomFeatures" value="false"/>
+<booleanAttribute key="useDefaultConfig" value="true"/>
+<booleanAttribute key="useDefaultConfigArea" value="false"/>
+<booleanAttribute key="useProduct" value="true"/>
+</launchConfiguration>


Property changes on: trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/launcher/CodeGeneration.launch
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Added: trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/src/org/jboss/tools/hb/ui/bot/suite/CodeGenerationSuite.java
===================================================================
--- trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/src/org/jboss/tools/hb/ui/bot/suite/CodeGenerationSuite.java	                        (rev 0)
+++ trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/src/org/jboss/tools/hb/ui/bot/suite/CodeGenerationSuite.java	2012-03-19 07:43:52 UTC (rev 39605)
@@ -0,0 +1,12 @@
+package org.jboss.tools.hb.ui.bot.suite;
+
+import org.jboss.tools.hb.ui.bot.test.generation.CreateCodeGenerationConfiguration;
+import org.jboss.tools.ui.bot.ext.RequirementAwareSuite;
+import org.junit.runner.RunWith;
+import org.junit.runners.Suite.SuiteClasses;
+
+ at RunWith(RequirementAwareSuite.class)
+ at SuiteClasses({CreateCodeGenerationConfiguration.class})
+public class CodeGenerationSuite {
+
+}


Property changes on: trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/src/org/jboss/tools/hb/ui/bot/suite/CodeGenerationSuite.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Added: trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/src/org/jboss/tools/hb/ui/bot/test/generation/CreateCodeGenerationConfiguration.java
===================================================================
--- trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/src/org/jboss/tools/hb/ui/bot/test/generation/CreateCodeGenerationConfiguration.java	                        (rev 0)
+++ trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/src/org/jboss/tools/hb/ui/bot/test/generation/CreateCodeGenerationConfiguration.java	2012-03-19 07:43:52 UTC (rev 39605)
@@ -0,0 +1,111 @@
+package org.jboss.tools.hb.ui.bot.test.generation;
+
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swtbot.eclipse.finder.matchers.WidgetMatcherFactory;
+import org.eclipse.swtbot.swt.finder.widgets.SWTBotCheckBox;
+import org.eclipse.swtbot.swt.finder.widgets.SWTBotMenu;
+import org.eclipse.swtbot.swt.finder.widgets.SWTBotShell;
+import org.hamcrest.Matcher;
+import org.jboss.tools.hb.ui.bot.test.HibernateBaseTest;
+import org.jboss.tools.ui.bot.ext.config.Annotations.DB;
+import org.jboss.tools.ui.bot.ext.config.Annotations.Require;
+import org.jboss.tools.ui.bot.ext.types.IDELabel;
+import org.junit.Test;
+
+/**
+ * Hibernate code generation configuration ui bot test
+ * 
+ * @author jpeterka
+ * 
+ */
+ at Require(db = @DB, clearProjects = false, perspective = "Hibernate")
+public class CreateCodeGenerationConfiguration extends HibernateBaseTest {
+
+	final String prjName = "hibernate35";
+	
+	@Test
+	public void hibernateCodeGeneration() {
+		importTestProject("/resources/prj/hibernate35");
+		SWTBotShell dlg = openCodeGenerationDlg();
+		fillMainTab();
+		fillExportersTab(dlg);
+		fillRefreshTab(dlg);
+		fillCommonTab(dlg);
+		runCodeGeneration();
+		
+	}
+
+	private SWTBotShell openCodeGenerationDlg() {
+		SWTBotShell ret = null;
+		SWTBotMenu menu,menu1 = null;
+		menu = bot.menu("Run");
+		menu1 = menu.menu(IDELabel.Menu.HIBERNATE_CODE_GENERATION);
+		menu1.menu(IDELabel.Menu.HIBERNATE_CODE_GENERATION_CONF).click();		
+		ret = bot.activeShell();
+		return ret;
+	}
+
+	private void runCodeGeneration() {
+		bot.button(IDELabel.Button.RUN).click();
+	}
+
+	private void fillMainTab() {
+
+		bot.tree().expandNode("Hibernate Code Generation").select();
+		bot.toolbarButtonWithTooltip("New launch configuration").click();
+
+		eclipse.selectTreeLocation("Hibernate Code Generation",
+				"New_configuration");
+		bot.textWithLabel("Name:").setText("HSQL Configuration");
+
+		// Console Configuration
+		bot.comboBoxWithLabel("Console configuration:").setSelection(
+				prjName);
+
+		// Output directory
+		bot.button("Browse...").click();
+		bot.shell("Select output directory").activate();
+		eclipse.selectTreeLocation(prjName);
+		bot.button("Create New Folder...").click();
+		bot.shell("New Folder").activate();
+		bot.textWithLabel("Folder name:").setText("gen");
+		bot.button(IDELabel.Button.OK).click();
+		eclipse.selectTreeLocation(prjName, "gen");
+		bot.button(IDELabel.Button.OK).click();
+
+		// Create console configuration
+		Matcher<Button> matcher = WidgetMatcherFactory
+				.withText("Reverse engineer from JDBC Connection");
+		Button button = bot.widget(matcher);
+		SWTBotCheckBox cb = new SWTBotCheckBox(button);
+
+		if (!cb.isChecked())
+			cb.click();
+
+		bot.textWithLabel("Package:").setText("org.test");
+		log.info("HB Code Generation Main tab DONE");
+		bot.sleep(TIME_1S);
+	}
+
+	private void fillExportersTab(SWTBotShell mainShell) {
+		mainShell.activate();
+		bot.cTabItem(IDELabel.HBLaunchConfigurationDialog.EXPORTERS_TAB)
+				.activate();
+		bot.table().select("Domain code (.java)");
+		bot.table().getTableItem(0).check();
+		log.info("HB Code Generation Exporters tab DONE");
+		bot.sleep(TIME_1S);
+	}
+
+	private void fillRefreshTab(SWTBotShell mainShell) {
+		mainShell.activate();
+		bot.cTabItem(IDELabel.HBLaunchConfigurationDialog.REFRESH_TAB)
+				.activate();
+	}
+
+	private void fillCommonTab(SWTBotShell mainShell) {
+		mainShell.activate();
+		bot.cTabItem(IDELabel.HBLaunchConfigurationDialog.COMMON_TAB)
+				.activate();
+	}
+}


Property changes on: trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/src/org/jboss/tools/hb/ui/bot/test/generation/CreateCodeGenerationConfiguration.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain



More information about the jbosstools-commits mailing list