JBoss Tools SVN: r19798 - trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext.
by jbosstools-commits@lists.jboss.org
Author: vpakan(a)redhat.com
Date: 2010-01-19 05:14:41 -0500 (Tue, 19 Jan 2010)
New Revision: 19798
Modified:
trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/SWTJBTExt.java
Log:
Changed waiting for project to start in method runProjectOnServer().
Modified: trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/SWTJBTExt.java
===================================================================
--- trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/SWTJBTExt.java 2010-01-18 19:37:54 UTC (rev 19797)
+++ trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/SWTJBTExt.java 2010-01-19 10:14:41 UTC (rev 19798)
@@ -259,8 +259,7 @@
bot.shell(IDELabel.Shell.RUN_ON_SERVER).activate();
bot.button(IDELabel.Button.FINISH).click();
SWTUtilExt swtUtil = new SWTUtilExt(bot);
- swtUtil.waitForJobs(10*1000L,JobName.BUILDING_WS);
- swtUtil.waitForJobs(10*1000L,JobName.UPDATING_INDEXES);
+ swtUtil.waitForAll(10*1000L);
}
else{
throw new WidgetNotFoundException("Unable to find Menu Item with Label 'Run on Server'");
14 years, 5 months
JBoss Tools SVN: r19797 - trunk/documentation/qa/docs/Test_Cases.
by jbosstools-commits@lists.jboss.org
Author: vpakan(a)redhat.com
Date: 2010-01-18 14:37:54 -0500 (Mon, 18 Jan 2010)
New Revision: 19797
Modified:
trunk/documentation/qa/docs/Test_Cases/SmokeTests.doc
Log:
Added new SWTBot Struts Tests.
Modified: trunk/documentation/qa/docs/Test_Cases/SmokeTests.doc
===================================================================
(Binary files differ)
14 years, 5 months
JBoss Tools SVN: r19796 - in trunk: jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext and 3 other directories.
by jbosstools-commits@lists.jboss.org
Author: vpakan(a)redhat.com
Date: 2010-01-18 14:29:45 -0500 (Mon, 18 Jan 2010)
New Revision: 19796
Added:
trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/types/JobName.java
trunk/struts/tests/org.jboss.tools.struts.ui.bot.test/src/org/jboss/tools/struts/ui/bot/test/smoke/ImportStrutsProjectTest.java
trunk/struts/tests/org.jboss.tools.struts.ui.bot.test/src/org/jboss/tools/struts/ui/bot/test/smoke/RenameStrutsConfigXmlFile.java
trunk/struts/tests/org.jboss.tools.struts.ui.bot.test/src/org/jboss/tools/struts/ui/bot/test/smoke/RenameTldFile.java
trunk/struts/tests/org.jboss.tools.struts.ui.bot.test/src/org/jboss/tools/struts/ui/bot/test/smoke/RunStrutsProjectOnServer.java
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.ui.bot.test/src/org/jboss/tools/jsf/ui/bot/test/smoke/AddRemoveJSFCapabilitiesTest.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/SWTJBTExt.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/types/IDELabel.java
trunk/struts/tests/org.jboss.tools.struts.ui.bot.test/src/org/jboss/tools/struts/ui/bot/test/StrutsAllBotTests.java
trunk/struts/tests/org.jboss.tools.struts.ui.bot.test/src/org/jboss/tools/struts/ui/bot/test/smoke/CreateNewStrutsProjectTest.java
Log:
Added new SWTBot Struts Tests together with some SWTBot extensions.
Modified: trunk/jsf/tests/org.jboss.tools.jsf.ui.bot.test/src/org/jboss/tools/jsf/ui/bot/test/smoke/AddRemoveJSFCapabilitiesTest.java
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.ui.bot.test/src/org/jboss/tools/jsf/ui/bot/test/smoke/AddRemoveJSFCapabilitiesTest.java 2010-01-18 19:26:19 UTC (rev 19795)
+++ trunk/jsf/tests/org.jboss.tools.jsf.ui.bot.test/src/org/jboss/tools/jsf/ui/bot/test/smoke/AddRemoveJSFCapabilitiesTest.java 2010-01-18 19:29:45 UTC (rev 19796)
@@ -11,9 +11,10 @@
package org.jboss.tools.jsf.ui.bot.test.smoke;
+import static org.jboss.tools.ui.bot.ext.SWTTestExt.eclipse;
+
import java.io.File;
-import org.eclipse.swt.widgets.MenuItem;
import org.eclipse.swtbot.swt.finder.SWTBot;
import org.eclipse.swtbot.swt.finder.exceptions.WidgetNotFoundException;
import org.eclipse.swtbot.swt.finder.widgets.SWTBotMenu;
@@ -34,9 +35,11 @@
*/
public class AddRemoveJSFCapabilitiesTest extends JSFAutoTestCase {
-
- private MenuItem miRunOnServer = null;
+ private SWTJBTExt swtJbtExt = null;
+ public AddRemoveJSFCapabilitiesTest(){
+ swtJbtExt = new SWTJBTExt(bot);
+ }
public void testAddRemoveJSFCapabilities() {
boolean jbdsIsRunning = SWTJBTExt.isJBDSRun(bot);
removeJSFCapabilities(jbdsIsRunning);
@@ -63,8 +66,7 @@
}
if (parts.length > index + 1){
- String webXmlFileLocation = parts[index + 1] + File.separator
- + JBT_TEST_PROJECT_NAME + File.separator
+ String webXmlFileLocation = SWTUtilExt.getTestPluginLocation(JBT_TEST_PROJECT_NAME) + File.separator
+ "WebContent" + File.separator
+ "WEB-INF" + File.separator
+ "web.xml";
@@ -78,79 +80,17 @@
bot.shell(IDELabel.Shell.IMPORT_JSF_PROJECT).activate();
bot.textWithLabel("web.xml Location*").setText(webXmlFileLocation);
-
bot.button(WidgetVariables.NEXT_BUTTON).click();
- // Check if there is defined Application Server if not create one
- if (!SWTJBTExt.isServerDefinedInWebWizardPage(bot)){
- // Specify Application Server for Deployment
- bot.button(WidgetVariables.NEW_BUTTON, 1).click();
- bot.shell("New Server").activate();
- bot.tree().expandNode("JBoss Enterprise Middleware")
- .select("JBoss Enterprise Application Platform 4.3");
- bot.button(WidgetVariables.FINISH_BUTTON).click();
- // Server Jobs has different labels now
- }
- delay();
- // Finish Import
- bot.button(WidgetVariables.FINISH_BUTTON).click();
- bot.shell("Warning").activate();
- bot.button(WidgetVariables.CONTINUE_BUTTON).click();
-
- waitForBlockingJobsAcomplished(BUILDING_WS);
+ SWTJBTExt.addServerToServerViewOnWizardPage(bot, IDELabel.ServerGroup.JBOSS_EAP_4_3, IDELabel.ServerType.JBOSS_EAP_4_3);
+ bot.sleep(1000L);
+ bot.button(IDELabel.Button.FINISH).click();
+ eclipse.closeWarningWindowIfOpened(true);
+ eclipse.closeOpenAssociatedPerspectiveShellIfOpened(false);
// Start Application Server
- SWTJBTExt.startApplicationServer(bot, 0);
- // Run it on server
- openPackageExplorer();
- SWTBot packageExplorer = bot.viewByTitle(WidgetVariables.PACKAGE_EXPLORER)
- .bot();
- SWTBotTree packageExplorerTree = packageExplorer.tree();
-
- packageExplorerTree.setFocus();
-
- SWTBotTreeItem packageExplorerTreeItem = packageExplorerTree
- .getTreeItem(JBT_TEST_PROJECT_NAME);
- packageExplorerTreeItem.select();
- packageExplorerTreeItem.click();
- // Search for Menu Item with Run on Server substring within label
- final SWTBotMenu menuRunAs = bot.menu("Run").menu("Run As");
- bot.getDisplay().syncExec(new Runnable() {
- public void run() {
- int menuItemIndex = 0;
- boolean isFound = false;
- final MenuItem[] menuItems = menuRunAs.widget.getMenu().getItems();
- while (!isFound && menuItemIndex < menuItems.length){
- if (menuItems[menuItemIndex].getText().indexOf("Run on Server") > - 1){
- isFound = true;
- }
- else{
- menuItemIndex++;
- }
- }
- if (isFound){
- setMiRunOnServer(menuItems[menuItemIndex]);
- }
- else{
- setMiRunOnServer(null);
- }
- }
- });
-
- if (getMiRunOnServer() != null){
- new SWTBotMenu(getMiRunOnServer()).click();
- }
- else
- {
- throw new WidgetNotFoundException("Menu item with mnemonic Run on Server");
- }
-
- bot.shell("Run On Server").activate();
- bot.button(WidgetVariables.FINISH_BUTTON).click();
-
- waitForBlockingJobsAcomplished(10*1000L , BUILDING_WS);
- waitForBlockingJobsAcomplished(10*1000L , UPDATING_INDEXES);
+ swtJbtExt.startApplicationServer(0);
+ swtJbtExt.runProjectOnServer(JBT_TEST_PROJECT_NAME);
// Check Browser Content
String browserText = WidgetFinderHelper.browserInEditorText(bot, "Input User Name Page",true);
-
assertTrue("Displayed HTML page has wrong content",
browserText.indexOf("<TITLE>Input User Name Page</TITLE>") > - 1);
// Stop Application Server and remove Application Server from Server View
@@ -328,14 +268,6 @@
delay();
}
-
- private void setMiRunOnServer(MenuItem menuItem){
- miRunOnServer = menuItem;
- }
-
- private MenuItem getMiRunOnServer(){
- return miRunOnServer;
- }
/**
* Remove JSF Test Project from all Servers
*/
Modified: trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/SWTEclipseExt.java
===================================================================
--- trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/SWTEclipseExt.java 2010-01-18 19:26:19 UTC (rev 19795)
+++ trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/SWTEclipseExt.java 2010-01-18 19:29:45 UTC (rev 19796)
@@ -408,5 +408,21 @@
// do nothing
}
}
+ /**
+ * Close Warning Window if is opened.
+ * Press Continue or Cancel button dependent on pressContinueButton
+ * @param pressContinueButton
+ */
+ public void closeWarningWindowIfOpened(boolean pressContinueButton){
+ try{
+ bot.shell(IDELabel.Shell.WARNING).activate();
+ bot.button(pressContinueButton ? IDELabel.Button.CONTINUE : IDELabel.Button.CANCEL).click();
+ } catch (WidgetNotFoundException wnfe){
+ // do nothing
+ }
+ }
+ public static void closeWarningWindowIfOpened(SWTWorkbenchBot bot, boolean pressContinueButton){
+ closeWarningWindowIfOpened(bot, pressContinueButton);
+ }
}
Modified: trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/SWTJBTExt.java
===================================================================
--- trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/SWTJBTExt.java 2010-01-18 19:26:19 UTC (rev 19795)
+++ trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/SWTJBTExt.java 2010-01-18 19:29:45 UTC (rev 19796)
@@ -13,15 +13,21 @@
import static org.jboss.tools.ui.bot.ext.SWTTestExt.eclipse;
+import java.io.IOException;
+
import org.apache.log4j.Logger;
+import org.eclipse.swt.widgets.MenuItem;
import org.eclipse.swtbot.eclipse.finder.SWTWorkbenchBot;
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.helper.ContextMenuHelper;
import org.jboss.tools.ui.bot.ext.types.IDELabel;
+import org.jboss.tools.ui.bot.ext.types.JobName;
import org.jboss.tools.ui.bot.ext.types.ViewType;
/**
* Provides JBoss Tools common operations based on SWTBot element operations
@@ -156,6 +162,7 @@
}
/**
* Remove Project from all Servers
+ * @param projectName
*/
public void removeProjectFromServers(String projectName){
@@ -189,5 +196,109 @@
public void delay() {
bot.sleep(500);
}
+ /**
+ * Delete Project from workspace
+ * @param projectName
+ */
+ public void deleteProject(String projectName) {
+
+ removeProjectFromServers(projectName);
+
+ SWTBot packageExplorer = eclipse.showView(ViewType.PACKAGE_EXPLORER);
+ delay();
+ SWTBotTree tree = packageExplorer.tree();
+ delay();
+
+ ContextMenuHelper.prepareTreeItemForContextMenu(tree,
+ tree.getTreeItem(projectName));
+ new SWTBotMenu(ContextMenuHelper.getContextMenu(tree,
+ IDELabel.Menu.DELETE, false)).click();
+ bot.shell(IDELabel.Shell.DELETE_RESOURCES).activate();
+ bot.button(IDELabel.Button.OK).click();
+
+ new SWTUtilExt(bot).waitForNonIgnoredJobs();
+
+ }
+ /**
+ * Choose Run On Server menu for specified project
+ * @param bot
+ * @param projectName
+ */
+ public static void runProjectOnServer(SWTWorkbenchBot bot, String projectName){
+
+ SWTBotTree packageExplorerTree = eclipse.showView(ViewType.PACKAGE_EXPLORER).tree();
+
+ packageExplorerTree.setFocus();
+ SWTBotTreeItem packageExplorerTreeItem = packageExplorerTree
+ .getTreeItem(projectName);
+
+ packageExplorerTreeItem.select();
+ packageExplorerTreeItem.click();
+ // Search for Menu Item with Run on Server substring within label
+ final SWTBotMenu menuRunAs = bot.menu(IDELabel.Menu.RUN).menu(IDELabel.Menu.RUN_AS);
+ final MenuItem menuItem = UIThreadRunnable
+ .syncExec(new WidgetResult<MenuItem>() {
+ @SuppressWarnings("unchecked")
+ 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();
+ bot.shell(IDELabel.Shell.RUN_ON_SERVER).activate();
+ bot.button(IDELabel.Button.FINISH).click();
+ SWTUtilExt swtUtil = new SWTUtilExt(bot);
+ swtUtil.waitForJobs(10*1000L,JobName.BUILDING_WS);
+ swtUtil.waitForJobs(10*1000L,JobName.UPDATING_INDEXES);
+ }
+ else{
+ throw new WidgetNotFoundException("Unable to find Menu Item with Label 'Run on Server'");
+ }
+ }
+ /**
+ * Choose Run On Server menu for specified project
+ * @param projectName
+ */
+ public void runProjectOnServer(String projectName){
+ runProjectOnServer(bot,projectName);
+ }
+ /**
+ * Creates new Server within Server View when Wizard for new Project is called
+ * @param bot
+ * @param serverGroup
+ * @param serverType
+ */
+ public static void addServerToServerViewOnWizardPage (SWTWorkbenchBot bot,String serverGroup , String serverType){
+ // Check if there is defined Application Server if not create one
+ if (!SWTJBTExt.isServerDefinedInWebWizardPage(bot)){
+ // Specify Application Server for Deployment
+ bot.button(IDELabel.Button.NEW, 1).click();
+ bot.shell(IDELabel.Shell.NEW_SERVER).activate();
+ bot.tree().select(serverGroup);
+ bot.tree().expandNode(serverGroup)
+ .select(serverType);
+ bot.button(IDELabel.Button.FINISH).click();
+ }
+
+ }
+ /**
+ * Creates new Server within Server View when Wizard for new Project is called
+ * @param serverGroup
+ * @param serverType
+ */
+ public void addServerToServerViewOnWizardPage (String serverGroup , String serverType){
+ addServerToServerViewOnWizardPage (bot,serverGroup , serverType);
+ }
}
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-01-18 19:26:19 UTC (rev 19795)
+++ trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/SWTUtilExt.java 2010-01-18 19:29:45 UTC (rev 19796)
@@ -352,4 +352,22 @@
});
}
+ /**
+ * Returns Test Plugin Location within file system
+ * @param projectName
+ * @return
+ */
+ public static String getTestPluginLocation(String projectName){
+
+ String[] parts = System.getProperty("eclipse.commands").split("\n");
+
+ int index = 0;
+
+ for (index = 0;parts.length > index + 1 && !parts[index].equals("-data");index++){
+ // do nothing just go through
+ }
+
+ return parts[index + 1] + File.separator + projectName;
+
+ }
}
\ No newline at end of file
Modified: trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/types/IDELabel.java
===================================================================
--- trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/types/IDELabel.java 2010-01-18 19:26:19 UTC (rev 19795)
+++ trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/types/IDELabel.java 2010-01-18 19:29:45 UTC (rev 19796)
@@ -60,6 +60,8 @@
public static final String JBT_REMOVE_STRUTS_CAPABILITIES = "Remove Struts Capabilities";
public static final String ADD_STRUTS_CAPABILITIES = "Add Struts Capabilities...";
public static final String WEB_PROJECT_JBT_STRUTS = "JBoss Tools Struts";
+ public static final String RUN = "Run";
+ public static final String RUN_ON_SERVER = "Run on Server";
}
@@ -75,6 +77,8 @@
public static final String RUN = "Run";
public static final String APPLY = "Apply";
public static final String ADD = "Add...";
+ public static final String NEW = "New...";
+ public static final String CONTINUE = "Continue";
}
public class Shell {
@@ -97,6 +101,12 @@
public static final String PREFERENCES = "Preferences";
public static final String NEW_SERVER_RUNTIME_ENVIRONMENT = "New Server Runtime Environment";
public static final String OPEN_ASSOCIATED_PERSPECTIVE = "Open Associated Perspective?";
+ public static final String DELETE_RESOURCES = "Delete Resources";
+ public static final String IMPORT_STRUTS_PROJECT = "Import Struts Project";
+ public static final String UNSUPPORTED_CONTENT_TYPE = "Unsupported Content Type";
+ public static final String NEW_SERVER = "New Server";
+ public static final String RUN_ON_SERVER = "Run On Server";
+ public static final String WARNING = "Warning";
}
public class EntityGroup {
@@ -206,6 +216,11 @@
public static final String WEB_XML = "web.xml";
public static final String CONTEXT_PARAMS = "Context Params";
public static final String JAVAX_FACES_CONFIG_FILES = "javax.faces.CONFIG_FILES";
+ public static final String DEFAULT = "default";
+ public static final String SERVLETS = "Servlets";
+ public static final String ACTION_STRUTS = "action:org.apache.struts.action.ActionServlet";
+ public static final String CONFIG = "config";
+ public static final String TAG_LIBRARIES = "Tag Libraries";
}
@@ -289,10 +304,14 @@
public static final String JBOSS_EAP_4_3 = "JBoss Enterprise Middleware";
}
- public static final class ServerType {
+ public static final class ServerRuntimeType {
public static final String JBOSS_EAP_4_3 = "JBoss Enterprise Application Platform 4.3 Runtime";
}
+ public static final class ServerType {
+ public static final String JBOSS_EAP_4_3 = "JBoss Enterprise Application Platform 4.3";
+
+ }
}
Added: trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/types/JobName.java
===================================================================
--- trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/types/JobName.java (rev 0)
+++ trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/types/JobName.java 2010-01-18 19:29:45 UTC (rev 19796)
@@ -0,0 +1,23 @@
+/*******************************************************************************
+ * 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;
+
+/**
+* Define Job Names Constants
+* @author Vladimir Pakan
+*
+*/
+public class JobName {
+ public static final String BUILDING_WS = "Building workspace";
+ public static final String VISUAL_UPDATE = "Visual Editor View Update";
+ public static final String VISUAL_REFRESH = "Visual Editor Refresh";
+ public static final String UPDATING_INDEXES = "Updating indexes";
+}
Property changes on: trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/types/JobName.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: trunk/struts/tests/org.jboss.tools.struts.ui.bot.test/src/org/jboss/tools/struts/ui/bot/test/StrutsAllBotTests.java
===================================================================
--- trunk/struts/tests/org.jboss.tools.struts.ui.bot.test/src/org/jboss/tools/struts/ui/bot/test/StrutsAllBotTests.java 2010-01-18 19:26:19 UTC (rev 19795)
+++ trunk/struts/tests/org.jboss.tools.struts.ui.bot.test/src/org/jboss/tools/struts/ui/bot/test/StrutsAllBotTests.java 2010-01-18 19:29:45 UTC (rev 19796)
@@ -12,6 +12,10 @@
import org.jboss.tools.struts.ui.bot.test.smoke.AddRemoveStrutsCapabilities;
import org.jboss.tools.struts.ui.bot.test.smoke.CreateNewStrutsProjectTest;
+import org.jboss.tools.struts.ui.bot.test.smoke.ImportStrutsProjectTest;
+import org.jboss.tools.struts.ui.bot.test.smoke.RenameStrutsConfigXmlFile;
+import org.jboss.tools.struts.ui.bot.test.smoke.RenameTldFile;
+import org.jboss.tools.struts.ui.bot.test.smoke.RunStrutsProjectOnServer;
import org.jboss.tools.ui.bot.ext.SWTTestExt;
import org.jboss.tools.ui.bot.ext.types.IDELabel;
import org.junit.AfterClass;
@@ -28,8 +32,12 @@
*
*/
@RunWith(Suite.class)
-@SuiteClasses( {CreateNewStrutsProjectTest.class,
- AddRemoveStrutsCapabilities.class})
+(a)SuiteClasses({CreateNewStrutsProjectTest.class,
+ RunStrutsProjectOnServer.class,
+ AddRemoveStrutsCapabilities.class,
+ ImportStrutsProjectTest.class,
+ RenameStrutsConfigXmlFile.class,
+ RenameTldFile.class})
public class StrutsAllBotTests extends SWTTestExt {
public static final String STRUTS_PROJECT_NAME = "strutsTest";
@BeforeClass
Modified: trunk/struts/tests/org.jboss.tools.struts.ui.bot.test/src/org/jboss/tools/struts/ui/bot/test/smoke/CreateNewStrutsProjectTest.java
===================================================================
--- trunk/struts/tests/org.jboss.tools.struts.ui.bot.test/src/org/jboss/tools/struts/ui/bot/test/smoke/CreateNewStrutsProjectTest.java 2010-01-18 19:26:19 UTC (rev 19795)
+++ trunk/struts/tests/org.jboss.tools.struts.ui.bot.test/src/org/jboss/tools/struts/ui/bot/test/smoke/CreateNewStrutsProjectTest.java 2010-01-18 19:29:45 UTC (rev 19796)
@@ -14,6 +14,7 @@
import static org.junit.Assert.assertTrue;
import org.jboss.tools.ui.bot.ext.SWTEclipseExt;
+import org.jboss.tools.ui.bot.ext.SWTJBTExt;
import org.jboss.tools.ui.bot.ext.SWTTestExt;
import org.jboss.tools.ui.bot.ext.types.EntityType;
import org.jboss.tools.ui.bot.ext.types.IDELabel;
@@ -36,13 +37,15 @@
eclipse.showView(ViewType.WEB_PROJECTS);
eclipse.addServerRuntime(IDELabel.ServerRuntimeName.JBOSS_EAP_4_3,
IDELabel.ServerGroup.JBOSS_EAP_4_3,
- IDELabel.ServerType.JBOSS_EAP_4_3,
+ IDELabel.ServerRuntimeType.JBOSS_EAP_4_3,
StrutsAllBotTests.getProperty("JBossEap4.3Home"));
eclipse.createNew(EntityType.STRUTS_PROJECT);
bot.shell(IDELabel.Shell.NEW_STRUTS_PROJECT).activate();
bot.textWithLabel(IDELabel.NewStrutsProjectDialog.NAME).setText(StrutsAllBotTests.STRUTS_PROJECT_NAME);
bot.comboBoxWithLabel(IDELabel.NewStrutsProjectDialog.TEMPLATE).setSelection(IDELabel.NewStrutsProjectDialog.TEMPLATE_KICK_START);
bot.button(IDELabel.Button.NEXT).click();
+ SWTJBTExt.addServerToServerViewOnWizardPage(bot, IDELabel.ServerGroup.JBOSS_EAP_4_3, IDELabel.ServerType.JBOSS_EAP_4_3);
+ bot.sleep(1000L);
bot.button(IDELabel.Button.NEXT).click();
bot.button(IDELabel.Button.FINISH).click();
eclipse.closeOpenAssociatedPerspectiveShellIfOpened(false);
Added: trunk/struts/tests/org.jboss.tools.struts.ui.bot.test/src/org/jboss/tools/struts/ui/bot/test/smoke/ImportStrutsProjectTest.java
===================================================================
--- trunk/struts/tests/org.jboss.tools.struts.ui.bot.test/src/org/jboss/tools/struts/ui/bot/test/smoke/ImportStrutsProjectTest.java (rev 0)
+++ trunk/struts/tests/org.jboss.tools.struts.ui.bot.test/src/org/jboss/tools/struts/ui/bot/test/smoke/ImportStrutsProjectTest.java 2010-01-18 19:29:45 UTC (rev 19796)
@@ -0,0 +1,93 @@
+ /*******************************************************************************
+ * 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.struts.ui.bot.test.smoke;
+
+import static org.junit.Assert.assertTrue;
+
+import java.io.File;
+
+import org.eclipse.swtbot.swt.finder.widgets.SWTBotTree;
+import org.jboss.tools.ui.bot.ext.SWTEclipseExt;
+import org.jboss.tools.ui.bot.ext.SWTJBTExt;
+import org.jboss.tools.ui.bot.ext.SWTTestExt;
+import org.jboss.tools.ui.bot.ext.SWTUtilExt;
+import org.jboss.tools.ui.bot.ext.types.IDELabel;
+import org.jboss.tools.ui.bot.ext.types.ViewType;
+import org.jboss.tools.ui.bot.test.WidgetVariables;
+import org.junit.Test;
+import org.jboss.tools.struts.ui.bot.test.StrutsAllBotTests;
+/**
+ * Test importing Struts Project
+ * @author Vladimir Pakan
+ *
+ */
+public class ImportStrutsProjectTest extends SWTTestExt{
+
+ /**
+ * Test importing Struts Project
+ */
+ private SWTJBTExt swtJbtExt = null;
+ public ImportStrutsProjectTest (){
+ swtJbtExt = new SWTJBTExt(bot);
+ }
+ @Test
+ public void testImportStrutsProjectTest() {
+ // Remove Struts Project
+ swtJbtExt.deleteProject(StrutsAllBotTests.STRUTS_PROJECT_NAME);
+ // Import Struts Project
+ String webXmlFileLocation = SWTUtilExt
+ .getTestPluginLocation(StrutsAllBotTests.STRUTS_PROJECT_NAME)
+ + File.separator
+ + "WebContent"
+ + File.separator
+ + "WEB-INF"
+ + File.separator + "web.xml";
+
+ bot.menu(IDELabel.Menu.FILE).menu(IDELabel.Menu.IMPORT).click();
+ bot.shell(IDELabel.Shell.IMPORT).activate();
+ SWTBotTree tree = bot.tree();
+ swtJbtExt.delay();
+ tree.expandNode("Other").select(IDELabel.Menu.STRUTS_PROJECT);
+ bot.button("Next >").click();
+ bot.shell(IDELabel.Shell.IMPORT_STRUTS_PROJECT).activate();
+
+ bot.textWithLabel("web.xml Location*").setText(webXmlFileLocation);
+
+ bot.button(WidgetVariables.NEXT_BUTTON).click();
+ // Check if there is defined Application Server if not create one
+ if (!SWTJBTExt.isServerDefinedInWebWizardPage(bot)) {
+ // Specify Application Server for Deployment
+ bot.button(WidgetVariables.NEW_BUTTON, 1).click();
+ bot.shell("New Server").activate();
+ bot.tree().expandNode("JBoss Enterprise Middleware").select(
+ "JBoss Enterprise Application Platform 4.3");
+ bot.button(WidgetVariables.FINISH_BUTTON).click();
+ // Server Jobs has different labels now
+ }
+ swtJbtExt.delay();
+ // Finish Import
+ bot.button(WidgetVariables.FINISH_BUTTON).click();
+ bot.shell("Warning").activate();
+ bot.button(WidgetVariables.CONTINUE_BUTTON).click();
+
+ eclipse.closeOpenAssociatedPerspectiveShellIfOpened(false);
+
+ eclipse.showView(ViewType.WEB_PROJECTS);
+
+ assertTrue("Project " + StrutsAllBotTests.STRUTS_PROJECT_NAME
+ + " was not created properly.", SWTEclipseExt
+ .treeContainsItemWithLabel(bot.viewByTitle(IDELabel.View.WEB_PROJECTS)
+ .bot().tree(), StrutsAllBotTests.STRUTS_PROJECT_NAME));
+
+ }
+
+}
Property changes on: trunk/struts/tests/org.jboss.tools.struts.ui.bot.test/src/org/jboss/tools/struts/ui/bot/test/smoke/ImportStrutsProjectTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/struts/tests/org.jboss.tools.struts.ui.bot.test/src/org/jboss/tools/struts/ui/bot/test/smoke/RenameStrutsConfigXmlFile.java
===================================================================
--- trunk/struts/tests/org.jboss.tools.struts.ui.bot.test/src/org/jboss/tools/struts/ui/bot/test/smoke/RenameStrutsConfigXmlFile.java (rev 0)
+++ trunk/struts/tests/org.jboss.tools.struts.ui.bot.test/src/org/jboss/tools/struts/ui/bot/test/smoke/RenameStrutsConfigXmlFile.java 2010-01-18 19:29:45 UTC (rev 19796)
@@ -0,0 +1,75 @@
+ /*******************************************************************************
+ * 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.struts.ui.bot.test.smoke;
+
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
+
+import org.eclipse.swtbot.swt.finder.widgets.SWTBotMenu;
+import org.eclipse.swtbot.swt.finder.widgets.SWTBotTable;
+import org.eclipse.swtbot.swt.finder.widgets.SWTBotTree;
+import org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem;
+import org.jboss.tools.ui.bot.ext.SWTTestExt;
+import org.jboss.tools.ui.bot.ext.helper.ContextMenuHelper;
+import org.jboss.tools.ui.bot.ext.helper.FileRenameHelper;
+import org.jboss.tools.ui.bot.ext.types.IDELabel;
+import org.jboss.tools.ui.bot.ext.types.ViewType;
+import org.junit.Test;
+import org.jboss.tools.struts.ui.bot.test.StrutsAllBotTests;
+
+/**
+ * Test renaming of struts-config.xml file
+ * @author Vladimir Pakan
+ *
+ */
+public class RenameStrutsConfigXmlFile extends SWTTestExt{
+ private static final String OLD_STRUTS_CONFIG_FILE_NAME = "struts-config.xml";
+ private static final String NEW_STRUTS_CONFIG_FILE_NAME = "struts-config-renamed.xml";
+ /**
+ * Test renaming of struts-config.xml file
+ */
+ @Test
+ public void testRenameStrutsConfigXmlFile() {
+
+ String checkResult = FileRenameHelper.checkFileRenamingWithinWebProjects(bot,
+ OLD_STRUTS_CONFIG_FILE_NAME, NEW_STRUTS_CONFIG_FILE_NAME,
+ new String[]{StrutsAllBotTests.STRUTS_PROJECT_NAME, IDELabel.WebProjectsTree.CONFIGURATION ,IDELabel.WebProjectsTree.DEFAULT});
+ assertNull(checkResult, checkResult);
+ // web.xml file was properly modified
+ SWTBotTree tree = eclipse.showView(ViewType.WEB_PROJECTS).tree();
+ tree.setFocus();
+ SWTBotTreeItem configFilesTreeItem = tree
+ .getTreeItem(StrutsAllBotTests.STRUTS_PROJECT_NAME)
+ .expand()
+ .getNode(IDELabel.WebProjectsTree.CONFIGURATION)
+ .expand()
+ .getNode(IDELabel.WebProjectsTree.WEB_XML)
+ .expand()
+ .getNode(IDELabel.WebProjectsTree.SERVLETS)
+ .expand()
+ .getNode(IDELabel.WebProjectsTree.ACTION_STRUTS)
+ .expand()
+ .getNode(IDELabel.WebProjectsTree.CONFIG);
+
+ ContextMenuHelper.prepareTreeItemForContextMenu(tree,configFilesTreeItem);
+ new SWTBotMenu(ContextMenuHelper.getContextMenu(tree, IDELabel.Menu.PROPERTIES, true)).click();
+ bot.shell(IDELabel.Shell.PROPERTIES).activate();
+ SWTBotTable propertiesTable = bot.table();
+ String fullConfigFileName = propertiesTable.cell(propertiesTable.indexOf(IDELabel.PropertiesDialog.PARAM_VALUE, 0), 1);
+ bot.button(IDELabel.Button.CLOSE).click();
+ assertTrue(NEW_STRUTS_CONFIG_FILE_NAME + " Name of "
+ + OLD_STRUTS_CONFIG_FILE_NAME
+ + " file was not changed in web.xml file.",
+ fullConfigFileName.endsWith(NEW_STRUTS_CONFIG_FILE_NAME));
+ }
+
+}
Property changes on: trunk/struts/tests/org.jboss.tools.struts.ui.bot.test/src/org/jboss/tools/struts/ui/bot/test/smoke/RenameStrutsConfigXmlFile.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/struts/tests/org.jboss.tools.struts.ui.bot.test/src/org/jboss/tools/struts/ui/bot/test/smoke/RenameTldFile.java
===================================================================
--- trunk/struts/tests/org.jboss.tools.struts.ui.bot.test/src/org/jboss/tools/struts/ui/bot/test/smoke/RenameTldFile.java (rev 0)
+++ trunk/struts/tests/org.jboss.tools.struts.ui.bot.test/src/org/jboss/tools/struts/ui/bot/test/smoke/RenameTldFile.java 2010-01-18 19:29:45 UTC (rev 19796)
@@ -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.struts.ui.bot.test.smoke;
+
+import static org.junit.Assert.assertNull;
+import org.jboss.tools.ui.bot.ext.SWTTestExt;
+import org.jboss.tools.ui.bot.ext.helper.FileRenameHelper;
+import org.jboss.tools.ui.bot.ext.types.IDELabel;
+import org.junit.Test;
+import org.jboss.tools.struts.ui.bot.test.StrutsAllBotTests;
+
+/**
+ * Test renaming of Tld file
+ * @author Vladimir Pakan
+ *
+ */
+public class RenameTldFile extends SWTTestExt{
+ private static final String OLD_TLD_FILE_NAME = "struts-html.tld";
+ private static final String NEW_TLD_FILE_NAME = "struts-html-renamed.tld";
+ /**
+ * Test renaming of struts-config.xml file
+ */
+ @Test
+ public void testRenameStrutsConfigXmlFile() {
+ String checkResult = FileRenameHelper.checkFileRenamingWithinWebProjects(bot,
+ OLD_TLD_FILE_NAME, NEW_TLD_FILE_NAME,
+ new String[]{StrutsAllBotTests.STRUTS_PROJECT_NAME, IDELabel.WebProjectsTree.TAG_LIBRARIES},
+ " [html]");
+ assertNull(checkResult, checkResult);
+ }
+
+}
Property changes on: trunk/struts/tests/org.jboss.tools.struts.ui.bot.test/src/org/jboss/tools/struts/ui/bot/test/smoke/RenameTldFile.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/struts/tests/org.jboss.tools.struts.ui.bot.test/src/org/jboss/tools/struts/ui/bot/test/smoke/RunStrutsProjectOnServer.java
===================================================================
--- trunk/struts/tests/org.jboss.tools.struts.ui.bot.test/src/org/jboss/tools/struts/ui/bot/test/smoke/RunStrutsProjectOnServer.java (rev 0)
+++ trunk/struts/tests/org.jboss.tools.struts.ui.bot.test/src/org/jboss/tools/struts/ui/bot/test/smoke/RunStrutsProjectOnServer.java 2010-01-18 19:29:45 UTC (rev 19796)
@@ -0,0 +1,49 @@
+ /*******************************************************************************
+ * 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.struts.ui.bot.test.smoke;
+
+import static org.junit.Assert.assertTrue;
+
+import org.jboss.tools.ui.bot.ext.SWTJBTExt;
+import org.jboss.tools.ui.bot.ext.SWTTestExt;
+import org.jboss.tools.ui.bot.ext.helper.WidgetFinderHelper;
+import org.junit.Test;
+import org.jboss.tools.struts.ui.bot.test.StrutsAllBotTests;
+
+/**
+ * Test running Struts Project on Server
+ * @author Vladimir Pakan
+ *
+ */
+public class RunStrutsProjectOnServer extends SWTTestExt{
+ private SWTJBTExt swtJbtExt = null;
+ public RunStrutsProjectOnServer (){
+ swtJbtExt = new SWTJBTExt(bot);
+ }
+ /**
+ * Test running Struts Project on Server
+ */
+ @Test
+ public void testRunStrutsProjectOnServer() {
+ // Start Application Server
+ swtJbtExt.startApplicationServer(0);
+ swtJbtExt.runProjectOnServer(StrutsAllBotTests.STRUTS_PROJECT_NAME);
+ // Check Browser Content
+ String browserText = WidgetFinderHelper.browserInEditorText(bot, "KickStart: Input name",true);
+ assertTrue("Displayed HTML page has wrong content",
+ browserText.indexOf("<TITLE>KickStart: Input name</TITLE>") > - 1);
+ swtJbtExt.stopApplicationServer( 0);
+ swtJbtExt.removeProjectFromServers(StrutsAllBotTests.STRUTS_PROJECT_NAME);
+ SWTJBTExt.deleteApplicationServer(bot, 0);
+ }
+
+}
Property changes on: trunk/struts/tests/org.jboss.tools.struts.ui.bot.test/src/org/jboss/tools/struts/ui/bot/test/smoke/RunStrutsProjectOnServer.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
14 years, 5 months
JBoss Tools SVN: r19795 - in trunk: vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/smoke and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: vpakan(a)redhat.com
Date: 2010-01-18 14:26:19 -0500 (Mon, 18 Jan 2010)
New Revision: 19795
Added:
trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/helper/FileRenameHelper.java
Removed:
trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/smoke/CheckRenaming.java
Modified:
trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/smoke/RenameFacesConfigFileTest.java
trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/smoke/RenameJSPFileTest.java
trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/smoke/RenameXHTMLFileTest.java
Log:
Renaming check moved from CheckRenaming.java to FileRenameHelper.java.
Added: trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/helper/FileRenameHelper.java
===================================================================
--- trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/helper/FileRenameHelper.java (rev 0)
+++ trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/helper/FileRenameHelper.java 2010-01-18 19:26:19 UTC (rev 19795)
@@ -0,0 +1,123 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2009 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributor:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.ui.bot.ext.helper;
+
+import static org.jboss.tools.ui.bot.ext.SWTTestExt.eclipse;
+
+import org.eclipse.swtbot.eclipse.finder.SWTWorkbenchBot;
+import org.eclipse.swtbot.swt.finder.SWTBot;
+import org.eclipse.swtbot.swt.finder.exceptions.WidgetNotFoundException;
+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.SWTUtilExt;
+import org.jboss.tools.ui.bot.ext.types.IDELabel;
+import org.jboss.tools.ui.bot.ext.types.JobName;
+import org.jboss.tools.ui.bot.ext.types.ViewType;
+
+/**
+ * Check Renaming Functionality within WebProjects View
+ * Tests if file was properly renamed in WebProjects View
+ * and Title of file in Editor was renamed also.
+ * @author Vladimir Pakan
+ *
+ */
+public class FileRenameHelper {
+ private static final int sleepTime = 1000;
+ /**
+ * Check File Renaming
+ * @param bot
+ * @param oldFileName
+ * @param newFileName
+ * @param treePathItems
+ * @param fileTreeItemSuffix
+ * @return
+ */
+ public static String checkFileRenamingWithinWebProjects(SWTWorkbenchBot bot , String oldFileName, String newFileName,
+ String[] treePathItems , String fileTreeItemSuffix){
+
+ bot.sleep(sleepTime);
+ SWTBot webProjects = eclipse.showView(ViewType.WEB_PROJECTS);
+ SWTBotTree tree = webProjects.tree();
+
+ tree.setFocus();
+
+ if (treePathItems != null && treePathItems.length > 0){
+ SWTBotTreeItem parentTreeItem = tree.getTreeItem(treePathItems[0]);
+ parentTreeItem.expand();
+ bot.sleep(1000);
+ parentTreeItem.select();
+ bot.sleep(1000);
+ // Do not remove this part of code otherwise tree view is not populated properly
+ parentTreeItem.collapse();
+ bot.sleep(1000);
+ parentTreeItem.expand();
+ bot.sleep(1000);
+ int index = 1;
+ while (treePathItems.length > index){
+ parentTreeItem = parentTreeItem.getNode(treePathItems[index]);
+ parentTreeItem.expand();
+ index++;
+ }
+ // Open File
+ ContextMenuHelper.prepareTreeItemForContextMenu(tree , parentTreeItem.getNode(oldFileName + fileTreeItemSuffix));
+ new SWTBotMenu(ContextMenuHelper.getContextMenu(tree, IDELabel.Menu.OPEN, true)).click();
+ bot.sleep(sleepTime);
+ // Rename file
+ new SWTBotMenu(ContextMenuHelper.getContextMenu(tree, IDELabel.Menu.RENAME, true)).click();
+ bot.sleep(sleepTime);
+ bot.shell(IDELabel.Shell.RENAME_RESOURCE).activate();
+ bot.textWithLabel(IDELabel.RenameResourceDialog.NEW_NAME)
+ .setText(newFileName);
+ bot.button(IDELabel.Button.OK).click();
+ bot.sleep(sleepTime);
+ new SWTUtilExt(bot).waitForJobs(JobName.UPDATING_INDEXES);
+ // Check Results
+ // File with Old Name doesn't exists within WebProjects View
+ try{
+ parentTreeItem.getNode(oldFileName + fileTreeItemSuffix);
+ return "File " + oldFileName + " was not renamed to " + newFileName + ".";
+ }catch (WidgetNotFoundException wnfe) {
+ // do nothing
+ }
+ // File with New Name exists within WebProjects View
+ try{
+ parentTreeItem.getNode(newFileName + fileTreeItemSuffix);
+ }catch (WidgetNotFoundException wnfe) {
+ return "Renamed File " + newFileName + " was not found.";
+ }
+ // Editor Title was renamed
+ try{
+ bot.editorByTitle(newFileName);
+ }catch (WidgetNotFoundException wnfe) {
+ return "Editor Title was not changed to " + newFileName + " after renaming.";
+ }
+ }
+ else{
+ return "Unable to find file for renaming.";
+ }
+
+ return null;
+
+ }
+ /**
+ * Check File Renaming
+ * @param bot
+ * @param oldFileName
+ * @param newFileName
+ * @param treePathItems
+ * @return
+ */
+ public static String checkFileRenamingWithinWebProjects(SWTWorkbenchBot bot , String oldFileName, String newFileName,
+ String[] treePathItems){
+ return checkFileRenamingWithinWebProjects(bot, oldFileName, newFileName, treePathItems, "");
+ }
+}
Deleted: trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/smoke/CheckRenaming.java
===================================================================
--- trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/smoke/CheckRenaming.java 2010-01-18 18:27:34 UTC (rev 19794)
+++ trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/smoke/CheckRenaming.java 2010-01-18 19:26:19 UTC (rev 19795)
@@ -1,98 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007-2009 Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributor:
- * Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-package org.jboss.tools.vpe.ui.bot.test.smoke;
-
-import org.eclipse.swtbot.swt.finder.SWTBot;
-import org.eclipse.swtbot.swt.finder.exceptions.WidgetNotFoundException;
-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.helper.ContextMenuHelper;
-import org.jboss.tools.ui.bot.ext.types.IDELabel;
-import org.jboss.tools.ui.bot.test.SWTJBTBot;
-import org.jboss.tools.ui.bot.test.WidgetVariables;
-
-/**
- * Check Renaming Functionality within WebProjects View
- * Tests if file war properly renamed in WebProjects View
- * and Title of file in Editor was renamed also.
- * @author Vladimir Pakan
- *
- */
-public class CheckRenaming {
- private static final int sleepTime = 1000;
- /**
- * Check File Renaming
- * @param bot
- * @param oldFileName
- * @param newFileName
- * @param treePathItems
- * @return
- */
- public static String checkRenameJSPFile(SWTJBTBot bot , String oldFileName, String newFileName, String... treePathItems){
-
- bot.sleep(sleepTime);
- SWTBot webProjects = bot.viewByTitle(WidgetVariables.WEB_PROJECTS).bot();
- SWTBotTree tree = webProjects.tree();
-
- tree.setFocus();
-
- if (treePathItems != null && treePathItems.length > 0){
- SWTBotTreeItem parentTreeItem = tree.getTreeItem(treePathItems[0]);
- parentTreeItem.expand();
- int index = 1;
- while (treePathItems.length > index){
- parentTreeItem = parentTreeItem.getNode(treePathItems[index]);
- parentTreeItem.expand();
- index++;
- }
- // Open File
- ContextMenuHelper.prepareTreeItemForContextMenu(tree , parentTreeItem.getNode(oldFileName));
- new SWTBotMenu(ContextMenuHelper.getContextMenu(tree, IDELabel.Menu.OPEN, true)).click();
- bot.sleep(sleepTime);
- // Rename file
- new SWTBotMenu(ContextMenuHelper.getContextMenu(tree, IDELabel.Menu.RENAME, true)).click();
- bot.sleep(sleepTime);
- bot.shell(IDELabel.Shell.RENAME_RESOURCE).activate();
- bot.textWithLabel(IDELabel.RenameResourceDialog.NEW_NAME)
- .setText(newFileName);
- bot.button(IDELabel.Button.OK).click();
- bot.sleep(sleepTime);
- // Check Results
- // File with Old Name doesn't exists within WebProjects View
- try{
- parentTreeItem.getNode(oldFileName);
- return "File " + oldFileName + " was not renamed to " + newFileName + ".";
- }catch (WidgetNotFoundException wnfe) {
- // do nothing
- }
- // File with New Name exists within WebProjects View
- try{
- parentTreeItem.getNode(newFileName);
- }catch (WidgetNotFoundException wnfe) {
- return "Renamed File " + newFileName + " was not found.";
- }
- // Editor Title was renamed
- try{
- bot.editorByTitle(newFileName);
- }catch (WidgetNotFoundException wnfe) {
- return "Editor Title was not changed to " + newFileName + " after renaming.";
- }
- }
- else{
- return "Unable to find file for renaming.";
- }
-
- return null;
-
- }
-
-}
Modified: trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/smoke/RenameFacesConfigFileTest.java
===================================================================
--- trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/smoke/RenameFacesConfigFileTest.java 2010-01-18 18:27:34 UTC (rev 19794)
+++ trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/smoke/RenameFacesConfigFileTest.java 2010-01-18 19:26:19 UTC (rev 19795)
@@ -15,6 +15,7 @@
import org.eclipse.swtbot.swt.finder.widgets.SWTBotTable;
import org.eclipse.swtbot.swt.finder.widgets.SWTBotTree;
import org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem;
+import org.jboss.tools.ui.bot.ext.helper.FileRenameHelper;
import org.jboss.tools.ui.bot.ext.helper.ContextMenuHelper;
import org.jboss.tools.ui.bot.ext.types.IDELabel;
import org.jboss.tools.ui.bot.test.WidgetVariables;
@@ -49,8 +50,8 @@
SWTBotTree tree = webProjects.tree();
tree.setFocus();
- String checkResult = CheckRenaming.checkRenameJSPFile(bot, OLD_FACES_CONFIG_FILE_NAME, NEW_FACES_CONFIG_FILE_NAME,
- JBT_TEST_PROJECT_NAME,IDELabel.WebProjectsTree.CONFIGURATION);
+ String checkResult = FileRenameHelper.checkFileRenamingWithinWebProjects(bot, OLD_FACES_CONFIG_FILE_NAME, NEW_FACES_CONFIG_FILE_NAME,
+ new String[]{JBT_TEST_PROJECT_NAME,IDELabel.WebProjectsTree.CONFIGURATION});
assertNull(checkResult,checkResult);
// web.xml file was properly modified
SWTBotTreeItem configFilesTreeItem = tree
@@ -68,7 +69,7 @@
SWTBotTable propertiesTable = bot.table();
String fullConfigFileName = propertiesTable.cell(propertiesTable.indexOf(IDELabel.PropertiesDialog.PARAM_VALUE, 0), 1);
bot.button(IDELabel.Button.CLOSE).click();
- assertTrue(NEW_FACES_CONFIG_FILE_NAME + "Name of "
+ assertTrue(NEW_FACES_CONFIG_FILE_NAME + " Name of "
+ OLD_FACES_CONFIG_FILE_NAME
+ " file was not changed in web.xml file.",
fullConfigFileName.endsWith(NEW_FACES_CONFIG_FILE_NAME));
Modified: trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/smoke/RenameJSPFileTest.java
===================================================================
--- trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/smoke/RenameJSPFileTest.java 2010-01-18 18:27:34 UTC (rev 19794)
+++ trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/smoke/RenameJSPFileTest.java 2010-01-18 19:26:19 UTC (rev 19795)
@@ -12,6 +12,7 @@
import org.eclipse.swtbot.swt.finder.SWTBot;
import org.eclipse.swtbot.swt.finder.widgets.SWTBotTree;
+import org.jboss.tools.ui.bot.ext.helper.FileRenameHelper;
import org.jboss.tools.ui.bot.ext.types.IDELabel;
import org.jboss.tools.ui.bot.test.WidgetVariables;
import org.jboss.tools.vpe.ui.bot.test.editor.VPEEditorTestCase;
@@ -43,9 +44,9 @@
SWTBotTree tree = webProjects.tree();
tree.setFocus();
- String checkResult = CheckRenaming.checkRenameJSPFile(bot,
+ String checkResult = FileRenameHelper.checkFileRenamingWithinWebProjects(bot,
JSPPageCreationTest.TEST_NEW_JSP_FILE_NAME, NEW_JSP_FILE_NAME,
- JBT_TEST_PROJECT_NAME, IDELabel.WebProjectsTree.WEB_CONTENT);
+ new String[] {JBT_TEST_PROJECT_NAME, IDELabel.WebProjectsTree.WEB_CONTENT});
assertNull(checkResult, checkResult);
}
Modified: trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/smoke/RenameXHTMLFileTest.java
===================================================================
--- trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/smoke/RenameXHTMLFileTest.java 2010-01-18 18:27:34 UTC (rev 19794)
+++ trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/smoke/RenameXHTMLFileTest.java 2010-01-18 19:26:19 UTC (rev 19795)
@@ -12,6 +12,7 @@
import org.eclipse.swtbot.swt.finder.SWTBot;
import org.eclipse.swtbot.swt.finder.widgets.SWTBotTree;
+import org.jboss.tools.ui.bot.ext.helper.FileRenameHelper;
import org.jboss.tools.ui.bot.ext.types.IDELabel;
import org.jboss.tools.ui.bot.test.WidgetVariables;
import org.jboss.tools.vpe.ui.bot.test.editor.VPEEditorTestCase;
@@ -48,9 +49,9 @@
SWTBotTree tree = webProjects.tree();
tree.setFocus();
- String checkResult = CheckRenaming.checkRenameJSPFile(bot,
+ String checkResult = FileRenameHelper.checkFileRenamingWithinWebProjects(bot,
XHTMLPageCreationTest.TEST_NEW_XHTML_FILE_NAME, NEW_XHTML_FILE_NAME,
- JBT_TEST_PROJECT_NAME, IDELabel.WebProjectsTree.WEB_CONTENT);
+ new String[] {JBT_TEST_PROJECT_NAME, IDELabel.WebProjectsTree.CONFIGURATION});
assertNull(checkResult, checkResult);
}
14 years, 5 months
JBoss Tools SVN: r19794 - trunk/jsf/docs/userguide/en/modules.
by jbosstools-commits@lists.jboss.org
Author: abogachuk
Date: 2010-01-18 13:27:34 -0500 (Mon, 18 Jan 2010)
New Revision: 19794
Modified:
trunk/jsf/docs/userguide/en/modules/editors.xml
Log:
fixed tags problem
Modified: trunk/jsf/docs/userguide/en/modules/editors.xml
===================================================================
--- trunk/jsf/docs/userguide/en/modules/editors.xml 2010-01-18 17:16:58 UTC (rev 19793)
+++ trunk/jsf/docs/userguide/en/modules/editors.xml 2010-01-18 18:27:34 UTC (rev 19794)
@@ -2031,7 +2031,9 @@
</figure>
</section>
</section>
- </section><title>Page Preview</title>
+ </section>
+
+ <title>Page Preview</title>
<para><property>VPE</property> comes with design-time preview feature which is available
for:</para>
<itemizedlist>
@@ -2280,7 +2282,7 @@
</section>
-->
- </section>
+ <!-- </section>-->
<section id="more_editors">
14 years, 5 months
JBoss Tools SVN: r19793 - trunk/birt/docs.
by jbosstools-commits@lists.jboss.org
Author: ochikvina
Date: 2010-01-18 12:16:58 -0500 (Mon, 18 Jan 2010)
New Revision: 19793
Modified:
trunk/birt/docs/pom.xml
Log:
<html><head><meta name="qrichtext" content="1" /></head><body style="font-size:9pt;font-family:Sans Serif">
<p>https://jira.jboss.org/jira/browse/JBDS-1052 updated pom.xml,because the assembly bundle in releaseJDBS profile didn't build.</p>
</body></html>
Modified: trunk/birt/docs/pom.xml
===================================================================
--- trunk/birt/docs/pom.xml 2010-01-18 15:22:07 UTC (rev 19792)
+++ trunk/birt/docs/pom.xml 2010-01-18 17:16:58 UTC (rev 19793)
@@ -36,7 +36,7 @@
<xsl-single>classpath:/xslt/com/jboss/tools/xhtml-single-release-nomarker.xsl</xsl-single>
<xsl-chunked>classpath:/xslt/com/jboss/tools/xhtml-release-nomarker.xsl</xsl-chunked>
<xsl-pdf>classpath:/xslt/com/jboss/tools/pdf.xsl</xsl-pdf>
- <cssdir>../../../documentation/jbosstools-jdocbook-style/src/main/com/css/</cssdir>
+ <cssdir>../../documentation/jbosstools-jdocbook-style/src/main/com/css/</cssdir>
</properties>
</profile>
<profile>
14 years, 5 months
JBoss Tools SVN: r19792 - trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/jspeditor.
by jbosstools-commits@lists.jboss.org
Author: dmaliarevich
Date: 2010-01-18 10:22:07 -0500 (Mon, 18 Jan 2010)
New Revision: 19792
Modified:
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/jspeditor/JSPMultiPageEditor.java
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/jspeditor/JSPMultiPageEditorPart.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-5666, reverting, because JSPMultiPageEditorPart's changes had influenced Ctrl+Space shortcut and content assist got broken.
Modified: trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/jspeditor/JSPMultiPageEditor.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/jspeditor/JSPMultiPageEditor.java 2010-01-18 14:27:12 UTC (rev 19791)
+++ trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/jspeditor/JSPMultiPageEditor.java 2010-01-18 15:22:07 UTC (rev 19792)
@@ -35,7 +35,6 @@
import org.eclipse.jface.viewers.ISelectionChangedListener;
import org.eclipse.jface.viewers.ISelectionProvider;
import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.swt.custom.CTabFolder;
import org.eclipse.swt.events.DisposeEvent;
import org.eclipse.swt.events.DisposeListener;
import org.eclipse.swt.widgets.Composite;
@@ -791,11 +790,7 @@
.getString(IVpePreferencesPage.DEFAULT_VPE_TAB);
try {
int ind = Integer.parseInt(tabIndex);
- /*
- * After fixing https://jira.jboss.org/jira/browse/JBIDE-5666
- * Getting a multipage container should return CTabFolder.
- */
- ((CTabFolder)getContainer()).setSelection(ind);
+ getTabFolder().setSelection(ind);
pageChange(ind);
} catch (NumberFormatException e) {
JspEditorPlugin.getPluginLog().logError(e);
Modified: trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/jspeditor/JSPMultiPageEditorPart.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/jspeditor/JSPMultiPageEditorPart.java 2010-01-18 14:27:12 UTC (rev 19791)
+++ trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/jspeditor/JSPMultiPageEditorPart.java 2010-01-18 15:22:07 UTC (rev 19792)
@@ -10,27 +10,197 @@
******************************************************************************/
package org.jboss.tools.jst.jsp.jspeditor;
+import java.util.ArrayList;
+import java.util.Iterator;
+import org.eclipse.core.runtime.SafeRunner;
+import org.eclipse.jface.util.Assert;
+import org.eclipse.jface.util.SafeRunnable;
+import org.eclipse.jface.viewers.ISelectionProvider;
+import org.eclipse.jface.viewers.SelectionChangedEvent;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.custom.CTabFolder;
+import org.eclipse.swt.custom.CTabItem;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.layout.FillLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Item;
+import org.eclipse.ui.IEditorActionBarContributor;
import org.eclipse.ui.IEditorInput;
import org.eclipse.ui.IEditorPart;
import org.eclipse.ui.IEditorSite;
+import org.eclipse.ui.IKeyBindingService;
+import org.eclipse.ui.INestableKeyBindingService;
+import org.eclipse.ui.IPropertyListener;
+import org.eclipse.ui.IWorkbenchPart;
import org.eclipse.ui.PartInitException;
-import org.eclipse.ui.part.MultiPageEditorPart;
+import org.eclipse.ui.part.EditorPart;
+import org.eclipse.ui.part.MultiPageEditorActionBarContributor;
+import org.eclipse.ui.part.MultiPageEditorSite;
+import org.eclipse.ui.part.MultiPageSelectionProvider;
import org.jboss.tools.common.core.resources.XModelObjectEditorInput;
/**
*
*/
-public abstract class JSPMultiPageEditorPart extends MultiPageEditorPart {
+public abstract class JSPMultiPageEditorPart extends EditorPart {
+ private CTabFolder container;
+
+ private ArrayList nestedEditors = new ArrayList(3);
+
protected JSPMultiPageEditorPart() {
super();
}
+ public int addPage(Control control) {
+ createItem(control);
+ return getPageCount() - 1;
+ }
+
+ /**
+ *
+ */
+
+ Composite ppp = null;
+
+ public int addPage(IEditorPart editor, IEditorInput input)
+ throws PartInitException {
+ Composite parent2;
+ if (ppp == null) {
+ IEditorSite site = createSite(editor);
+ editor.init(site, input);
+ parent2 = new Composite(getContainer(), SWT.NONE);
+ ppp = parent2;
+ parent2.setLayout(new FillLayout());
+ editor.createPartControl(parent2);
+ editor.addPropertyListener(new IPropertyListener() {
+ public void propertyChanged(Object source, int propertyId) {
+ JSPMultiPageEditorPart.this
+ .handlePropertyChange(propertyId);
+ }
+ });
+ nestedEditors.add(editor);
+ } else {
+ parent2 = ppp;
+ }
+ Item item = createItem(parent2);
+ item.setData(editor);
+ return getPageCount() - 1;
+ }
+
+ /**
+ *
+ * @param parent
+ * @return
+ */
+ private CTabFolder createContainer(Composite parent) {
+ final CTabFolder newContainer = new CTabFolder(parent, SWT.BOTTOM
+ | SWT.FLAT);
+ newContainer.addSelectionListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent e) {
+ int newPageIndex = newContainer.indexOf((CTabItem) e.item);
+ pageChange(newPageIndex);
+ }
+ });
+ return newContainer;
+ }
+
+ /*
+ *
+ */
+ private CTabItem createItem(Control control) {
+ CTabItem item = new CTabItem(getTabFolder(), SWT.NONE);
+ item.setControl(control);
+ return item;
+ }
+
+ protected abstract void createPages();
+
+ public final void createPartControl(Composite parent) {
+ this.container = createContainer(parent);
+ createPages();
+ // set the active page (page 0 by default), unless it has already been
+ // done
+ if (getActivePage() == -1)
+ setActivePage(0);
+ }
+
+ protected abstract IEditorSite createSite(IEditorPart editor);
+
+ public void dispose() {
+ getSite().setSelectionProvider(null);
+ for (int i = 0; i < nestedEditors.size(); ++i) {
+ IEditorPart editor = (IEditorPart) nestedEditors.get(i);
+ disposePart(editor);
+ }
+ nestedEditors.clear();
+ }
+
protected IEditorPart getActiveEditor() {
- return super.getActiveEditor();
+ int index = getActivePage();
+ if (index != -1)
+ return getEditor(0);
+ return null;
}
+ protected int getActivePage() {
+ CTabFolder tabFolder = getTabFolder();
+ if (tabFolder != null && !tabFolder.isDisposed())
+ return tabFolder.getSelectionIndex();
+ return -1;
+ }
+
+ protected Composite getContainer() {
+ return container;
+ }
+
+ protected Control getControl(int pageIndex) {
+ return getItem(0).getControl();
+ }
+
+ protected IEditorPart getEditor(int pageIndex) {
+ Item item = getItem(pageIndex);
+ if (item != null) {
+ Object data = item.getData();
+ if (data instanceof IEditorPart) {
+ return (IEditorPart) data;
+ }
+ }
+ return null;
+ }
+
+ private CTabItem getItem(int pageIndex) {
+ return getTabFolder().getItem(pageIndex);
+ }
+
+ protected int getPageCount() {
+ CTabFolder folder = getTabFolder();
+ // May not have been created yet, or may have been disposed.
+ if (folder != null && !folder.isDisposed())
+ return folder.getItemCount();
+ return 0;
+ }
+
+ protected Image getPageImage(int pageIndex) {
+ return getItem(pageIndex).getImage();
+ }
+
+ protected String getPageText(int pageIndex) {
+ return getItem(pageIndex).getText();
+ }
+
+ protected CTabFolder getTabFolder() {
+ return container;
+ }
+
+ protected void handlePropertyChange(int propertyId) {
+ firePropertyChange(propertyId);
+ }
+
public void init(IEditorSite site, IEditorInput input)
throws PartInitException {
setSite(site);
@@ -38,4 +208,123 @@
site.setSelectionProvider(new JSPMultiPageSelectionProvider(this));
}
+ public boolean isDirty() {
+ // use nestedEditors to avoid SWT requests; see bug 12996
+ for (Iterator i = nestedEditors.iterator(); i.hasNext();) {
+ IEditorPart editor = (IEditorPart) i.next();
+ if (editor.isDirty()) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ protected void pageChange(int newPageIndex) {
+ Control control = getControl(newPageIndex);
+ if (control != null) {
+ control.setVisible(true);
+ }
+
+ setFocus();
+ IEditorPart activeEditor = getEditor(newPageIndex);
+ IEditorActionBarContributor contributor = getEditorSite()
+ .getActionBarContributor();
+ if (contributor != null
+ && contributor instanceof MultiPageEditorActionBarContributor) {
+ ((MultiPageEditorActionBarContributor) contributor)
+ .setActivePage(activeEditor);
+ }
+ if (activeEditor != null) {
+ ISelectionProvider selectionProvider = activeEditor.getSite()
+ .getSelectionProvider();
+ if (selectionProvider != null) {
+ SelectionChangedEvent event = new SelectionChangedEvent(
+ selectionProvider, selectionProvider.getSelection());
+ ((MultiPageSelectionProvider) getSite().getSelectionProvider())
+ .fireSelectionChanged(event);
+ }
+ }
+ }
+
+ private void disposePart(final IWorkbenchPart part) {
+ SafeRunner.run(new SafeRunnable() {
+ public void run() {
+ if (part.getSite() instanceof MultiPageEditorSite) {
+ MultiPageEditorSite partSite = (MultiPageEditorSite) part
+ .getSite();
+ partSite.dispose();
+ }
+ part.dispose();
+ }
+
+ public void handleException(Throwable e) {
+ }
+ });
+ }
+
+ public void removePage(int pageIndex) {
+ Assert.isTrue(pageIndex >= 0 && pageIndex < getPageCount());
+ IEditorPart editor = getEditor(pageIndex);
+ getItem(pageIndex).dispose();
+ if (editor != null) {
+ nestedEditors.remove(editor);
+ disposePart(editor);
+ }
+ }
+
+ protected void setActivePage(int pageIndex) {
+ Assert.isTrue(pageIndex >= 0 && pageIndex < getPageCount());
+ getTabFolder().setSelection(pageIndex);
+ }
+
+ protected void setControl(int pageIndex, Control control) {
+ getItem(pageIndex).setControl(control);
+ }
+
+ public void setFocus() {
+ setFocus(getActivePage());
+ }
+
+ private void setFocus(int pageIndex) {
+ final IKeyBindingService service = getSite().getKeyBindingService();
+ if (pageIndex < 0 || pageIndex >= getPageCount()) {
+ if (service instanceof INestableKeyBindingService) {
+ final INestableKeyBindingService nestableService = (INestableKeyBindingService) service;
+ nestableService.activateKeyBindingService(null);
+ }
+ return;
+ }
+
+ IEditorPart editor = getEditor(pageIndex);
+ if (editor != null) {
+ editor.setFocus();
+ if (service instanceof INestableKeyBindingService) {
+ INestableKeyBindingService nestableService = (INestableKeyBindingService) service;
+ if (editor != null) {
+ nestableService.activateKeyBindingService(editor
+ .getEditorSite());
+ } else {
+ nestableService.activateKeyBindingService(null);
+ }
+ }
+ } else {
+ if (service instanceof INestableKeyBindingService) {
+ INestableKeyBindingService nestableService = (INestableKeyBindingService) service;
+ nestableService.activateKeyBindingService(null);
+ }
+
+ Control control = getControl(pageIndex);
+ if (control != null) {
+ control.setFocus();
+ }
+ }
+ }
+
+ protected void setPageImage(int pageIndex, Image image) {
+ getItem(pageIndex).setImage(image);
+ }
+
+ protected void setPageText(int pageIndex, String text) {
+ getItem(pageIndex).setText(text);
+ }
}
14 years, 5 months
JBoss Tools SVN: r19791 - trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/jpa/actions.
by jbosstools-commits@lists.jboss.org
Author: vyemialyanchyk
Date: 2010-01-18 09:27:12 -0500 (Mon, 18 Jan 2010)
New Revision: 19791
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/jpa/actions/JPAMapToolActor.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-5674 - fixed
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/jpa/actions/JPAMapToolActor.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/jpa/actions/JPAMapToolActor.java 2010-01-18 14:08:43 UTC (rev 19790)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/jpa/actions/JPAMapToolActor.java 2010-01-18 14:27:12 UTC (rev 19791)
@@ -13,6 +13,7 @@
import java.lang.reflect.Field;
import java.util.HashMap;
import java.util.Iterator;
+import java.util.Map;
import java.util.Set;
import org.eclipse.core.internal.filebuffers.SynchronizableDocument;
@@ -33,6 +34,7 @@
import org.eclipse.jface.text.IDocument;
import org.eclipse.jface.text.TextSelection;
import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.viewers.StructuredSelection;
import org.eclipse.jface.viewers.TreeSelection;
import org.eclipse.swt.widgets.Shell;
@@ -125,7 +127,9 @@
}
}
if (getSelectionCUSize() == 0) {
- processor.modify(new HashMap<String, EntityInfo>(), true, createSelection2Update());
+ Map<String, EntityInfo> mapCUs_Info = new HashMap<String, EntityInfo>();
+ IStructuredSelection selection2Update = createSelection2Update();
+ processor.modify(mapCUs_Info, true, selection2Update);
return;
}
Iterator<ICompilationUnit> it = compileUnitCollector.setSelectionCUIterator();
@@ -137,7 +141,9 @@
collector.resolveRelations();
if (collector.getNonInterfaceCUNumber() > 0) {
processor.setAnnotationStylePreference(collector.getAnnotationStylePreference());
- processor.modify(collector.getMapCUs_Info(), true, createSelection2Update());
+ Map<String, EntityInfo> mapCUs_Info = collector.getMapCUs_Info();
+ IStructuredSelection selection2Update = createSelection2Update();
+ processor.modify(mapCUs_Info, true, selection2Update);
} else {
MessageDialog.openInformation(getShell(),
JdtUiMessages.JPAMapToolActor_message_title,
@@ -176,14 +182,14 @@
CompilationUnitEditor cue = (CompilationUnitEditor)editor;
ICompilationUnit cu = (ICompilationUnit)cue.getViewPartInput();
if (cu != null) {
- //IJavaProject javaProject = cu.getJavaProject();
- //collector.initCollector(javaProject);
+ addCompilationUnit(cu);
collector.initCollector();
collector.collect(cu, depth);
collector.resolveRelations();
if (collector.getNonInterfaceCUNumber() > 0) {
- //processor.modify(javaProject, collector.getMapCUs_Info(), true, createSelection2Update());
- processor.modify(collector.getMapCUs_Info(), true, createSelection2Update());
+ Map<String, EntityInfo> mapCUs_Info = collector.getMapCUs_Info();
+ IStructuredSelection selection2Update = createSelection2Update();
+ processor.modify(mapCUs_Info, true, selection2Update);
} else {
MessageDialog.openInformation(getShell(),
JdtUiMessages.JPAMapToolActor_message_title,
14 years, 5 months
JBoss Tools SVN: r19789 - in trunk/as/plugins/org.jboss.ide.eclipse.as.classpath.core: src/org/jboss/ide/eclipse/as/classpath/core/runtime and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: snjeza
Date: 2010-01-17 18:51:34 -0500 (Sun, 17 Jan 2010)
New Revision: 19789
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.classpath.core/plugin.xml
trunk/as/plugins/org.jboss.ide.eclipse.as.classpath.core/src/org/jboss/ide/eclipse/as/classpath/core/runtime/ClientAllRuntimeClasspathProvider.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-5582 Support for server runtime JBossAS 6.0
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.classpath.core/plugin.xml
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.classpath.core/plugin.xml 2010-01-17 23:33:54 UTC (rev 19788)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.classpath.core/plugin.xml 2010-01-17 23:51:34 UTC (rev 19789)
@@ -47,6 +47,13 @@
<type class="org.eclipse.jst.common.project.facet.core.IClasspathProvider"/>
</adapter>
+ <adapter>
+ <runtime-component
+ id="org.jboss.ide.eclipse.as.runtime.component" version="6.0"/>
+ <factory class="org.jboss.ide.eclipse.as.classpath.core.runtime.ProjectRuntimeClasspathProvider$Factory"/>
+ <type class="org.eclipse.jst.common.project.facet.core.IClasspathProvider"/>
+ </adapter>
+
<adapter>
<runtime-component
id="org.jboss.ide.eclipse.eap.runtime.component" version="4.3"/>
@@ -76,7 +83,7 @@
<extension point="org.eclipse.jst.server.core.runtimeClasspathProviders">
<runtimeClasspathProvider
id="org.jboss.ide.eclipse.as.core.server.runtime.runtimeTarget"
- runtimeTypeIds="org.jboss.ide.eclipse.as.runtime.32, org.jboss.ide.eclipse.as.runtime.40, org.jboss.ide.eclipse.as.runtime.42,org.jboss.ide.eclipse.as.runtime.50,org.jboss.ide.eclipse.as.runtime.51,org.jboss.ide.eclipse.as.runtime.eap.43,org.jboss.ide.eclipse.as.runtime.eap.50"
+ runtimeTypeIds="org.jboss.ide.eclipse.as.runtime.32, org.jboss.ide.eclipse.as.runtime.40, org.jboss.ide.eclipse.as.runtime.42,org.jboss.ide.eclipse.as.runtime.50,org.jboss.ide.eclipse.as.runtime.51,org.jboss.ide.eclipse.as.runtime.60,org.jboss.ide.eclipse.as.runtime.eap.43,org.jboss.ide.eclipse.as.runtime.eap.50"
class="org.jboss.ide.eclipse.as.classpath.core.runtime.ClientAllRuntimeClasspathProvider"/>
</extension>
<extension
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.classpath.core/src/org/jboss/ide/eclipse/as/classpath/core/runtime/ClientAllRuntimeClasspathProvider.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.classpath.core/src/org/jboss/ide/eclipse/as/classpath/core/runtime/ClientAllRuntimeClasspathProvider.java 2010-01-17 23:33:54 UTC (rev 19788)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.classpath.core/src/org/jboss/ide/eclipse/as/classpath/core/runtime/ClientAllRuntimeClasspathProvider.java 2010-01-17 23:51:34 UTC (rev 19789)
@@ -78,6 +78,7 @@
// Added cautiously, not sure on changes, may change
if(AS_51.equals(rtID)) return get50(loc,configPath);
+ if(AS_60.equals(rtID)) return get50(loc,configPath);
if(EAP_50.equals(rtID)) return get50(loc,configPath);
return null;
}
14 years, 5 months