JBoss Tools SVN: r21473 - trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/src/org/jboss/tools/hibernate/ui/bot/testcase.
by jbosstools-commits@lists.jboss.org
Author: jpeterka
Date: 2010-04-14 10:39:41 -0400 (Wed, 14 Apr 2010)
New Revision: 21473
Modified:
trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/src/org/jboss/tools/hibernate/ui/bot/testcase/DaliTest.java
Log:
Dali test update for latest JBT-trunk
Modified: 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 2010-04-14 14:39:15 UTC (rev 21472)
+++ trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/src/org/jboss/tools/hibernate/ui/bot/testcase/DaliTest.java 2010-04-14 14:39:41 UTC (rev 21473)
@@ -58,6 +58,8 @@
// JPA Facet Page
bot.comboBoxInGroup("Platform").setSelection("Hibernate");
+ //bot.comboBoxInGroup("JPA Implementation").setSelection("Library Provided by Target Runtime");
+ bot.comboBoxInGroup("JPA implementation").setSelection("Disable Library Configuration");
// Finish
bot.button(IDELabel.Button.FINISH).click();
@@ -98,9 +100,7 @@
bot.button(IDELabel.Button.FINISH).click();
// Check file
- ProjectExplorer explorer = new ProjectExplorer();
- explorer.openFile(Project.JPA_PRJ_NAME, Project.DDL_OUTPUT,
- Project.DDL_FILENAME);
+ packageExplorer.openFile(Project.JPA_PRJ_NAME, Project.DDL_OUTPUT, Project.DDL_FILENAME);
}
/**
14 years, 9 months
JBoss Tools SVN: r21472 - trunk/jsf/features/org.jboss.tools.richfaces.feature.
by jbosstools-commits@lists.jboss.org
Author: nickboldt
Date: 2010-04-14 10:39:15 -0400 (Wed, 14 Apr 2010)
New Revision: 21472
Modified:
trunk/jsf/features/org.jboss.tools.richfaces.feature/feature.xml
Log:
https://jira.jboss.org/jira/browse/JBIDE-6127 add <plugin id="org.jboss.tools.jsf.vpe.jbpm"> to richfaces feature too (already in jsf.feature)
Modified: trunk/jsf/features/org.jboss.tools.richfaces.feature/feature.xml
===================================================================
--- trunk/jsf/features/org.jboss.tools.richfaces.feature/feature.xml 2010-04-14 14:17:44 UTC (rev 21471)
+++ trunk/jsf/features/org.jboss.tools.richfaces.feature/feature.xml 2010-04-14 14:39:15 UTC (rev 21472)
@@ -335,4 +335,10 @@
version="0.0.0"
unpack="false"/>
+ <plugin
+ id="org.jboss.tools.jsf.vpe.jbpm"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"/>
+
</feature>
14 years, 9 months
JBoss Tools SVN: r21471 - branches/modular_build.
by jbosstools-commits@lists.jboss.org
Author: nickboldt
Date: 2010-04-14 10:17:44 -0400 (Wed, 14 Apr 2010)
New Revision: 21471
Modified:
branches/modular_build/build.xml
Log:
tweak COMMON_TOOLS dir defn
Modified: branches/modular_build/build.xml
===================================================================
--- branches/modular_build/build.xml 2010-04-14 14:15:36 UTC (rev 21470)
+++ branches/modular_build/build.xml 2010-04-14 14:17:44 UTC (rev 21471)
@@ -54,7 +54,7 @@
<target name="init" depends="local">
<property name="WORKINGDIR" value="${basedir}" />
- <property name="COMMON_TOOLS" value="${basedir}/../tools" />
+ <property name="COMMON_TOOLS" value="${WORKINGDIR}/../tools" />
<mkdir dir="${COMMON_TOOLS}" />
<available file="${COMMON_TOOLS}/ant-contrib.jar" type="file" property="ant-contrib.jar.exists" />
14 years, 9 months
JBoss Tools SVN: r21470 - trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/src/org/jboss/tools/hibernate/ui/bot/testcase.
by jbosstools-commits@lists.jboss.org
Author: jpeterka
Date: 2010-04-14 10:15:36 -0400 (Wed, 14 Apr 2010)
New Revision: 21470
Modified:
trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/src/org/jboss/tools/hibernate/ui/bot/testcase/ConsolePerspectiveTest.java
Log:
Initial OpenPerspectiveElement test added
Modified: 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 2010-04-14 14:08:07 UTC (rev 21469)
+++ trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/src/org/jboss/tools/hibernate/ui/bot/testcase/ConsolePerspectiveTest.java 2010-04-14 14:15:36 UTC (rev 21470)
@@ -12,6 +12,7 @@
import org.eclipse.swtbot.swt.finder.junit.SWTBotJunit4ClassRunner;
import org.jboss.tools.hibernate.ui.bot.testsuite.HibernateTest;
+import org.jboss.tools.ui.bot.ext.gen.ActionItem;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -19,11 +20,21 @@
public class ConsolePerspectiveTest extends HibernateTest {
/**
- * TC 17
+ * TC 17 - Check presence of basic hibernate views
*/
@Test
public void openPerspectiveElements() {
-
+ bot.viewByTitle("Welcome").close();
+
+ open.perspective(ActionItem.Perspective.HIBERNATE.LABEL);
+ bot.sleep(TIME_1S);
+
+ open.viewOpen(ActionItem.View.HibernateHibernateConfigurations.LABEL);
+ bot.sleep(TIME_1S);
+ open.viewOpen(ActionItem.View.HibernateHibernateDynamicSQLPreview.LABEL);
+ bot.sleep(TIME_1S);
+ open.viewOpen(ActionItem.View.HibernateHibernateQueryResult.LABEL);
+ bot.sleep(TIME_1S);
}
}
14 years, 9 months
JBoss Tools SVN: r21469 - in trunk: vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: mareshkau
Date: 2010-04-14 10:08:07 -0400 (Wed, 14 Apr 2010)
New Revision: 21469
Added:
trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/wizard/NewXHTMLPageWizardTest.java
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/wizard/newfile/NewXHTMLWizard.java
trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/VPEAllBotTests.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-5946
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/wizard/newfile/NewXHTMLWizard.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/wizard/newfile/NewXHTMLWizard.java 2010-04-14 12:58:06 UTC (rev 21468)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/wizard/newfile/NewXHTMLWizard.java 2010-04-14 14:08:07 UTC (rev 21469)
@@ -82,7 +82,7 @@
// no file extension specified so add default extension
String fileName = fNewFilePage.getFileName();
if (fileName.lastIndexOf('.') == -1) {
- String newFileName = fileName+".xthml"; //$NON-NLS-1$
+ String newFileName = fileName+".xhtml"; //$NON-NLS-1$
fNewFilePage.setFileName(newFileName);
}
Modified: trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/VPEAllBotTests.java
===================================================================
--- trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/VPEAllBotTests.java 2010-04-14 12:58:06 UTC (rev 21468)
+++ trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/VPEAllBotTests.java 2010-04-14 14:08:07 UTC (rev 21469)
@@ -24,6 +24,7 @@
import org.jboss.tools.vpe.ui.bot.test.smoke.RenameXHTMLFileTest;
import org.jboss.tools.vpe.ui.bot.test.smoke.XHTMLPageCreationTest;
import org.jboss.tools.vpe.ui.bot.test.wizard.ImportUnknownTagsWizardTest;
+import org.jboss.tools.vpe.ui.bot.test.wizard.NewXHTMLPageWizardTest;
public class VPEAllBotTests extends SWTBotTestCase{
public static Test suite(){
@@ -49,7 +50,7 @@
suite.addTestSuite(RenameJSPFileTest.class);
suite.addTestSuite(RenameXHTMLFileTest.class);
suite.addTestSuite(ImportUnknownTagsWizardTest.class);
-
+ suite.addTestSuite(NewXHTMLPageWizardTest.class);
return new TestSetup(suite);
}
}
Added: trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/wizard/NewXHTMLPageWizardTest.java
===================================================================
--- trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/wizard/NewXHTMLPageWizardTest.java (rev 0)
+++ trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/wizard/NewXHTMLPageWizardTest.java 2010-04-14 14:08:07 UTC (rev 21469)
@@ -0,0 +1,53 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2010 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.vpe.ui.bot.test.wizard;
+
+import org.eclipse.swtbot.swt.finder.widgets.SWTBotTree;
+import org.jboss.tools.ui.bot.test.WidgetVariables;
+import org.jboss.tools.vpe.ui.bot.test.VPEAutoTestCase;
+
+/**
+ * @author mareshkau
+ *
+ */
+public class NewXHTMLPageWizardTest extends VPEAutoTestCase{
+
+ @Override
+ protected void closeUnuseDialogs() {
+ // TODO Auto-generated method stub
+
+ }
+
+ @Override
+ protected boolean isUnuseDialogOpened() {
+ // TODO Auto-generated method stub
+ return false;
+ }
+
+ public void testNewXHTMLPageWizard() {
+ /*
+ * Open wizard page
+ */
+ this.bot.menu("File").menu("New").menu("Other...").click(); //$NON-NLS-1$//$NON-NLS-2$//$NON-NLS-3$
+ this.bot.shell("New").activate(); //$NON-NLS-1$
+ SWTBotTree importTree = this.bot.tree();
+ importTree.expandNode("JBoss Tools Web").select("XHTML Page"); //$NON-NLS-1$//$NON-NLS-2$
+ this.bot.button(WidgetVariables.NEXT_BUTTON).click();
+ this.bot.shell("New XHTML Page"); //$NON-NLS-1$
+// this.bot.textWithMessage("File name:").setText("test.xhtml"); //$NON-NLS-1$
+ this.bot.textWithLabel("File name:").setText("test"); //$NON-NLS-1$ //$NON-NLS-2$
+ this.bot.button(WidgetVariables.NEXT_BUTTON).click();
+ this.bot.checkBox("Use XHTML Template").click(); //$NON-NLS-1$
+ this.bot.button(WidgetVariables.FINISH_BUTTON).click();
+ assertEquals("Active Editor Title should be" ,"test.xhtml", this.bot.activeEditor().getTitle()); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+
+}
14 years, 9 months
JBoss Tools SVN: r21468 - trunk/esb/docs/esb_ref_guide/en-US.
by jbosstools-commits@lists.jboss.org
Author: abogachuk
Date: 2010-04-14 08:58:06 -0400 (Wed, 14 Apr 2010)
New Revision: 21468
Modified:
trunk/esb/docs/esb_ref_guide/en-US/esb_support.xml
Log:
https://jira.jboss.org/jira/browse/JBDS-1143 Jboss AS docs mistakes.
Text was corrected.
Modified: trunk/esb/docs/esb_ref_guide/en-US/esb_support.xml
===================================================================
--- trunk/esb/docs/esb_ref_guide/en-US/esb_support.xml 2010-04-14 12:47:12 UTC (rev 21467)
+++ trunk/esb/docs/esb_ref_guide/en-US/esb_support.xml 2010-04-14 12:58:06 UTC (rev 21468)
@@ -195,8 +195,8 @@
<title>Deploying a ESB Project</title>
<para>In this chapter you will see how to deploy a ESB project using the WTP deployment framework.</para>
- <para>Before deploying the project, open the JBoss Server View by selecting <emphasis><property>Window > Show View > Other >
- Server > JBoss Server View</property></emphasis>,
+ <para>Before deploying the project, open the Servers View by selecting <emphasis><property>Window > Show View > Other >
+ Server > Servers</property></emphasis>,
create a JBoss Server in the Server view and start it, and then right click the created JBoss server,
select <emphasis><property> </property> Add and Remove Projects</emphasis>,
and add the ESB projects you want to deploy from the left side to the right side in the opened dialog. </para>
@@ -214,7 +214,7 @@
You also can drag the ESB project from the Project View to the server.</para>
<figure>
- <title>JBoss Server View</title>
+ <title>Servers View</title>
<mediaobject>
<imageobject>
<imagedata fileref="images/esb_project/09_esb_runtime_new.png"/>
14 years, 9 months
JBoss Tools SVN: r21467 - trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/src/org/jboss/tools/hibernate/ui/bot/testcase.
by jbosstools-commits@lists.jboss.org
Author: jpeterka
Date: 2010-04-14 08:47:12 -0400 (Wed, 14 Apr 2010)
New Revision: 21467
Modified:
trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/src/org/jboss/tools/hibernate/ui/bot/testcase/CodeGenerationLauncherTest.java
Log:
Fix Project Explorer problem and changed to updated SWTBotExt API
Modified: 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 2010-04-14 12:33:06 UTC (rev 21466)
+++ trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/src/org/jboss/tools/hibernate/ui/bot/testcase/CodeGenerationLauncherTest.java 2010-04-14 12:47:12 UTC (rev 21467)
@@ -12,18 +12,17 @@
import org.eclipse.swt.widgets.Button;
import org.eclipse.swtbot.eclipse.finder.matchers.WidgetMatcherFactory;
-import org.eclipse.swtbot.swt.finder.SWTBot;
import org.eclipse.swtbot.swt.finder.junit.SWTBotJunit4ClassRunner;
import org.eclipse.swtbot.swt.finder.widgets.SWTBotCheckBox;
import org.eclipse.swtbot.swt.finder.widgets.SWTBotMenu;
import org.eclipse.swtbot.swt.finder.widgets.SWTBotShell;
-import org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem;
import org.hamcrest.Matcher;
import org.jboss.tools.hibernate.ui.bot.testsuite.HibernateTest;
import org.jboss.tools.hibernate.ui.bot.testsuite.Project;
+import org.jboss.tools.ui.bot.ext.gen.ActionItem;
import org.jboss.tools.ui.bot.ext.types.IDELabel;
import org.jboss.tools.ui.bot.ext.types.PerspectiveType;
-import org.jboss.tools.ui.bot.ext.types.ViewType;
+import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -38,7 +37,7 @@
/**
* Setup prerequisites for this test
*/
- public void setUpTest() {
+ public static void setUpTest() {
prepareProject();
prepareConsole();
@@ -85,20 +84,15 @@
for (SWTBotShell shell : shells) {
log.info("Possible shell: " + shell.getText());
}
-
- bot.sleep(TIME_20S);
- SWTBot viewBot = eclipse.showView(ViewType.PROJECT_EXPLORER);
- SWTBotTreeItem item;
+
+ open.viewOpen(ActionItem.View.JavaPackageExplorer.LABEL);
- item = eclipse.selectTreeLocation(viewBot, Project.PROJECT_NAME,"gen","org","test","Customers.java");
- item.doubleClick();
- item = eclipse.selectTreeLocation(viewBot, Project.PROJECT_NAME,"gen","org","test","Employees.java");
- item.doubleClick();
- item = eclipse.selectTreeLocation(viewBot, Project.PROJECT_NAME,"gen","org","test","Offices.java");
- item.doubleClick();
-
+ packageExplorer.openFile(Project.PROJECT_NAME,"gen","org","test","Customers.java");
+ packageExplorer.openFile(Project.PROJECT_NAME,"gen","org","test","Customers.java");
+ packageExplorer.openFile(Project.PROJECT_NAME,"gen","org","test","Employees.java");
+ packageExplorer.openFile(Project.PROJECT_NAME,"gen","org","test","Offices.java");
+
log.info("Generated files check DONE");
- bot.sleep(TIME_10S);
}
/**
@@ -182,4 +176,8 @@
log.info("HB Code Generation Common tab DONE");
bot.sleep(TIME_1S);
}
+
+ @AfterClass
+ public static void clean() {
+ }
}
14 years, 9 months
JBoss Tools SVN: r21466 - trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/view.
by jbosstools-commits@lists.jboss.org
Author: jpeterka
Date: 2010-04-14 08:33:06 -0400 (Wed, 14 Apr 2010)
New Revision: 21466
Modified:
trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/view/ExplorerBase.java
Log:
Fix for proper selection of Explorer type
Modified: trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/view/ExplorerBase.java
===================================================================
--- trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/view/ExplorerBase.java 2010-04-14 11:56:02 UTC (rev 21465)
+++ trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/view/ExplorerBase.java 2010-04-14 12:33:06 UTC (rev 21466)
@@ -109,9 +109,7 @@
* @return editor with opened file
*/
public SWTBotEditor openFile(String projectName, String... path) {
- SWTBot viewBot = viewByTitle(IDELabel.View.PROJECT_EXPLORER).bot();
- viewByTitle(IDELabel.View.PROJECT_EXPLORER).show();
- viewByTitle(IDELabel.View.PROJECT_EXPLORER).setFocus();
+ SWTBot viewBot = open.viewOpen(viewObject).bot();
SWTBotTree tree = viewBot.tree();
SWTBotTreeItem item = tree.expandNode(projectName);
StringBuilder builder = new StringBuilder(projectName);
@@ -130,7 +128,7 @@
* @param projectName
*/
public void runOnServer(String projectName) {
- SWTBot viewBot = viewByTitle(viewObject.getName()).bot();
+ SWTBot viewBot = open.viewOpen(viewObject).bot();
SWTBotTreeItem item = viewBot.tree().expandNode(projectName);
ContextMenuHelper.prepareTreeItemForContextMenu(viewBot.tree(), item);
final SWTBotMenu menuRunAs = viewBot.menu(IDELabel.Menu.RUN).menu(IDELabel.Menu.RUN_AS);
14 years, 9 months
JBoss Tools SVN: r21465 - in trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext: parts and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: lzoubek(a)redhat.com
Date: 2010-04-14 07:56:02 -0400 (Wed, 14 Apr 2010)
New Revision: 21465
Added:
trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/parts/SWTBotScaleExt.java
trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/view/ExplorerBase.java
Modified:
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/SWTOpenExt.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/parts/SWTBotBrowserExt.java
trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/view/PackageExplorer.java
trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/view/ProjectExplorer.java
trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/view/ServersView.java
Log:
improoved SWTBot extensions, code formating
Modified: 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 2010-04-14 11:52:35 UTC (rev 21464)
+++ trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/SWTBotExt.java 2010-04-14 11:56:02 UTC (rev 21465)
@@ -17,6 +17,7 @@
import org.apache.log4j.Logger;
import org.eclipse.swt.browser.Browser;
+import org.eclipse.swt.widgets.Scale;
import org.eclipse.swtbot.eclipse.finder.SWTWorkbenchBot;
import org.eclipse.swtbot.eclipse.finder.widgets.SWTBotEditor;
import org.eclipse.swtbot.swt.finder.exceptions.WidgetNotFoundException;
@@ -27,6 +28,7 @@
import org.eclipse.swtbot.swt.finder.widgets.SWTBotTree;
import org.jboss.tools.ui.bot.ext.parts.SWTBotBrowserExt;
import org.jboss.tools.ui.bot.ext.parts.SWTBotEditorExt;
+import org.jboss.tools.ui.bot.ext.parts.SWTBotScaleExt;
/**
* Extended version of SWTWorkbenchBot, logging added
@@ -107,4 +109,18 @@
}
}
+ public SWTBotScaleExt scale() {
+ return scale(0);
+ }
+ @SuppressWarnings("unchecked")
+ public SWTBotScaleExt scale(int index) {
+ try {
+ List<Scale> bsrs = (List<Scale>) widgets(widgetOfType(Scale.class));
+ return new SWTBotScaleExt(bsrs.get(0));
+ } catch (WidgetNotFoundException ex) {
+ throw new WidgetNotFoundException(
+ "Could not find widget of type Browser", ex);
+ }
+ }
+
}
Modified: trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/SWTOpenExt.java
===================================================================
--- trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/SWTOpenExt.java 2010-04-14 11:52:35 UTC (rev 21464)
+++ trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/SWTOpenExt.java 2010-04-14 11:56:02 UTC (rev 21465)
@@ -1,7 +1,6 @@
package org.jboss.tools.ui.bot.ext;
import static org.eclipse.swtbot.swt.finder.waits.Conditions.shellCloses;
-import static org.eclipse.swtbot.swt.finder.waits.Conditions.waitForShell;
import java.util.Iterator;
@@ -12,7 +11,6 @@
import org.eclipse.swtbot.eclipse.finder.widgets.SWTBotView;
import org.eclipse.swtbot.swt.finder.SWTBot;
import org.eclipse.swtbot.swt.finder.exceptions.WidgetNotFoundException;
-import org.eclipse.swtbot.swt.finder.waits.ICondition;
import org.eclipse.swtbot.swt.finder.widgets.SWTBotButton;
import org.eclipse.swtbot.swt.finder.widgets.SWTBotShell;
import org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem;
@@ -25,9 +23,7 @@
import org.jboss.tools.ui.bot.ext.gen.INewObject;
import org.jboss.tools.ui.bot.ext.gen.IPerspective;
import org.jboss.tools.ui.bot.ext.gen.IPreference;
-import org.jboss.tools.ui.bot.ext.gen.IServer;
import org.jboss.tools.ui.bot.ext.gen.IView;
-import org.jboss.tools.ui.bot.ext.gen.ActionItem.NewObject.ServerServer;
/**
* this class represents
@@ -52,6 +48,7 @@
try {
viewObj = bot.viewByTitle(view.getName());
viewObj.setFocus();
+ viewObj.show();
return viewObj;
} catch (WidgetNotFoundException ex) {
}
@@ -62,6 +59,7 @@
bot.button("OK").click();
viewObj = bot.viewByTitle(view.getName());
viewObj.setFocus();
+ viewObj.show();
return viewObj;
}
/**
@@ -251,8 +249,18 @@
return;
} catch (TimeoutException ex) {
if (System.currentTimeMillis()-time>timeout) {
- log.error("Shell '"+activeShellStr+"' probably hanged up (480s timeout), returning, expect upcomming errors");
- return;
+ log.error("Shell '"+activeShellStr+"' probably hanged up (480s timeout), returning, forcing to close it, expect errors");
+ try {
+ bot.activeShell().close();
+ activeShell.close();
+ bot.waitUntil(shellCloses(activeShell));
+ log.info("Shell '"+activeShellStr+"' was forced to close.");
+ return;
+ }
+ catch (Exception e) {
+ e.printStackTrace();
+ }
+ throw new WidgetNotFoundException("Shell '"+activeShellStr+"' did not close after timeout", ex);
}
log.warn("Shell '" + activeShellStr + "' is still opened");
}
Modified: 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 2010-04-14 11:52:35 UTC (rev 21464)
+++ trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/SWTUtilExt.java 2010-04-14 11:56:02 UTC (rev 21465)
@@ -27,6 +27,7 @@
import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.swt.widgets.MenuItem;
import org.eclipse.swtbot.eclipse.finder.SWTWorkbenchBot;
+import org.eclipse.swtbot.eclipse.finder.widgets.SWTBotEditor;
import org.eclipse.swtbot.swt.finder.SWTBot;
import org.eclipse.swtbot.swt.finder.exceptions.WidgetNotFoundException;
import org.eclipse.swtbot.swt.finder.utils.SWTUtils;
@@ -134,8 +135,19 @@
}
}
-
/**
+ * closes all editor tabs
+ * @param save changes?
+ */
+ public void closeAllEditors(boolean save) {
+ for (SWTBotEditor e : bot.editors()) {
+ if (save) {
+ e.save();
+ }
+ e.close();
+ }
+ }
+ /**
* Wait for named running jobs with defined TIMEOUT
*/
public void waitForJobs(String... jobNames) {
Modified: trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/parts/SWTBotBrowserExt.java
===================================================================
--- trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/parts/SWTBotBrowserExt.java 2010-04-14 11:52:35 UTC (rev 21464)
+++ trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/parts/SWTBotBrowserExt.java 2010-04-14 11:56:02 UTC (rev 21465)
@@ -8,7 +8,6 @@
import org.eclipse.swt.browser.Browser;
import org.eclipse.swt.browser.ProgressEvent;
import org.eclipse.swt.browser.ProgressListener;
-import org.eclipse.swt.widgets.Control;
import org.eclipse.swtbot.swt.finder.exceptions.WidgetNotFoundException;
import org.eclipse.swtbot.swt.finder.finders.UIThreadRunnable;
import org.eclipse.swtbot.swt.finder.results.VoidResult;
@@ -124,6 +123,21 @@
}
});
}
+ public void forward() {
+ UIThreadRunnable.syncExec(new VoidResult() {
+ public void run() {
+ pl.setDone(false);
+ widget.addProgressListener(pl);
+ if (widget.isForwardEnabled()) {
+ if (!widget.forward()) {
+ pl.setDone(true);
+ widget.removeProgressListener(pl);
+ }
+ }
+
+ }
+ });
+ }
/**
* loads given URI into browser, page is loaded asynchronously (see {@link #isPageLoaded()})
*
@@ -146,7 +160,8 @@
/**
*
* @return true by default or when page was completely loaded by browser
- * = asynchronous page load invoked by {@link #goURL(String)} was finished
+ * i.e asynchronous page load invoked by {@link #goURL(String)} was finished
+ * returns false only when browser is loading the page
*/
public boolean isPageLoaded() {
return pl.isDone();
Added: trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/parts/SWTBotScaleExt.java
===================================================================
--- trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/parts/SWTBotScaleExt.java (rev 0)
+++ trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/parts/SWTBotScaleExt.java 2010-04-14 11:56:02 UTC (rev 21465)
@@ -0,0 +1,104 @@
+package org.jboss.tools.ui.bot.ext.parts;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.widgets.Scale;
+import org.eclipse.swtbot.swt.finder.exceptions.WidgetNotFoundException;
+import org.eclipse.swtbot.swt.finder.results.IntResult;
+import org.eclipse.swtbot.swt.finder.results.VoidResult;
+import org.eclipse.swtbot.swt.finder.utils.MessageFormat;
+import org.eclipse.swtbot.swt.finder.widgets.AbstractSWTBotControl;
+/**
+ * SWTBot Scale component (very similar to slider, can be found for example in 'New Web Service' wizard)
+ * @author lzoubek
+ *
+ */
+public class SWTBotScaleExt extends AbstractSWTBotControl<Scale> {
+
+ public SWTBotScaleExt(Scale w) throws WidgetNotFoundException {
+ super(w);
+ // TODO Auto-generated constructor stub
+ }
+
+ /**
+ * Return the current value of the slider.
+ *
+ * @return the current selection in the slider.
+ */
+ public int getSelection() {
+ return syncExec(new IntResult() {
+ public Integer run() {
+ return widget.getSelection();
+ }
+ });
+ }
+
+ /**
+ * Set the selection to the specified value.
+ *
+ * @param value the value to set into the slider.
+ */
+ public void setSelection(final int value) {
+ log.debug(MessageFormat.format("Setting selection on {0} to {1}", this, value)); //$NON-NLS-1$
+ waitForEnabled();
+ asyncExec(new VoidResult() {
+ public void run() {
+ widget.setSelection(value);
+ }
+ });
+ notify(SWT.Selection);
+ log.debug(MessageFormat.format("Set selection on {0} to {1}", this, value)); //$NON-NLS-1$
+ }
+
+ /**
+ * Return the maximum value the slider will accept.
+ *
+ * @return the maximum of the slider.
+ */
+ public int getMaximum() {
+ return syncExec(new IntResult() {
+ public Integer run() {
+ return widget.getMaximum();
+ }
+ });
+ }
+
+ /**
+ * Return the minimum value the slider will accept.
+ *
+ * @return the minimum of the slider.
+ */
+ public int getMinimum() {
+ return syncExec(new IntResult() {
+ public Integer run() {
+ return widget.getMinimum();
+ }
+ });
+ }
+
+ /**
+ * Return the increment of the slider.
+ *
+ * @return the increment of the slider.
+ */
+ public int getIncrement() {
+ return syncExec(new IntResult() {
+ public Integer run() {
+ return widget.getIncrement();
+ }
+ });
+ }
+
+ /**
+ * Return the page increment of the slider.
+ *
+ * @return the increment of the slider.
+ */
+ public int getPageIncrement() {
+ return syncExec(new IntResult() {
+ public Integer run() {
+ return widget.getPageIncrement();
+ }
+ });
+ }
+
+}
Property changes on: trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/parts/SWTBotScaleExt.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/view/ExplorerBase.java
===================================================================
--- trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/view/ExplorerBase.java (rev 0)
+++ trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/view/ExplorerBase.java 2010-04-14 11:56:02 UTC (rev 21465)
@@ -0,0 +1,201 @@
+package org.jboss.tools.ui.bot.ext.view;
+
+import java.util.List;
+import java.util.Vector;
+
+import org.apache.log4j.Logger;
+import org.eclipse.swt.widgets.MenuItem;
+import org.eclipse.swtbot.eclipse.finder.widgets.SWTBotEditor;
+import org.eclipse.swtbot.swt.finder.SWTBot;
+import org.eclipse.swtbot.swt.finder.exceptions.WidgetNotFoundException;
+import org.eclipse.swtbot.swt.finder.finders.UIThreadRunnable;
+import org.eclipse.swtbot.swt.finder.results.WidgetResult;
+import org.eclipse.swtbot.swt.finder.widgets.SWTBotMenu;
+import org.eclipse.swtbot.swt.finder.widgets.SWTBotTree;
+import org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem;
+import org.jboss.tools.ui.bot.ext.SWTBotExt;
+import org.jboss.tools.ui.bot.ext.SWTEclipseExt;
+import org.jboss.tools.ui.bot.ext.SWTOpenExt;
+import org.jboss.tools.ui.bot.ext.SWTUtilExt;
+import org.jboss.tools.ui.bot.ext.Timing;
+import org.jboss.tools.ui.bot.ext.gen.IView;
+import org.jboss.tools.ui.bot.ext.helper.ContextMenuHelper;
+import org.jboss.tools.ui.bot.ext.types.IDELabel;
+/**
+ * base class for explorer-like helper components
+ * @author lzoubek
+ *
+ */
+public abstract class ExplorerBase extends SWTBotExt {
+ /**
+ * view object representing current view, MUST be defined in derived constructor (for use, see {@link SWTOpenExt#viewOpen(IView)}
+ */
+ protected IView viewObject;
+ protected final SWTOpenExt open;
+ Logger log = Logger.getLogger(ExplorerBase.class);
+ public ExplorerBase() {
+ open = new SWTOpenExt(this);
+ }
+
+ /**
+ * shows Explorer view
+ */
+ public void show() {
+ open.viewOpen(viewObject);
+ }
+ /*
+ * Selects given project in Package Explorer
+ */
+ public void selectProject(String projectName) {
+ SWTBot viewBot = viewByTitle(viewObject.getName()).bot();
+ viewBot.tree().expandNode(projectName).select();
+ }
+ /**
+ * Selects Tree Item within Package Explorer
+ * @param treeItemText
+ * @param path
+ * @return
+ */
+ public SWTBotTreeItem selectTreeItem(String treeItemText, String[] path) {
+ return SWTEclipseExt.getTreeItemOnPath(viewByTitle(viewObject.getName()).bot().tree(),
+ treeItemText, path)
+ .select();
+ }
+ /**
+ * deletes given project from workspace
+ * @param projectName
+ * @param fileSystem if true, project will be also deleted from file-system
+ */
+ public void deleteProject(String projectName, boolean fileSystem) {
+ log.info("Deleting project '"+projectName+"'");
+ SWTBot viewBot = viewByTitle(viewObject.getName()).bot();
+ SWTBotTreeItem item = viewBot.tree().expandNode(projectName);
+ ContextMenuHelper.prepareTreeItemForContextMenu(viewBot.tree(), item);
+ new SWTBotMenu(ContextMenuHelper.getContextMenu(viewBot.tree(), IDELabel.Menu.DELETE, false)).click();
+ shell("Delete Resources").activate();
+ if (fileSystem) {
+ checkBox().click();
+ }
+ open.finish(this,IDELabel.Button.OK);
+ new SWTUtilExt(this).waitForNonIgnoredJobs();
+ }
+ /**
+ * deletes all projects from workspace
+ */
+ public void deleteAllProjects() {
+ SWTBot viewBot = viewByTitle(viewObject.getName()).bot();
+ List<String> items = new Vector<String>();
+ for (SWTBotTreeItem ti : viewBot.tree().getAllItems()) {
+ items.add(ti.getText());
+ }
+ for (String proj : items) {
+ try {
+ viewBot.tree().expandNode(proj);
+ viewBot.tree().select(proj);
+ // try to select project in tree (in some cases, when one project is deleted,
+ // the other item in tree (not being a project) is auto-deleted)
+
+ } catch (WidgetNotFoundException ex) {
+ log.warn("Attempted to delete non-existing project '"+proj+"'");
+ continue;
+ }
+ deleteProject(proj,true);
+ }
+ }
+ /**
+ * opens file (selects in tree and doubleclicks)
+ * @param projectName
+ * @param path to file
+ * @return editor with opened file
+ */
+ public SWTBotEditor openFile(String projectName, String... path) {
+ SWTBot viewBot = viewByTitle(IDELabel.View.PROJECT_EXPLORER).bot();
+ viewByTitle(IDELabel.View.PROJECT_EXPLORER).show();
+ viewByTitle(IDELabel.View.PROJECT_EXPLORER).setFocus();
+ SWTBotTree tree = viewBot.tree();
+ SWTBotTreeItem item = 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());
+ SWTBotEditor editor = activeEditor();
+ return editor;
+ }
+ /**
+ * runs given project on Server (uses default server, the first one) server MUST be running
+ * @param projectName
+ */
+ public void runOnServer(String projectName) {
+ SWTBot viewBot = viewByTitle(viewObject.getName()).bot();
+ SWTBotTreeItem item = viewBot.tree().expandNode(projectName);
+ ContextMenuHelper.prepareTreeItemForContextMenu(viewBot.tree(), item);
+ final SWTBotMenu menuRunAs = viewBot.menu(IDELabel.Menu.RUN).menu(IDELabel.Menu.RUN_AS);
+ final MenuItem menuItem = UIThreadRunnable
+ .syncExec(new WidgetResult<MenuItem>() {
+ public MenuItem run() {
+ int menuItemIndex = 0;
+ MenuItem menuItem = null;
+ final MenuItem[] menuItems = menuRunAs.widget.getMenu().getItems();
+ while (menuItem == null && menuItemIndex < menuItems.length){
+ if (menuItems[menuItemIndex].getText().indexOf("Run on Server") > - 1){
+ menuItem = menuItems[menuItemIndex];
+ }
+ else{
+ menuItemIndex++;
+ }
+ }
+ return menuItem;
+ }
+ });
+ if (menuItem != null){
+ new SWTBotMenu(menuItem).click();
+ shell(IDELabel.Shell.RUN_ON_SERVER).activate();
+ open.finish(this);
+ new SWTUtilExt(this).waitForAll(Timing.time3S());
+ }
+ else{
+ throw new WidgetNotFoundException("Unable to find Menu Item with Label 'Run on Server'");
+ }
+
+ }
+ /**
+ * true if resource described by parameters exists in ProjectExplorer
+ * @param projectName project name
+ * @param resource path (e.g. 'Project' 'src' 'org.jbosstools.test' 'MyClass.java')
+ * @return
+ */
+ public boolean existsResource(String... resource) {
+
+ try {
+ SWTBot viewBot = viewByTitle(viewObject.getName()).bot();
+ SWTBotTreeItem ancestor = viewBot.tree().getTreeItem(resource[0]);
+ viewBot.tree().expandNode(resource[0]);
+ for (int i=1;i<resource.length;i++) {
+ ancestor = getItem(ancestor, resource[i]);
+ if (ancestor == null) {
+ return false;
+ }
+ }
+ return true;
+ }
+ catch (WidgetNotFoundException ex) {
+ ex.printStackTrace();
+ return false;
+ }
+ }
+ private SWTBotTreeItem getItem(SWTBotTreeItem ancestor, String name) {
+ try {
+ return ancestor.expandNode(name);
+ }
+ catch (WidgetNotFoundException ex) {
+ return null;
+ }
+ }
+
+
+
+}
Property changes on: trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/view/ExplorerBase.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/view/PackageExplorer.java
===================================================================
--- trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/view/PackageExplorer.java 2010-04-14 11:52:35 UTC (rev 21464)
+++ trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/view/PackageExplorer.java 2010-04-14 11:56:02 UTC (rev 21465)
@@ -1,36 +1,15 @@
package org.jboss.tools.ui.bot.ext.view;
-import org.eclipse.swtbot.swt.finder.SWTBot;
-import org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem;
-import org.jboss.tools.ui.bot.ext.SWTBotExt;
-import org.jboss.tools.ui.bot.ext.SWTEclipseExt;
-import org.jboss.tools.ui.bot.ext.types.IDELabel;
+import org.jboss.tools.ui.bot.ext.gen.ActionItem.View.JavaPackageExplorer;
/**
* Class provides bot routines related to Package Explorer View
* @author jpeterka
*
*/
-public class PackageExplorer extends SWTBotExt {
-
- /*
- * Selects project in Package Explorer
- */
- public void selectProject(String projectName) {
- SWTBot viewBot = viewByTitle(IDELabel.View.PACKAGE_EXPLORER).bot();
- viewBot.tree().expandNode(projectName).select();
- }
+public class PackageExplorer extends ExplorerBase {
- /**
- * Selects Tree Item within Package Explorer
- * @param treeItemText
- * @param path
- * @return
- */
- public SWTBotTreeItem selectTreeItem(String treeItemText, String[] path) {
- return SWTEclipseExt.getTreeItemOnPath(viewByTitle(IDELabel.View.PACKAGE_EXPLORER).bot().tree(),
- treeItemText, path)
- .select();
- }
-
+ public PackageExplorer() {
+ viewObject = JavaPackageExplorer.LABEL;
+ }
}
Modified: trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/view/ProjectExplorer.java
===================================================================
--- trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/view/ProjectExplorer.java 2010-04-14 11:52:35 UTC (rev 21464)
+++ trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/view/ProjectExplorer.java 2010-04-14 11:56:02 UTC (rev 21465)
@@ -10,215 +10,17 @@
******************************************************************************/
package org.jboss.tools.ui.bot.ext.view;
-import static org.jboss.tools.ui.bot.ext.SWTTestExt.eclipse;
-
-import java.util.List;
-import java.util.Vector;
-
-import org.apache.log4j.Logger;
-import org.eclipse.swt.widgets.MenuItem;
-import org.eclipse.swtbot.eclipse.finder.widgets.SWTBotEditor;
-import org.eclipse.swtbot.swt.finder.SWTBot;
-import org.eclipse.swtbot.swt.finder.exceptions.WidgetNotFoundException;
-import org.eclipse.swtbot.swt.finder.finders.UIThreadRunnable;
-import org.eclipse.swtbot.swt.finder.results.WidgetResult;
-import org.eclipse.swtbot.swt.finder.widgets.SWTBotMenu;
-import org.eclipse.swtbot.swt.finder.widgets.SWTBotTree;
-import org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem;
-import org.jboss.tools.ui.bot.ext.SWTBotExt;
-import org.jboss.tools.ui.bot.ext.SWTOpenExt;
-import org.jboss.tools.ui.bot.ext.SWTUtilExt;
-import org.jboss.tools.ui.bot.ext.Timing;
-import org.jboss.tools.ui.bot.ext.gen.ActionItem;
import org.jboss.tools.ui.bot.ext.gen.ActionItem.View;
-import org.jboss.tools.ui.bot.ext.gen.ActionItem.NewObject.ServerServer;
-import org.jboss.tools.ui.bot.ext.gen.ActionItem.View.ServerServers;
-import org.jboss.tools.ui.bot.ext.helper.ContextMenuHelper;
-import org.jboss.tools.ui.bot.ext.types.IDELabel;
-import org.jboss.tools.ui.bot.ext.types.ViewType;
/**
- * Eclipse project type enum
+ * Eclipse project explorer helper component
*
- * @author jpeterka
+ * @author jpeterka & lzoubek
*
*/
-public class ProjectExplorer extends SWTBotExt {
+public class ProjectExplorer extends ExplorerBase {
- Logger log = Logger.getLogger(ProjectExplorer.class);
- private final SWTOpenExt open;
public ProjectExplorer() {
- open = new SWTOpenExt(this);
+ viewObject = View.GeneralProjectExplorer.LABEL;
}
- /**
- * shows Project Explorer view
- */
- public void show() {
- open.viewOpen(ActionItem.View.GeneralProjectExplorer.LABEL);
- }
- public void removeProjectFromServers(String projectName){
-
- SWTBot bot = open.viewOpen(View.ServerServers.LABEL).bot();
- SWTBotTree serverTree = bot.tree();
- // Expand All
- for (SWTBotTreeItem serverTreeItem : serverTree.getAllItems()){
- serverTreeItem.expand();
- // if JSF Test Project is deployed to server remove it
- SWTBotTreeItem[] serverTreeItemChildren = serverTreeItem.getItems();
- if (serverTreeItemChildren != null && serverTreeItemChildren.length > 0){
- int itemIndex = 0;
- boolean found = false;
- do{
- String treeItemlabel = serverTreeItemChildren[itemIndex].getText();
- found = treeItemlabel.startsWith(projectName);
- } while (!found && ++itemIndex < serverTreeItemChildren.length);
- // Server Tree Item has Child with Text equal to JSF TEst Project
- if (found){
- log.info("Found project to be removed from server: " + serverTreeItemChildren[itemIndex].getText());
- ContextMenuHelper.prepareTreeItemForContextMenu(serverTree,serverTreeItemChildren[itemIndex]);
- new SWTBotMenu(ContextMenuHelper.getContextMenu(serverTree, IDELabel.Menu.REMOVE, false)).click();
- bot.shell("Server").activate();
- open.finish(this, IDELabel.Button.OK);
- log.info("Removed project from server: " + serverTreeItemChildren[itemIndex].getText());
- }
- }
- }
- }
- /**
- * runs given project on Server (uses default server, the first one) server MUST be running
- * @param projectName
- */
- public void runOnServer(String projectName) {
- SWTBot viewBot = viewByTitle(IDELabel.View.PROJECT_EXPLORER).bot();
- SWTBotTreeItem item = viewBot.tree().expandNode(projectName);
- ContextMenuHelper.prepareTreeItemForContextMenu(viewBot.tree(), item);
- final SWTBotMenu menuRunAs = viewBot.menu(IDELabel.Menu.RUN).menu(IDELabel.Menu.RUN_AS);
- final MenuItem menuItem = UIThreadRunnable
- .syncExec(new WidgetResult<MenuItem>() {
- public MenuItem run() {
- int menuItemIndex = 0;
- MenuItem menuItem = null;
- final MenuItem[] menuItems = menuRunAs.widget.getMenu().getItems();
- while (menuItem == null && menuItemIndex < menuItems.length){
- if (menuItems[menuItemIndex].getText().indexOf("Run on Server") > - 1){
- menuItem = menuItems[menuItemIndex];
- }
- else{
- menuItemIndex++;
- }
- }
- return menuItem;
- }
- });
- if (menuItem != null){
- new SWTBotMenu(menuItem).click();
- shell(IDELabel.Shell.RUN_ON_SERVER).activate();
- new SWTOpenExt(this).finish(this);
- SWTUtilExt swtUtil = new SWTUtilExt(this);
- swtUtil.waitForNonIgnoredJobs();
- swtUtil.waitForAll(Timing.time3S());
- }
- else{
- throw new WidgetNotFoundException("Unable to find Menu Item with Label 'Run on Server'");
- }
-
- }
- public SWTBotEditor openFile(String projectName, String... path) {
- SWTBot viewBot = viewByTitle(IDELabel.View.PROJECT_EXPLORER).bot();
-
- viewByTitle(IDELabel.View.PROJECT_EXPLORER).show();
- viewByTitle(IDELabel.View.PROJECT_EXPLORER).setFocus();
- SWTBotTree tree = viewBot.tree();
- SWTBotTreeItem item = 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());
-
- SWTBotEditor editor = activeEditor();
- return editor;
- }
- public void deleteAllProjects() {
- SWTBot viewBot = viewByTitle(IDELabel.View.PROJECT_EXPLORER).bot();
- List<String> items = new Vector<String>();
- for (SWTBotTreeItem ti : viewBot.tree().getAllItems()) {
- items.add(ti.getText());
- }
- for (String proj : items) {
- try {
- viewBot.tree().expandNode(proj);
- viewBot.tree().select(proj);
- // try to select project in tree (in some cases, when one project is deleted,
- // the other item in tree (not being a project) is auto-deleted)
-
- } catch (WidgetNotFoundException ex) {
- log.warn("Attempted to delete non-existing project '"+proj+"'");
- continue;
- }
- deleteProject(proj,true);
- }
- }
- /**
- * deletes given project from workspace
- * @param projectName
- * @param fileSystem if true, project will be also deleted from filesystem
- */
- public void deleteProject(String projectName, boolean fileSystem) {
- SWTBot viewBot = viewByTitle(IDELabel.View.PROJECT_EXPLORER).bot();
- SWTBotTreeItem item = viewBot.tree().expandNode(projectName);
- ContextMenuHelper.prepareTreeItemForContextMenu(viewBot.tree(), item);
- new SWTBotMenu(ContextMenuHelper.getContextMenu(viewBot.tree(), IDELabel.Menu.DELETE, false)).click();
- shell("Delete Resources").activate();
- if (fileSystem) {
- checkBox().click();
- }
- new SWTOpenExt(this).finish(this,IDELabel.Button.OK);
- new SWTUtilExt(this).waitForNonIgnoredJobs();
-
- }
- /*
- * Selects given project in Package Explorer
- */
- public void selectProject(String projectName) {
- SWTBot viewBot = viewByTitle(IDELabel.View.PROJECT_EXPLORER).bot();
- viewBot.tree().expandNode(projectName).select();
- }
- /**
- * true if resource described by parameters exists in ProjectExplorer
- * @param projectName project name
- * @param resource path (e.g. 'Project' 'src' 'org.jbosstools.test' 'MyClass.java')
- * @return
- */
- public boolean existsResource(String... resource) {
-
- try {
- SWTBot viewBot = viewByTitle(IDELabel.View.PROJECT_EXPLORER).bot();
- SWTBotTreeItem ancestor = viewBot.tree().getTreeItem(resource[0]);
- viewBot.tree().expandNode(resource[0]);
- for (int i=1;i<resource.length;i++) {
- ancestor = getItem(ancestor, resource[i]);
- if (ancestor == null) {
- return false;
- }
- }
- return true;
- }
- catch (WidgetNotFoundException ex) {
- ex.printStackTrace();
- return false;
- }
- }
- private SWTBotTreeItem getItem(SWTBotTreeItem ancestor, String name) {
- try {
- return ancestor.expandNode(name);
- }
- catch (WidgetNotFoundException ex) {
- return null;
- }
- }
}
Modified: trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/view/ServersView.java
===================================================================
--- trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/view/ServersView.java 2010-04-14 11:52:35 UTC (rev 21464)
+++ trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/view/ServersView.java 2010-04-14 11:56:02 UTC (rev 21465)
@@ -12,6 +12,7 @@
import org.jboss.tools.ui.bot.ext.SWTUtilExt;
import org.jboss.tools.ui.bot.ext.Timing;
import org.jboss.tools.ui.bot.ext.gen.ActionItem;
+import org.jboss.tools.ui.bot.ext.gen.ActionItem.View;
import org.jboss.tools.ui.bot.ext.gen.ActionItem.View.ServerServers;
import org.jboss.tools.ui.bot.ext.helper.ContextMenuHelper;
import org.jboss.tools.ui.bot.ext.types.IDELabel;
@@ -101,4 +102,43 @@
}
return null;
}
+ /**
+ * removes project with given name from all servers
+ * @param projectName
+ */
+ public void removeProjectFromServers(String projectName){
+
+ SWTBot bot = open.viewOpen(View.ServerServers.LABEL).bot();
+ SWTBotTree serverTree = bot.tree();
+ // Expand All
+ for (SWTBotTreeItem serverTreeItem : serverTree.getAllItems()){
+ serverTreeItem.expand();
+ // if JSF Test Project is deployed to server remove it
+ SWTBotTreeItem[] serverTreeItemChildren = serverTreeItem.getItems();
+ if (serverTreeItemChildren != null && serverTreeItemChildren.length > 0){
+ int itemIndex = 0;
+ boolean found = false;
+ do{
+ String treeItemlabel = serverTreeItemChildren[itemIndex].getText();
+ found = treeItemlabel.startsWith(projectName);
+ } while (!found && ++itemIndex < serverTreeItemChildren.length);
+ // Server Tree Item has Child with Text equal to JSF TEst Project
+ if (found){
+ log.info("Found project to be removed from server: " + serverTreeItemChildren[itemIndex].getText());
+ ContextMenuHelper.prepareTreeItemForContextMenu(serverTree,serverTreeItemChildren[itemIndex]);
+ new SWTBotMenu(ContextMenuHelper.getContextMenu(serverTree, IDELabel.Menu.REMOVE, false)).click();
+ bot.shell("Server").activate();
+ open.finish(this, IDELabel.Button.OK);
+ log.info("Removed project from server: " + serverTreeItemChildren[itemIndex].getText());
+ new SWTUtilExt(this).waitForNonIgnoredJobs();
+ } else {
+ log.info("Project '"+projectName+"' not found on any server");
+ }
+ }
+ }
+ }
+ /**
+ * removes project with given name from all servers
+ * @param projectName
+ */
}
14 years, 9 months
JBoss Tools SVN: r21464 - trunk/hibernatetools/tests/org.hibernate.eclipse.jdt.ui.test/res/hbm/pack.
by jbosstools-commits@lists.jboss.org
Author: dgeraskov
Date: 2010-04-14 07:52:35 -0400 (Wed, 14 Apr 2010)
New Revision: 21464
Modified:
trunk/hibernatetools/tests/org.hibernate.eclipse.jdt.ui.test/res/hbm/pack/B.java
Log:
Resolve compilation error in resources. (It is not visible because file doesn't actually compiled)
Modified: trunk/hibernatetools/tests/org.hibernate.eclipse.jdt.ui.test/res/hbm/pack/B.java
===================================================================
--- trunk/hibernatetools/tests/org.hibernate.eclipse.jdt.ui.test/res/hbm/pack/B.java 2010-04-14 11:17:42 UTC (rev 21463)
+++ trunk/hibernatetools/tests/org.hibernate.eclipse.jdt.ui.test/res/hbm/pack/B.java 2010-04-14 11:52:35 UTC (rev 21464)
@@ -4,7 +4,7 @@
* @author Emmanuel Bernard
*/
public class B {
- private String id;
+ private Integer id;
private int[] testIntArray;
public int[] getTestIntArray() {
14 years, 9 months