[embjopr-commits] EMBJOPR SVN: r888 - in branches/EmbJopr-1.4.0-SN-EAP5/jsfunit: src/test/java/org/jboss/jopr/jsfunit and 4 other directories.

embjopr-commits at lists.jboss.org embjopr-commits at lists.jboss.org
Fri Mar 26 15:14:26 EDT 2010


Author: ozizka at redhat.com
Date: 2010-03-26 15:14:25 -0400 (Fri, 26 Mar 2010)
New Revision: 888

Modified:
   branches/EmbJopr-1.4.0-SN-EAP5/jsfunit/
   branches/EmbJopr-1.4.0-SN-EAP5/jsfunit/pom.xml
   branches/EmbJopr-1.4.0-SN-EAP5/jsfunit/src/test/java/org/jboss/jopr/jsfunit/EmbjoprTestCase.java
   branches/EmbJopr-1.4.0-SN-EAP5/jsfunit/src/test/java/org/jboss/jopr/jsfunit/HelloJoprTest.java
   branches/EmbJopr-1.4.0-SN-EAP5/jsfunit/src/test/java/org/jboss/jopr/jsfunit/JavaScriptTest.java
   branches/EmbJopr-1.4.0-SN-EAP5/jsfunit/src/test/java/org/jboss/jopr/jsfunit/MultipleUserLoginTest.java
   branches/EmbJopr-1.4.0-SN-EAP5/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/ResourceTestBase.java
   branches/EmbJopr-1.4.0-SN-EAP5/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/datasources/DatasourceTest.java
   branches/EmbJopr-1.4.0-SN-EAP5/jsfunit/src/test/java/org/jboss/jopr/jsfunit/util/EmbJoprTestToolkit.java
   branches/EmbJopr-1.4.0-SN-EAP5/jsfunit/testdata/jboss-configuration/conf/jboss-log4j.xml
Log:
* POM: Updated versions:
     JSFUnit    1.2.0.Final <-- 1.1.0.GA-HTMLUnit26
     HTMLUnit        2.7 <-- 2.6
     jDOM            1.1 <-- 1.0
     commons-lang    2.5 <-- 2.4
     commons-codec   1.4 <-- 1.3 
     junit           4.8.1  (added - was brought in by JSFUnit 1.1)

* EJTT rewritten to conform to HTMLUnit 2.7
* POM: Added: admin / admin credentials to Cargo Maven plugin config.
* POM: Added: disable nav-tree AJAX.
* POM: "debug" profile moved above cargo to show the message about waiting at port :4000 before it really happens.
* Workaround for HTMLUnit XPath bug (started working on)
* Logging of irrelevant HTML style warnings muted.


Property changes on: branches/EmbJopr-1.4.0-SN-EAP5/jsfunit
___________________________________________________________________
Name: svn:ignore
   - nb-configuration.xml
TEST-TestSuite-01.xsl
parent
CHANGES.txt
pom_1.xml
TEST-TestSuite-02.xsl
pom_05-XSLT.xml
pom_3.xml
pom_2.xml
pom_pure_maven.xml
target
TEST-TestSuite.xsl
pom_4.xml
nbactions.xml

   + nb-configuration.xml
TEST-TestSuite-01.xsl
parent
CHANGES.txt
pom_1.xml
TEST-TestSuite-02.xsl
pom_05-XSLT.xml
pom_3.xml
pom_2.xml
pom_pure_maven.xml
target
TEST-TestSuite.xsl
pom_4.xml
nbactions.xml
target-233of308


Modified: branches/EmbJopr-1.4.0-SN-EAP5/jsfunit/pom.xml
===================================================================
--- branches/EmbJopr-1.4.0-SN-EAP5/jsfunit/pom.xml	2010-03-26 14:46:54 UTC (rev 887)
+++ branches/EmbJopr-1.4.0-SN-EAP5/jsfunit/pom.xml	2010-03-26 19:14:25 UTC (rev 888)
@@ -9,7 +9,7 @@
       <mavenConflictResolvers>newest,nearest</mavenConflictResolvers>
 
       <cargo.plugin.version>1.0.1-SNAPSHOT</cargo.plugin.version>
-      <jsfunit.version>1.1.0.GA-HTMLUnit26</jsfunit.version> <!-- 1.2.0.GA-SNAPSHOT -->
+      <jsfunit.version>1.2.0.Final</jsfunit.version> <!-- 1.1.0.GA-HTMLUnit26 -->
 
       <jvm.args.debug></jvm.args.debug> <!-- Used by the -Pdebug profile. -->
       <jvm.args.profiler></jvm.args.profiler> <!-- Used by the -Pprofile profile. -->
@@ -23,7 +23,7 @@
       <htmlunit.browser>ff3</htmlunit.browser><!-- ff2 | ff3 | ie6 | ie7 -->
       <jboss.isSecured>true</jboss.isSecured><!-- true | false ;  True if JBoss AS/EAP is secured. Only informative for EJTT - has no effect on AS. -->
 
-      <as.dist.war></as.dist.war> <!-- Used for overlaying a distribution war. -->
+      <as.dist.war></as.dist.war> <!-- Used for o verlaying a distribution war. -->
    </properties>
 
    <parent>
@@ -106,14 +106,22 @@
         <groupId>net.sourceforge.htmlunit</groupId>
         <artifactId>htmlunit</artifactId>
         <scope>compile</scope>
-        <version>2.6</version>
+        <version>2.7</version>
       </dependency>
       <dependency>
+        <groupId>net.sourceforge.htmlunit</groupId>
+        <artifactId>htmlunit-core-js</artifactId>
+        <scope>compile</scope>
+        <version>2.7</version>
+      </dependency>
+      <!--
+      <dependency>
         <groupId>rhino</groupId>
         <artifactId>js</artifactId>
         <scope>compile</scope>
         <version>1.7R2</version>
       </dependency>
+      -->
 
       <!-- For version comparison -->
       <dependency>
@@ -142,19 +150,19 @@
       <dependency>
          <groupId>javax.faces</groupId>
          <artifactId>jsf-api</artifactId>
-         <version>2.0.1-FCS</version> <!-- 2.0 -->
+         <version>2.0.1-FCS</version>
          <scope>provided</scope>
       </dependency>
       <dependency>
          <groupId>org.jboss.jbossas</groupId>
          <artifactId>jboss-as-j2se</artifactId>
-         <version>5.1.0.GA</version> <!-- 5.1.0.GA -->
+         <version>5.1.0.GA</version>
          <scope>provided</scope>
       </dependency>
       <dependency>
          <groupId>javax.servlet</groupId>
          <artifactId>servlet-api</artifactId>
-         <version>2.5</version> <!-- 2.5 -->
+         <version>2.5</version>
          <scope>provided</scope>
       </dependency>
       <dependency>
@@ -167,34 +175,34 @@
          <groupId>xerces</groupId>
          <artifactId>xercesImpl</artifactId>
          <scope>provided</scope>
-         <version>2.9.1</version> <!-- 2.9.1 -->
+         <version>2.9.1</version>
       </dependency>
       <dependency>
          <groupId>jdom</groupId>
          <artifactId>jdom</artifactId>
-         <version>1.0</version> <!-- 1.1 -->
+         <version>1.1</version>
       </dependency>
       <dependency>
          <groupId>commons-lang</groupId>
          <artifactId>commons-lang</artifactId>
-         <version>2.4</version>
+         <version>2.5</version>
       </dependency>
       <dependency>
          <groupId>commons-codec</groupId>
          <artifactId>commons-codec</artifactId>
-         <version>1.3</version>
+         <version>1.4</version>
          <scope>compile</scope>
       </dependency>
       <dependency>
          <groupId>org.jboss.integration</groupId>
          <artifactId>jboss-profileservice-spi</artifactId>          
-         <version>5.1.0.GA</version> <!-- 5.1.0.SP1 -->
+         <version>5.1.0.GA</version>
          <scope>provided</scope>
       </dependency>
       <dependency>
          <groupId>org.jboss.man</groupId>
          <artifactId>jboss-metatype</artifactId>
-         <version>2.1.1.GA</version> <!-- 2.1.1.GA -->
+         <version>2.1.1.GA</version>
          <scope>provided</scope>
       </dependency>
       <dependency>
@@ -212,9 +220,16 @@
       <dependency>
         <groupId>org.jboss.javaee</groupId>
         <artifactId>jboss-javaee</artifactId>
-        <version>5.0.1.GA</version> <!-- 5.2.0.Beta1 -->
+        <version>5.0.1.GA</version>
         <scope>provided</scope>
       </dependency> 
+
+      <dependency>
+        <groupId>junit</groupId>
+        <artifactId>junit</artifactId>
+        <version>4.8.1</version>
+        <scope>compile</scope>
+      </dependency>
    </dependencies>
 
 
@@ -362,16 +377,12 @@
                      <execution>
                         <id>start-container</id>
                         <phase>pre-integration-test</phase>
-                        <goals>
-                           <goal>start</goal>
-                        </goals>
+                        <goals> <goal>start</goal> </goals>
                      </execution>
                      <execution>
                         <id>stop-container</id>
                         <phase>post-integration-test</phase>
-                        <goals>
-                           <goal>stop</goal>
-                        </goals>
+                        <goals> <goal>stop</goal> </goals>
                      </execution>
                   </executions>
                </plugin>
@@ -449,6 +460,16 @@
                 <artifactId>maven-replacer-plugin</artifactId>
                 <version>0.0.9</version>
                 <executions>
+                  <!--
+                  <execution><id>disable-navtree-ajax</id>
+                    <phase>prepare-package</phase><goals><goal>replace</goal></goals>
+                    <configuration>
+                      <file>${basedir}/</file>
+                      <token>attribute name="EnableMessageCounters"&gt;false</token>
+                      <value>attribute name="EnableMessageCounters"&gt;true</value>
+                    </configuration>
+                  </execution>
+                  -->
                   <execution><id>mrp1</id>
                     <phase>initialize</phase><goals><goal>replace</goal></goals>
                     <configuration>
@@ -481,7 +502,7 @@
                 <groupId>org.apache.maven.plugins</groupId>
                 <artifactId>maven-antrun-plugin</artifactId>
                 <executions>
-                  <!-- Extract WAR - SEAM bug. -->
+                  <!-- Extract WAR (SEAM bug) - rename to _archive.war and unzip to a .war dir. .  -->
                   <execution>
                     <id>extract_war_for_cargo</id>
                     <phase>package</phase> <goals><goal>run</goal></goals>
@@ -491,6 +512,9 @@
                           toFile="${project.build.directory}/${project.build.finalName}_archive.${project.packaging}"/>
                       <unzip src="${project.build.directory}/${project.build.finalName}_archive.${project.packaging}"
                              dest="${project.build.directory}/${project.build.finalName}.${project.packaging}"/>
+                     <echo>  *** Disabling navtree AJAX... ***  </echo>
+                     <replace file="${project.build.directory}/${project.build.finalName}.${project.packaging}/WEB-INF/facelets/resourceNavigation.xhtml"
+                              token="switchType=&quot;ajax" value="switchType=&quot;server"/>
                     </tasks></configuration>
                   </execution>
                   <!-- Write "Don't kill" to hudson log/ -->
@@ -595,6 +619,8 @@
                          <cargo.jboss.configuration>${cargo.jboss.configuration}</cargo.jboss.configuration>
                          <!-- Set explicitely because of Cargo's bad port settings for JBoss. -->
                          <cargo.rmi.port>1099</cargo.rmi.port>
+                         <cargo.jboss.user>admin</cargo.jboss.user>
+                         <cargo.jboss.password>admin</cargo.jboss.password>
                        </properties>
                        <!-- Override Cargo's default files (some taken from cargo's .jar, some from 'default') -->
                        <configfiles>
@@ -804,6 +830,15 @@
         <properties>
           <jvm.args.debug>-Xdebug -Xnoagent -Xrunjdwp:transport=dt_socket,address=4000,server=y,suspend=y</jvm.args.debug>
         </properties>
+        <build>
+          <plugins>
+            <plugin> <artifactId>maven-antrun-plugin</artifactId>
+              <executions> <execution> <phase>pre-integration-test</phase>  <goals><goal>run</goal></goals> <configuration> <tasks>
+                <echo>  *** Waiting for debugger connection at port :4000 ... ***  </echo>
+              </tasks> </configuration> </execution> </executions>
+            </plugin>
+          </plugins>
+        </build>
       </profile>
 
 

Modified: branches/EmbJopr-1.4.0-SN-EAP5/jsfunit/src/test/java/org/jboss/jopr/jsfunit/EmbjoprTestCase.java
===================================================================
--- branches/EmbJopr-1.4.0-SN-EAP5/jsfunit/src/test/java/org/jboss/jopr/jsfunit/EmbjoprTestCase.java	2010-03-26 14:46:54 UTC (rev 887)
+++ branches/EmbJopr-1.4.0-SN-EAP5/jsfunit/src/test/java/org/jboss/jopr/jsfunit/EmbjoprTestCase.java	2010-03-26 19:14:25 UTC (rev 888)
@@ -169,6 +169,9 @@
         this.client = jsfSession.getJSFClientSession();
         this.server = jsfSession.getJSFServerSession();
 
+				this.server.getFacesContext().getExternalContext().getApplicationMap().put("resourceNavigationServerType", Boolean.TRUE);
+
+
 				this.ejtt = new EmbJoprTestToolkit(client, server);
 				this.ejtt.setCurrentTest(this);
     }
@@ -210,7 +213,7 @@
 			HtmlAnchor link = getLinkInsideForm(formId, resourceName);
 			// The id will look like "resourceSummaryForm:dataTable:2:resourceName"
 			// I need the row number. (2 in the above example)
-			String id = link.getIdAttribute();
+			String id = link.getId();
 			String[] idElements = id.split(":");
 			String row = idElements[idElements.length - 2];
 			// resourceSummaryForm:dataTable:2:removeButton
@@ -223,8 +226,19 @@
     public HtmlAnchor getLinkInsideForm(String formId, String linkLabel)
     {
 			HtmlForm form = (HtmlForm)client.getElement(formId);
+			/*
 			List links = form.getByXPath(".//a"); // get all <a> tags inside form
+			List linksA = form.getByXPath(".//A"); // get all <a> tags inside form
+			List linksB = form.getByXPath(".//a/text()"); // debug
+			List linksC = form.getByXPath(".//*"); // debug
+			List linksTA = form.getByXPath(".//table"); // debug
+			List linksTR = form.getByXPath(".//tr"); // debug
+			List linksTD = form.getByXPath(".//td"); // debug
+			List linksX1 = form.getByXPath(".//*[normalize-space() = '"+linkLabel+"']"); // debug
+			List linksX2 = form.getByXPath(".//a[normalize-space() = '"+linkLabel+"']"); // debug
+			List linksX3 = form.getByXPath(".//A[normalize-space() = '"+linkLabel+"']"); // debug
 
+			 List linksX4 = form.getByXPath(".//*[name() = 'a'  and  normalize-space() = '"+linkLabel+"']"); // debug
 			for (Iterator i = links.iterator(); i.hasNext();)
 			{
 					HtmlAnchor link = (HtmlAnchor)i.next();
@@ -233,32 +247,35 @@
 					linkText = linkText.trim(); // ignore any leading or trailing spaces
 					if (linkText.equals(linkLabel)) return link;
 			}
-
+			 */
+			List links = form.getByXPath(".//*[name() = 'a'  and  normalize-space() = '"+linkLabel+"']"); // get all <a> tags inside form
+			if (links.size() == 1 ) return (HtmlAnchor) links.get(0);
 			throw new IllegalStateException("Link for '"+ linkLabel +"' not found in form #"+formId);
     }
-    
+
+		
     /**
      * Finds the arrow icon in the nav tree that corresponds to the resource
      * given by resourceName. This method is used to expand tree nodes 
      * (eg. "Web Applications (WAR)", "Datasources", etc.) in the 
      * navigation tree.
      */
-    public ClickableElement getNavTreeArrow(String resourceName) throws EmbJoprTestException {
+    public HtmlElement getNavTreeArrow(String resourceName) throws EmbJoprTestException {
 
 				// Tree.Item JS object can be still loading.
-				ejtt.navTree.waitUntilReady(100, 15);
+				//ejtt.navTree.waitUntilReady(100, 100);
 				// After expanding some node, it's children are loaded using AJAX.
 				// Here, we wait for the node with given label to appear in the nav tree.
 				ejtt.navTree.waitUntilNodeLoadedByAjax(resourceName, 200, 10);
 
         HtmlAnchor link = getNavTreeLink(resourceName);
-        String id = link.getIdAttribute();
+        String id = link.getId();
         
         // An example id is: "navTreeForm:navTree:81:82:83:84::typeSummaryLink"
         // The icon's id would be: "81:82:83:84::typeSummary:handle:img:collapsed"
         int index = id.lastIndexOf("Link");
         id = id.substring(0, index) + ":handle";
-        return (ClickableElement)client.getElement(id);
+        return (HtmlElement)client.getElement(id);
     }
     
     /**
@@ -267,7 +284,7 @@
     public void expandNavTreeArrow(String resourceName) throws IOException, EmbJoprTestException {
         
         // Expand the tree node
-        ClickableElement resourceArrow = getNavTreeArrow(resourceName);
+        HtmlElement resourceArrow = getNavTreeArrow(resourceName);
         resourceArrow.click();
     }
     
@@ -299,7 +316,7 @@
             HtmlTableCell metric = row.getCell(0);
                    
             if(metric.asText().equals(metricName)) {
-                String id = metric.getIdAttribute();
+                String id = metric.getId();
                    
                 // An example id is: dataTable:0:j_id118:2:j_id119
                 // We would need: dataTable:0:j_id118:2:measurementValue
@@ -664,7 +681,7 @@
     public void refreshTreeNode(String nodeName) throws EmbJoprTestException {
        try { 
            // Collapse and then expand the nav tree node 
-           ClickableElement nodeArrow = getNavTreeArrow(nodeName);
+           HtmlElement nodeArrow = getNavTreeArrow(nodeName);
            nodeArrow.click();
        
            nodeArrow = getNavTreeArrow(nodeName);

Modified: branches/EmbJopr-1.4.0-SN-EAP5/jsfunit/src/test/java/org/jboss/jopr/jsfunit/HelloJoprTest.java
===================================================================
--- branches/EmbJopr-1.4.0-SN-EAP5/jsfunit/src/test/java/org/jboss/jopr/jsfunit/HelloJoprTest.java	2010-03-26 14:46:54 UTC (rev 887)
+++ branches/EmbJopr-1.4.0-SN-EAP5/jsfunit/src/test/java/org/jboss/jopr/jsfunit/HelloJoprTest.java	2010-03-26 19:14:25 UTC (rev 888)
@@ -213,7 +213,7 @@
 		HtmlAnchor link = getLinkInsideForm("resourceSummaryForm", resourceName);
 		// The id will look like "resourceSummaryForm:dataTable:2:resourceName"
 		// I need the row number. (2 in the above example)
-		String id = link.getIdAttribute();
+		String id = link.getId();
 		String[] idElements = id.split(":");
 		String row = idElements[idElements.length - 2];
 		return (HtmlButtonInput) client.getElement(row + ":removeButton");

Modified: branches/EmbJopr-1.4.0-SN-EAP5/jsfunit/src/test/java/org/jboss/jopr/jsfunit/JavaScriptTest.java
===================================================================
--- branches/EmbJopr-1.4.0-SN-EAP5/jsfunit/src/test/java/org/jboss/jopr/jsfunit/JavaScriptTest.java	2010-03-26 14:46:54 UTC (rev 887)
+++ branches/EmbJopr-1.4.0-SN-EAP5/jsfunit/src/test/java/org/jboss/jopr/jsfunit/JavaScriptTest.java	2010-03-26 19:14:25 UTC (rev 888)
@@ -27,11 +27,12 @@
 import java.io.IOException;
 import junit.framework.Test;
 import junit.framework.TestSuite;
+import net.sourceforge.htmlunit.corejs.javascript.NativeFunction;
 import org.apache.commons.lang.ObjectUtils;
 import org.jboss.jopr.jsfunit.util.ActiveConditionChecker;
 import org.jboss.jopr.jsfunit.util.DescribedCondition;
 import org.jboss.jopr.jsfunit.util.EmbJoprTestToolkit;
-import org.mozilla.javascript.NativeFunction;
+//import org.mozilla.javascript.NativeFunction;
 
 /**
  * JavaScript tests. Primarily written to try how Rhino JavaScript impl works.

Modified: branches/EmbJopr-1.4.0-SN-EAP5/jsfunit/src/test/java/org/jboss/jopr/jsfunit/MultipleUserLoginTest.java
===================================================================
--- branches/EmbJopr-1.4.0-SN-EAP5/jsfunit/src/test/java/org/jboss/jopr/jsfunit/MultipleUserLoginTest.java	2010-03-26 14:46:54 UTC (rev 887)
+++ branches/EmbJopr-1.4.0-SN-EAP5/jsfunit/src/test/java/org/jboss/jopr/jsfunit/MultipleUserLoginTest.java	2010-03-26 19:14:25 UTC (rev 888)
@@ -235,10 +235,10 @@
 	protected Page clickSubmitComponent(HtmlPage page, String elementName) throws IOException
 	{
 		HtmlElement htmlElement = getElement(page, elementName);
-		if (!(htmlElement instanceof ClickableElement))
-			throw new IllegalStateException("Component with name=" + elementName + " is not a ClickableElement.");
+		if (!(htmlElement instanceof HtmlElement))
+			throw new IllegalStateException("Component with name=" + elementName + " is not a HtmlElement.");
 
-		ClickableElement clickable = (ClickableElement)htmlElement;
+		HtmlElement clickable = (HtmlElement)htmlElement;
 		return clickable.click();
 	}
 

Modified: branches/EmbJopr-1.4.0-SN-EAP5/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/ResourceTestBase.java
===================================================================
--- branches/EmbJopr-1.4.0-SN-EAP5/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/ResourceTestBase.java	2010-03-26 14:46:54 UTC (rev 887)
+++ branches/EmbJopr-1.4.0-SN-EAP5/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/ResourceTestBase.java	2010-03-26 19:14:25 UTC (rev 888)
@@ -40,6 +40,7 @@
 import org.apache.commons.lang.StringUtils;
 import org.jboss.jopr.jsfunit.util.EmbJoprTestToolkit.NavTreeNode;
 import org.jboss.jopr.jsfunit.exceptions.*;
+import org.jboss.jsfunit.jsfsession.ComponentIDNotFoundException;
 
 /**
  * This class contains basic methods for creating, configuring, and deleting
@@ -283,7 +284,12 @@
         } catch (IllegalStateException e) { 
             
             // The delete button was not found on this page
-            client.click(NEXT_PAGE);
+						try {
+							client.click(NEXT_PAGE);
+						}catch( ComponentIDNotFoundException ex ){
+							new EmbJoprTestException("'"+NEXT_PAGE+"' not found for resource "+resourceName+" in form "+resourceFormName, this);
+							throw ex;
+						}
             deleteButton = getDeleteButton(resourceFormName, resourceName);
             deleteButton.click();
         }  

Modified: branches/EmbJopr-1.4.0-SN-EAP5/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/datasources/DatasourceTest.java
===================================================================
--- branches/EmbJopr-1.4.0-SN-EAP5/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/datasources/DatasourceTest.java	2010-03-26 14:46:54 UTC (rev 887)
+++ branches/EmbJopr-1.4.0-SN-EAP5/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/datasources/DatasourceTest.java	2010-03-26 19:14:25 UTC (rev 888)
@@ -67,7 +67,7 @@
                                     Map<String, String> propertiesMap) throws IOException, EmbJoprTestException {
 
         // Expand the "Datasources" tree node
-        ClickableElement datasourcesArrow = getNavTreeArrow(DS_NAV_LABEL);
+        HtmlElement datasourcesArrow = getNavTreeArrow(DS_NAV_LABEL);
         datasourcesArrow.click();
 
         HtmlAnchor datasourceLink = getNavTreeLink(datasourceType.getLabel());

Modified: branches/EmbJopr-1.4.0-SN-EAP5/jsfunit/src/test/java/org/jboss/jopr/jsfunit/util/EmbJoprTestToolkit.java
===================================================================
--- branches/EmbJopr-1.4.0-SN-EAP5/jsfunit/src/test/java/org/jboss/jopr/jsfunit/util/EmbJoprTestToolkit.java	2010-03-26 14:46:54 UTC (rev 887)
+++ branches/EmbJopr-1.4.0-SN-EAP5/jsfunit/src/test/java/org/jboss/jopr/jsfunit/util/EmbJoprTestToolkit.java	2010-03-26 19:14:25 UTC (rev 888)
@@ -32,6 +32,7 @@
 import javax.management.MBeanServer;
 import javax.management.ObjectName;
 import javax.servlet.http.HttpServletRequest;
+import net.sourceforge.htmlunit.corejs.javascript.NativeFunction;
 import org.apache.commons.lang.StringUtils;
 import org.apache.commons.lang.math.NumberUtils;
 import org.jboss.jopr.jsfunit.AppConstants;
@@ -44,7 +45,7 @@
 import org.jboss.jsfunit.jsfsession.*;
 import org.jboss.logging.Logger;
 import org.jboss.mx.util.MBeanServerLocator;
-import org.mozilla.javascript.NativeFunction;
+//import org.mozilla.javascript.NativeFunction;
 import org.w3c.dom.Element;
 
 
@@ -409,16 +410,16 @@
      * navigation tree.
 		 * @see getNodeByLabel().getArrowLink()
      */
-    public ClickableElement getNodeArrow(String resourceName) throws HtmlElementNotFoundException
+    public HtmlElement getNodeArrow(String resourceName) throws HtmlElementNotFoundException
 		{
         HtmlAnchor link = getNodeLink(resourceName);
-        String id = link.getIdAttribute();
+        String id = link.getId();
 
         // An example id is: "navTreeForm:navTree:81:82:83:84::typeSummaryLink"
         // The icon's id would be: "81:82:83:84::typeSummary:handle:img:collapsed"
         int index = id.lastIndexOf("Link");
         id = id.substring(0, index) + ":handle";
-        return (ClickableElement)client.getElement(id);
+        return (HtmlElement)client.getElement(id);
     }
 
 
@@ -640,11 +641,11 @@
 			return new TabContentBox(tabContentBox);
 		}
 
-		public ClickableElement getTabByLabel( String label ) throws HtmlElementNotFoundException
+		public HtmlElement getTabByLabel( String label ) throws HtmlElementNotFoundException
 		{
 			DomElement element = (DomElement)client.getElement("tabmenu");
 			String xPath = "ul/li/span[normalize-space(string())='"+label+"'] | ul/li/a[normalize-space(string())='"+label+"']";
-			ClickableElement tabContent = element.getFirstByXPath(xPath);
+			HtmlElement tabContent = element.getFirstByXPath(xPath);
 
 
 			if( null == tabContent )
@@ -653,9 +654,9 @@
 			return tabContent;
 		}
 
-		public ClickableElement getTabByID( String tabID ) throws HtmlElementNotFoundException
+		public HtmlElement getTabByID( String tabID ) throws HtmlElementNotFoundException
 		{
-			ClickableElement element = (ClickableElement)client.getElement(tabID);
+			HtmlElement element = (HtmlElement)client.getElement(tabID);
 			if( null == element )
 				throw new HtmlElementNotFoundException("Tab with id '"+tabID+"' not found, perhaps disabled?", currentTest);
 
@@ -688,24 +689,24 @@
 			return isTabDisabled( getTabByID(id) );
 		}
 
-		public boolean isTabActive( StyledElement tab ){
+		public boolean isTabActive( HtmlElement tab ){
 			return "span".equals( tab.getTagName() )
-							&& tab.getClassAttribute().contains("active");
+							&& tab.getAttribute("class").contains("active");
 		}
 
-		public boolean isTabDisabled( StyledElement tab ){
+		public boolean isTabDisabled( HtmlElement tab ){
 			return "span".equals( tab.getTagName() )
-							&& tab.getClassAttribute().contains("disabled");
+							&& tab.getAttribute("class").contains("disabled");
 		}
 
 		/** Shotcut -  getTab(label).click(); Not necesarilly clicks an anchor. */
 		public void clickTab( String label ) throws IOException, ActionNotAvailableException, HtmlElementNotFoundException {
 
-			StyledElement tabContent = getTabByLabel(label);
-			if( !( tabContent instanceof ClickableElement ) )
+			HtmlElement tabContent = getTabByLabel(label);
+			if( !( tabContent instanceof HtmlElement ) )
 				throw new ActionNotAvailableException("Tab element <"+tabContent.getTagName()+"> is not clickable: "+label);
 
-			((ClickableElement)tabContent).click();
+			((HtmlElement)tabContent).click();
 
 		}
 
@@ -972,11 +973,11 @@
 		/**
 		 * Finds first button with given label inside this tab box.
 		 */
-		public ClickableElement getButtonByLabel( String label )
+		public HtmlElement getButtonByLabel( String label )
 						throws HtmlElementNotFoundException, ActionOutOfSyncException
 		{
 			checkIfStillValid();
-			ClickableElement button = this.element.getFirstByXPath(".//input[normalize-space(@value)='"+label+"']");
+			HtmlElement button = this.element.getFirstByXPath(".//input[normalize-space(@value)='"+label+"']");
 			if( null == button )
 				throw new HtmlElementNotFoundException("Button labelled '"+label+"' not found.", currentTest);
 
@@ -1709,7 +1710,7 @@
 		 * @returns the button element - either HtmlButtonInput or HtmlButton.
 		 * @throws org.jboss.jopr.jsfunit.exceptions.HtmlElementNotFoundException
 		 */
-		public ClickableElement getButtonByLabel( String label ) throws HtmlElementNotFoundException
+		public HtmlElement getButtonByLabel( String label ) throws HtmlElementNotFoundException
 		{
 			String xPath = ".//input[@type='button' and normalize-space(@value) = '"+label+"']" +
 							" | .//button[normalize-space() = '"+label+"']";
@@ -1719,7 +1720,7 @@
 			if( !(elm instanceof HtmlButton ) && !(elm instanceof HtmlButtonInput) )
 				throw new HtmlElementNotFoundException("Element is not a button, but: "+elm.getClass().getName());
 
-			return (ClickableElement)elm;
+			return (HtmlElement)elm;
 		}
 
 
@@ -1935,7 +1936,7 @@
 
 
 		public boolean isPageActive( int pageNumber ) throws IOException, HtmlElementNotFoundException{
-			return !getGoPage(pageNumber).getStyleAttribute().contains("-inact");
+			return !getGoPage(pageNumber).getAttribute("style").contains("-inact");
 		}
 
 		public int getPageCount() throws HtmlElementNotFoundException {
@@ -2043,8 +2044,8 @@
 	/**
 	 *  Finds element by ID and returns retyped as HTML button.
 	 */
-	public ClickableElement getClickableByID( String id ) throws HtmlElementNotFoundException {
-		ClickableElement clickable = (ClickableElement) client.getElement( id );
+	public HtmlElement getClickableByID( String id ) throws HtmlElementNotFoundException {
+		HtmlElement clickable = (HtmlElement) client.getElement( id );
 		if( null == clickable )
 			throw new HtmlElementNotFoundException("Can't find element with ID: "+id);
 		return clickable;

Modified: branches/EmbJopr-1.4.0-SN-EAP5/jsfunit/testdata/jboss-configuration/conf/jboss-log4j.xml
===================================================================
--- branches/EmbJopr-1.4.0-SN-EAP5/jsfunit/testdata/jboss-configuration/conf/jboss-log4j.xml	2010-03-26 14:46:54 UTC (rev 887)
+++ branches/EmbJopr-1.4.0-SN-EAP5/jsfunit/testdata/jboss-configuration/conf/jboss-log4j.xml	2010-03-26 19:14:25 UTC (rev 888)
@@ -218,6 +218,10 @@
    <category name="com.gargoylesoftware.htmlunit.html.HtmlScript">
       <priority value="INFO"/>
    </category>
+	<!-- Too much of  "WARN  [IncorrectnessListenerImpl] Obsolete content type encountered: 'text/javascript'." -->
+   <category name="com.gargoylesoftware.htmlunit.IncorrectnessListenerImpl">
+      <priority value="ERROR"/>
+   </category>
 
    <category name="org.jboss.managed.plugins.factory.AbstractManagedObjectFactory">
       <priority value="INFO"/>



More information about the embjopr-commits mailing list