geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From xiam...@apache.org
Subject svn commit: r988375 - in /geronimo/server/branches/2.2: testsuite/console-testsuite/advanced/src/test/java/org/apache/geronimo/testsuite/console/ testsuite/console-testsuite/basic/src/test/java/org/apache/geronimo/testsuite/console/ testsupport/testsup...
Date Tue, 24 Aug 2010 02:28:29 GMT
Author: xiaming
Date: Tue Aug 24 02:28:29 2010
New Revision: 988375

URL: http://svn.apache.org/viewvc?rev=988375&view=rev
Log:
GERONIMO-5418 refractor patch for console-testsuite provided by janel Zhang

Modified:
    geronimo/server/branches/2.2/testsuite/console-testsuite/advanced/src/test/java/org/apache/geronimo/testsuite/console/TestSupport.java
    geronimo/server/branches/2.2/testsuite/console-testsuite/basic/src/test/java/org/apache/geronimo/testsuite/console/BasicConsoleTestSupport.java
    geronimo/server/branches/2.2/testsuite/console-testsuite/basic/src/test/java/org/apache/geronimo/testsuite/console/SimpleLoginTest.java
    geronimo/server/branches/2.2/testsupport/testsupport-selenium/src/main/java/org/apache/geronimo/testsupport/console/ConsoleTestSupport.java

Modified: geronimo/server/branches/2.2/testsuite/console-testsuite/advanced/src/test/java/org/apache/geronimo/testsuite/console/TestSupport.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/2.2/testsuite/console-testsuite/advanced/src/test/java/org/apache/geronimo/testsuite/console/TestSupport.java?rev=988375&r1=988374&r2=988375&view=diff
==============================================================================
--- geronimo/server/branches/2.2/testsuite/console-testsuite/advanced/src/test/java/org/apache/geronimo/testsuite/console/TestSupport.java
(original)
+++ geronimo/server/branches/2.2/testsuite/console-testsuite/advanced/src/test/java/org/apache/geronimo/testsuite/console/TestSupport.java
Tue Aug 24 02:28:29 2010
@@ -43,27 +43,4 @@ public class TestSupport
     public void signOut() throws Exception {
         logout();
     }
-    protected String getNavigationTreeNodeLocation(String navigationTreeLabel){
-    	//map label to id according to treeData
-		Map<String,Integer> navigationTreeLabel2Index=new HashMap<String,Integer>();
-		navigationTreeLabel2Index.put("Welcome",0);
-		navigationTreeLabel2Index.put("Server",1);
-		navigationTreeLabel2Index.put("Services",2);
-		navigationTreeLabel2Index.put("Applications",3);
-		navigationTreeLabel2Index.put("Security",4);
-		navigationTreeLabel2Index.put("Debug Views",5);
-		navigationTreeLabel2Index.put("Embedded DB",6);
-		//get tree node id dynamicly 
-		String script=" var navigationTree=this.browserbot.getCurrentWindow().dijit.byId('navigationTree');";
-	 	script=script+"var wrapperNode =navigationTree._itemNodesMap["+navigationTreeLabel2Index.get(navigationTreeLabel).intValue()+"];";
-	 	script+="wrapperNode[0].id;";
-	 	String navigationTreeNodeId=selenium.getEval(script);
-	 	
-	 	//collapse the tree node 
-	 	script=" var navigationTree=this.browserbot.getCurrentWindow().dijit.byId('navigationTree');";
-	 	script=script+"var wrapperNode =navigationTree._itemNodesMap["+navigationTreeLabel2Index.get(navigationTreeLabel).intValue()+"];";
-	 	script+="navigationTree._collapseNode(wrapperNode[0]);";
-		selenium.getEval(script);
-        return "xpath=//div[@id='"+navigationTreeNodeId+"']/div[1]/img";
-	}
 }

Modified: geronimo/server/branches/2.2/testsuite/console-testsuite/basic/src/test/java/org/apache/geronimo/testsuite/console/BasicConsoleTestSupport.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/2.2/testsuite/console-testsuite/basic/src/test/java/org/apache/geronimo/testsuite/console/BasicConsoleTestSupport.java?rev=988375&r1=988374&r2=988375&view=diff
==============================================================================
--- geronimo/server/branches/2.2/testsuite/console-testsuite/basic/src/test/java/org/apache/geronimo/testsuite/console/BasicConsoleTestSupport.java
(original)
+++ geronimo/server/branches/2.2/testsuite/console-testsuite/basic/src/test/java/org/apache/geronimo/testsuite/console/BasicConsoleTestSupport.java
Tue Aug 24 02:28:29 2010
@@ -53,28 +53,4 @@ public class BasicConsoleTestSupport ext
     protected String getPortletHelpLocation(int index) {
         return "xpath=//div[@class = 'portlet'][" + index + "]/div/a[contains(@title, 'Help')]";
     }
-    
-	protected String getNavigationTreeNodeLocation(String navigationTreeLabel){
-		//map label to id according to treeData
-		Map<String,Integer> navigationTreeLabel2Index=new HashMap<String,Integer>();
-		navigationTreeLabel2Index.put("Welcome",0);
-		navigationTreeLabel2Index.put("Server",1);
-		navigationTreeLabel2Index.put("Services",2);
-		navigationTreeLabel2Index.put("Applications",3);
-		navigationTreeLabel2Index.put("Security",4);
-		navigationTreeLabel2Index.put("Debug Views",5);
-		navigationTreeLabel2Index.put("Embedded DB",6);
-		//get tree node id dynamicly 
-		String script=" var navigationTree=this.browserbot.getCurrentWindow().dijit.byId('navigationTree');";
-	 	script=script+"var wrapperNode =navigationTree._itemNodesMap["+navigationTreeLabel2Index.get(navigationTreeLabel).intValue()+"];";
-	 	script+="wrapperNode[0].id;";
-	 	String navigationTreeNodeId=selenium.getEval(script);
-	 	
-	 	//collapse the tree node 
-	 	script=" var navigationTree=this.browserbot.getCurrentWindow().dijit.byId('navigationTree');";
-	 	script=script+"var wrapperNode =navigationTree._itemNodesMap["+navigationTreeLabel2Index.get(navigationTreeLabel).intValue()+"];";
-	 	script+="navigationTree._collapseNode(wrapperNode[0]);";
-		selenium.getEval(script);
-        return "xpath=//div[@id='"+navigationTreeNodeId+"']/div[1]/img";
-	}
 }

Modified: geronimo/server/branches/2.2/testsuite/console-testsuite/basic/src/test/java/org/apache/geronimo/testsuite/console/SimpleLoginTest.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/2.2/testsuite/console-testsuite/basic/src/test/java/org/apache/geronimo/testsuite/console/SimpleLoginTest.java?rev=988375&r1=988374&r2=988375&view=diff
==============================================================================
--- geronimo/server/branches/2.2/testsuite/console-testsuite/basic/src/test/java/org/apache/geronimo/testsuite/console/SimpleLoginTest.java
(original)
+++ geronimo/server/branches/2.2/testsuite/console-testsuite/basic/src/test/java/org/apache/geronimo/testsuite/console/SimpleLoginTest.java
Tue Aug 24 02:28:29 2010
@@ -40,7 +40,7 @@ public class SimpleLoginTest
         	login();
             logout();
             login();
-            selenium.click(new BasicConsoleTestSupport().getNavigationTreeNodeLocation("Server"));
+            selenium.click(getNavigationTreeNodeLocation("Server"));
             selenium.click("link=Information");
             waitForPageLoad();            
             assertEquals("Geronimo Console", selenium.getTitle());
@@ -51,7 +51,7 @@ public class SimpleLoginTest
             assertEquals("Geronimo Console", selenium.getTitle());
             
             //selenium.open("/console");
-            selenium.click(new BasicConsoleTestSupport().getNavigationTreeNodeLocation("Embedded
DB"));
+            selenium.click(getNavigationTreeNodeLocation("Embedded DB"));
             selenium.click("link=DB Info");
             waitForPageLoad();
             assertEquals("Geronimo Console", selenium.getTitle());            

Modified: geronimo/server/branches/2.2/testsupport/testsupport-selenium/src/main/java/org/apache/geronimo/testsupport/console/ConsoleTestSupport.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/2.2/testsupport/testsupport-selenium/src/main/java/org/apache/geronimo/testsupport/console/ConsoleTestSupport.java?rev=988375&r1=988374&r2=988375&view=diff
==============================================================================
--- geronimo/server/branches/2.2/testsupport/testsupport-selenium/src/main/java/org/apache/geronimo/testsupport/console/ConsoleTestSupport.java
(original)
+++ geronimo/server/branches/2.2/testsupport/testsupport-selenium/src/main/java/org/apache/geronimo/testsupport/console/ConsoleTestSupport.java
Tue Aug 24 02:28:29 2010
@@ -55,4 +55,27 @@ public abstract class ConsoleTestSupport
         
         //selenium.removeCookie("JSESSIONID", "/");
     }
+    protected String getNavigationTreeNodeLocation(String navigationTreeLabel){
+		//map label to id according to treeData
+		Map<String,Integer> navigationTreeLabel2Index=new HashMap<String,Integer>();
+		navigationTreeLabel2Index.put("Welcome",0);
+		navigationTreeLabel2Index.put("Server",1);
+		navigationTreeLabel2Index.put("Services",2);
+		navigationTreeLabel2Index.put("Applications",3);
+		navigationTreeLabel2Index.put("Security",4);
+		navigationTreeLabel2Index.put("Debug Views",5);
+		navigationTreeLabel2Index.put("Embedded DB",6);
+		//get tree node id dynamicly 
+		String script=" var navigationTree=this.browserbot.getCurrentWindow().dijit.byId('navigationTree');";
+	 	script=script+"var wrapperNode =navigationTree._itemNodesMap["+navigationTreeLabel2Index.get(navigationTreeLabel).intValue()+"];";
+	 	script+="wrapperNode[0].id;";
+	 	String navigationTreeNodeId=selenium.getEval(script);
+	 	
+	 	//collapse the tree node 
+	 	script=" var navigationTree=this.browserbot.getCurrentWindow().dijit.byId('navigationTree');";
+	 	script=script+"var wrapperNode =navigationTree._itemNodesMap["+navigationTreeLabel2Index.get(navigationTreeLabel).intValue()+"];";
+	 	script+="navigationTree._collapseNode(wrapperNode[0]);";
+		selenium.getEval(script);
+        return "xpath=//div[@id='"+navigationTreeNodeId+"']/div[1]/img";
+	}
 }
\ No newline at end of file



Mime
View raw message