JBoss Tools SVN: r18574 - in trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test: .settings and 13 other directories.
by jbosstools-commits@lists.jboss.org
Author: jpeterka
Date: 2009-11-10 11:48:58 -0500 (Tue, 10 Nov 2009)
New Revision: 18574
Added:
trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/.classpath
trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/.project
trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/.settings/
trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/.settings/org.eclipse.jdt.core.prefs
trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/META-INF/
trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/META-INF/MANIFEST.MF
trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/build.properties
trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/hibernate.cfg.xml
trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/resources/
trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/resources/project.properties
trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/resources/src/
trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/resources/src/org.jboss.hibernate.test/
trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/resources/src/org.jboss.hibernate.test/Customer.java
trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/resources/src/org.jboss.hibernate.test/Order.java
trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/src/
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/
trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/src/org/jboss/
trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/src/org/jboss/tools/
trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/src/org/jboss/tools/hibernate/
trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/src/org/jboss/tools/hibernate/ui/
trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/src/org/jboss/tools/hibernate/ui/bot/
trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/src/org/jboss/tools/hibernate/ui/bot/testcase/
trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/src/org/jboss/tools/hibernate/ui/bot/testcase/Activator.java
trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/src/org/jboss/tools/hibernate/ui/bot/testcase/CodeGenerationLauncherTest.java
trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/src/org/jboss/tools/hibernate/ui/bot/testcase/ConfigurationContextTest.java
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/ConsolePerspectiveTest.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/CriteriaEditorsTest.java
trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/src/org/jboss/tools/hibernate/ui/bot/testcase/DaliTest.java
trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/src/org/jboss/tools/hibernate/ui/bot/testcase/JIRATest.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/MappingsDiagramTest.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/testcase/ViewsTest.java
trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/src/org/jboss/tools/hibernate/ui/bot/testsuite/
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
Log:
Initial commit of skeleton of hibernate tools swtbot tests
Added: trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/.classpath
===================================================================
--- trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/.classpath (rev 0)
+++ trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/.classpath 2009-11-10 16:48:58 UTC (rev 18574)
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry combineaccessrules="false" kind="src" path="/org.jboss.tools.ui.bot.ext"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
Added: trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/.project
===================================================================
--- trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/.project (rev 0)
+++ trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/.project 2009-11-10 16:48:58 UTC (rev 18574)
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.jboss.tools.hibernate.ui.bot.test</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
Added: trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/.settings/org.eclipse.jdt.core.prefs
===================================================================
--- trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/.settings/org.eclipse.jdt.core.prefs (rev 0)
+++ trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/.settings/org.eclipse.jdt.core.prefs 2009-11-10 16:48:58 UTC (rev 18574)
@@ -0,0 +1,8 @@
+#Mon Aug 31 15:12:26 CEST 2009
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+org.eclipse.jdt.core.compiler.compliance=1.5
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.5
Added: 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 (rev 0)
+++ trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/META-INF/MANIFEST.MF 2009-11-10 16:48:58 UTC (rev 18574)
@@ -0,0 +1,20 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: Hibernate Tools SWTBot Tests
+Bundle-SymbolicName: org.jboss.tools.hibernate.ui.bot.test
+Bundle-Version: 1.0.0.qualifier
+Bundle-Activator: org.jboss.tools.hibernate.ui.bot.testcase.Activator
+Require-Bundle: org.eclipse.ui,
+ org.eclipse.core.runtime,
+ org.junit4,
+ org.apache.log4j;bundle-version="1.2.13",
+ 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",
+ org.jboss.tools.ui.bot.ext;bundle-version="1.0.0"
+Bundle-ActivationPolicy: lazy
+Bundle-RequiredExecutionEnvironment: J2SE-1.5
+Eclipse-RegisterBuddy: org.apache.log4j
Added: trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/build.properties
===================================================================
--- trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/build.properties (rev 0)
+++ trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/build.properties 2009-11-10 16:48:58 UTC (rev 18574)
@@ -0,0 +1,5 @@
+source.. = src/,\
+ resources/
+output.. = bin/
+bin.includes = META-INF/,\
+ .
Added: trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/hibernate.cfg.xml
===================================================================
--- trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/hibernate.cfg.xml (rev 0)
+++ trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/hibernate.cfg.xml 2009-11-10 16:48:58 UTC (rev 18574)
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE hibernate-configuration PUBLIC
+ "-//Hibernate/Hibernate Configuration DTD 3.0//EN"
+ "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
+<hibernate-configuration>
+ <session-factory>
+ </session-factory>
+</hibernate-configuration>
Added: trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/resources/project.properties
===================================================================
Added: trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/resources/src/org.jboss.hibernate.test/Customer.java
===================================================================
--- trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/resources/src/org.jboss.hibernate.test/Customer.java (rev 0)
+++ trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/resources/src/org.jboss.hibernate.test/Customer.java 2009-11-10 16:48:58 UTC (rev 18574)
@@ -0,0 +1,11 @@
+package org.jboss.hibernate.test;
+
+import java.util.List;
+
+public class Customer {
+
+ public String name;
+
+ List<Order> order;
+
+}
Added: trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/resources/src/org.jboss.hibernate.test/Order.java
===================================================================
--- trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/resources/src/org.jboss.hibernate.test/Order.java (rev 0)
+++ trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/resources/src/org.jboss.hibernate.test/Order.java 2009-11-10 16:48:58 UTC (rev 18574)
@@ -0,0 +1,22 @@
+package org.jboss.hibernate.test;
+
+public class Order {
+ private long id;
+ private long sum;
+
+ public long getId() {
+ return id;
+ }
+
+ public void setId(long id) {
+ this.id = id;
+ }
+
+ public long getSum() {
+ return sum;
+ }
+
+ public void setSum(long sum) {
+ this.sum = sum;
+ }
+}
Added: 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 (rev 0)
+++ trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/src/log4j.xml 2009-11-10 16:48:58 UTC (rev 18574)
@@ -0,0 +1,60 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
+<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/"
+ debug="false">
+
+ <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" />
+ </layout>
+ </appender>
+
+ <appender name="fileAppender" class="org.apache.log4j.FileAppender">
+ <param name="File" value="/tmp/debug.log" />
+ <param name="Append" value="false" />
+ <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" />
+ </layout>
+ </appender>
+
+ <appender name="asyncAppender" class="org.apache.log4j.AsyncAppender">
+ <appender-ref ref="consoleAppender" />
+ <appender-ref ref="fileAppender" />
+ </appender>
+
+ <!-- don't log matchers, this is very high amount of chatter -->
+ <category name="org.eclipse.swtbot.swt.finder.matchers">
+ <priority value="OFF" />
+ </category>
+
+ <!--
+ don't log widget notification events, this is moderately high chatter
+ -->
+ <category name="org.eclipse.swtbot.swt.finder.widgets">
+ <priority value="OFF" />
+ </category>
+
+ <!-- don't log finders, this is moderate chatter -->
+ <category name="org.eclipse.swtbot.swt.finder.finders">
+ <priority value="DEBUG" />
+ </category>
+
+ <category name="org.eclipse.swtbot.swt.finder.keyboard">
+ <!-- set to a value higher than debug to turn on. -->
+ <priority value="DEBUG" />
+ </category>
+
+ <category name="org.eclipse.swtbot">
+ <priority value="ALL" />
+ </category>
+
+ <root>
+ <priority value="INFO" />
+ <appender-ref ref="consoleAppender" />
+ <appender-ref ref="fileAppender" />
+ </root>
+
+</log4j:configuration>
\ No newline at end of file
Added: trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/src/org/jboss/tools/hibernate/ui/bot/testcase/Activator.java
===================================================================
--- trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/src/org/jboss/tools/hibernate/ui/bot/testcase/Activator.java (rev 0)
+++ trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/src/org/jboss/tools/hibernate/ui/bot/testcase/Activator.java 2009-11-10 16:48:58 UTC (rev 18574)
@@ -0,0 +1,66 @@
+ /*******************************************************************************
+ * 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.hibernate.ui.bot.testcase;
+
+import org.eclipse.ui.plugin.AbstractUIPlugin;
+import org.osgi.framework.BundleContext;
+
+/**
+ * The activator class controls the plug-in life cycle
+ */
+public class Activator extends AbstractUIPlugin {
+
+ // The plug-in ID
+ public static final String PLUGIN_ID = "org.jboss.tools.hibernate.ui.bot.test";
+
+ // The shared instance
+ private static Activator plugin;
+
+ /**
+ * The constructor
+ */
+ public Activator() {
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext
+ * )
+ */
+ public void start(BundleContext context) throws Exception {
+ super.start(context);
+ plugin = this;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext
+ * )
+ */
+ public void stop(BundleContext context) throws Exception {
+ plugin = null;
+ super.stop(context);
+ }
+
+ /**
+ * Returns the shared instance
+ *
+ * @return the shared instance
+ */
+ public static Activator getDefault() {
+ return plugin;
+ }
+
+}
Added: trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/src/org/jboss/tools/hibernate/ui/bot/testcase/CodeGenerationLauncherTest.java
===================================================================
--- trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/src/org/jboss/tools/hibernate/ui/bot/testcase/CodeGenerationLauncherTest.java (rev 0)
+++ trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/src/org/jboss/tools/hibernate/ui/bot/testcase/CodeGenerationLauncherTest.java 2009-11-10 16:48:58 UTC (rev 18574)
@@ -0,0 +1,53 @@
+ /*******************************************************************************
+ * 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.hibernate.ui.bot.testcase;
+
+import org.eclipse.swtbot.swt.finder.junit.SWTBotJunit4ClassRunner;
+import org.jboss.tools.hibernate.ui.bot.testsuite.HibernateTest;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+(a)RunWith(SWTBotJunit4ClassRunner.class)
+public class CodeGenerationLauncherTest extends HibernateTest {
+
+ /**
+ * TC 09
+ */
+ @Test
+ public void fillMainTab() {
+
+ }
+
+ /**
+ * TC 10
+ */
+ @Test
+ public void fillExportersTab() {
+
+ }
+
+ /**
+ * TC 11
+ */
+ @Test
+ public void fillRefreshTab() {
+
+ }
+
+ /**
+ * TC 12
+ */
+ @Test
+ public void fillCommonTab() {
+
+ }
+
+}
Added: trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/src/org/jboss/tools/hibernate/ui/bot/testcase/ConfigurationContextTest.java
===================================================================
--- trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/src/org/jboss/tools/hibernate/ui/bot/testcase/ConfigurationContextTest.java (rev 0)
+++ trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/src/org/jboss/tools/hibernate/ui/bot/testcase/ConfigurationContextTest.java 2009-11-10 16:48:58 UTC (rev 18574)
@@ -0,0 +1,29 @@
+ /*******************************************************************************
+ * 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.hibernate.ui.bot.testcase;
+
+import org.eclipse.swtbot.swt.finder.junit.SWTBotJunit4ClassRunner;
+import org.jboss.tools.hibernate.ui.bot.testsuite.HibernateTest;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+(a)RunWith(SWTBotJunit4ClassRunner.class)
+public class ConfigurationContextTest extends HibernateTest {
+
+ /**
+ * TC 18
+ */
+ @Test
+ public void checkHibernateConfiguration() {
+
+ }
+
+}
Added: 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 (rev 0)
+++ trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/src/org/jboss/tools/hibernate/ui/bot/testcase/ConfigurationFileTest.java 2009-11-10 16:48:58 UTC (rev 18574)
@@ -0,0 +1,37 @@
+ /*******************************************************************************
+ * 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.hibernate.ui.bot.testcase;
+
+import org.eclipse.swtbot.swt.finder.junit.SWTBotJunit4ClassRunner;
+import org.jboss.tools.hibernate.ui.bot.testsuite.HibernateTest;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+(a)RunWith(SWTBotJunit4ClassRunner.class)
+public class ConfigurationFileTest extends HibernateTest {
+
+ /**
+ * TC 02
+ */
+ @Test
+ public void createFile() {
+
+ }
+
+ /**
+ * TC 13
+ */
+ @Test
+ public void editFile() {
+
+ }
+
+}
Added: trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/src/org/jboss/tools/hibernate/ui/bot/testcase/ConsolePerspectiveTest.java
===================================================================
--- trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/src/org/jboss/tools/hibernate/ui/bot/testcase/ConsolePerspectiveTest.java (rev 0)
+++ trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/src/org/jboss/tools/hibernate/ui/bot/testcase/ConsolePerspectiveTest.java 2009-11-10 16:48:58 UTC (rev 18574)
@@ -0,0 +1,29 @@
+ /*******************************************************************************
+ * 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.hibernate.ui.bot.testcase;
+
+import org.eclipse.swtbot.swt.finder.junit.SWTBotJunit4ClassRunner;
+import org.jboss.tools.hibernate.ui.bot.testsuite.HibernateTest;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+(a)RunWith(SWTBotJunit4ClassRunner.class)
+public class ConsolePerspectiveTest extends HibernateTest {
+
+ /**
+ * TC 17
+ */
+ @Test
+ public void openPerspectiveElements() {
+
+ }
+
+}
Added: 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 (rev 0)
+++ trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/src/org/jboss/tools/hibernate/ui/bot/testcase/ConsoleTest.java 2009-11-10 16:48:58 UTC (rev 18574)
@@ -0,0 +1,69 @@
+ /*******************************************************************************
+ * 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.hibernate.ui.bot.testcase;
+
+import org.eclipse.swtbot.swt.finder.junit.SWTBotJunit4ClassRunner;
+import org.jboss.tools.hibernate.ui.bot.testsuite.HibernateTest;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+(a)RunWith(SWTBotJunit4ClassRunner.class)
+public class ConsoleTest extends HibernateTest {
+
+ /**
+ * TC 03
+ */
+ @Test
+ public void createMainTab() {
+
+ }
+
+ /**
+ * TC 04
+ */
+ @Test
+ public void createOptionTab() {
+
+ }
+
+ /**
+ * TC 05
+ */
+ @Test
+ public void createClasspathTab() {
+
+ }
+
+ /**
+ * TC 06
+ */
+ @Test
+ public void createMappingsTab() {
+
+ }
+
+ /**
+ * TC 07
+ */
+ @Test
+ public void createCommonTab() {
+
+ }
+
+ /**
+ * TC 16
+ */
+ @Test
+ public void editConsole() {
+
+ }
+
+}
Added: trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/src/org/jboss/tools/hibernate/ui/bot/testcase/CriteriaEditorsTest.java
===================================================================
--- trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/src/org/jboss/tools/hibernate/ui/bot/testcase/CriteriaEditorsTest.java (rev 0)
+++ trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/src/org/jboss/tools/hibernate/ui/bot/testcase/CriteriaEditorsTest.java 2009-11-10 16:48:58 UTC (rev 18574)
@@ -0,0 +1,37 @@
+ /*******************************************************************************
+ * 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.hibernate.ui.bot.testcase;
+
+import org.eclipse.swtbot.swt.finder.junit.SWTBotJunit4ClassRunner;
+import org.jboss.tools.hibernate.ui.bot.testsuite.HibernateTest;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+(a)RunWith(SWTBotJunit4ClassRunner.class)
+public class CriteriaEditorsTest extends HibernateTest {
+
+ /**
+ * TC 19
+ */
+ @Test
+ public void checkHQLEditor() {
+
+ }
+
+ /**
+ * TC 19
+ */
+ @Test
+ public void checkCriteriaEditor() {
+
+ }
+
+}
Added: trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/src/org/jboss/tools/hibernate/ui/bot/testcase/DaliTest.java
===================================================================
--- trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/src/org/jboss/tools/hibernate/ui/bot/testcase/DaliTest.java (rev 0)
+++ trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/src/org/jboss/tools/hibernate/ui/bot/testcase/DaliTest.java 2009-11-10 16:48:58 UTC (rev 18574)
@@ -0,0 +1,69 @@
+ /*******************************************************************************
+ * 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.hibernate.ui.bot.testcase;
+
+import org.eclipse.swtbot.swt.finder.junit.SWTBotJunit4ClassRunner;
+import org.jboss.tools.hibernate.ui.bot.testsuite.HibernateTest;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+(a)RunWith(SWTBotJunit4ClassRunner.class)
+public class DaliTest extends HibernateTest {
+
+ /**
+ * TC 22
+ */
+ @Test
+ public void createJPAProject() {
+
+ }
+
+ /**
+ * TC 24
+ */
+ @Test
+ public void generateDDL() {
+
+ }
+
+ /**
+ * TC 24
+ */
+ @Test
+ public void generateEntities() {
+
+ }
+
+ /**
+ * TC 23
+ */
+ @Test
+ public void checkJPAPerspective() {
+
+ }
+
+ /**
+ * TC 25
+ */
+ @Test
+ public void checkCAInConfigurationEditor() {
+
+ }
+
+ /**
+ * TC 25
+ */
+ @Test
+ public void checkCAInMappingEditor() {
+
+ }
+
+}
Added: trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/src/org/jboss/tools/hibernate/ui/bot/testcase/JIRATest.java
===================================================================
--- trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/src/org/jboss/tools/hibernate/ui/bot/testcase/JIRATest.java (rev 0)
+++ trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/src/org/jboss/tools/hibernate/ui/bot/testcase/JIRATest.java 2009-11-10 16:48:58 UTC (rev 18574)
@@ -0,0 +1,29 @@
+ /*******************************************************************************
+ * 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.hibernate.ui.bot.testcase;
+
+import org.eclipse.swtbot.swt.finder.junit.SWTBotJunit4ClassRunner;
+import org.jboss.tools.hibernate.ui.bot.testsuite.HibernateTest;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+(a)RunWith(SWTBotJunit4ClassRunner.class)
+public class JIRATest extends HibernateTest {
+
+ /**
+ * TC 99
+ */
+ @Test
+ public void issue1() {
+
+ }
+
+}
Added: 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 (rev 0)
+++ trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/src/org/jboss/tools/hibernate/ui/bot/testcase/MappingFileTest.java 2009-11-10 16:48:58 UTC (rev 18574)
@@ -0,0 +1,100 @@
+ /*******************************************************************************
+ * 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.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.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.types.EntityType;
+import org.jboss.tools.ui.bot.ext.types.Label;
+import org.junit.AfterClass;
+import org.junit.BeforeClass;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+(a)RunWith(SWTBotJunit4ClassRunner.class)
+public class MappingFileTest extends HibernateTest {
+
+ @BeforeClass
+ public static void setUp() {
+ HibernateTest.prepare();
+ }
+
+ @AfterClass
+ public static void tearDown() {
+ HibernateTest.clean();
+ }
+
+ /**
+ * TC 01 - Create Hibernate Mapping file (when package is selected)
+ */
+ @Test
+ public void createFile() {
+ createFilesFromPackage();
+
+ // Remove files generated in the first round
+ eclipse.removeFile(Project.PROJECT_NAME,"src",Project.PACKAGE_NAME,Project.CLASS1 + ".hbm.xml");
+ eclipse.removeFile(Project.PROJECT_NAME,"src",Project.PACKAGE_NAME,Project.CLASS2 + ".hbm.xml");
+
+ createFilesFromClasses();
+ }
+
+ /**
+ * Create Hibernate Mapping file from selected classes
+ */
+ private void createFilesFromClasses() {
+ // Select Both classes
+ SWTBot viewBot = bot.viewByTitle(Label.View.PACKAGE_EXPLORER).bot();
+ SWTBotTreeItem item = viewBot.tree().expandNode(Project.PROJECT_NAME).expandNode("src");
+ item = item.expandNode(Project.PACKAGE_NAME).select();
+ item.select(Project.CLASS1+".java",Project.CLASS2+".java");
+
+ // Create mapping files
+ eclipse.createNew(EntityType.HIBERNATE_MAPPING_FILE);
+ eclipse.waitForShell(Label.Shell.NEW_HIBERNATE_MAPPING_FILE);
+ bot.button(Label.Button.NEXT).click();
+ bot.button(Label.Button.FINISH).click();
+ util.waitForNonIgnoredJobs();
+
+ // Check if new mapping files exists
+ eclipse.openFile(Project.PROJECT_NAME,"src",Project.PACKAGE_NAME,Project.CLASS1 + ".hbm.xml" );
+ eclipse.openFile(Project.PROJECT_NAME,"src",Project.PACKAGE_NAME,Project.CLASS2 + ".hbm.xml" );
+ }
+
+ /**
+ * Create Hibernate mapping files from selected package
+ */
+ private void createFilesFromPackage() {
+ // Select Package file
+ SWTBot viewBot = bot.viewByTitle(Label.View.PACKAGE_EXPLORER).bot();
+ SWTBotTreeItem item = viewBot.tree().expandNode(Project.PROJECT_NAME).expandNode("src");
+ item = item.expandNode(Project.PACKAGE_NAME).select();
+
+ // Create mapping files
+ eclipse.createNew(EntityType.HIBERNATE_MAPPING_FILE);
+ eclipse.waitForShell(Label.Shell.NEW_HIBERNATE_MAPPING_FILE);
+ bot.button(Label.Button.FINISH).click();
+ util.waitForNonIgnoredJobs();
+
+ // Check if new mapping files exists
+ eclipse.openFile(Project.PROJECT_NAME,"src",Project.PACKAGE_NAME,Project.CLASS1 + ".hbm.xml" );
+ eclipse.openFile(Project.PROJECT_NAME,"src",Project.PACKAGE_NAME,Project.CLASS2 + ".hbm.xml" );
+}
+
+ /**
+ * TC 14 - Editing Hibernate Mapping file
+ */
+ @Test
+ public void editFile() {
+ }
+}
Added: trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/src/org/jboss/tools/hibernate/ui/bot/testcase/MappingsDiagramTest.java
===================================================================
--- trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/src/org/jboss/tools/hibernate/ui/bot/testcase/MappingsDiagramTest.java (rev 0)
+++ trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/src/org/jboss/tools/hibernate/ui/bot/testcase/MappingsDiagramTest.java 2009-11-10 16:48:58 UTC (rev 18574)
@@ -0,0 +1,29 @@
+ /*******************************************************************************
+ * 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.hibernate.ui.bot.testcase;
+
+import org.eclipse.swtbot.swt.finder.junit.SWTBotJunit4ClassRunner;
+import org.jboss.tools.hibernate.ui.bot.testsuite.HibernateTest;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+(a)RunWith(SWTBotJunit4ClassRunner.class)
+public class MappingsDiagramTest extends HibernateTest {
+
+ /**
+ * TC 21
+ */
+ @Test
+ public void testDiagram() {
+
+ }
+
+}
Added: 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 (rev 0)
+++ trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/src/org/jboss/tools/hibernate/ui/bot/testcase/ReverseEngineerFileTest.java 2009-11-10 16:48:58 UTC (rev 18574)
@@ -0,0 +1,37 @@
+ /*******************************************************************************
+ * 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.hibernate.ui.bot.testcase;
+
+import org.eclipse.swtbot.swt.finder.junit.SWTBotJunit4ClassRunner;
+import org.jboss.tools.hibernate.ui.bot.testsuite.HibernateTest;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+(a)RunWith(SWTBotJunit4ClassRunner.class)
+public class ReverseEngineerFileTest extends HibernateTest {
+
+ /**
+ * TC 08
+ */
+ @Test
+ public void createFile() {
+
+ }
+
+ /**
+ * TC 15
+ */
+ @Test
+ public void editFile() {
+
+ }
+
+}
Added: trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/src/org/jboss/tools/hibernate/ui/bot/testcase/ViewsTest.java
===================================================================
--- trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/src/org/jboss/tools/hibernate/ui/bot/testcase/ViewsTest.java (rev 0)
+++ trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/src/org/jboss/tools/hibernate/ui/bot/testcase/ViewsTest.java 2009-11-10 16:48:58 UTC (rev 18574)
@@ -0,0 +1,29 @@
+ /*******************************************************************************
+ * 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.hibernate.ui.bot.testcase;
+
+import org.eclipse.swtbot.swt.finder.junit.SWTBotJunit4ClassRunner;
+import org.jboss.tools.hibernate.ui.bot.testsuite.HibernateTest;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+(a)RunWith(SWTBotJunit4ClassRunner.class)
+public class ViewsTest extends HibernateTest {
+
+ /**
+ * TC 20
+ */
+ @Test
+ public void checkViews() {
+
+ }
+
+}
Added: 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 (rev 0)
+++ trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/src/org/jboss/tools/hibernate/ui/bot/testsuite/HibernateAllTests.java 2009-11-10 16:48:58 UTC (rev 18574)
@@ -0,0 +1,38 @@
+ /*******************************************************************************
+ * 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.hibernate.ui.bot.testsuite;
+
+import org.jboss.tools.hibernate.ui.bot.testcase.MappingFileTest;
+import org.junit.AfterClass;
+import org.junit.BeforeClass;
+import org.junit.runner.RunWith;
+import org.junit.runners.Suite;
+import org.junit.runners.Suite.SuiteClasses;
+
+(a)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 */})
+public class HibernateAllTests extends HibernateTest {
+
+ @BeforeClass
+ public static void setUp() {
+ HibernateTest.prepare();
+ }
+
+ @AfterClass
+ public static void tearDown() {
+ HibernateTest.clean();
+ }
+}
Added: 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 (rev 0)
+++ trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/src/org/jboss/tools/hibernate/ui/bot/testsuite/HibernateTest.java 2009-11-10 16:48:58 UTC (rev 18574)
@@ -0,0 +1,66 @@
+ /*******************************************************************************
+ * 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.hibernate.ui.bot.testsuite;
+
+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.Label;
+import org.jboss.tools.ui.bot.ext.types.PerspectiveType;
+
+public class HibernateTest extends SWTTestExt {
+
+ private static boolean prepared = false;
+ //private static Properties properties;
+
+ public static void prepare() {
+
+ if (prepared == true)
+ return;
+
+ log.info("Hibernate test preparation started");
+ // Load project properties (not needed yet)
+ // loadProperties(Activator.PLUGIN_ID);
+
+ // Show perspective and view
+ eclipse.closeView(Label.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);
+ classEntity.setPackageName(Project.PACKAGE_NAME);
+ eclipse.createJavaClass(classEntity);
+ eclipse.setClassContentFromResource(Activator.PLUGIN_ID, "src", Project.PACKAGE_NAME, Project.CLASS1+".java");
+
+ // Class 2
+ classEntity.setClassName(Project.CLASS2);
+ classEntity.setPackageName(Project.PACKAGE_NAME);
+ eclipse.createJavaClass(classEntity);
+ eclipse.setClassContentFromResource(Activator.PLUGIN_ID, "src", Project.PACKAGE_NAME, Project.CLASS2+".java");
+
+ prepared = true;
+ log.info("Hibernate test preparation finished");
+ }
+
+ public static void clean() {
+ log.info("Clean finished");
+ bot.sleep(TIME_10S);
+ }
+}
Added: 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 (rev 0)
+++ trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/src/org/jboss/tools/hibernate/ui/bot/testsuite/Project.java 2009-11-10 16:48:58 UTC (rev 18574)
@@ -0,0 +1,24 @@
+ /*******************************************************************************
+ * 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.hibernate.ui.bot.testsuite;
+
+/**
+ * Hibernate Test Suite properties. Properties for all tests and test prerequisites
+ * @author jpeterka
+ *
+ */
+public class Project {
+ public static final String CLASS1 = "Customer";
+ public static final String CLASS2 = "Order";
+ public static final String PACKAGE_NAME = "org.jboss.hibernate.test";
+ public static final String PROJECT_NAME = "HibernateTest";
+
+}
15 years, 1 month
JBoss Tools SVN: r18573 - trunk/bpel/features/org.jboss.tools.bpel.tests.feature.
by jbosstools-commits@lists.jboss.org
Author: nickboldt
Date: 2009-11-10 11:46:20 -0500 (Tue, 10 Nov 2009)
New Revision: 18573
Modified:
trunk/bpel/features/org.jboss.tools.bpel.tests.feature/feature.xml
Log:
add o.j.tools.tests to tests feature
Modified: trunk/bpel/features/org.jboss.tools.bpel.tests.feature/feature.xml
===================================================================
--- trunk/bpel/features/org.jboss.tools.bpel.tests.feature/feature.xml 2009-11-10 16:25:43 UTC (rev 18572)
+++ trunk/bpel/features/org.jboss.tools.bpel.tests.feature/feature.xml 2009-11-10 16:46:20 UTC (rev 18573)
@@ -50,6 +50,12 @@
download-size="0"
install-size="0"
version="0.0.0"/>
+
+ <plugin
+ id="org.jboss.tools.common.test"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"/>
<plugin
id="org.jboss.tools.bpel.ui.test"
15 years, 1 month
JBoss Tools SVN: r18572 - trunk/bpel/releng.
by jbosstools-commits@lists.jboss.org
Author: nickboldt
Date: 2009-11-10 11:25:43 -0500 (Tue, 10 Nov 2009)
New Revision: 18572
Modified:
trunk/bpel/releng/testing.properties
Log:
https://jira.jboss.org/jira/browse/JBIDE-5171 wrong class name
Modified: trunk/bpel/releng/testing.properties
===================================================================
--- trunk/bpel/releng/testing.properties 2009-11-10 15:43:06 UTC (rev 18571)
+++ trunk/bpel/releng/testing.properties 2009-11-10 16:25:43 UTC (rev 18572)
@@ -3,9 +3,8 @@
#csv list of test plugins to run
testPluginsToRun=\
org.jboss.tools.bpel.ui.test
-#,org.jboss.tools.bpel.core.test
# define which suite to run within each test plugin; or, include a test.xml script in
# the test plugin to deviate from default one-suite-per-plugin operation
-org.jboss.tools.bpel.ui.test.suite=org.jboss.tools.bpel.ui.BPELUIAllTests
-#org.jboss.tools.bpel.core.test.suite=org.jboss.tools.bpel.core.BPELCoreAllTests
+org.jboss.tools.bpel.ui.test.suite=org.jboss.tools.bpel.ui.test.BpelUIAllTests
+
15 years, 1 month
JBoss Tools SVN: r18571 - in trunk/esb/plugins/org.jboss.tools.esb.ui: templates and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2009-11-10 10:43:06 -0500 (Tue, 10 Nov 2009)
New Revision: 18571
Added:
trunk/esb/plugins/org.jboss.tools.esb.ui/templates/
trunk/esb/plugins/org.jboss.tools.esb.ui/templates/esb_1_1.properties
trunk/esb/plugins/org.jboss.tools.esb.ui/templates/esb_1_1.xml
Modified:
trunk/esb/plugins/org.jboss.tools.esb.ui/build.properties
trunk/esb/plugins/org.jboss.tools.esb.ui/plugin.xml
Log:
https://jira.jboss.org/jira/browse/JBIDE-2023
Modified: trunk/esb/plugins/org.jboss.tools.esb.ui/build.properties
===================================================================
--- trunk/esb/plugins/org.jboss.tools.esb.ui/build.properties 2009-11-10 15:05:58 UTC (rev 18570)
+++ trunk/esb/plugins/org.jboss.tools.esb.ui/build.properties 2009-11-10 15:43:06 UTC (rev 18571)
@@ -7,7 +7,8 @@
about.properties,\
about.mappings,\
about.ini,\
- jboss_about.png
+ jboss_about.png,\
+ templates/
source.esb-ui.jar = src/,\
resources/
jars.compile.order = esb-ui.jar
Modified: trunk/esb/plugins/org.jboss.tools.esb.ui/plugin.xml
===================================================================
--- trunk/esb/plugins/org.jboss.tools.esb.ui/plugin.xml 2009-11-10 15:05:58 UTC (rev 18570)
+++ trunk/esb/plugins/org.jboss.tools.esb.ui/plugin.xml 2009-11-10 15:43:06 UTC (rev 18571)
@@ -162,5 +162,10 @@
</extension>
+ <extension point="org.jboss.tools.common.model.ui.metaTemplates">
+ <include file="templates/esb_1_1.xml" translations="templates/esb_1_1.properties">
+ </include>
+ </extension>
+
</plugin>
Added: trunk/esb/plugins/org.jboss.tools.esb.ui/templates/esb_1_1.properties
===================================================================
Property changes on: trunk/esb/plugins/org.jboss.tools.esb.ui/templates/esb_1_1.properties
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/esb/plugins/org.jboss.tools.esb.ui/templates/esb_1_1.xml
===================================================================
--- trunk/esb/plugins/org.jboss.tools.esb.ui/templates/esb_1_1.xml (rev 0)
+++ trunk/esb/plugins/org.jboss.tools.esb.ui/templates/esb_1_1.xml 2009-11-10 15:43:06 UTC (rev 18571)
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE meta-template PUBLIC "-//Red Hat Inc.//DTD Meta Templates 1.0//EN"
+ "http://www.redhat.com/templates/dtds/meta-template_1_0.dtd">
+
+<meta-templates uri="http://anonsvn.labs.jboss.com/labs/jbossesb/trunk/product/etc/schemas/xml... http://anonsvn.labs.jboss.com/labs/jbossesb/trunk/product/etc/schemas/xml...">
+
+ <meta-template axis="action@class" displayName="Action Class" xEntity="NONE">
+ <super-class name="org.jboss.soa.esb.actions.AbstractActionLifecycle"/>
+ </meta-template>
+
+</meta-templates>
\ No newline at end of file
Property changes on: trunk/esb/plugins/org.jboss.tools.esb.ui/templates/esb_1_1.xml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
15 years, 1 month
JBoss Tools SVN: r18570 - in trunk/hibernatetools/plugins/org.jboss.tools.hibernate.xml: resources/meta and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2009-11-10 10:05:58 -0500 (Tue, 10 Nov 2009)
New Revision: 18570
Added:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.xml/src/org/jboss/tools/hibernate/xml/model/impl/HibClassImpl.java
Modified:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.xml/plugin.xml
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.xml/resources/meta/hibernate3.meta
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.xml/src/org/jboss/tools/hibernate/xml/model/impl/HibernateClassImpl.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.xml/src/org/jboss/tools/hibernate/xml/model/impl/HibernateElementImpl.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-5175
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.xml/plugin.xml
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.xml/plugin.xml 2009-11-10 14:51:52 UTC (rev 18569)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.xml/plugin.xml 2009-11-10 15:05:58 UTC (rev 18570)
@@ -96,6 +96,8 @@
class="org.jboss.tools.hibernate.xml.model.impl.HibConfigComplexPropertyImpl"/>
<xclass id="org.jboss.tools.hibernate.xml.model.impl.HibConfigSimplePropertyImpl"
class="org.jboss.tools.hibernate.xml.model.impl.HibConfigSimplePropertyImpl"/>
+ <xclass id="org.jboss.tools.hibernate.xml.model.impl.HibClassImpl"
+ class="org.jboss.tools.hibernate.xml.model.impl.HibClassImpl"/>
<xclass id="org.jboss.tools.hibernate.xml.model.impl.ContextPackageProvider"
class="org.jboss.tools.hibernate.xml.model.impl.ContextPackageProvider"/>
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.xml/resources/meta/hibernate3.meta
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.xml/resources/meta/hibernate3.meta 2009-11-10 14:51:52 UTC (rev 18569)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.xml/resources/meta/hibernate3.meta 2009-11-10 15:05:58 UTC (rev 18570)
@@ -437,6 +437,7 @@
kind="action" name="AddJoinedSubclass">
<EntityData EntityName="Hibernate3JoinedSubclass">
<AttributeData AttributeName="name"/>
+ <AttributeData AttributeName="entity-name" Mandatory="no"/>
</EntityData>
</XActionItem>
<XActionItem
@@ -446,6 +447,7 @@
WizardClassName="%Default%" displayName="Subclass..." kind="action" name="AddSubclass">
<EntityData EntityName="Hibernate3Subclass">
<AttributeData AttributeName="name"/>
+ <AttributeData AttributeName="entity-name" Mandatory="no"/>
</EntityData>
</XActionItem>
<XActionItem
@@ -456,6 +458,7 @@
kind="action" name="AddUnionSubclass">
<EntityData EntityName="Hibernate3UnionSubclass">
<AttributeData AttributeName="name"/>
+ <AttributeData AttributeName="entity-name" Mandatory="no"/>
</EntityData>
</XActionItem>
</XActionItem>
@@ -824,7 +827,8 @@
WizardClassName="%Default%" displayName="Many-to-Many..."
kind="action" name="AddManyToMany">
<EntityData EntityName="Hibernate3ManyToMany">
- <AttributeData AttributeName="class"/>
+ <AttributeData AttributeName="class" Mandatory="no"/>
+ <AttributeData AttributeName="entity-name" Mandatory="no"/>
</EntityData>
</XActionItem>
<XActionItem HandlerClassName="%Hibernate3Replace%"
@@ -833,7 +837,8 @@
WizardClassName="%Default%" displayName="One-to-Many..."
kind="action" name="AddOneToMany">
<EntityData EntityName="Hibernate3OneToMany">
- <AttributeData AttributeName="class"/>
+ <AttributeData AttributeName="class" Mandatory="no"/>
+ <AttributeData AttributeName="entity-name" Mandatory="no"/>
</EntityData>
</XActionItem>
<XActionItem kind="list" name="SQL">
@@ -1678,7 +1683,8 @@
WizardClassName="%Default%" displayName="Many-to-Many..."
kind="action" name="AddManyToMany">
<EntityData EntityName="Hibernate3ManyToMany">
- <AttributeData AttributeName="class"/>
+ <AttributeData AttributeName="class" Mandatory="no"/>
+ <AttributeData AttributeName="entity-name" Mandatory="no"/>
</EntityData>
</XActionItem>
<XActionItem HandlerClassName="%Hibernate3Replace%"
@@ -1687,7 +1693,8 @@
WizardClassName="%Default%" displayName="One-to-Many..."
kind="action" name="AddOneToMany">
<EntityData EntityName="Hibernate3OneToMany">
- <AttributeData AttributeName="class"/>
+ <AttributeData AttributeName="class" Mandatory="no"/>
+ <AttributeData AttributeName="entity-name" Mandatory="no"/>
</EntityData>
</XActionItem>
<XActionItem kind="list" name="SQL">
@@ -1803,7 +1810,7 @@
</XModelEntity>
<XModelEntity
AdoptManagerClass="org.jboss.tools.hibernate.xml.model.handlers.FolderOwnerAdopt"
- ImplementingClass="%Ordered2%"
+ ImplementingClass="org.jboss.tools.hibernate.xml.model.impl.HibClassImpl"
PROPERTIES="loaderKind=class;formFactory=%Default%;formLayout=org.jboss.tools.hibernate.ui.xml.form.Hibernate3FormLayoutData"
XMLSUBPATH="class" name="Hibernate3Class">
<XChildrenEntities>
@@ -1835,7 +1842,7 @@
<XModelAttribute default="class" loader="ElementType" name="element type">
<Editor name="Uneditable"/>
</XModelAttribute>
- <XModelAttribute PROPERTIES="category=advanced" name="entity-name" xmlname="entity-name"/>
+ <XModelAttribute PROPERTIES="category=general" name="entity-name" xmlname="entity-name"/>
<XModelAttribute
PROPERTIES="save=always;id=true;category=general;contextPackageProvider=org.jboss.tools.hibernate.xml.model.impl.ContextPackageProvider"
name="name" xmlname="name">
@@ -2222,6 +2229,7 @@
WizardClassName="%Default%" displayName="Class..." kind="action" name="AddClass">
<EntityData EntityName="Hibernate3Class">
<AttributeData AttributeName="name"/>
+ <AttributeData AttributeName="entity-name" Mandatory="no"/>
</EntityData>
</XActionItem>
<XActionItem HandlerClassName="%Create%"
@@ -2230,6 +2238,7 @@
displayName="Joined-Subclass..." kind="action" name="AddJoinedSubclass">
<EntityData EntityName="Hibernate3JoinedSubclass">
<AttributeData AttributeName="name"/>
+ <AttributeData AttributeName="entity-name" Mandatory="no"/>
<AttributeData AttributeName="extends"/>
</EntityData>
</XActionItem>
@@ -2238,6 +2247,7 @@
WizardClassName="%Default%" displayName="Subclass..." kind="action" name="AddSubclass">
<EntityData EntityName="Hibernate3Subclass">
<AttributeData AttributeName="name"/>
+ <AttributeData AttributeName="entity-name" Mandatory="no"/>
<AttributeData AttributeName="extends"/>
</EntityData>
</XActionItem>
@@ -2247,6 +2257,7 @@
displayName="Union-Subclass..." kind="action" name="AddUnionSubclass">
<EntityData EntityName="Hibernate3UnionSubclass">
<AttributeData AttributeName="name"/>
+ <AttributeData AttributeName="entity-name" Mandatory="no"/>
<AttributeData AttributeName="extends"/>
</EntityData>
</XActionItem>
@@ -4131,7 +4142,8 @@
WizardClassName="%Default%" displayName="Many-to-Many..."
kind="action" name="AddManyToMany">
<EntityData EntityName="Hibernate3ManyToMany">
- <AttributeData AttributeName="class"/>
+ <AttributeData AttributeName="class" Mandatory="no"/>
+ <AttributeData AttributeName="entity-name" Mandatory="no"/>
</EntityData>
</XActionItem>
<XActionItem HandlerClassName="%Hibernate3Replace%"
@@ -4140,7 +4152,8 @@
WizardClassName="%Default%" displayName="One-to-Many..."
kind="action" name="AddOneToMany">
<EntityData EntityName="Hibernate3OneToMany">
- <AttributeData AttributeName="class"/>
+ <AttributeData AttributeName="class" Mandatory="no"/>
+ <AttributeData AttributeName="entity-name" Mandatory="no"/>
</EntityData>
</XActionItem>
<XActionItem kind="list" name="SQL">
@@ -4903,6 +4916,7 @@
displayName="Joined-Subclass..." kind="action" name="AddJoinedSubclass">
<EntityData EntityName="Hibernate3JoinedSubclass">
<AttributeData AttributeName="name"/>
+ <AttributeData AttributeName="entity-name" Mandatory="no"/>
</EntityData>
</XActionItem>
</XActionItem>
@@ -5410,7 +5424,8 @@
WizardClassName="%Default%" displayName="Many-to-Many..."
kind="action" name="AddManyToMany">
<EntityData EntityName="Hibernate3ManyToMany">
- <AttributeData AttributeName="class"/>
+ <AttributeData AttributeName="class" Mandatory="no"/>
+ <AttributeData AttributeName="entity-name" Mandatory="no"/>
</EntityData>
</XActionItem>
<XActionItem HandlerClassName="%Hibernate3Replace%"
@@ -5419,7 +5434,8 @@
WizardClassName="%Default%" displayName="One-to-Many..."
kind="action" name="AddOneToMany">
<EntityData EntityName="Hibernate3OneToMany">
- <AttributeData AttributeName="class"/>
+ <AttributeData AttributeName="class" Mandatory="no"/>
+ <AttributeData AttributeName="entity-name" Mandatory="no"/>
</EntityData>
</XActionItem>
<XActionItem kind="list" name="SQL">
@@ -5704,7 +5720,7 @@
</XModelEntity>
<XModelEntity
ImplementingClass="org.jboss.tools.hibernate.xml.model.impl.HibernateElementImpl"
- PROPERTIES="presentationAttribute=class;formFactory=%Default%;formLayout=org.jboss.tools.hibernate.ui.xml.form.Hibernate3FormLayoutData"
+ PROPERTIES="presentationAttribute=entity-name|class;formFactory=%Default%;formLayout=org.jboss.tools.hibernate.ui.xml.form.Hibernate3FormLayoutData"
XMLSUBPATH="many-to-many" name="Hibernate3ManyToMany">
<XChildrenEntities>
<XChildEntity maxCount="1" name="Hibernate3MetaFolder" required="yes"/>
@@ -5721,8 +5737,7 @@
<XModelAttribute default="many-to-many" loader="ElementType" name="element type">
<Editor name="Uneditable"/>
</XModelAttribute>
- <XModelAttribute PROPERTIES="save=always;category=general"
- name="class" xmlname="class"/>
+ <XModelAttribute PROPERTIES="category=general" name="class" xmlname="class"/>
<XModelAttribute PROPERTIES="category=advanced" name="node" xmlname="node"/>
<XModelAttribute PROPERTIES="category=advanced" default="true"
name="embed-xml" xmlname="embed-xml">
@@ -6302,7 +6317,8 @@
WizardClassName="%Default%" displayName="One-to-Many..."
kind="action" name="AddOneToMany">
<EntityData EntityName="Hibernate3OneToMany">
- <AttributeData AttributeName="class"/>
+ <AttributeData AttributeName="class" Mandatory="no"/>
+ <AttributeData AttributeName="entity-name" Mandatory="no"/>
</EntityData>
</XActionItem>
<XActionItem HandlerClassName="%Hibernate3Replace%"
@@ -6311,7 +6327,8 @@
WizardClassName="%Default%" displayName="Many-to-Many..."
kind="action" name="AddManyToMany">
<EntityData EntityName="Hibernate3ManyToMany">
- <AttributeData AttributeName="class"/>
+ <AttributeData AttributeName="class" Mandatory="no"/>
+ <AttributeData AttributeName="entity-name" Mandatory="no"/>
</EntityData>
</XActionItem>
<XActionItem HandlerClassName="%Hibernate3Replace%"
@@ -6835,7 +6852,8 @@
</XModelEntity>
<XModelEntity
ImplementingClass="org.jboss.tools.hibernate.xml.model.impl.HibernateElementImpl"
- PROPERTIES="presentationAttribute=class" XMLSUBPATH="one-to-many" name="Hibernate3OneToMany">
+ PROPERTIES="presentationAttribute=entity-name|class"
+ XMLSUBPATH="one-to-many" name="Hibernate3OneToMany">
<XChildrenEntities/>
<XEntityRenderer>
<ICONS>
@@ -6846,7 +6864,7 @@
<XModelAttribute default="one-to-many" loader="ElementType" name="element type">
<Editor name="Uneditable"/>
</XModelAttribute>
- <XModelAttribute PROPERTIES="save=always" name="class" xmlname="class">
+ <XModelAttribute name="class" xmlname="class">
<Editor name="AccessibleJava"/>
</XModelAttribute>
<XModelAttribute default="exception" name="not-found" xmlname="not-found">
@@ -8927,7 +8945,8 @@
WizardClassName="%Default%" displayName="Many-to-Many..."
kind="action" name="AddManyToMany">
<EntityData EntityName="Hibernate3ManyToMany">
- <AttributeData AttributeName="class"/>
+ <AttributeData AttributeName="class" Mandatory="no"/>
+ <AttributeData AttributeName="entity-name" Mandatory="no"/>
</EntityData>
</XActionItem>
<XActionItem HandlerClassName="%Hibernate3Replace%"
@@ -8936,7 +8955,8 @@
WizardClassName="%Default%" displayName="One-to-Many..."
kind="action" name="AddOneToMany">
<EntityData EntityName="Hibernate3OneToMany">
- <AttributeData AttributeName="class"/>
+ <AttributeData AttributeName="class" Mandatory="no"/>
+ <AttributeData AttributeName="entity-name" Mandatory="no"/>
</EntityData>
</XActionItem>
<XActionItem kind="list" name="SQL">
@@ -9021,7 +9041,7 @@
<Constraint loader="QClassName"/>
<Editor name="AccessibleJava"/>
</XModelAttribute>
- <XModelAttribute name="entity-name" xmlname="entity-name"/>
+ <XModelAttribute PROPERTIES="category=general" name="entity-name" xmlname="entity-name"/>
<XModelAttribute PROPERTIES="category=general" name="proxy" xmlname="proxy">
<Editor name="AccessibleJava"/>
</XModelAttribute>
@@ -9262,6 +9282,7 @@
WizardClassName="%Default%" displayName="Subclass..." kind="action" name="AddSubclass">
<EntityData EntityName="Hibernate3Subclass">
<AttributeData AttributeName="name"/>
+ <AttributeData AttributeName="entity-name" Mandatory="no"/>
</EntityData>
</XActionItem>
</XActionItem>
@@ -10008,6 +10029,7 @@
displayName="Union-Subclass..." kind="action" name="AddUnionSubclass">
<EntityData EntityName="Hibernate3UnionSubclass">
<AttributeData AttributeName="name"/>
+ <AttributeData AttributeName="entity-name" Mandatory="no"/>
</EntityData>
</XActionItem>
</XActionItem>
Added: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.xml/src/org/jboss/tools/hibernate/xml/model/impl/HibClassImpl.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.xml/src/org/jboss/tools/hibernate/xml/model/impl/HibClassImpl.java (rev 0)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.xml/src/org/jboss/tools/hibernate/xml/model/impl/HibClassImpl.java 2009-11-10 15:05:58 UTC (rev 18570)
@@ -0,0 +1,22 @@
+package org.jboss.tools.hibernate.xml.model.impl;
+
+public class HibClassImpl extends OrderedObject2Impl {
+ private static final long serialVersionUID = 1L;
+
+ public String getPresentationString() {
+ String en = getAttributeValue("entity-name"); //$NON-NLS-1$
+ if(en == null || en.length() == 0) {
+ return super.getPresentationString();
+ }
+ return en;
+ }
+
+ public String getPathPart() {
+ String en = getAttributeValue("entity-name"); //$NON-NLS-1$
+ if(en == null || en.length() == 0) {
+ return super.getPathPart();
+ }
+
+ return super.getPathPart() + ':' + en.replace('/', '#');
+ }
+}
Property changes on: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.xml/src/org/jboss/tools/hibernate/xml/model/impl/HibClassImpl.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.xml/src/org/jboss/tools/hibernate/xml/model/impl/HibernateClassImpl.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.xml/src/org/jboss/tools/hibernate/xml/model/impl/HibernateClassImpl.java 2009-11-10 14:51:52 UTC (rev 18569)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.xml/src/org/jboss/tools/hibernate/xml/model/impl/HibernateClassImpl.java 2009-11-10 15:05:58 UTC (rev 18570)
@@ -10,7 +10,7 @@
******************************************************************************/
package org.jboss.tools.hibernate.xml.model.impl;
-public class HibernateClassImpl extends OrderedObject2Impl {
+public class HibernateClassImpl extends HibClassImpl {
private static final long serialVersionUID = 3382417320218706443L;
public String get(String s) {
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.xml/src/org/jboss/tools/hibernate/xml/model/impl/HibernateElementImpl.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.xml/src/org/jboss/tools/hibernate/xml/model/impl/HibernateElementImpl.java 2009-11-10 14:51:52 UTC (rev 18569)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.xml/src/org/jboss/tools/hibernate/xml/model/impl/HibernateElementImpl.java 2009-11-10 15:05:58 UTC (rev 18570)
@@ -10,15 +10,25 @@
******************************************************************************/
package org.jboss.tools.hibernate.xml.model.impl;
+import java.util.StringTokenizer;
+
import org.jboss.tools.common.model.impl.OrderedObjectImpl;
public class HibernateElementImpl extends OrderedObjectImpl {
private static final long serialVersionUID = 220538596631608391L;
public String getPresentationString() {
+ String suff = "[" + getAttributeValue("element type") + "]"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
String presentationAttr = getModelEntity().getProperty("presentationAttribute"); //$NON-NLS-1$
- return ((presentationAttr != null) ? getAttributeValue(presentationAttr) : "") + //$NON-NLS-1$
- "[" + getAttributeValue("element type") + "]"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ if(presentationAttr != null) {
+ StringTokenizer st = new StringTokenizer(presentationAttr, "|"); //$NON-NLS-1$
+ while(st.hasMoreTokens()) {
+ String att = st.nextToken();
+ String v = getAttributeValue(att);
+ if(v != null && v.length() > 0) return v + suff;
+ }
+ }
+ return suff;
}
public String name() {
15 years, 1 month
JBoss Tools SVN: r18569 - trunk/hibernatetools/tests.
by jbosstools-commits@lists.jboss.org
Author: jpeterka
Date: 2009-11-10 09:51:52 -0500 (Tue, 10 Nov 2009)
New Revision: 18569
Added:
trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/
Log:
Initial import.
15 years, 1 month
JBoss Tools SVN: r18568 - in trunk/jst/tests/org.jboss.tools.ui.bot.ext: .settings and 11 other directories.
by jbosstools-commits@lists.jboss.org
Author: jpeterka
Date: 2009-11-10 09:29:25 -0500 (Tue, 10 Nov 2009)
New Revision: 18568
Added:
trunk/jst/tests/org.jboss.tools.ui.bot.ext/.classpath
trunk/jst/tests/org.jboss.tools.ui.bot.ext/.project
trunk/jst/tests/org.jboss.tools.ui.bot.ext/.settings/
trunk/jst/tests/org.jboss.tools.ui.bot.ext/.settings/org.eclipse.jdt.core.prefs
trunk/jst/tests/org.jboss.tools.ui.bot.ext/META-INF/
trunk/jst/tests/org.jboss.tools.ui.bot.ext/META-INF/MANIFEST.MF
trunk/jst/tests/org.jboss.tools.ui.bot.ext/build.properties
trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/
trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/log4j.xml
trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/
trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/
trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/
trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/
trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/
trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/
trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/Activator.java
trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/SWTBotExt.java
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/SWTUtilExt.java
trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/entity/
trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/entity/JavaClassEntity.java
trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/entity/JavaProjectEntity.java
trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/helper/
trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/helper/ContextMenuHelper.java
trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/types/
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/JobLists.java
trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/types/JobState.java
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/PerspectiveType.java
trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/types/ProjectType.java
trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/types/ViewType.java
Log:
Initial commit of swtbot related support
Added: trunk/jst/tests/org.jboss.tools.ui.bot.ext/.classpath
===================================================================
--- trunk/jst/tests/org.jboss.tools.ui.bot.ext/.classpath (rev 0)
+++ trunk/jst/tests/org.jboss.tools.ui.bot.ext/.classpath 2009-11-10 14:29:25 UTC (rev 18568)
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
Added: trunk/jst/tests/org.jboss.tools.ui.bot.ext/.project
===================================================================
--- trunk/jst/tests/org.jboss.tools.ui.bot.ext/.project (rev 0)
+++ trunk/jst/tests/org.jboss.tools.ui.bot.ext/.project 2009-11-10 14:29:25 UTC (rev 18568)
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.jboss.tools.ui.bot.ext</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
Added: trunk/jst/tests/org.jboss.tools.ui.bot.ext/.settings/org.eclipse.jdt.core.prefs
===================================================================
--- trunk/jst/tests/org.jboss.tools.ui.bot.ext/.settings/org.eclipse.jdt.core.prefs (rev 0)
+++ trunk/jst/tests/org.jboss.tools.ui.bot.ext/.settings/org.eclipse.jdt.core.prefs 2009-11-10 14:29:25 UTC (rev 18568)
@@ -0,0 +1,8 @@
+#Fri Sep 25 09:46:34 CEST 2009
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+org.eclipse.jdt.core.compiler.compliance=1.5
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.5
Added: 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 (rev 0)
+++ trunk/jst/tests/org.jboss.tools.ui.bot.ext/META-INF/MANIFEST.MF 2009-11-10 14:29:25 UTC (rev 18568)
@@ -0,0 +1,24 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: JBoss Tools SWTBot Extensions
+Bundle-SymbolicName: org.jboss.tools.ui.bot.ext
+Bundle-Version: 1.0.0.qualifier
+Bundle-Activator: org.jboss.tools.ui.bot.ext.Activator
+Require-Bundle: org.eclipse.ui,
+ org.eclipse.core.runtime,
+ 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",
+ org.hamcrest;bundle-version="1.1.0",
+ org.junit4;bundle-version="4.5.0",
+ org.apache.log4j;bundle-version="1.2.13"
+Bundle-ActivationPolicy: lazy
+Bundle-RequiredExecutionEnvironment: J2SE-1.5
+Eclipse-RegisterBuddy: org.apache.log4j
+Export-Package: org.jboss.tools.ui.bot.ext,
+ org.jboss.tools.ui.bot.ext.entity,
+ org.jboss.tools.ui.bot.ext.types
+
Added: trunk/jst/tests/org.jboss.tools.ui.bot.ext/build.properties
===================================================================
--- trunk/jst/tests/org.jboss.tools.ui.bot.ext/build.properties (rev 0)
+++ trunk/jst/tests/org.jboss.tools.ui.bot.ext/build.properties 2009-11-10 14:29:25 UTC (rev 18568)
@@ -0,0 +1,4 @@
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+ .
Added: trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/log4j.xml
===================================================================
--- trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/log4j.xml (rev 0)
+++ trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/log4j.xml 2009-11-10 14:29:25 UTC (rev 18568)
@@ -0,0 +1,60 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
+<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/"
+ debug="false">
+
+ <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" />
+ </layout>
+ </appender>
+
+ <appender name="fileAppender" class="org.apache.log4j.FileAppender">
+ <param name="File" value="/tmp/debug.log" />
+ <param name="Append" value="false" />
+ <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" />
+ </layout>
+ </appender>
+
+ <appender name="asyncAppender" class="org.apache.log4j.AsyncAppender">
+ <!-- appender-ref ref="consoleAppender" / -->
+ <appender-ref ref="fileAppender" />
+ </appender>
+
+ <!-- don't log matchers, this is very high amount of chatter -->
+ <category name="org.eclipse.swtbot.swt.finder.matchers">
+ <priority value="OFF" />
+ </category>
+
+ <!--
+ don't log widget notification events, this is moderately high chatter
+ -->
+ <category name="org.eclipse.swtbot.swt.finder.widgets">
+ <priority value="OFF" />
+ </category>
+
+ <!-- don't log finders, this is moderate chatter -->
+ <category name="org.eclipse.swtbot.swt.finder.finders">
+ <priority value="DEBUG" />
+ </category>
+
+ <category name="org.eclipse.swtbot.swt.finder.keyboard">
+ <!-- set to a value higher than debug to turn on. -->
+ <priority value="DEBUG" />
+ </category>
+
+ <category name="org.eclipse.swtbot">
+ <priority value="ALL" />
+ </category>
+
+ <root>
+ <priority value="INFO" />
+ <appender-ref ref="consoleAppender" />
+ <appender-ref ref="fileAppender" />
+ </root>
+
+</log4j:configuration>
\ No newline at end of file
Added: trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/Activator.java
===================================================================
--- trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/Activator.java (rev 0)
+++ trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/Activator.java 2009-11-10 14:29:25 UTC (rev 18568)
@@ -0,0 +1,66 @@
+ /*******************************************************************************
+ * 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;
+
+import org.eclipse.ui.plugin.AbstractUIPlugin;
+import org.osgi.framework.BundleContext;
+
+/**
+ * The activator class controls the plug-in life cycle
+ */
+public class Activator extends AbstractUIPlugin {
+
+ // The plug-in ID
+ public static final String PLUGIN_ID = "org.jboss.tools.ui.bot.ext";
+
+ // The shared instance
+ private static Activator plugin;
+
+ /**
+ * The constructor
+ */
+ public Activator() {
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext
+ * )
+ */
+ public void start(BundleContext context) throws Exception {
+ super.start(context);
+ plugin = this;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext
+ * )
+ */
+ public void stop(BundleContext context) throws Exception {
+ plugin = null;
+ super.stop(context);
+ }
+
+ /**
+ * Returns the shared instance
+ *
+ * @return the shared instance
+ */
+ public static Activator getDefault() {
+ return plugin;
+ }
+
+}
Added: trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/SWTBotExt.java
===================================================================
--- trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/SWTBotExt.java (rev 0)
+++ trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/SWTBotExt.java 2009-11-10 14:29:25 UTC (rev 18568)
@@ -0,0 +1,72 @@
+ /*******************************************************************************
+ * 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;
+
+import static org.junit.Assert.fail;
+
+import org.apache.log4j.Logger;
+import org.eclipse.swtbot.eclipse.finder.SWTWorkbenchBot;
+import org.eclipse.swtbot.swt.finder.widgets.SWTBotButton;
+import org.eclipse.swtbot.swt.finder.widgets.SWTBotCCombo;
+import org.eclipse.swtbot.swt.finder.widgets.SWTBotMenu;
+import org.eclipse.swtbot.swt.finder.widgets.SWTBotTable;
+import org.eclipse.swtbot.swt.finder.widgets.SWTBotTree;
+
+/**
+ * Extended version of SWTWorkbenchBot, logging added
+ *
+ * @author jpeterka
+ *
+ */
+public class SWTBotExt extends SWTWorkbenchBot {
+
+ private Logger log = Logger.getLogger(SWTBotExt.class);
+
+ public void logAndFail(String msg) {
+ log.error(msg);
+ fail(msg);
+ }
+
+ // ------------------------------------------------------------
+ // SWTBot method wrapper ( for better logging mainly )
+ // ------------------------------------------------------------
+
+ @Override
+ public SWTBotMenu menu(String text) {
+ log.info("Menu \"" + text + "\" secleted");
+ return super.menu(text);
+ }
+
+ @Override
+ public SWTBotButton button(String text) {
+ log.info("Button \"" + text + "\" selected");
+ return super.button(text);
+ }
+
+ @Override
+ public SWTBotTree tree() {
+ log.info("Tree selected");
+ return super.tree();
+ }
+
+ @Override
+ public SWTBotCCombo ccomboBox(String text) {
+ log.info("Combobox \"" + text + "\" selected");
+ return super.ccomboBox(text);
+ }
+
+ @Override
+ public SWTBotTable table() {
+ log.info("Table selected");
+ return super.table();
+ }
+
+}
Added: 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 (rev 0)
+++ trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/SWTEclipseExt.java 2009-11-10 14:29:25 UTC (rev 18568)
@@ -0,0 +1,254 @@
+ /*******************************************************************************
+ * 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;
+
+import static org.junit.Assert.assertEquals;
+
+import java.io.File;
+import java.util.logging.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.SWTBotTreeItem;
+import org.hamcrest.Matcher;
+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.EntityType;
+import org.jboss.tools.ui.bot.ext.types.Label;
+import org.jboss.tools.ui.bot.ext.types.PerspectiveType;
+import org.jboss.tools.ui.bot.ext.types.ViewType;
+
+/**
+ * Provieds Eclipse common operation based on SWTBot element operations
+ * @author jpeterka
+ *
+ */
+public class SWTEclipseExt {
+
+ SWTBotExt bot = new SWTBotExt();
+ SWTUtilExt util = new SWTUtilExt();
+ Logger log = Logger.getLogger(SWTEclipseExt.class.getName());
+
+ // ------------------------------------------------------------
+ // Additional missing or more advance methods
+ // ------------------------------------------------------------
+ /**
+ * Close view by text
+ */
+ public void closeView(String view) {
+ bot.viewByTitle(view).close();
+ }
+
+ /**
+ * Show view
+ *
+ * @param type
+ */
+ public void showView(ViewType type) {
+ bot.menu(Label.Menu.WINDOW).menu(Label.Menu.SHOW_VIEW).menu(
+ Label.Menu.OTHER).click();
+ bot.tree().expandNode(type.getGroupLabel()).expandNode(type.getViewLabel()).select();
+ bot.button(Label.Button.OK).click();
+
+
+ }
+
+ /**
+ * Open Perspective
+ *
+ * @param type
+ */
+ public void openPerspective(PerspectiveType type) {
+ String perspectiveLabel = "";
+
+ if (type == PerspectiveType.JAVA) {
+ perspectiveLabel = Label.SelectPerspectiveDialog.JAVA;
+ }
+
+ bot.menu(Label.Menu.WINDOW).menu(Label.Menu.OPEN_PERSPECTIVE).menu(
+ Label.Menu.OTHER).click();
+ bot.table().select(perspectiveLabel);
+
+ // Another approach
+ // SWTBotShell openPerpectiveShell = bot.shell("Open Perspective");
+ // openPerpectiveShell.activate();
+
+ bot.button(Label.Button.OK).click();
+ }
+
+ /**
+ * Create Java Project desribed with propriate entity
+ * @param entity
+ */
+ public void createJavaProject(JavaProjectEntity entity) {
+ // NewWizard
+ createNew(EntityType.JAVA_PROJECT);
+ waitForShell(Label.Shell.NEW_JAVA_PROJECT);
+
+ // JavaProjectWizard
+ bot.textWithLabel(Label.JavaProjectWizard.PROJECT_NAME).setText(
+ entity.getProjectName());
+ bot.button(Label.Button.FINISH).click();
+
+ // Wait for shell closing JavaProjectWizard
+ waitForClosedShell(Label.Shell.NEW_JAVA_PROJECT);
+ util.waitForNonIgnoredJobs();
+ }
+
+ /**
+ * Create new Java Class described with JavaClassEntity
+ * @param entity
+ */
+ public void createJavaClass(JavaClassEntity entity) {
+ createNew(EntityType.JAVA_CLASS);
+ waitForShell(Label.Shell.NEW_JAVA_CLASS);
+
+ bot.textWithLabel(Label.NewClassCreationWizard.PACKAGE_NAME).setText(entity.getPackageName());
+ bot.textWithLabel(Label.NewClassCreationWizard.CLASS_NAME).setText(entity.getClassName());
+ bot.button(Label.Button.FINISH).click();
+
+ waitForClosedShell(Label.Shell.NEW_JAVA_CLASS);
+ util.waitForNonIgnoredJobs();
+ }
+
+ /**
+ * Remove entity from package explorer
+ * @param projectName
+ * @param path
+ */
+ public void removeFile(String projectName, String... path) {
+ // Open Package Explorer and aim the Project
+ SWTBot viewBot = bot.viewByTitle(Label.View.PACKAGE_EXPLORER).bot();
+ SWTBotTreeItem item = viewBot.tree().expandNode(projectName);
+
+ // Go through path
+ for ( String nodeName: path ) {
+ item = item.expandNode(nodeName);
+ }
+
+ // Delete File
+ item.select().contextMenu("Delete").click();
+ bot.button(Label.Button.OK).click();
+ }
+
+
+ /**
+ * Open File in Package Explorer
+ * @param projectName
+ * @param path
+ */
+ public void openFile(String projectName, String... path) {
+ SWTBot viewBot = bot.viewByTitle(Label.View.PACKAGE_EXPLORER).bot();
+ SWTBotTreeItem item = viewBot.tree().expandNode(projectName);
+ StringBuilder builder = new StringBuilder(projectName);
+
+ // Go through path
+ for ( String nodeName: path ) {
+ item = item.expandNode(nodeName);
+ builder.append("/" + nodeName);
+ }
+
+ item.select().doubleClick();
+ log.info("File Opened:" + builder.toString());
+ }
+
+
+ // ------------------------------------------------------------
+ // Subroutines
+ // ------------------------------------------------------------
+
+ /**
+ * Invoke Create new entity dialog (it means File -> New -> EntityType -> Next )
+ */
+ public void createNew(EntityType entityType) {
+
+ String groupLabel = entityType.getGroupLabel();
+ String entityLabel = entityType.getEntityLabel();
+
+ bot.menu(Label.Menu.FILE).menu(Label.Menu.NEW).menu(Label.Menu.OTHER).click();
+ waitForShell(Label.Shell.NEW);
+
+ bot.tree().expandNode(groupLabel).select(entityLabel);
+ bot.button(Label.Button.NEXT).click();
+ }
+
+ /**
+ * Wait for appereance shell of given name
+ * @param shellName
+ */
+ public void waitForShell(String shellName) {
+ Matcher<Shell> matcher = WidgetMatcherFactory
+ .withText(shellName);
+ bot.waitUntil(Conditions.waitForShell(matcher));
+ }
+
+ /**
+ * Waits for closed shell with shell name
+ * @param shellName
+ */
+ public void waitForClosedShell(String shellName) {
+ bot.waitWhile(Conditions.shellIsActive(shellName));
+ }
+
+ /**
+ * Assert same content of file in project explorer with content of file in resources
+ * @param pluginId
+ * @param projectName
+ * @param path
+ */
+ public void assertSameContent(String pluginId, String projectName, String... path) {
+ File file = util.getResourceFile(pluginId, path);
+ String resourceContent = util.readTextFile(file);
+
+ openAsText(projectName, path);
+ SWTBotEclipseEditor editor = bot.editorByTitle(path[path.length - 1]).toTextEditor();
+ String fileContent = editor.getText();
+
+ assertEquals(resourceContent, fileContent );
+ }
+
+ /**
+ * Open file from Package Explorer as text
+ * @param projectName
+ * @param path
+ */
+ public void openAsText(String projectName, String... path) {
+ SWTBot viewBot = bot.viewByTitle(Label.View.PACKAGE_EXPLORER).bot();
+ SWTBotTreeItem item = viewBot.tree().expandNode(projectName);
+
+ // Go through path
+ for ( String nodeName: path ) {
+ log.info(nodeName);
+ item = item.expandNode(nodeName);
+ }
+
+ item.select();
+ }
+
+ /**
+ * Replace class content from content of class from resource
+ * @param pluginId
+ * @param path
+ */
+ public void setClassContentFromResource(String pluginId, String... path) {
+ SWTBotEclipseEditor editor;
+ editor = bot.editorByTitle(path[path.length - 1]).toTextEditor();
+ editor.selectRange(0, 0, editor.getLineCount());
+ File file = util.getResourceFile(pluginId, path);
+ String content = util.readTextFile(file);
+ editor.setText(content);
+ editor.save();
+ }
+}
Added: 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 (rev 0)
+++ trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/SWTTestExt.java 2009-11-10 14:29:25 UTC (rev 18568)
@@ -0,0 +1,43 @@
+ /*******************************************************************************
+ * 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;
+
+import java.util.Properties;
+
+import org.apache.log4j.Logger;
+
+/**
+ * Base class for SWTBot Tests using SWTBotExt
+ * @author jpeterka
+ *
+ */
+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();
+ private static Properties properties;
+
+ /**
+ * Get properties for hibernate tests
+ * @param key
+ */
+ public static String getProperty(String key) {
+ return util.getValue(properties,key);
+ }
+
+ // Wait Constants
+ public static int TIME_1S = 1000;
+ public static int TIME_5S = 5000;
+ public static int TIME_10S = 10000;
+ public static int TIME_20S = 20000;
+}
Added: trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/SWTUtilExt.java
===================================================================
--- trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/SWTUtilExt.java (rev 0)
+++ trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/SWTUtilExt.java 2009-11-10 14:29:25 UTC (rev 18568)
@@ -0,0 +1,305 @@
+ /*******************************************************************************
+ * 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;
+
+import static org.junit.Assert.fail;
+
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.FileReader;
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Properties;
+
+import org.apache.log4j.Logger;
+import org.eclipse.core.runtime.FileLocator;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.swtbot.swt.finder.utils.SWTUtils;
+import org.jboss.tools.ui.bot.ext.types.JobLists;
+import org.jboss.tools.ui.bot.ext.types.JobState;
+import org.osgi.framework.Bundle;
+
+/**
+ * Base class for all classes using SWTBot
+ *
+ * @author jpeterka
+ *
+ */
+public class SWTUtilExt extends SWTUtils {
+
+ private Logger log = Logger.getLogger(SWTUtilExt.class);
+ protected SWTBotExt bot = new SWTBotExt();
+
+ // ------------------------------------------------------------
+ // Waiting methods
+ // ------------------------------------------------------------
+
+ // Constants
+ final int TIMEOUT = 20000; // 10s
+ final int SLEEPTIME = 1000; // 0.5s
+
+ /**
+ * Wait for named running jobs with defined TIMEOUT
+ */
+ public void waitForJobs(String... jobNames) {
+ waitForJobs(TIMEOUT, jobNames);
+ }
+
+ /**
+ * Wait for all running jobs not named in JobList.ignoredJobs
+ */
+ public void waitForNonIgnoredJobs() {
+ waitForAllExcept(JobLists.ignoredJobs);
+ }
+
+ /**
+ * Wait for all running jobs
+ */
+ public void waitForAll() {
+ waitForAllExcept(new String[0]);
+ }
+
+ /**
+ * Wait for all running jobs except named jobs
+ * @param jobNames
+ */
+ public void waitForAllExcept(String... jobNames) {
+
+ // Find all jobs
+ Job[] jobs = Job.getJobManager().find(null);
+ List<String> listNames = new ArrayList<String>();
+
+ for (Job job : jobs) {
+ listNames.add(job.getName());
+ }
+
+ // Remove ignored jobs
+ for (String jobName : jobNames) {
+ if (listNames.contains(jobName))
+ listNames.remove(jobName);
+ }
+
+ // Create rest job list
+ String[] names = new String[listNames.size()];
+ for (int i = 0; i < listNames.size(); i++) {
+ names[i] = listNames.get(i);
+ }
+
+ waitForJobs(names);
+ }
+
+ /**
+ * Waits for selected job
+ * @param timeOut
+ * @param jobNames
+ */
+ public void waitForJobs(long timeOut, String... jobNames) {
+
+ // DEBUG
+ printRunningJobs();
+
+ // No Jobs
+ if (jobNames == null || jobNames.length == 0) {
+ log.info("No jobs prescribed as blocking");
+ delay();
+ return;
+ }
+
+ // Jobs prescribed
+ long startTime = System.currentTimeMillis();
+ List<String> blockingJobs = new ArrayList<String>();
+
+ // Go through jobs and wait for completion
+ for (String jobName : jobNames) {
+ if (isJobRunning(jobName)) {
+ log.info("Blocking job " + jobName + " found");
+ blockingJobs.add(jobName);
+ }
+ }
+
+ // Wait until all blocking jobs aren't finished or timeout
+ for (String jobName : blockingJobs) {
+ while (true) {
+ if (!isJobRunning(jobName)) {
+ log.info("Job " + jobName + " is finished");
+ break;
+ }
+
+ long waitTime = System.currentTimeMillis() - startTime;
+ if ((System.currentTimeMillis() - startTime) > TIMEOUT) {
+ log.info("Waiting for job " + jobName + " TIMEOUT");
+ break;
+ }
+ log.info("Job \"" + jobName + "\" is running for " + waitTime
+ / 1000 + "s");
+ bot.sleep(SLEEPTIME);
+ }
+ }
+
+ log.info("All blocking jobs finished or skipped");
+ }
+
+ /**
+ * Search for jobname in JobManager job list
+ *
+ * @param jobName
+ * name of the job
+ * @return true if job with corresponding name found, else false
+ */
+ private boolean isJobRunning(String jobName) {
+ Job[] jobs = Job.getJobManager().find(null);
+ for (Job job : jobs) {
+ if ((jobName.equalsIgnoreCase(job.getName()))
+ && ((job.getState() == JobState.RUNNING) || (job.getState() == JobState.WAITING)))
+ return true;
+ }
+ return false;
+ }
+
+ private void printRunningJobs() {
+ Job[] jobs = Job.getJobManager().find(null);
+ for (Job job : jobs) {
+
+ String jobStateName = JobState.getStateName(job.getState());
+
+ log.info("Active Job: P:" + job.getPriority() + "\" S:"
+ + jobStateName + "\" R:" + job.getResult() + "\" N:\""
+ + job.getName() + "\"");
+ }
+ }
+
+ public void delay() {
+ bot.sleep(500);
+ }
+
+ // ------------------------------------------------------------
+ // Resource methods
+ // ------------------------------------------------------------
+
+ /**
+ * Get resource file
+ */
+ public File getResourceFile(String pluginId, String... path) {
+
+ // Construct path
+ StringBuilder builder = new StringBuilder();
+ for (String fragment: path) {
+ builder.append("/" + fragment);
+ }
+
+ String filePath = "";
+ try {
+ filePath = FileLocator.toFileURL(
+ Platform.getBundle(pluginId).getEntry("/"))
+ .getFile() + "resources" + builder.toString();
+ File file = new File(filePath);
+ if (!file.isFile()) {
+ filePath = FileLocator.toFileURL(
+ Platform.getBundle(pluginId).getEntry("/"))
+ .getFile() + builder.toString();
+ }
+ } catch (IOException ex) {
+ String message = filePath + " resource file not found";
+ log.error(message);
+ fail(message);
+ }
+
+ File file = new File(filePath);
+ return file;
+ }
+
+ /**
+ * Reads text file
+ *
+ * @param file
+ * @return
+ */
+ public String readTextFile(File file) {
+
+ StringBuilder contents = new StringBuilder();
+
+ try {
+ BufferedReader input = new BufferedReader(new FileReader(file));
+ try {
+ String line = null; //not declared within while loop
+ while (( line = input.readLine()) != null){
+ contents.append(line);
+ contents.append(System.getProperty("line.separator"));
+ }
+ }
+ finally {
+ input.close();
+ }
+ }
+ catch (IOException ex){
+ ex.printStackTrace();
+ }
+
+ return contents.toString();
+ }
+
+ /**
+ * Loads project property file for particular test plugin
+ * @param pluginId
+ * @return
+ */
+ public Properties loadProperties(String pluginId) {
+ Properties properties = new Properties();
+ try {
+ log.info("Loading properties for " + pluginId);
+ // Read project properties
+ Bundle bundle = Platform.getBundle(pluginId);
+ InputStream is = bundle.getResource("project.properties").openStream();
+ properties.load(is);
+ log.info("Properties for " + pluginId + " loaded:");
+
+ } catch (Exception ex) {
+ logAndFail("Problem with loading properties file");
+ }
+ return properties;
+ }
+
+ /**
+ * Get value from property file with error logging
+ * @param properties
+ * @param key
+ * @return
+ */
+ public String getValue(Properties properties, String key) {
+ String value = properties.getProperty(key);
+ if ((value == null) || value.equalsIgnoreCase("")) {
+ logAndFail("Missing property value for key \"" + key
+ + "\"");
+ }
+ return value;
+ }
+
+ /**
+ * Check Property values
+ * @param properties
+ * @param key
+ */
+ public void checkAndLogValue(Properties properties, String key) {
+ log.info(key + "=" + getValue(properties, key));
+ }
+
+ /**
+ * Log and fail
+ * @param msg
+ */
+ public void logAndFail(String msg) {
+ log.error(msg);
+ fail(msg);
+ }
+}
\ No newline at end of file
Added: trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/entity/JavaClassEntity.java
===================================================================
--- trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/entity/JavaClassEntity.java (rev 0)
+++ trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/entity/JavaClassEntity.java 2009-11-10 14:29:25 UTC (rev 18568)
@@ -0,0 +1,40 @@
+ /*******************************************************************************
+ * 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.entity;
+
+/**
+ * Java Class Entity describing needed attributes of Java class for bot test purposes
+ * @author jpeterka
+ *
+ */
+public class JavaClassEntity {
+
+ private String className = "";
+ private String packageName = "";
+
+ public String getClassName() {
+ return className;
+ }
+
+ public void setClassName(String className) {
+ this.className = className;
+ }
+
+ public String getPackageName() {
+ return packageName;
+ }
+
+ public void setPackageName(String packageName) {
+ this.packageName = packageName;
+ }
+
+
+}
Added: trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/entity/JavaProjectEntity.java
===================================================================
--- trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/entity/JavaProjectEntity.java (rev 0)
+++ trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/entity/JavaProjectEntity.java 2009-11-10 14:29:25 UTC (rev 18568)
@@ -0,0 +1,30 @@
+ /*******************************************************************************
+ * 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.entity;
+
+/**
+ * This class is describing needed Java Project parameters used as input parameter for other methods
+ * @author jpeterka
+ *
+ */
+public class JavaProjectEntity {
+
+ String projectName;
+
+ public String getProjectName() {
+ return projectName;
+ }
+
+ public void setProjectName(String projectName) {
+ this.projectName = projectName;
+ }
+
+}
Added: trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/helper/ContextMenuHelper.java
===================================================================
--- trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/helper/ContextMenuHelper.java (rev 0)
+++ trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/helper/ContextMenuHelper.java 2009-11-10 14:29:25 UTC (rev 18568)
@@ -0,0 +1,131 @@
+ /*******************************************************************************
+ * 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.helper;
+
+import static org.eclipse.swtbot.swt.finder.matchers.WidgetMatcherFactory.withMnemonic;
+import static org.hamcrest.Matchers.allOf;
+import static org.hamcrest.Matchers.instanceOf;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.widgets.Menu;
+import org.eclipse.swt.widgets.MenuItem;
+import org.eclipse.swt.widgets.Widget;
+import org.eclipse.swtbot.swt.finder.exceptions.WidgetNotFoundException;
+import org.eclipse.swtbot.swt.finder.finders.UIThreadRunnable;
+import org.eclipse.swtbot.swt.finder.results.VoidResult;
+import org.eclipse.swtbot.swt.finder.results.WidgetResult;
+import org.eclipse.swtbot.swt.finder.widgets.AbstractSWTBot;
+import org.hamcrest.Matcher;
+
+/**
+ * Helper to find context menu of widget
+ * @author Vladimir Pakan
+ *
+ */
+public class ContextMenuHelper {
+
+ /**
+ * Clicks the context menu matching the text.
+ *
+ * @param bot bot containing context menu.
+ * @param text the text on the context menu.
+ * @param hideAfterwards hide menu when method is finished.
+ * @throws WidgetNotFoundException if the widget is not found.
+ */
+ public static MenuItem getContextMenu(final AbstractSWTBot<?> bot,
+ final String text, final boolean hideAfterwards) {
+ final MenuItem menuItem = UIThreadRunnable
+ .syncExec(new WidgetResult<MenuItem>() {
+ @SuppressWarnings("unchecked")
+ public MenuItem run() {
+ MenuItem menuItem = null;
+ Menu menu = getWidgetMenu(bot.widget);
+ Matcher<?> matcher = allOf(instanceOf(MenuItem.class),withMnemonic(text));
+ menuItem = show(menu, matcher, hideAfterwards);
+ if (menuItem != null) {
+ menu = menuItem.getMenu();
+ } else {
+ hide(menu);
+ }
+ return menuItem;
+ }
+ });
+ if (menuItem == null) {
+ throw new WidgetNotFoundException("Could not find menu: " + text);
+ }
+ else{
+ if (hideAfterwards){
+ // hide
+ UIThreadRunnable.syncExec(new VoidResult() {
+ public void run() {
+ hide(menuItem.getParent());
+ }
+ });
+ }
+
+ return menuItem;
+ }
+ }
+ /**
+ * Simulate Show event to menu and returns MenuItem matching to matcher
+ * @param menu
+ * @param matcher
+ * @param hideAfterwards
+ * @return
+ */
+ private static MenuItem show(final Menu menu, final Matcher<?> matcher, final boolean hideAfterwards) {
+ if (menu != null) {
+ menu.notifyListeners(SWT.Show, new Event());
+ MenuItem[] items = menu.getItems();
+ for (final MenuItem menuItem : items) {
+ if (matcher.matches(menuItem)) {
+ return menuItem;
+ }
+ }
+ if (hideAfterwards){
+ menu.notifyListeners(SWT.Hide, new Event());
+ }
+ }
+ return null;
+ }
+ /**
+ * Recursively hide menus
+ * @param menu bottom menu to start hiding from
+ */
+ private static void hide(final Menu menu) {
+ menu.notifyListeners(SWT.Hide, new Event());
+ if (menu.getParentMenu() != null) {
+ hide(menu.getParentMenu());
+ }
+ }
+ /**
+ * Returns menu of input widget
+ * @param widget
+ * @return
+ */
+ private static Menu getWidgetMenu (Widget widget){
+
+ Menu result = null;
+
+ if (widget instanceof MenuItem){
+ result = ((MenuItem)widget).getMenu();
+ }
+ else{
+ result = ((Control)widget).getMenu();
+ }
+
+ return result;
+
+ }
+}
Added: 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 (rev 0)
+++ trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/types/EntityType.java 2009-11-10 14:29:25 UTC (rev 18568)
@@ -0,0 +1,52 @@
+ /*******************************************************************************
+ * 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;
+
+import static org.junit.Assert.fail;
+
+/**
+ * Provides functionality for evaluation particular entity location like projects types, file types, etc.
+ * @author jpeterka
+ */
+public enum EntityType {
+ HIBERNATE_MAPPING_FILE, JAVA_PROJECT, JAVA_CLASS;
+
+ public String getGroupLabel() {
+ String groupLabel = "";
+
+
+ switch (this) {
+ case HIBERNATE_MAPPING_FILE: groupLabel = Label.EntityGroup.HIBERNATE; break;
+ case JAVA_PROJECT: groupLabel = Label.EntityGroup.JAVA; break;
+ case JAVA_CLASS: groupLabel = Label.EntityGroup.JAVA; break;
+ default: fail("Unknown Entity Type");
+ }
+
+ return groupLabel;
+ }
+
+ /**
+ * Return entity label acc
+ * @return
+ */
+ public String getEntityLabel() {
+ String entityLabel = "";
+
+ switch (this) {
+ case HIBERNATE_MAPPING_FILE: entityLabel = Label.EntityLabel.HIBERNATE_MAPPING_FILE; break;
+ case JAVA_PROJECT: entityLabel = Label.EntityLabel.JAVA_PROJECT; break;
+ case JAVA_CLASS: entityLabel = Label.EntityLabel.JAVA_CLASS; break;
+ default: fail("Unknown Entity Type");
+ }
+
+ return entityLabel;
+ }
+}
\ No newline at end of file
Added: trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/types/JobLists.java
===================================================================
--- trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/types/JobLists.java (rev 0)
+++ trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/types/JobLists.java 2009-11-10 14:29:25 UTC (rev 18568)
@@ -0,0 +1,20 @@
+ /*******************************************************************************
+ * 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;
+
+/**
+ * Class provides job lists like list of jobs which should be ignored for wait methods
+ **/
+public class JobLists {
+
+ public static String[] ignoredJobs = { "Usage Data Event consumer",
+ "Updating indexes" };
+}
Added: trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/types/JobState.java
===================================================================
--- trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/types/JobState.java (rev 0)
+++ trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/types/JobState.java 2009-11-10 14:29:25 UTC (rev 18568)
@@ -0,0 +1,39 @@
+ /*******************************************************************************
+ * 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;
+
+/**
+ * Support class for JobState evaluation
+ * @author jpeterka
+ */
+public class JobState {
+ public static final int NONE = 0;
+ public static final int SLEEPING = 1;
+ public static final int WAITING = 2;
+ public static final int RUNNING = 4;
+
+ public static String getStateName(int jobState) {
+ String jobStateName = "";
+
+ if (jobState == JobState.NONE)
+ jobStateName = "None";
+ else if (jobState == JobState.SLEEPING)
+ jobStateName = "Sleeping";
+ else if (jobState == 2)
+ jobStateName = "Waiting";
+ else if (jobState == 4)
+ jobStateName = "Running";
+ else
+ throw new IllegalArgumentException("Unknown JobState");
+
+ return jobStateName;
+ }
+}
Added: 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/Label.java (rev 0)
+++ trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/types/Label.java 2009-11-10 14:29:25 UTC (rev 18568)
@@ -0,0 +1,94 @@
+ /*******************************************************************************
+ * 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 Label {
+ 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 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";
+
+ }
+}
Added: trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/types/PerspectiveType.java
===================================================================
--- trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/types/PerspectiveType.java (rev 0)
+++ trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/types/PerspectiveType.java 2009-11-10 14:29:25 UTC (rev 18568)
@@ -0,0 +1,20 @@
+ /*******************************************************************************
+ * 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;
+
+/**
+ * Eclipse perspective type enum
+ * @author jpeterka
+ *
+ */
+public enum PerspectiveType {
+ SEAM, JAVA, WEB_DEVELOPMENT;
+}
Added: trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/types/ProjectType.java
===================================================================
--- trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/types/ProjectType.java (rev 0)
+++ trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/types/ProjectType.java 2009-11-10 14:29:25 UTC (rev 18568)
@@ -0,0 +1,20 @@
+ /*******************************************************************************
+ * 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;
+
+/**
+ * Eclipse project type enum
+ * @author jpeterka
+ *
+ */
+public enum ProjectType {
+ JAVA, SEAM
+}
Added: 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 (rev 0)
+++ trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/types/ViewType.java 2009-11-10 14:29:25 UTC (rev 18568)
@@ -0,0 +1,41 @@
+ /*******************************************************************************
+ * 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;
+
+import static org.junit.Assert.fail;
+
+/**
+ * Provides functionality to locate appropriate view type
+ * @author jpeterka
+ *
+ */
+public enum ViewType {
+ PROJECT_EXPLORER, WELCOME;
+
+
+ public String getGroupLabel() {
+ String viewLabel = "";
+ switch (this) {
+ case PROJECT_EXPLORER: viewLabel = Label.ViewGroup.GENERAL; break;
+ default: fail("Unknown View Type");
+ }
+ return viewLabel;
+ }
+
+ public String getViewLabel() {
+ String viewLabel = "";
+ switch (this) {
+ case PROJECT_EXPLORER: viewLabel = Label.View.PROJECT_EXPLORER; break;
+ default: fail("Unknown View Type");
+ }
+ return viewLabel;
+ }
+}
15 years, 1 month
JBoss Tools SVN: r18567 - trunk/jst/tests.
by jbosstools-commits@lists.jboss.org
Author: jpeterka
Date: 2009-11-10 09:23:07 -0500 (Tue, 10 Nov 2009)
New Revision: 18567
Added:
trunk/jst/tests/org.jboss.tools.ui.bot.ext/
Log:
Initial import.
15 years, 1 month
JBoss Tools SVN: r18565 - trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor.
by jbosstools-commits@lists.jboss.org
Author: yzhishko
Date: 2009-11-10 08:25:15 -0500 (Tue, 10 Nov 2009)
New Revision: 18565
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeController.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeEditorPart.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeVisualDomBuilder.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-5161 https://jira.jboss.org/jira/browse/JBIDE-5105 fixed
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeController.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeController.java 2009-11-10 09:40:28 UTC (rev 18564)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeController.java 2009-11-10 13:25:15 UTC (rev 18565)
@@ -274,7 +274,10 @@
WebAppHelper.getWebApp(xm));
}
}
-
+
+ // Fix for JBIDE-5105, JBIDE-5161
+ visualEditor.getEditor();
+
IDOMDocument sourceDocument = sourceModel.getDocument();
// FIXED FOR JBIDE-3799 by sdzmitrovich, moved calling of this method to buid dom
// visualBuilder.refreshExternalLinks();
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeEditorPart.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeEditorPart.java 2009-11-10 09:40:28 UTC (rev 18564)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeEditorPart.java 2009-11-10 13:25:15 UTC (rev 18565)
@@ -913,7 +913,9 @@
// initialize editor
// this method must be invoked before any visual
// node is created, see JBIDE-5105
- visualEditor.getEditor();
+ // this method should be called after browser was loading
+ // see JBIDE-5161
+ // visualEditor.getEditor();
}
public void createPreviewBrowser() {
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeVisualDomBuilder.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeVisualDomBuilder.java 2009-11-10 09:40:28 UTC (rev 18564)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeVisualDomBuilder.java 2009-11-10 13:25:15 UTC (rev 18565)
@@ -198,6 +198,11 @@
}
public void buildDom(Document sourceDocument) {
+ nsIDOMNodeList children = getContentArea().getChildNodes();
+ long len = children.getLength();
+ for (long i = len - 1; i >= 0; i--) {
+ getContentArea().removeChild(children.item(i));
+ }
VpeSourceDomBuilder sourceBuilder = pageContext.getSourceBuilder();
IDocument document = sourceBuilder.getStructuredTextViewer()
.getDocument();
@@ -252,13 +257,16 @@
// FIXED FOR JBIDE-3799 by sdzmitrovich, moved calling of this method to buid dom
// refreshExternalLinks();
pageContext.getBundle().refreshRegisteredBundles();
+
+ //Next path was moved to buildDom method
+ //to avoid <br> in a visual DOM before editor browser
+ //load and after reload
+// nsIDOMNodeList children = getContentArea().getChildNodes();
+// long len = children.getLength();
+// for (long i = len - 1; i >= 0; i--) {
+// getContentArea().removeChild(children.item(i));
+// }
- nsIDOMNodeList children = getContentArea().getChildNodes();
- long len = children.getLength();
- for (long i = len - 1; i >= 0; i--) {
- getContentArea().removeChild(children.item(i));
- }
-
if (sourceDocument != null) {
buildDom(sourceDocument);
}
15 years, 1 month
JBoss Tools SVN: r18564 - trunk/documentation/jbosstools-jdocbook-style/src/main/org/css/css.
by jbosstools-commits@lists.jboss.org
Author: msorokin
Date: 2009-11-10 04:40:28 -0500 (Tue, 10 Nov 2009)
New Revision: 18564
Modified:
trunk/documentation/jbosstools-jdocbook-style/src/main/org/css/css/tools.css
Log:
updated the styles to include a note about co-authors
Modified: trunk/documentation/jbosstools-jdocbook-style/src/main/org/css/css/tools.css
===================================================================
--- trunk/documentation/jbosstools-jdocbook-style/src/main/org/css/css/tools.css 2009-11-10 09:39:28 UTC (rev 18563)
+++ trunk/documentation/jbosstools-jdocbook-style/src/main/org/css/css/tools.css 2009-11-10 09:40:28 UTC (rev 18564)
@@ -85,7 +85,7 @@
.corpauthor img{
display:none !important;
}
-
+.othercredit h3 {font-size: 12px;}
ul.docnav {
margin:0px;
width: 57em;
@@ -324,3 +324,4 @@
font-style:normal;
}
+
15 years, 1 month