Author: jlukas(a)redhat.com
Date: 2010-10-26 05:46:52 -0400 (Tue, 26 Oct 2010)
New Revision: 26049
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/smoke/AddRemoveStrutsCapabilities.java
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/RunStrutsProjectOnServer.java
trunk/struts/tests/org.jboss.tools.struts.ui.bot.test/src/org/jboss/tools/struts/ui/bot/test/tutorial/TutorialTest.java
trunk/struts/tests/org.jboss.tools.struts.ui.bot.test/src/org/jboss/tools/struts/ui/bot/test/utils/WizardBot.java
Log:
making struts bot tests up-to-date
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-10-26
09:21:14 UTC (rev 26048)
+++
trunk/struts/tests/org.jboss.tools.struts.ui.bot.test/src/org/jboss/tools/struts/ui/bot/test/StrutsAllBotTests.java 2010-10-26
09:46:52 UTC (rev 26049)
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007-2009 Red Hat, Inc.
+ * 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,
@@ -10,54 +10,44 @@
******************************************************************************/
package org.jboss.tools.struts.ui.bot.test;
-import org.eclipse.swtbot.eclipse.finder.widgets.SWTBotView;
-import org.eclipse.swtbot.swt.finder.exceptions.WidgetNotFoundException;
+import java.util.logging.Logger;
+
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.jboss.tools.struts.ui.bot.test.tutorial.TutorialTest;
+import org.jboss.tools.ui.bot.ext.RequirementAwareSuite;
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.runner.RunWith;
-import org.junit.runners.Suite;
import org.junit.runners.Suite.SuiteClasses;
/**
*
* This is struts swtbot testcase for JBoss Tools.
*
+ * System properties:
+ * -Dswtbot.test.properties.file=$PATH
+ * -Dusage_reporting_enabled=$BOOLEAN
+ *
+ * Suite duration: aprox. 10min
+ *
* @author Vladimir Pakan
+ * @author Lukas Jungmann
*
*/
-(a)RunWith(Suite.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
- public static void setUpTest() {
- properties = util.loadProperties(Activator.PLUGIN_ID);
- try{
- SWTBotView welcomeView = eclipse.getBot().viewByTitle(IDELabel.View.WELCOME);
- welcomeView.close();
- } catch (WidgetNotFoundException wnfe){
- // Do nothing ignore this error
- }
-
- }
-
- @AfterClass
- public static void tearDownTest() {
- // Ready for later usage
- }
-
+(a)RunWith(RequirementAwareSuite.class)
+@SuiteClasses({
+ TutorialTest.class,
+ CreateNewStrutsProjectTest.class,
+ RunStrutsProjectOnServer.class,
+ AddRemoveStrutsCapabilities.class,
+ ImportStrutsProjectTest.class,
+ RenameStrutsConfigXmlFile.class,
+ RenameTldFile.class})
+public class StrutsAllBotTests {
+ public static final String STRUTS_PROJECT_NAME = "strutsTest";
}
\ No newline at end of file
Modified:
trunk/struts/tests/org.jboss.tools.struts.ui.bot.test/src/org/jboss/tools/struts/ui/bot/test/smoke/AddRemoveStrutsCapabilities.java
===================================================================
---
trunk/struts/tests/org.jboss.tools.struts.ui.bot.test/src/org/jboss/tools/struts/ui/bot/test/smoke/AddRemoveStrutsCapabilities.java 2010-10-26
09:21:14 UTC (rev 26048)
+++
trunk/struts/tests/org.jboss.tools.struts.ui.bot.test/src/org/jboss/tools/struts/ui/bot/test/smoke/AddRemoveStrutsCapabilities.java 2010-10-26
09:46:52 UTC (rev 26049)
@@ -1,13 +1,13 @@
- /*******************************************************************************
- * 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
- ******************************************************************************/
+/*******************************************************************************
+ * 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.struts.ui.bot.test.smoke;
@@ -22,97 +22,91 @@
import org.jboss.tools.ui.bot.ext.types.IDELabel;
import org.jboss.tools.ui.bot.ext.types.ViewType;
import org.junit.Test;
+
/**
* Test adding and removing Struts Capabilities from/to Struts Project
+ *
* @author Vladimir Pakan
- *
+ * @author Lukas Jungmann
+ *
*/
-public class AddRemoveStrutsCapabilities extends SWTTestExt{
- private SWTJBTExt swtJbtExt = null;
- public AddRemoveStrutsCapabilities (){
- swtJbtExt = new SWTJBTExt(bot);
- }
- @Test
+public class AddRemoveStrutsCapabilities extends SWTTestExt {
+ private SWTJBTExt swtJbtExt = null;
+
+ public AddRemoveStrutsCapabilities() {
+ swtJbtExt = new SWTJBTExt(bot);
+ }
+
+ @Test
public void testAddRemoveStrutsCapabilities() {
- boolean jbdsIsRunning = SWTJBTExt.isJBDSRun(bot);
- swtJbtExt.delay();
- removeStrutsCapabilities(jbdsIsRunning);
- swtJbtExt.delay();
- addStrutsCapabilities();
+ boolean jbdsIsRunning = SWTJBTExt.isJBDSRun();
+ swtJbtExt.delay();
+ removeStrutsCapabilities(jbdsIsRunning);
+ swtJbtExt.delay();
+ addStrutsCapabilities();
}
-
- /**
- * Remove Struts Capabilities from Struts Project
- * @param jbdsIsRunning
- */
- private void removeStrutsCapabilities(boolean jbdsIsRunning) {
- swtJbtExt.removeProjectFromServers(StrutsAllBotTests.STRUTS_PROJECT_NAME);
- util.delay();
- eclipse.showView(ViewType.WEB_PROJECTS);
-
- SWTBotTree tree = bot.viewByTitle(IDELabel.View.WEB_PROJECTS).bot().tree();
-
- ContextMenuHelper.prepareTreeItemForContextMenu(tree,
- tree.getTreeItem(StrutsAllBotTests.STRUTS_PROJECT_NAME));
+ /**
+ * Remove Struts Capabilities from Struts Project
+ *
+ * @param jbdsIsRunning
+ */
+ private void removeStrutsCapabilities(boolean jbdsIsRunning) {
+ swtJbtExt.removeProjectFromServers(StrutsAllBotTests.STRUTS_PROJECT_NAME);
+ util.delay();
+ eclipse.showView(ViewType.WEB_PROJECTS);
+ SWTBotTree tree = bot.viewByTitle(IDELabel.View.WEB_PROJECTS).bot().tree();
+ ContextMenuHelper.prepareTreeItemForContextMenu(tree,
+ tree.getTreeItem(StrutsAllBotTests.STRUTS_PROJECT_NAME));
+ new SWTBotMenu(ContextMenuHelper.getContextMenu(tree,
+ IDELabel.Menu.WEB_PROJECT_JBT_STRUTS, false)).menu(
+ IDELabel.Menu.JBT_REMOVE_STRUTS_CAPABILITIES).click();
+ bot.shell("Confirmation").activate();
+ bot.button(IDELabel.Button.OK).click();
+ util.waitForNonIgnoredJobs(5L * 1000);
+ bot.sleep(2500);
- new SWTBotMenu(ContextMenuHelper.getContextMenu(tree,
- IDELabel.Menu.WEB_PROJECT_JBT_STRUTS, false)).menu(
- IDELabel.Menu.JBT_REMOVE_STRUTS_CAPABILITIES).click();
+ assertTrue(
+ "Project " + StrutsAllBotTests.STRUTS_PROJECT_NAME
+ + " was not removed from Web Projects view after Struts Capabilities were
removed.",
+ !SWTEclipseExt.treeContainsItemWithLabel(
+ bot.viewByTitle(IDELabel.View.WEB_PROJECTS).bot()
+ .tree(), StrutsAllBotTests.STRUTS_PROJECT_NAME));
+ }
- bot.shell("Confirmation").activate();
- bot.button(IDELabel.Button.OK).click();
+ /**
+ * Add Struts Capabilities to JSF Project
+ */
+ private void addStrutsCapabilities() {
+ swtJbtExt.removeProjectFromServers(StrutsAllBotTests.STRUTS_PROJECT_NAME);
+ SWTBotTree tree = eclipse.showView(ViewType.PACKAGE_EXPLORER).tree();
+ util.delay();
+ ContextMenuHelper.prepareTreeItemForContextMenu(tree,
+ tree.getTreeItem(StrutsAllBotTests.STRUTS_PROJECT_NAME));
- util.waitForNonIgnoredJobs(5L*1000);
-
- assertTrue(
- "Project "
- + StrutsAllBotTests.STRUTS_PROJECT_NAME
- + " was not removed from Web Projects view after Struts Capabilities were
removed.",
-
!SWTEclipseExt.treeContainsItemWithLabel(bot.viewByTitle(IDELabel.View.WEB_PROJECTS).bot().tree(),
- StrutsAllBotTests.STRUTS_PROJECT_NAME));
-
- }
+ try {
+ new SWTBotMenu(ContextMenuHelper.getContextMenu(tree,
+ IDELabel.Menu.PACKAGE_EXPLORER_JBT, false)).menu(
+ IDELabel.Menu.ADD_STRUTS_CAPABILITIES).click();
+ } catch (WidgetNotFoundException wnfe) {
+ // From 3.1.0.RC1 version this menu is moved to Configure submenu
+ new SWTBotMenu(ContextMenuHelper.getContextMenu(tree,
+ IDELabel.Menu.PACKAGE_EXPLORER_CONFIGURE, false)).menu(
+ IDELabel.Menu.ADD_STRUTS_CAPABILITIES).click();
+ }
- /**
- * Add Struts Capabilities to JSF Project
- */
- private void addStrutsCapabilities() {
+ bot.shell("Add Struts Capabilities").activate();
+ bot.button(IDELabel.Button.NEXT).click();
+ bot.button(IDELabel.Button.FINISH).click();
+ eclipse.closeOpenAssociatedPerspectiveShellIfOpened(false);
+ util.waitForNonIgnoredJobs(5L * 1000);
+ eclipse.showView(ViewType.WEB_PROJECTS);
- swtJbtExt.removeProjectFromServers(StrutsAllBotTests.STRUTS_PROJECT_NAME);
-
- SWTBotTree tree = eclipse.showView(ViewType.PACKAGE_EXPLORER).tree();
-
- util.delay();
-
- ContextMenuHelper.prepareTreeItemForContextMenu(tree,
- tree.getTreeItem(StrutsAllBotTests.STRUTS_PROJECT_NAME));
-
- try{
- new SWTBotMenu(ContextMenuHelper.getContextMenu(tree,
- IDELabel.Menu.PACKAGE_EXPLORER_JBT, false)).menu(
- IDELabel.Menu.ADD_STRUTS_CAPABILITIES).click();
- } catch (WidgetNotFoundException wnfe){
- // From 3.1.0.RC1 version this menu is moved to Configure submenu
- new SWTBotMenu(ContextMenuHelper.getContextMenu(tree,
- IDELabel.Menu.PACKAGE_EXPLORER_CONFIGURE, false)).menu(
- IDELabel.Menu.ADD_STRUTS_CAPABILITIES).click();
- }
-
- bot.shell("Add Struts Capabilities").activate();
- bot.button(IDELabel.Button.NEXT).click();
- bot.button(IDELabel.Button.FINISH).click();
-
- eclipse.closeOpenAssociatedPerspectiveShellIfOpened(false);
-
- util.waitForNonIgnoredJobs(5L*1000);
-
- eclipse.showView(ViewType.WEB_PROJECTS);
-
- assertTrue("JSF Capabilities were not added to project "
- + StrutsAllBotTests.STRUTS_PROJECT_NAME,
-
SWTEclipseExt.treeContainsItemWithLabel(bot.viewByTitle(IDELabel.View.WEB_PROJECTS).bot().tree(),
- StrutsAllBotTests.STRUTS_PROJECT_NAME));
-
- }
+ assertTrue(
+ "JSF Capabilities were not added to project "
+ + StrutsAllBotTests.STRUTS_PROJECT_NAME,
+ SWTEclipseExt.treeContainsItemWithLabel(
+ bot.viewByTitle(IDELabel.View.WEB_PROJECTS).bot()
+ .tree(), StrutsAllBotTests.STRUTS_PROJECT_NAME));
+ }
}
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-10-26
09:21:14 UTC (rev 26048)
+++
trunk/struts/tests/org.jboss.tools.struts.ui.bot.test/src/org/jboss/tools/struts/ui/bot/test/smoke/CreateNewStrutsProjectTest.java 2010-10-26
09:46:52 UTC (rev 26049)
@@ -1,80 +1,61 @@
- /*******************************************************************************
- * 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
- ******************************************************************************/
+/*******************************************************************************
+ * 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.struts.ui.bot.test.smoke;
+import org.eclipse.swtbot.swt.finder.SWTBot;
+import org.eclipse.swtbot.swt.finder.widgets.SWTBotTree;
+import org.jboss.tools.struts.ui.bot.test.StrutsAllBotTests;
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.config.Annotations.SWTBotTestRequires;
+import org.jboss.tools.ui.bot.ext.config.Annotations.Server;
+import org.jboss.tools.ui.bot.ext.config.Annotations.ServerState;
import org.jboss.tools.ui.bot.ext.types.EntityType;
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 creating new Struts Project
+ *
* @author Vladimir Pakan
- *
+ * @author Lukas Jungmann
+ *
*/
-public class CreateNewStrutsProjectTest extends SWTTestExt{
-
- /**
- * Test create new Struts Project
- */
- @Test
- public void testCreateNewStrutsProject() {
- // Default server version is 4.3
- String serverGroup = IDELabel.ServerGroup.JBOSS_EAP_4_3;
- String serverType = IDELabel.ServerType.JBOSS_EAP_4_3;
-
- if (!SWTJBTExt.isServerRuntimeDefined(bot)) {
- eclipse.addServerRuntime(IDELabel.ServerRuntimeName.JBOSS_EAP_4_3,
- IDELabel.ServerGroup.JBOSS_EAP_4_3,
- IDELabel.ServerRuntimeType.JBOSS_EAP_4_3, StrutsAllBotTests
- .getProperty("JBossEap4.3Home"));
- }
- else{
- // Check version of already defined server runtime
- String serverRuntimeVersion = SWTJBTExt.getDefinedServerRuntimeVersion(bot, 0);
- if (serverRuntimeVersion != null){
- if (serverRuntimeVersion.equals("5.0")){
- serverGroup = IDELabel.ServerGroup.JBOSS_EAP_5_0;
- serverType = IDELabel.ServerType.JBOSS_EAP_5_0;
- }else if(!serverRuntimeVersion.equals("4.3")){
- throw new RuntimeException("Unsupported server runtime: " +
serverRuntimeVersion);
- }
- }
- else{
- throw new RuntimeException("Unsupported server runtime: " +
serverRuntimeVersion);
- }
- }
- eclipse.showView(ViewType.WEB_PROJECTS);
- 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,
- serverGroup, serverType);
- bot.sleep(1000L);
- bot.button(IDELabel.Button.NEXT).click();
- bot.button(IDELabel.Button.FINISH).click();
- eclipse.closeOpenAssociatedPerspectiveShellIfOpened(false);
+@SWTBotTestRequires(server = @Server(state = ServerState.NotRunning), perspective =
"Web Development")
+public class CreateNewStrutsProjectTest extends SWTTestExt {
- assertTrue("Project " + StrutsAllBotTests.STRUTS_PROJECT_NAME
- + " was not created properly.", SWTEclipseExt
- .treeContainsItemWithLabel(bot.viewByTitle(IDELabel.View.WEB_PROJECTS)
- .bot().tree(), StrutsAllBotTests.STRUTS_PROJECT_NAME));
- }
+ /**
+ * Test create new Struts Project
+ */
+ @Test
+ public void testCreateNewStrutsProject() {
+ 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();
+ bot.sleep(1000L);
+ bot.button(IDELabel.Button.NEXT).click();
+ bot.button(IDELabel.Button.FINISH).click();
+ bot.sleep(1500);
+ SWTBot v = eclipse.showView(ViewType.PACKAGE_EXPLORER);
+ SWTBotTree tree = v.tree();
+ tree.setFocus();
+ assertTrue("Project " + StrutsAllBotTests.STRUTS_PROJECT_NAME + " was
not created properly.",
+ SWTEclipseExt.treeContainsItemWithLabel(tree,
StrutsAllBotTests.STRUTS_PROJECT_NAME));
+ }
+
}
Modified:
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 2010-10-26
09:21:14 UTC (rev 26048)
+++
trunk/struts/tests/org.jboss.tools.struts.ui.bot.test/src/org/jboss/tools/struts/ui/bot/test/smoke/RunStrutsProjectOnServer.java 2010-10-26
09:46:52 UTC (rev 26049)
@@ -1,13 +1,13 @@
- /*******************************************************************************
- * 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
- ******************************************************************************/
+/*******************************************************************************
+ * 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.struts.ui.bot.test.smoke;
@@ -19,29 +19,38 @@
/**
* Test running Struts Project on Server
+ *
* @author Vladimir Pakan
- *
+ * @author Lukas Jungmann
+ *
*/
-public class RunStrutsProjectOnServer extends SWTTestExt{
- private SWTJBTExt swtJbtExt = null;
- public RunStrutsProjectOnServer (){
- swtJbtExt = new SWTJBTExt(bot);
- }
- /**
- * Test running Struts Project on Server
- */
- @Test
+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,150*1000L);
- swtJbtExt.runProjectOnServer(StrutsAllBotTests.STRUTS_PROJECT_NAME);
- // Check Browser Content
- String browserText = WidgetFinderHelper.browserInEditorText(bot, "KickStart:
Input name",true);
- swtJbtExt.stopApplicationServer(0);
- swtJbtExt.removeProjectFromServers(StrutsAllBotTests.STRUTS_PROJECT_NAME);
- SWTJBTExt.deleteApplicationServer(bot, 0);
- assertTrue("Displayed HTML page has wrong content",
- (browserText!= null) &&
(browserText.indexOf("<TITLE>KickStart: Input name</TITLE>") > -
1));
- }
-
+ // Start Application Server
+ if (!configuredState.getServer().isRunning) {
+ servers.startServer(configuredState.getServer().name);
+ configuredState.getServer().isRunning = true;
+ }
+ swtJbtExt.runProjectOnServer(StrutsAllBotTests.STRUTS_PROJECT_NAME);
+ // Check Browser Content
+ String browserText = WidgetFinderHelper.browserInEditorText(bot,
+ "KickStart: Input name", true);
+ swtJbtExt.stopApplicationServer(0);
+ swtJbtExt.removeProjectFromServers(StrutsAllBotTests.STRUTS_PROJECT_NAME);
+ SWTJBTExt.deleteApplicationServer(bot, 0);
+ assertTrue("Displayed HTML page has wrong content",
+ (browserText != null)
+ && (browserText.indexOf("<TITLE>KickStart: Input
name</TITLE>") > -1));
+ }
+
}
Modified:
trunk/struts/tests/org.jboss.tools.struts.ui.bot.test/src/org/jboss/tools/struts/ui/bot/test/tutorial/TutorialTest.java
===================================================================
---
trunk/struts/tests/org.jboss.tools.struts.ui.bot.test/src/org/jboss/tools/struts/ui/bot/test/tutorial/TutorialTest.java 2010-10-26
09:21:14 UTC (rev 26048)
+++
trunk/struts/tests/org.jboss.tools.struts.ui.bot.test/src/org/jboss/tools/struts/ui/bot/test/tutorial/TutorialTest.java 2010-10-26
09:46:52 UTC (rev 26049)
@@ -308,7 +308,7 @@
SWTBotTree tree = v.bot().tree();
final SWTBotTreeItem projectNode = tree.getTreeItem(PROJECT_NAME);
nodeContextMenu(tree, projectNode.getNode("WEB-ROOT (WebContent)"),
"New", "File", "JSP...").click();
- handleWizard("index");
+ handleStandardWizard("index");
editor = bot.editorByTitle("index.jsp");
editor.show();
editorA = new
SWTBotJSPMultiPageEditor(bot.editorByTitle("index.jsp").getReference(), new
SWTWorkbenchBot());
@@ -501,16 +501,9 @@
}
private void handleWizard(String itemName) {
- handleWizard(itemName, null);
- }
-
- private void handleWizard(String itemName, String template) {
assert itemName != null && itemName.trim().length() > 0;
WizardBot sh = new WizardBot(bot.activeShell());
sh.setName(itemName);
- if (template != null) {
- sh.setTemplate(template);
- }
sh.finish();
}
Modified:
trunk/struts/tests/org.jboss.tools.struts.ui.bot.test/src/org/jboss/tools/struts/ui/bot/test/utils/WizardBot.java
===================================================================
---
trunk/struts/tests/org.jboss.tools.struts.ui.bot.test/src/org/jboss/tools/struts/ui/bot/test/utils/WizardBot.java 2010-10-26
09:21:14 UTC (rev 26048)
+++
trunk/struts/tests/org.jboss.tools.struts.ui.bot.test/src/org/jboss/tools/struts/ui/bot/test/utils/WizardBot.java 2010-10-26
09:46:52 UTC (rev 26049)
@@ -24,7 +24,7 @@
}
public void setName(String name) {
- bot.textWithLabel("Name*").setText(name);
+ bot.textWithLabel("Name:*").setText(name);
}
public void setTemplate(String template) {