[jbosstools-commits] JBoss Tools SVN: r43958 - in trunk/struts/tests/org.jboss.tools.struts.ui.bot.test/src/org/jboss/tools/struts/ui/bot/test: smoke and 1 other directory.

jbosstools-commits at lists.jboss.org jbosstools-commits at lists.jboss.org
Mon Sep 24 07:48:50 EDT 2012


Author: jjankovi
Date: 2012-09-24 07:48:50 -0400 (Mon, 24 Sep 2012)
New Revision: 43958

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/RunStrutsProjectOnServer.java
Log:
fixing struts bot test - cleaning the server to properly display html content

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	2012-09-24 10:42:54 UTC (rev 43957)
+++ trunk/struts/tests/org.jboss.tools.struts.ui.bot.test/src/org/jboss/tools/struts/ui/bot/test/StrutsAllBotTests.java	2012-09-24 11:48:50 UTC (rev 43958)
@@ -23,36 +23,19 @@
 
 /**
  * 
- * This is struts swtbot testcase for JBoss Tools.
- * 
- * System properties:
- *  -Dswtbot.test.properties.file=$PATH
- *  -Dusage_reporting_enabled=$BOOLEAN
- *  
- *  Format of swtbot.properties file:
- *  SERVER=EAP|JBOSS_AS,<server version>,<jre version to run with>|default,<server home>
- *  
- *  Sample swtbot.properties file:
- *
- *  SERVER=JBOSS_AS,6.0,default,/home/lukas/latest/jboss-6.0.0.Final
- *  JAVA=1.6,/space/java/sdk/jdk1.6.0_22
- *  
- *  
- *  Suite duration: aprox. 10min
- * 
  * @author Vladimir Pakan
  * @author Lukas Jungmann
- * 
+ * @author Jaroslav Jankovic
  */
 @RunWith(RequirementAwareSuite.class)
 @SuiteClasses({
-	TutorialTest.class,
 	CreateNewStrutsProjectTest.class,
 	RunStrutsProjectOnServer.class,
 	AddRemoveStrutsCapabilities.class,
 	ImportStrutsProjectTest.class,
 	RenameStrutsConfigXmlFile.class,
-	RenameTldFile.class
+	RenameTldFile.class,
+	TutorialTest.class,
 	})
 public class StrutsAllBotTests {
 	public static final String STRUTS_PROJECT_NAME = "strutsTest";

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	2012-09-24 10:42:54 UTC (rev 43957)
+++ trunk/struts/tests/org.jboss.tools.struts.ui.bot.test/src/org/jboss/tools/struts/ui/bot/test/smoke/RunStrutsProjectOnServer.java	2012-09-24 11:48:50 UTC (rev 43958)
@@ -13,7 +13,11 @@
 
 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.Require;
+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.helper.WidgetFinderHelper;
+import org.jboss.tools.ui.bot.ext.view.ServersView;
 import org.junit.Test;
 import org.jboss.tools.struts.ui.bot.test.StrutsAllBotTests;
 
@@ -24,6 +28,10 @@
  * @author Lukas Jungmann
  * 
  */
+ at Require(
+		clearProjects=false,
+		clearWorkspace=false, 
+		server = @Server(state = ServerState.NotRunning), perspective = "Web Development")
 public class RunStrutsProjectOnServer extends SWTTestExt {
 	private SWTJBTExt swtJbtExt = null;
 
@@ -42,16 +50,23 @@
 			configuredState.getServer().isRunning = true;
 		}
 		swtJbtExt.runProjectOnServer(StrutsAllBotTests.STRUTS_PROJECT_NAME);
+		
+		ServersView serversView = new ServersView();
+		serversView.cleanServer(configuredState.getServer().name);
+		serversView.openInWebBrowser(configuredState.getServer().name, 
+				StrutsAllBotTests.STRUTS_PROJECT_NAME);
+		
 		// Check Browser Content
 		String browserText = WidgetFinderHelper.browserInEditorText(bot,
 				"KickStart: Input name", true);
+		
+		// stop server, remove application from it and remove server as well
 		swtJbtExt.stopApplicationServer(0);
 		swtJbtExt.removeProjectFromServers(StrutsAllBotTests.STRUTS_PROJECT_NAME);
-		SWTJBTExt.deleteApplicationServer(bot, 0);
-		assertTrue("Displayed HTML page has wrong content. Application was not" +
-				" deployed by struts tools - known issue JBIDE-11306",
+		
+		assertTrue("Displayed HTML page has wrong content.",
 				(browserText != null)
-					&& (browserText.indexOf("<TITLE>KickStart: Input name</TITLE>") > -1));
+					&& (browserText.indexOf("KickStart: Input name") > -1));
 	}
 
 }



More information about the jbosstools-commits mailing list