Author: jpeterka
Date: 2009-12-01 10:58:29 -0500 (Tue, 01 Dec 2009)
New Revision: 18945
Added:
trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/resources/drv/
trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/resources/drv/hsqldb.jar
trunk/jst/tests/org.jboss.tools.ui.bot.ext/build.xml
trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/types/IDELabel.java
trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/view/
trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/view/PackageExplorer.java
Removed:
trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/types/IDELabel.java
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/src/log4j.xml
trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/src/org/jboss/tools/hibernate/ui/bot/testcase/ConfigurationFileTest.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/MappingFileTest.java
trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/src/org/jboss/tools/hibernate/ui/bot/testcase/ReverseEngineerFileTest.java
trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/src/org/jboss/tools/hibernate/ui/bot/testsuite/HibernateAllTests.java
trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/src/org/jboss/tools/hibernate/ui/bot/testsuite/HibernateTest.java
trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/src/org/jboss/tools/hibernate/ui/bot/testsuite/Project.java
trunk/jst/tests/org.jboss.tools.ui.bot.ext/META-INF/MANIFEST.MF
trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/log4j.xml
trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/SWTEclipseExt.java
trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/SWTTestExt.java
trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/types/EntityType.java
trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/types/ViewType.java
Log:
Ongoing update of Hibernate SWTBot tests and SWTBotExt
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 2009-12-01
10:56:05 UTC (rev 18944)
+++
trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/META-INF/MANIFEST.MF 2009-12-01
15:58:29 UTC (rev 18945)
@@ -14,7 +14,9 @@
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",
- org.jboss.tools.ui.bot.ext;bundle-version="1.0.0"
+ org.jboss.tools.ui.bot.ext;bundle-version="1.0.0",
+ org.eclipse.jdt.ui
Bundle-ActivationPolicy: lazy
Bundle-RequiredExecutionEnvironment: J2SE-1.5
Eclipse-RegisterBuddy: org.apache.log4j
+Import-Package: org.eclipse.jdt.internal.ui
Added:
trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/resources/drv/hsqldb.jar
===================================================================
(Binary files differ)
Property changes on:
trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/resources/drv/hsqldb.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Modified: trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/src/log4j.xml
===================================================================
---
trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/src/log4j.xml 2009-12-01
10:56:05 UTC (rev 18944)
+++
trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/src/log4j.xml 2009-12-01
15:58:29 UTC (rev 18945)
@@ -6,8 +6,13 @@
<appender name="consoleAppender"
class="org.apache.log4j.ConsoleAppender">
<param name="Target" value="System.out" />
<layout class="org.apache.log4j.PatternLayout">
+ <!--
<param name="ConversionPattern"
value="%d{dd MMM yyyy HH:mm:ss.SSS} - %25t - %-5p - %30c{1} - (%C{1}.java:%L) -
%m%n" />
+ -->
+ <param name="ConversionPattern"
+ value="(%C{1}.java:%L) - %m%n" />
+
</layout>
</appender>
Modified:
trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/src/org/jboss/tools/hibernate/ui/bot/testcase/ConfigurationFileTest.java
===================================================================
---
trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/src/org/jboss/tools/hibernate/ui/bot/testcase/ConfigurationFileTest.java 2009-12-01
10:56:05 UTC (rev 18944)
+++
trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/src/org/jboss/tools/hibernate/ui/bot/testcase/ConfigurationFileTest.java 2009-12-01
15:58:29 UTC (rev 18945)
@@ -10,20 +10,61 @@
******************************************************************************/
package org.jboss.tools.hibernate.ui.bot.testcase;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swtbot.eclipse.finder.matchers.WidgetMatcherFactory;
import org.eclipse.swtbot.swt.finder.junit.SWTBotJunit4ClassRunner;
+import org.eclipse.swtbot.swt.finder.widgets.SWTBotCheckBox;
+import org.eclipse.swtbot.swt.finder.widgets.SWTBotShell;
+import org.hamcrest.Matcher;
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.types.EntityType;
+import org.jboss.tools.ui.bot.ext.types.IDELabel;
+import org.junit.AfterClass;
+import org.junit.BeforeClass;
import org.junit.Test;
import org.junit.runner.RunWith;
@RunWith(SWTBotJunit4ClassRunner.class)
public class ConfigurationFileTest extends HibernateTest {
+ @BeforeClass
+ public static void setUp() {
+ HibernateTest.createProject();
+ }
+
+ @AfterClass
+ public static void tearDown() {
+ HibernateTest.clean();
+ }
+
/**
- * TC 02
+ * TC 02 - Create Hibernate Configuration file with predefined variables
*/
@Test
public void createFile() {
+ eclipse.createNew(EntityType.HIBERNATE_CONFIGURATION_FILE);
+
+ eclipse.selectTreeLocation(Project.PROJECT_NAME,"src");
+ bot.textWithLabel(IDELabel.HBConfigurationWizard.FILE_NAME).setText(Project.CONF_FILE_NAME2);
+ bot.button(IDELabel.Button.NEXT).click();
+ // Create new configuration file
+ bot.comboBoxWithLabel(IDELabel.HBConsoleWizard.DATABASE_DIALECT).setSelection(Project.DB_DIALECT);
+ bot.comboBoxWithLabel(IDELabel.HBConsoleWizard.DRIVER_CLASS).setSelection(Project.DRIVER_CLASS);
+ bot.comboBoxWithLabel(IDELabel.HBConsoleWizard.CONNECTION_URL).setText(Project.JDBC_STRING);
+
+ // Create console configuration
+ Matcher<Button> matcher =
WidgetMatcherFactory.withText(IDELabel.HBConsoleWizard.CREATE_CONSOLE_CONFIGURATION);
+ Button button = bot.widget(matcher);
+ SWTBotCheckBox cb = new SWTBotCheckBox(button);
+
+ if (!cb.isChecked())
+ cb.click();
+
+ SWTBotShell shell = bot.activeShell();
+ bot.button(IDELabel.Button.FINISH).click();
+ eclipse.waitForClosedShell(shell);
}
/**
@@ -31,7 +72,7 @@
*/
@Test
public void editFile() {
-
+ // TODO
}
}
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 2009-12-01
10:56:05 UTC (rev 18944)
+++
trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/src/org/jboss/tools/hibernate/ui/bot/testcase/ConsoleTest.java 2009-12-01
15:58:29 UTC (rev 18945)
@@ -11,59 +11,112 @@
package org.jboss.tools.hibernate.ui.bot.testcase;
import org.eclipse.swtbot.swt.finder.junit.SWTBotJunit4ClassRunner;
+import org.eclipse.swtbot.swt.finder.widgets.SWTBotShell;
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.types.EntityType;
+import org.jboss.tools.ui.bot.ext.types.IDELabel;
+import org.junit.AfterClass;
+import org.junit.BeforeClass;
import org.junit.Test;
import org.junit.runner.RunWith;
@RunWith(SWTBotJunit4ClassRunner.class)
public class ConsoleTest extends HibernateTest {
+ @BeforeClass
+ public static void setUp() {
+ HibernateTest.createProject();
+ }
+
+ @AfterClass
+ public static void tearDown() {
+ HibernateTest.clean();
+ }
+
+ private SWTBotShell mainShell;
+
/**
- * TC 03
+ * Create console TestCases TC03 - TC16
*/
@Test
- public void createMainTab() {
-
+ public void createConsole() {
+ packageExplorer.selectProject(Project.PROJECT_NAME);
+ eclipse.createNew(EntityType.HIBERNATE_CONSOLE);
+
+ createMainTab();
+ mainShell.activate();
+ createOptionTab();
+ createClasspathTab();
+ createMappingsTab();
+ createCommonTab();
+
+ bot.button(IDELabel.Button.FINISH).click();
}
+
+ /**
+ * TC 03
+ */
+ private void createMainTab() {
+ bot.cTabItem(IDELabel.HBConsoleWizard.MAIN_TAB).activate();
+ bot.textWithLabelInGroup("",IDELabel.HBConsoleWizard.PROJECT_GROUP
).setText(Project.PROJECT_NAME);
+ mainShell = bot.activeShell();
+
+ // Create new configuration file
+ bot.buttonInGroup(IDELabel.HBConsoleWizard.SETUP_BUTTON,IDELabel.HBConsoleWizard.CONFIGURATION_FILE_GROUP).click();
+ bot.button(IDELabel.HBConsoleWizard.CREATE_NEW_BUTTON).click();
+ eclipse.selectTreeLocation(Project.PROJECT_NAME, "src");
+ eclipse.button(IDELabel.Button.NEXT).click();
+ bot.comboBoxWithLabel(IDELabel.HBConsoleWizard.DATABASE_DIALECT).setSelection(Project.DB_DIALECT);
+ bot.comboBoxWithLabel(IDELabel.HBConsoleWizard.DRIVER_CLASS).setSelection(Project.DRIVER_CLASS);
+ bot.comboBoxWithLabel(IDELabel.HBConsoleWizard.CONNECTION_URL).setText(Project.JDBC_STRING);
+
+ SWTBotShell shell = bot.activeShell();
+ bot.button(IDELabel.Button.FINISH).click();
+ eclipse.waitForClosedShell(shell);
+ }
/**
* TC 04
*/
- @Test
- public void createOptionTab() {
+ private void createOptionTab() {
+ mainShell.activate();
+ bot.cTabItem(IDELabel.HBConsoleWizard.OPTIONS_TAB).activate();
+
+ bot.comboBoxWithLabelInGroup("",
IDELabel.HBConsoleWizard.DATABASE_DIALECT).setSelection(Project.DB_DIALECT);
}
/**
* TC 05
*/
- @Test
- public void createClasspathTab() {
-
+ private void createClasspathTab() {
+ mainShell.activate();
+ bot.cTabItem(IDELabel.HBConsoleWizard.CLASSPATH_TAB).activate();
}
/**
* TC 06
*/
- @Test
- public void createMappingsTab() {
-
+ private void createMappingsTab() {
+ mainShell.activate();
+ bot.cTabItem(IDELabel.HBConsoleWizard.MAPPINGS_TAB).activate();
}
/**
* TC 07
*/
- @Test
- public void createCommonTab() {
-
+ private void createCommonTab() {
+ mainShell.activate();
+ bot.cTabItem(IDELabel.HBConsoleWizard.COMMON_TAB).activate();
}
/**
* TC 16
*/
- @Test
+ @Test
public void editConsole() {
-
+ // TODO
}
}
Modified:
trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/src/org/jboss/tools/hibernate/ui/bot/testcase/MappingFileTest.java
===================================================================
---
trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/src/org/jboss/tools/hibernate/ui/bot/testcase/MappingFileTest.java 2009-12-01
10:56:05 UTC (rev 18944)
+++
trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/src/org/jboss/tools/hibernate/ui/bot/testcase/MappingFileTest.java 2009-12-01
15:58:29 UTC (rev 18945)
@@ -37,7 +37,12 @@
/**
* TC 01 - Create Hibernate Mapping file (when package is selected)
- */
+ * Create new .hbm.xml
+ * ASSERT: No exception
+ * Select Class to map
+ * ASSERT: .hbm.xml must appears in JBoss Editor
+ * Note: 2 Way check Created from package and classes
+ */
@Test
public void createFile() {
createFilesFromPackage();
Modified:
trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/src/org/jboss/tools/hibernate/ui/bot/testcase/ReverseEngineerFileTest.java
===================================================================
---
trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/src/org/jboss/tools/hibernate/ui/bot/testcase/ReverseEngineerFileTest.java 2009-12-01
10:56:05 UTC (rev 18944)
+++
trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/src/org/jboss/tools/hibernate/ui/bot/testcase/ReverseEngineerFileTest.java 2009-12-01
15:58:29 UTC (rev 18945)
@@ -12,6 +12,8 @@
import org.eclipse.swtbot.swt.finder.junit.SWTBotJunit4ClassRunner;
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.types.EntityType;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -23,7 +25,12 @@
*/
@Test
public void createFile() {
-
+ // Create
+ eclipse.createNew(EntityType.HIBERNATE_REVERSE_FILE);
+
+
+ packageExplorer.selectProject(Project.PROJECT_NAME);
+
}
/**
Modified:
trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/src/org/jboss/tools/hibernate/ui/bot/testsuite/HibernateAllTests.java
===================================================================
---
trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/src/org/jboss/tools/hibernate/ui/bot/testsuite/HibernateAllTests.java 2009-12-01
10:56:05 UTC (rev 18944)
+++
trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/src/org/jboss/tools/hibernate/ui/bot/testsuite/HibernateAllTests.java 2009-12-01
15:58:29 UTC (rev 18945)
@@ -10,6 +10,8 @@
******************************************************************************/
package org.jboss.tools.hibernate.ui.bot.testsuite;
+import org.jboss.tools.hibernate.ui.bot.testcase.ConfigurationFileTest;
+import org.jboss.tools.hibernate.ui.bot.testcase.ConsoleTest;
import org.jboss.tools.hibernate.ui.bot.testcase.MappingFileTest;
import org.junit.AfterClass;
import org.junit.BeforeClass;
@@ -18,12 +20,22 @@
import org.junit.runners.Suite.SuiteClasses;
@RunWith(Suite.class)
-@SuiteClasses( { /*CodeGenerationLauncherTest.class,
- ConfigurationContextTest.class, ConfigurationFileTest.class,
- ConsolePerspectiveTest.class, ConsoleTest.class,
- CriteriaEditorsTest.class, DaliTest.class, JIRATest.class,*/
- MappingFileTest.class/*, MappingsDiagramTest.class,
- ReverseEngineerFileTest.class, ViewsTest.class */})
+/* CodeGenerationLauncherTest.class,
+ ConfigurationContextTest.class,
+ ConfigurationFileTest.class,
+ ConsolePerspectiveTest.class,
+ ConsoleTest.class,
+ CriteriaEditorsTest.class,
+ DaliTest.class,
+ JIRATest.class,
+ MappingFileTest.class,
+ MappingsDiagramTest.class,
+ ReverseEngineerFileTest.class, ViewsTest.class */
+
+@SuiteClasses( { ConfigurationFileTest.class,
+ ConsoleTest.class,
+ MappingFileTest.class})
+
public class HibernateAllTests extends HibernateTest {
@BeforeClass
Modified:
trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/src/org/jboss/tools/hibernate/ui/bot/testsuite/HibernateTest.java
===================================================================
---
trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/src/org/jboss/tools/hibernate/ui/bot/testsuite/HibernateTest.java 2009-12-01
10:56:05 UTC (rev 18944)
+++
trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/src/org/jboss/tools/hibernate/ui/bot/testsuite/HibernateTest.java 2009-12-01
15:58:29 UTC (rev 18945)
@@ -10,38 +10,43 @@
******************************************************************************/
package org.jboss.tools.hibernate.ui.bot.testsuite;
+import static org.junit.Assert.fail;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.nio.channels.FileChannel;
+
+import org.eclipse.core.runtime.Platform;
import org.jboss.tools.hibernate.ui.bot.testcase.Activator;
import org.jboss.tools.ui.bot.ext.SWTTestExt;
import org.jboss.tools.ui.bot.ext.entity.JavaClassEntity;
import org.jboss.tools.ui.bot.ext.entity.JavaProjectEntity;
import org.jboss.tools.ui.bot.ext.types.IDELabel;
import org.jboss.tools.ui.bot.ext.types.PerspectiveType;
+import org.jboss.tools.ui.bot.ext.types.ViewType;
public class HibernateTest extends SWTTestExt {
- private static boolean prepared = false;
+ private static boolean finished = false;
+ private static boolean classesCreated = false;
+ private static boolean projectCreated = false;
+
//private static Properties properties;
+
+
- public static void prepare() {
-
- if (prepared == true)
- return;
+ public static void prepare() {
+ createProject();
+ createClasses();
+ }
+
+ public static void createClasses() {
- log.info("Hibernate test preparation started");
- // Load project properties (not needed yet)
- // loadProperties(Activator.PLUGIN_ID);
+ if (classesCreated) return;
- // Show perspective and view
- eclipse.closeView(IDELabel.View.WELCOME);
- eclipse.openPerspective(PerspectiveType.JAVA);
-
- // Create needed project
- // Prepare entity
- JavaProjectEntity projectEntity = new JavaProjectEntity();
- projectEntity.setProjectName(Project.PROJECT_NAME);
- eclipse.createJavaProject(projectEntity);
-
- // Create classes
// Class 1
JavaClassEntity classEntity = new JavaClassEntity();
classEntity.setClassName(Project.CLASS1);
@@ -55,12 +60,74 @@
eclipse.createJavaClass(classEntity);
eclipse.setClassContentFromResource(Activator.PLUGIN_ID, "src",
Project.PACKAGE_NAME, Project.CLASS2+".java");
- prepared = true;
- log.info("Hibernate test preparation finished");
+ classesCreated = true;
}
+
+ public static void createProject() {
+
+ if (projectCreated) return;
+
+ eclipse.showView(ViewType.PACKAGE_EXPLORER);
+ bot.activeView();
+
+ System.out.println("View Activated");
+
+ // Show perspective and view
+ eclipse.closeView(IDELabel.View.WELCOME);
+ eclipse.openPerspective(PerspectiveType.JAVA);
- public static void clean() {
+ // Create needed project
+ // Prepare entity
+ JavaProjectEntity projectEntity = new JavaProjectEntity();
+ projectEntity.setProjectName(Project.PROJECT_NAME);
+ eclipse.createJavaProject(projectEntity);
+
+ // add HSQLDB Driver
+ addDriver();
+
+ projectCreated = true;
+ }
+
+ public static void addDriver() {
+ try {
+ addDriverIntoProject();
+ } catch (FileNotFoundException e) {
+ fail(e.getMessage());
+ } catch (IOException e) {
+ fail(e.getMessage());
+ }
+ addDriverClassPath();
+ }
+
+ public static void addDriverClassPath() {
+ // TODO add hsqldb into classpath
+ }
+
+ /**
+ * Add HSQLDB driver into project
+ * @throws FileNotFoundException
+ * @throws IOException
+ */
+ public static void addDriverIntoProject() throws FileNotFoundException, IOException {
+ File in = util.getResourceFile(Activator.PLUGIN_ID,
"drv","hsqldb.jar");
+ File out = new File(Platform.getLocation() + File.separator + Project.PROJECT_NAME +
File.separator + "hsqldb.jar");
+
+ FileChannel inChannel = null;
+ FileChannel outChannel = null;
+
+ inChannel = new FileInputStream(in).getChannel();
+ outChannel = new FileOutputStream(out).getChannel();
+
+ inChannel.transferTo(0, inChannel.size(), outChannel);
+
+ if (inChannel != null) inChannel.close();
+ if (outChannel != null) outChannel.close();
+ }
+
+ public static void clean() {
+ if (finished) return;
+
log.info("Clean finished");
bot.sleep(TIME_10S);
}
-}
+}
\ No newline at end of file
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 2009-12-01
10:56:05 UTC (rev 18944)
+++
trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/src/org/jboss/tools/hibernate/ui/bot/testsuite/Project.java 2009-12-01
15:58:29 UTC (rev 18945)
@@ -20,5 +20,10 @@
public static final String CLASS2 = "Order";
public static final String PACKAGE_NAME = "org.jboss.hibernate.test";
public static final String PROJECT_NAME = "HibernateTest";
+ public static final String DB_DIALECT = "HSQL";
+ public static final String DRIVER_CLASS = "org.hsqldb.jdbcDriver";
+ public static final String JDBC_STRING =
"jdbc:hsqldb:hsql://localhost/hbtestdb";
+ public static final String HSQLDB_PATH = "/home/jpeterka/lib/hsqldb";
+ public static final String CONF_FILE_NAME2 = "hibernate2.cfg.xml";
}
Modified: trunk/jst/tests/org.jboss.tools.ui.bot.ext/META-INF/MANIFEST.MF
===================================================================
--- trunk/jst/tests/org.jboss.tools.ui.bot.ext/META-INF/MANIFEST.MF 2009-12-01 10:56:05
UTC (rev 18944)
+++ trunk/jst/tests/org.jboss.tools.ui.bot.ext/META-INF/MANIFEST.MF 2009-12-01 15:58:29
UTC (rev 18945)
@@ -21,5 +21,6 @@
Export-Package: org.jboss.tools.ui.bot.ext,
org.jboss.tools.ui.bot.ext.entity,
org.jboss.tools.ui.bot.ext.helper,
- org.jboss.tools.ui.bot.ext.types
+ org.jboss.tools.ui.bot.ext.types,
+ org.jboss.tools.ui.bot.ext.view
Added: trunk/jst/tests/org.jboss.tools.ui.bot.ext/build.xml
===================================================================
--- trunk/jst/tests/org.jboss.tools.ui.bot.ext/build.xml (rev 0)
+++ trunk/jst/tests/org.jboss.tools.ui.bot.ext/build.xml 2009-12-01 15:58:29 UTC (rev
18945)
@@ -0,0 +1,94 @@
+<?xml version="1.0" encoding="UTF-8"
standalone="no"?>
+<!-- WARNING: Eclipse auto-generated file.
+ Any modifications will be overwritten.
+ To include a user specific buildfile here, simply create one in the same
+ directory with the processing instruction <?eclipse.ant.import?>
+ as the first entry and export the buildfile again. -->
+<project basedir="." default="build"
name="org.jboss.tools.ui.bot.ext">
+ <property environment="env"/>
+ <property name="ECLIPSE_HOME"
value="../../../ide/jbt/eclipse"/>
+ <property name="org.jboss.tools.hibernate.ui.bot.test.location"
value="../org.jboss.tools.hibernate.ui.bot.test"/>
+ <property name="debuglevel" value="source,lines,vars"/>
+ <property name="target" value="1.5"/>
+ <property name="source" value="1.5"/>
+ <path id="Plug-in Dependencies.libraryclasspath">
+ <pathelement
location="${ECLIPSE_HOME}/plugins/org.eclipse.ui_3.5.1.M20090902-1000.jar"/>
+ <pathelement
location="${ECLIPSE_HOME}/plugins/org.eclipse.swt_3.5.1.v3555a.jar"/>
+ <pathelement
location="${ECLIPSE_HOME}/plugins/org.eclipse.swt.gtk.linux.x86_64_3.5.1.v3555a.jar"/>
+ <pathelement
location="${ECLIPSE_HOME}/plugins/org.jboss.tools.xulrunner.initializer_1.1.0.v200911050315N-H55-GA.jar"/>
+ <pathelement
location="${ECLIPSE_HOME}/plugins/org.eclipse.jface_3.5.1.M20090826-0800.jar"/>
+ <pathelement
location="${ECLIPSE_HOME}/plugins/org.eclipse.core.commands_3.5.0.I20090525-2000.jar"/>
+ <pathelement
location="${ECLIPSE_HOME}/plugins/org.eclipse.ui.workbench_3.5.1.M20090826-0800a.jar"/>
+ <pathelement
location="${ECLIPSE_HOME}/plugins/org.eclipse.core.runtime_3.5.0.v20090525.jar"/>
+ <pathelement
location="${ECLIPSE_HOME}/plugins/org.eclipse.osgi_3.5.1.R35x_v20090827.jar"/>
+ <pathelement
location="${ECLIPSE_HOME}/plugins/javax.transaction_1.1.1.v200909161740.jar"/>
+ <pathelement
location="${ECLIPSE_HOME}/plugins/org.eclipse.persistence.jpa.equinox.weaving_1.1.2.v20090612-r4475.jar"/>
+ <pathelement
location="${ECLIPSE_HOME}/plugins/org.eclipse.equinox.common_3.5.1.R35x_v20090807-1100.jar"/>
+ <pathelement
location="${ECLIPSE_HOME}/plugins/org.eclipse.core.jobs_3.4.100.v20090429-1800.jar"/>
+ <pathelement
location="${ECLIPSE_HOME}/plugins/org.eclipse.core.runtime.compatibility.registry_3.2.200.v20090429-1800/runtime_registry_compatibility.jar"/>
+ <pathelement
location="${ECLIPSE_HOME}/plugins/org.eclipse.equinox.registry_3.4.100.v20090520-1800.jar"/>
+ <pathelement
location="${ECLIPSE_HOME}/plugins/org.eclipse.equinox.preferences_3.2.300.v20090520-1800.jar"/>
+ <pathelement
location="${ECLIPSE_HOME}/plugins/org.eclipse.core.contenttype_3.4.1.R35x_v20090826-0451.jar"/>
+ <pathelement
location="${ECLIPSE_HOME}/plugins/org.eclipse.equinox.app_1.2.0.v20090520-1800.jar"/>
+ <pathelement
location="${ECLIPSE_HOME}/plugins/org.eclipse.swtbot.eclipse.core_2.0.0.433-dev-e35.jar"/>
+ <pathelement
location="${ECLIPSE_HOME}/plugins/org.eclipse.swtbot.eclipse.finder_2.0.0.433-dev-e35.jar"/>
+ <pathelement
location="${ECLIPSE_HOME}/plugins/org.eclipse.swtbot.eclipse.spy_2.0.0.433-dev-e35.jar"/>
+ <pathelement
location="${ECLIPSE_HOME}/plugins/org.eclipse.swtbot.eclipse.ui_2.0.0.433-dev-e35.jar"/>
+ <pathelement
location="${ECLIPSE_HOME}/plugins/org.eclipse.swtbot.junit4_x_2.0.0.433-dev-e35.jar"/>
+ <pathelement
location="${ECLIPSE_HOME}/plugins/org.eclipse.swtbot.swt.finder_2.0.0.433-dev-e35.jar"/>
+ <pathelement
location="${ECLIPSE_HOME}/plugins/org.hamcrest_1.1.0.v20090501071000.jar"/>
+ <pathelement
location="${ECLIPSE_HOME}/plugins/org.hamcrest.core_1.1.0.v20090501071000.jar"/>
+ <pathelement
location="${ECLIPSE_HOME}/plugins/org.hamcrest.library_1.1.0.v20090501071000.jar"/>
+ <pathelement
location="${ECLIPSE_HOME}/plugins/org.hamcrest.integration_1.1.0.v20090501071000.jar"/>
+ <pathelement
location="${ECLIPSE_HOME}/plugins/org.hamcrest.text_1.1.0.v20090501071000.jar"/>
+ <pathelement
location="${ECLIPSE_HOME}/plugins/org.junit4_4.5.0.v20090824/junit.jar"/>
+ <pathelement
location="${ECLIPSE_HOME}/plugins/org.apache.log4j_1.2.13.v200903072027.jar"/>
+ </path>
+ <path id="org.jboss.tools.ui.bot.ext.classpath">
+ <path refid="Plug-in Dependencies.libraryclasspath"/>
+ <pathelement location="bin"/>
+ </path>
+ <target name="init">
+ <mkdir dir="bin"/>
+ <copy includeemptydirs="false" todir="bin">
+ <fileset dir="src">
+ <exclude name="**/*.launch"/>
+ <exclude name="**/*.java"/>
+ </fileset>
+ </copy>
+ </target>
+ <target name="clean">
+ <delete dir="bin"/>
+ </target>
+ <target depends="clean" name="cleanall"/>
+ <target depends="build-subprojects,build-project"
name="build"/>
+ <target name="build-subprojects"/>
+ <target depends="init" name="build-project">
+ <echo message="${ant.project.name}: ${ant.file}"/>
+ <javac debug="true" debuglevel="${debuglevel}"
destdir="bin" source="${source}" target="${target}">
+ <src path="src"/>
+ <classpath refid="org.jboss.tools.ui.bot.ext.classpath"/>
+ </javac>
+ </target>
+ <target description="Build all projects which reference this project. Useful
to propagate changes." name="build-refprojects">
+ <ant
antfile="${org.jboss.tools.hibernate.ui.bot.test.location}/build.xml"
dir="${org.jboss.tools.hibernate.ui.bot.test.location}"
inheritAll="false" target="clean"/>
+ <ant
antfile="${org.jboss.tools.hibernate.ui.bot.test.location}/build.xml"
dir="${org.jboss.tools.hibernate.ui.bot.test.location}"
inheritAll="false" target="build">
+ <propertyset>
+ <propertyref name="build.compiler"/>
+ </propertyset>
+ </ant>
+ </target>
+ <target description="copy Eclipse compiler jars to ant lib directory"
name="init-eclipse-compiler">
+ <copy todir="${ant.library.dir}">
+ <fileset dir="${ECLIPSE_HOME}/plugins"
includes="org.eclipse.jdt.core_*.jar"/>
+ </copy>
+ <unzip dest="${ant.library.dir}">
+ <patternset includes="jdtCompilerAdapter.jar"/>
+ <fileset dir="${ECLIPSE_HOME}/plugins"
includes="org.eclipse.jdt.core_*.jar"/>
+ </unzip>
+ </target>
+ <target description="compile project with Eclipse compiler"
name="build-eclipse-compiler">
+ <property name="build.compiler"
value="org.eclipse.jdt.core.JDTCompilerAdapter"/>
+ <antcall target="build"/>
+ </target>
+</project>
Modified: trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/log4j.xml
===================================================================
--- trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/log4j.xml 2009-12-01 10:56:05 UTC (rev
18944)
+++ trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/log4j.xml 2009-12-01 15:58:29 UTC (rev
18945)
@@ -6,8 +6,12 @@
<appender name="consoleAppender"
class="org.apache.log4j.ConsoleAppender">
<param name="Target" value="System.out" />
<layout class="org.apache.log4j.PatternLayout">
+ <!-- <param name="ConversionPattern"
+ value="%d{dd MMM yyyy HH:mm:ss.SSS} - %25t - %-5p - %30c{1} - (%C{1}.java:%L) -
%m%n" />
+ -->
<param name="ConversionPattern"
- value="%d{dd MMM yyyy HH:mm:ss.SSS} - %25t - %-5p - %30c{1} - (%C{1}.java:%L) -
%m%n" />
+ value="%d{HH:mm:ss} - (%C{1}.java:%L) - %m%n" />
+
</layout>
</appender>
Modified:
trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/SWTEclipseExt.java
===================================================================
---
trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/SWTEclipseExt.java 2009-12-01
10:56:05 UTC (rev 18944)
+++
trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/SWTEclipseExt.java 2009-12-01
15:58:29 UTC (rev 18945)
@@ -14,13 +14,14 @@
import static org.junit.Assert.assertEquals;
import java.io.File;
-import java.util.logging.Logger;
+import org.apache.log4j.Logger;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swtbot.eclipse.finder.matchers.WidgetMatcherFactory;
import org.eclipse.swtbot.eclipse.finder.waits.Conditions;
import org.eclipse.swtbot.eclipse.finder.widgets.SWTBotEclipseEditor;
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.hamcrest.Matcher;
import org.jboss.tools.ui.bot.ext.entity.JavaClassEntity;
@@ -35,14 +36,14 @@
* @author jpeterka
*
*/
-public class SWTEclipseExt {
+public class SWTEclipseExt extends SWTBotExt{
SWTBotExt bot = new SWTBotExt();
SWTUtilExt util = new SWTUtilExt();
- Logger log = Logger.getLogger(SWTEclipseExt.class.getName());
+ Logger log = Logger.getLogger(SWTEclipseExt.class);
// ------------------------------------------------------------
- // Additional missing or more advance methods
+ // View related methods
// ------------------------------------------------------------
/**
* Close view by text
@@ -64,7 +65,9 @@
}
-
+ // ------------------------------------------------------------
+ // Perspective related methods
+ // ------------------------------------------------------------
/**
* Open Perspective
*
@@ -82,12 +85,15 @@
bot.table().select(perspectiveLabel);
// Another approach
- // SWTBotShell openPerpectiveShell = bot.shell("Open Perspective");
- // openPerpectiveShell.activate();
+ SWTBotShell openPerpectiveShell = bot.shell("Open Perspective");
+ openPerpectiveShell.activate();
bot.button(IDELabel.Button.OK).click();
}
+ // ------------------------------------------------------------
+ // Create related methods
+ // ------------------------------------------------------------
/**
* Create Java Project desribed with propriate entity
* @param entity
@@ -107,6 +113,9 @@
util.waitForNonIgnoredJobs();
}
+ // ------------------------------------------------------------
+ // Create related methods
+ // ------------------------------------------------------------
/**
* Create new Java Class described with JavaClassEntity
* @param entity
@@ -164,7 +173,27 @@
log.info("File Opened:" + builder.toString());
}
+ // ------------------------------------------------------------
+ // Navigation related
+ // ------------------------------------------------------------
+ /**
+ * Select element in tree
+ */
+ public void selectTreeLocation(String... path) {
+ SWTBotTreeItem item = null;
+ // Go through path
+ for ( String nodeName: path ) {
+ if ( item == null ) {
+ item = bot.tree().expandNode(nodeName);
+ } else {
+ item = item.expandNode(nodeName);
+ }
+ log.info(nodeName);
+ }
+ item.select();
+ }
+
// ------------------------------------------------------------
// Subroutines
// ------------------------------------------------------------
@@ -192,6 +221,7 @@
Matcher<Shell> matcher = WidgetMatcherFactory
.withText(shellName);
bot.waitUntil(Conditions.waitForShell(matcher));
+
}
/**
@@ -199,8 +229,15 @@
* @param shellName
*/
public void waitForClosedShell(String shellName) {
- bot.waitWhile(Conditions.shellIsActive(shellName));
+ bot.waitWhile(Conditions.shellIsActive(shellName));
}
+
+ public void waitForClosedShell(SWTBotShell shell) {
+ while (shell.isActive()) {
+ bot.sleep(200);
+ log.info("Waiting for closing shell...");
+ }
+ }
/**
* Assert same content of file in project explorer with content of file in resources
Modified:
trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/SWTTestExt.java
===================================================================
---
trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/SWTTestExt.java 2009-12-01
10:56:05 UTC (rev 18944)
+++
trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/SWTTestExt.java 2009-12-01
15:58:29 UTC (rev 18945)
@@ -13,6 +13,7 @@
import java.util.Properties;
import org.apache.log4j.Logger;
+import org.jboss.tools.ui.bot.ext.view.PackageExplorer;
/**
* Base class for SWTBot Tests using SWTBotExt
@@ -21,10 +22,15 @@
*/
public class SWTTestExt {
- public static Logger log = Logger.getLogger(SWTTestExt.class);
- public static SWTBotExt bot = new SWTBotExt();
- public static SWTUtilExt util = new SWTUtilExt();
- public static SWTEclipseExt eclipse = new SWTEclipseExt();
+ public static final Logger log = Logger.getLogger(SWTTestExt.class);
+ public static final SWTBotExt bot = new SWTBotExt();
+ public static final SWTUtilExt util = new SWTUtilExt();
+ public static final SWTEclipseExt eclipse = new SWTEclipseExt();
+ public static final SWTDebugExt debug = new SWTDebugExt();
+
+ // Views
+ public static final PackageExplorer packageExplorer = new PackageExplorer();
+
private static Properties properties;
/**
Modified:
trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/types/EntityType.java
===================================================================
---
trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/types/EntityType.java 2009-12-01
10:56:05 UTC (rev 18944)
+++
trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/types/EntityType.java 2009-12-01
15:58:29 UTC (rev 18945)
@@ -17,7 +17,8 @@
* @author jpeterka
*/
public enum EntityType {
- HIBERNATE_MAPPING_FILE, JAVA_PROJECT, JAVA_CLASS;
+ HIBERNATE_MAPPING_FILE, JAVA_PROJECT, JAVA_CLASS, HIBERNATE_REVERSE_FILE,
HIBERNATE_CONSOLE,
+ HIBERNATE_CONFIGURATION_FILE;
public String getGroupLabel() {
String groupLabel = "";
@@ -26,7 +27,10 @@
switch (this) {
case HIBERNATE_MAPPING_FILE: groupLabel = IDELabel.EntityGroup.HIBERNATE; break;
case JAVA_PROJECT: groupLabel = IDELabel.EntityGroup.JAVA; break;
- case JAVA_CLASS: groupLabel = IDELabel.EntityGroup.JAVA; break;
+ case JAVA_CLASS: groupLabel = IDELabel.EntityGroup.JAVA; break;
+ case HIBERNATE_REVERSE_FILE: groupLabel = IDELabel.EntityGroup.HIBERNATE; break;
+ case HIBERNATE_CONFIGURATION_FILE: groupLabel = IDELabel.EntityGroup.HIBERNATE; break;
+ case HIBERNATE_CONSOLE: groupLabel = IDELabel.EntityGroup.HIBERNATE; break;
default: fail("Unknown Entity Type");
}
@@ -42,6 +46,9 @@
switch (this) {
case HIBERNATE_MAPPING_FILE: entityLabel = IDELabel.EntityLabel.HIBERNATE_MAPPING_FILE;
break;
+ case HIBERNATE_REVERSE_FILE: entityLabel = IDELabel.EntityLabel.HIBERNATE_REVERSE_FILE;
break;
+ case HIBERNATE_CONFIGURATION_FILE: entityLabel =
IDELabel.EntityLabel.HIBERNATE_CONFIGURATION_FILE; break;
+ case HIBERNATE_CONSOLE: entityLabel = IDELabel.EntityLabel.HIBERNATE_CONSOLE; break;
case JAVA_PROJECT: entityLabel = IDELabel.EntityLabel.JAVA_PROJECT; break;
case JAVA_CLASS: entityLabel = IDELabel.EntityLabel.JAVA_CLASS; break;
default: fail("Unknown Entity Type");
Deleted:
trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/types/IDELabel.java
===================================================================
---
trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/types/IDELabel.java 2009-12-01
10:56:05 UTC (rev 18944)
+++
trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/types/IDELabel.java 2009-12-01
15:58:29 UTC (rev 18945)
@@ -1,141 +0,0 @@
- /*******************************************************************************
- * Copyright (c) 2007-2009 Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at
http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributor:
- * Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-package org.jboss.tools.ui.bot.ext.types;
-
-/**
- * Base label constants for all widgets. Naming convention is (except buttons
- * and menus) based on Eclipse platform class names of each part (e.g.
- * NewJavaProjectWizardPageOne)
- *
- * @author jpeterka
- */
-public class IDELabel {
- public class Menu {
- public static final String FILE = "File";
- public static final String NEW = "New";
- public static final String PROJECT = "Project";
- public static final String OTHER = "Other...";
- public static final String WINDOW = "Window";
- public static final String SHOW_VIEW = "Show View";
- public static final String OPEN_PERSPECTIVE = "Open Perspective";
- public static final String OPEN_WITH = "Open With";
- public static final String TEXT_EDITOR = "Text Editor";
- public static final String EDIT = "Edit";
- public static final String SELECT_ALL = "Select All";
- public static final String JSP_FILE = "JSP File";
- public static final String XHTML_FILE = "XHTML File";
- public static final String CLOSE = "Close";
- public static final String OPEN = "Open";
- public static final String RENAME = "Rename";
- public static final String PROPERTIES = "Properties";
- public static final String HELP = "Help";
- public static final String ABOUT_JBOSS_DEVELOPER_STUDIO = "About JBoss Developer
Studio";
- }
-
- public class Button {
- public static final String NEXT = "Next >";
- public static final String BACK = "< Back";
- public static final String CANCEL = "Cancel";
- public static final String FINISH = "Finish";
- public static final String OK = "OK";
- public static final String YES = "Yes";
- public static final String NO = "No";
- public static final String CLOSE = "Close";
- }
-
- public class Shell {
- public static final String NEW_JAVA_PROJECT = "New Java Project";
- public static final String NEW_JAVA_CLASS = "New Java Class";
- public static final String NEW_HIBERNATE_MAPPING_FILE = "New Hibernate XML Mapping
file (hbm.xml)";
- public static final String NEW = "New";
- public static final String NEW_JSP_FILE = "New File JSP";
- public static final String NEW_XHTML_FILE = "New File XHTML";
- public static final String SAVE_RESOURCE = "Save Resource";
- public static final String RENAME_RESOURCE = "Rename Resource";
- public static final String PROPERTIES = "Properties";
- }
-
- public class EntityGroup {
- public static final String HIBERNATE = "Hibernate";
- public static final String JAVA = "Java";
- public static final String SEAM = "Seam";
- }
-
- public class EntityLabel {
- public static final String HIBERNATE_MAPPING_FILE = "Hibernate XML Mapping file
(hbm.xml)";
- public static final String JAVA_CLASS = "Class";
- public static final String JAVA_PROJECT = "Java Project";
- public static final String SEAM_PROJECT = "Seam Web Project";
- }
-
- public class JavaProjectWizard {
- public static final String PROJECT_NAME = "Project name:";
- }
-
- public class NewClassCreationWizard {
- public static final String CLASS_NAME = "Name:";
- public static final String PACKAGE_NAME = "Package:";
- }
-
- public class ShowViewDialog {
- public static final String JAVA_GROUP = "Java";
- public static final String PROJECT_EXPLORER = "Project Explorer";
-
- }
-
- public class View {
- public static final String WELCOME = "Welcome";
- public static final String PROJECT_EXPLORER = "Project Explorer";
- public static final String PACKAGE_EXPLORER = "Package Explorer";
- }
-
- public class ViewGroup {
- public static final String GENERAL = "General";
- public static final String JAVA = "Java";
- }
-
- public class SelectPerspectiveDialog {
- public static final String JAVA = "Java";
- public static final String HIBERNATE = "Hibernate";
-
- }
-
- public class WebProjectsTree {
- public static final String WEB_CONTENT = "WebContent";
- public static final String TAG_LIBRARIES = "Tag Libraries";
- public static final String RESOURCE_BUNDLES = "Resource Bundles";
- public static final String CONFIGURATION = "Configuration";
- public static final String BEANS = "Beans";
- public static final String TILES = "Tiles";
- public static final String WEB_XML = "web.xml";
- public static final String CONTEXT_PARAMS = "Context Params";
- public static final String JAVAX_FACES_CONFIG_FILES =
"javax.faces.CONFIG_FILES";
- }
-
- public class NewJSPFileDialog {
- public static final String NAME = "Name*";
- public static final String TEMPLATE = "Template";
- public static final String TEMPLATE_JSF_BASE_PAGE = "JSFBasePage";
- }
-
- public class NewXHTMLFileDialog {
- public static final String NAME = "Name*";
- public static final String TEMPLATE = "Template";
- public static final String TEMPLATE_FACELET_FORM_XHTML =
"FaceletForm.xhtml";
- }
- public class RenameResourceDialog {
- public static final String NEW_NAME = "New name:";
- }
- public class PropertiesDialog {
- public static final String PARAM_NAME = "Param-Name";
- public static final String PARAM_VALUE = "Param-Value";
- }
-}
Copied:
trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/types/IDELabel.java
(from rev 18608,
trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/types/Label.java)
===================================================================
---
trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/types/IDELabel.java
(rev 0)
+++
trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/types/IDELabel.java 2009-12-01
15:58:29 UTC (rev 18945)
@@ -0,0 +1,123 @@
+ /*******************************************************************************
+ * Copyright (c) 2007-2009 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at
http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributor:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.ui.bot.ext.types;
+
+/**
+ * Base label constants for all widgets. Naming convention is (except buttons
+ * and menus) based on Eclipse platform class names of each part (e.g.
+ * NewJavaProjectWizardPageOne)
+ *
+ * @author jpeterka
+ */
+public class IDELabel {
+ public class Menu {
+ public static final String FILE = "File";
+ public static final String NEW = "New";
+ public static final String PROJECT = "Project";
+ public static final String OTHER = "Other...";
+ public static final String WINDOW = "Window";
+ public static final String SHOW_VIEW = "Show View";
+ public static final String OPEN_PERSPECTIVE = "Open Perspective";
+ public static final String OPEN_WITH = "Open With";
+ public static final String TEXT_EDITOR = "Text Editor";
+ public static final String EDIT = "Edit";
+ public static final String SELECT_ALL = "Select All";
+ }
+
+ public class Button {
+ public static final String NEXT = "Next >";
+ public static final String BACK = "< Back";
+ public static final String CANCEL = "Cancel";
+ public static final String FINISH = "Finish";
+ public static final String OK = "OK";
+ }
+
+ public class Shell {
+ public static final String NEW_JAVA_PROJECT = "New Java Project";
+ public static final String NEW_JAVA_CLASS = "New Java Class";
+ public static final String NEW_HIBERNATE_MAPPING_FILE = "New Hibernate XML Mapping
file (hbm.xml)";
+ public static final String NEW = "New";
+ }
+
+ public class EntityGroup {
+ public static final String HIBERNATE = "Hibernate";
+ public static final String JAVA = "Java";
+ public static final String SEAM = "Seam";
+ }
+
+ public class EntityLabel {
+ public static final String HIBERNATE_MAPPING_FILE = "Hibernate XML Mapping file
(hbm.xml)";
+ public static final String HIBERNATE_REVERSE_FILE = "Hibernate Reverse Engineering
File(reveng.xml)";
+ public static final String HIBERNATE_CONSOLE = "Hibernate Console
Configuration";
+ public static final String JAVA_CLASS = "Class";
+ public static final String JAVA_PROJECT = "Java Project";
+ public static final String SEAM_PROJECT = "Seam Web Project";
+ public static final String HIBERNATE_CONFIGURATION_FILE = "Hibernate Configuration
File (cfg.xml)";
+ }
+
+ public class JavaProjectWizard {
+ public static final String PROJECT_NAME = "Project name:";
+ }
+
+ public class NewClassCreationWizard {
+ public static final String CLASS_NAME = "Name:";
+ public static final String PACKAGE_NAME = "Package:";
+ }
+
+ public class ShowViewDialog {
+ public static final String JAVA_GROUP = "Java";
+ public static final String PROJECT_EXPLORER = "Project Explorer";
+
+ }
+
+ public class View {
+ public static final String WELCOME = "Welcome";
+ public static final String PROJECT_EXPLORER = "Project Explorer";
+ public static final String PACKAGE_EXPLORER = "Package Explorer";
+ }
+
+ public class ViewGroup {
+ public static final String GENERAL = "General";
+ public static final String JAVA = "Java";
+ }
+
+ public class SelectPerspectiveDialog {
+ public static final String JAVA = "Java";
+ public static final String HIBERNATE = "Hibernate";
+
+ }
+ /**
+ * Hibernate Console Wizard (ConsoleConfigurationCreationWizard) Labels (
+ * @author jpeterka
+ *
+ */
+ public class HBConsoleWizard {
+ public static final String MAIN_TAB = "Main";
+ public static final String OPTIONS_TAB = "Options";
+ public static final String CLASSPATH_TAB = "Classpath";
+ public static final String MAPPINGS_TAB = "Mappings";
+ public static final String COMMON_TAB = "Common";
+ public static final String PROJECT_GROUP = "Project:";
+ public static final String CONFIGURATION_FILE_GROUP = "Configuration file:";
+ public static final String SETUP_BUTTON = "Setup...";
+ public static final String CREATE_NEW_BUTTON = "Create new...";
+ public static final String USE_EXISTING_BUTTON = "Use existing...";
+ public static final String DATABASE_DIALECT = "Database dialect:";
+ public static final String DRIVER_CLASS = "Driver class:";
+ public static final String CONNECTION_URL = "Connection URL:";
+ public static final String USERNAME = "Username:";
+ public static final String CREATE_CONSOLE_CONFIGURATION = "Create a console
configuration";
+ }
+
+ public class HBConfigurationWizard {
+ public static final String FILE_NAME = "File name:";
+ }
+}
Modified:
trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/types/ViewType.java
===================================================================
---
trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/types/ViewType.java 2009-12-01
10:56:05 UTC (rev 18944)
+++
trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/types/ViewType.java 2009-12-01
15:58:29 UTC (rev 18945)
@@ -18,13 +18,14 @@
*
*/
public enum ViewType {
- PROJECT_EXPLORER, WELCOME;
+ PACKAGE_EXPLORER, PROJECT_EXPLORER, WELCOME;
public String getGroupLabel() {
String viewLabel = "";
switch (this) {
case PROJECT_EXPLORER: viewLabel = IDELabel.ViewGroup.GENERAL; break;
+ case PACKAGE_EXPLORER: viewLabel = IDELabel.ViewGroup.JAVA; break;
default: fail("Unknown View Type");
}
return viewLabel;
@@ -34,6 +35,7 @@
String viewLabel = "";
switch (this) {
case PROJECT_EXPLORER: viewLabel = IDELabel.View.PROJECT_EXPLORER; break;
+ case PACKAGE_EXPLORER: viewLabel = IDELabel.View.PACKAGE_EXPLORER; break;
default: fail("Unknown View Type");
}
return viewLabel;
Added:
trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/view/PackageExplorer.java
===================================================================
---
trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/view/PackageExplorer.java
(rev 0)
+++
trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/view/PackageExplorer.java 2009-12-01
15:58:29 UTC (rev 18945)
@@ -0,0 +1,22 @@
+package org.jboss.tools.ui.bot.ext.view;
+
+import org.eclipse.swtbot.swt.finder.SWTBot;
+import org.jboss.tools.ui.bot.ext.SWTBotExt;
+import org.jboss.tools.ui.bot.ext.types.IDELabel;
+
+/**
+ * Class provides bot routines related to Package Explorer View
+ * @author jpeterka
+ *
+ */
+public class PackageExplorer extends SWTBotExt {
+
+ /*
+ * Selects project in Package Explorer
+ */
+ public void selectProject(String projectName) {
+ SWTBot viewBot = viewByTitle(IDELabel.View.PACKAGE_EXPLORER).bot();
+ viewBot.tree().expandNode(projectName).select();
+ }
+
+}