[jbosstools-commits] JBoss Tools SVN: r43290 - in trunk/tests/plugins/org.jboss.tools.ui.bot.ext: src/org/jboss/tools/ui/bot/ext/config/requirement and 1 other directories.

jbosstools-commits at lists.jboss.org jbosstools-commits at lists.jboss.org
Wed Aug 29 06:27:38 EDT 2012


Author: ljelinko
Date: 2012-08-29 06:27:37 -0400 (Wed, 29 Aug 2012)
New Revision: 43290

Modified:
   trunk/tests/plugins/org.jboss.tools.ui.bot.ext/
   trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/config/requirement/AddServer.java
   trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/view/ServersView.java
Log:
Merged as tests from 3.3 branch


Property changes on: trunk/tests/plugins/org.jboss.tools.ui.bot.ext
___________________________________________________________________
Added: svn:mergeinfo
   + /branches/jbosstools-3.3.x/tests/plugins/org.jboss.tools.ui.bot.ext:42906-42994

Modified: trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/config/requirement/AddServer.java
===================================================================
--- trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/config/requirement/AddServer.java	2012-08-29 10:08:29 UTC (rev 43289)
+++ trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/config/requirement/AddServer.java	2012-08-29 10:27:37 UTC (rev 43290)
@@ -5,6 +5,7 @@
 import org.jboss.tools.ui.bot.ext.SWTTestExt;
 import org.jboss.tools.ui.bot.ext.config.TestConfigurator;
 import org.jboss.tools.ui.bot.ext.gen.ActionItem.Server.JBossCommunityJBossAS32;
+import org.jboss.tools.ui.bot.ext.gen.ActionItem.Server.JBossCommunityJBossAS40;
 import org.jboss.tools.ui.bot.ext.gen.ActionItem.Server.JBossCommunityJBossAS42;
 import org.jboss.tools.ui.bot.ext.gen.ActionItem.Server.JBossCommunityJBossAS50;
 import org.jboss.tools.ui.bot.ext.gen.ActionItem.Server.JBossCommunityJBossAS51;
@@ -15,6 +16,7 @@
 import org.jboss.tools.ui.bot.ext.gen.ActionItem.Server.JBossEnterpriseMiddlewareJBossEnterpriseApplicationPlatform5x;
 import org.jboss.tools.ui.bot.ext.gen.ActionItem.Server.JBossEnterpriseMiddlewareJBossEnterpriseApplicationPlatform6x;
 import org.jboss.tools.ui.bot.ext.gen.ActionItem.ServerRuntime.JBossCommunityJBoss32Runtime;
+import org.jboss.tools.ui.bot.ext.gen.ActionItem.ServerRuntime.JBossCommunityJBoss40Runtime;
 import org.jboss.tools.ui.bot.ext.gen.ActionItem.ServerRuntime.JBossCommunityJBoss42Runtime;
 import org.jboss.tools.ui.bot.ext.gen.ActionItem.ServerRuntime.JBossCommunityJBoss50Runtime;
 import org.jboss.tools.ui.bot.ext.gen.ActionItem.ServerRuntime.JBossCommunityJBoss51Runtime;
@@ -154,6 +156,9 @@
 			if ("3.2".equals(version)) {
 				return new ServerInfo(JBossCommunityJBoss32Runtime.LABEL,JBossCommunityJBossAS32.LABEL);				
 			}
+			if ("4.0".equals(version)) {
+				return new ServerInfo(JBossCommunityJBoss40Runtime.LABEL,JBossCommunityJBossAS40.LABEL);				
+			}
 			if ("4.2".equals(version)) {
 				return new ServerInfo(JBossCommunityJBoss42Runtime.LABEL,JBossCommunityJBossAS42.LABEL);				
 			}

Modified: trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/view/ServersView.java
===================================================================
--- trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/view/ServersView.java	2012-08-29 10:08:29 UTC (rev 43289)
+++ trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/view/ServersView.java	2012-08-29 10:27:37 UTC (rev 43290)
@@ -224,19 +224,27 @@
 		SWTBotTreeItem server = findServerByName(bot.tree(), serverName);
 
 		String label = server.getText();
+		log.debug("Server label is: " + label);
 		int startIndex = label.indexOf('[') + 1;
 		int endIndex = label.indexOf(',');
+		if (endIndex < 0){
+			endIndex = label.indexOf(']');
+		}
 		return label.substring(startIndex, endIndex);
 	}
-	
+
 	public String getServerPublishStatus(String serverName){
 		SWTBot bot = show().bot();
 		SWTBotTreeItem server = findServerByName(bot.tree(), serverName);
 
 		String label = server.getText();
-		int startIndex = label.indexOf(',') + 2;
+		log.info("Server label is: " + label);
+		int startIndex = label.indexOf(',');
+		if (startIndex < 0){
+			throw new IllegalStateException("Label " + label + " does not contains server publish status information");
+		}
 		int endIndex = label.indexOf(']');
-		return label.substring(startIndex, endIndex);
+		return label.substring(startIndex + 2, endIndex);
 	}
 
 	public boolean containsProject(String serverName, String project){



More information about the jbosstools-commits mailing list