You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by mf...@apache.org on 2010/04/22 02:17:31 UTC

svn commit: r936580 - in /myfaces/portlet-bridge/testsuite/trunk: ./ portlet-bridge-testsuite-main/src/main/webapp/tests/ src/test/java/org/apache/myfaces/portlet/faces/tckharness/ src/test/resources/

Author: mfreedman
Date: Thu Apr 22 00:17:31 2010
New Revision: 936580

URL: http://svn.apache.org/viewvc?rev=936580&view=rev
Log:
Updates to simplify running TCK with external app servers

Added:
    myfaces/portlet-bridge/testsuite/trunk/src/test/resources/report-index.html
    myfaces/portlet-bridge/testsuite/trunk/tck.cmd
Modified:
    myfaces/portlet-bridge/testsuite/trunk/pom.xml
    myfaces/portlet-bridge/testsuite/trunk/portlet-bridge-testsuite-main/src/main/webapp/tests/chapter6_5.jsp
    myfaces/portlet-bridge/testsuite/trunk/src/test/java/org/apache/myfaces/portlet/faces/tckharness/TckTestCase.java

Modified: myfaces/portlet-bridge/testsuite/trunk/pom.xml
URL: http://svn.apache.org/viewvc/myfaces/portlet-bridge/testsuite/trunk/pom.xml?rev=936580&r1=936579&r2=936580&view=diff
==============================================================================
--- myfaces/portlet-bridge/testsuite/trunk/pom.xml (original)
+++ myfaces/portlet-bridge/testsuite/trunk/pom.xml Thu Apr 22 00:17:31 2010
@@ -23,14 +23,6 @@
     <version>3</version>
   </parent>
 
-  <modules>
-    <module>portlet-bridge-testsuite-main</module>
-    <module>portlet-bridge-testsuite-section3-2-lifecycle-set</module>
-    <module>portlet-bridge-testsuite-section3-2-render-policy-always-delegate</module>
-    <module>portlet-bridge-testsuite-section3-2-render-policy-never-delegate</module>
-    <module>portlet-bridge-testsuite-section3-2-render-policy-default</module>
-  </modules>
-
   <properties>
     <!-- Specification Configurations -->
     <servlet.version>2.5</servlet.version>
@@ -72,17 +64,12 @@
     <junit.version>4.7</junit.version>
     
     <!-- TCK Test Application Configuration -->
-    <bridge.tck.test.file.stylesheet>${basedir}/../src/test/resources/test.xsl</bridge.tck.test.file.stylesheet>
-    <bridge.tck.test.file.dir>${project.build.directory}/generated-resources/xml/xslt</bridge.tck.test.file.dir>
-    <bridge.tck.test.file.name>test.xml</bridge.tck.test.file.name>
-    <bridge.tck.test.host>localhost</bridge.tck.test.host>
-    <bridge.tck.test.port>8080</bridge.tck.test.port>
     <bridge.tck.test.path>${project.artifactId}/pluto/index.jsp?portlet=</bridge.tck.test.path>
     <bridge.tck.test.filter></bridge.tck.test.filter>
 
     <!-- TCK Test Harness Configuration -->
-    <bridge.tck.host>localhost</bridge.tck.host>
-    <bridge.tck.port>4444</bridge.tck.port>
+    <bridge.tck.selenium.host>localhost</bridge.tck.selenium.host>
+    <bridge.tck.selenium.port>4444</bridge.tck.selenium.port>
     <bridge.tck.browser>*firefox</bridge.tck.browser>
     <bridge.tck.login-file></bridge.tck.login-file>  
 
@@ -247,19 +234,18 @@
         <plugin>
           <groupId>org.codehaus.mojo</groupId>
           <artifactId>selenium-maven-plugin</artifactId>
+          <configuration>
+            <port>${bridge.tck.selenium.port}</port>
+          </configuration>
         </plugin>
 
         <plugin>
           <artifactId>maven-surefire-plugin</artifactId>
           <configuration>
             <systemProperties>
-              <!--<property>
-                <name>bridge.tck.client.base.url</name>
-                <value>${bridge.tck.base-url}</value>
-             </property>-->
               <property>
                 <name>bridge.tck.test.file</name>
-                <value>${bridge.tck.test.file.dir}/${bridge.tck.test.file.name}</value>
+                <value>${bridge.tck.test.file}</value>
               </property>
               <property>
                 <name>bridge.tck.test.base-url</name>
@@ -269,6 +255,14 @@
                 <name>bridge.tck.login.file</name>
                 <value>${bridge.tck.login-file}</value>
               </property>
+              <property>
+                <name>bridge.tck.selenium.host</name>
+                <value>${bridge.tck.selenium.host}</value>
+              </property>
+              <property>
+                <name>bridge.tck.selenium.port</name>
+                <value>${bridge.tck.selenium.port}</value>
+              </property>
             </systemProperties>
           </configuration>
         </plugin>
@@ -283,14 +277,15 @@
           <artifactId>maven-jetty-plugin</artifactId>
           <version>${jetty.version}</version>
           <configuration>
-              <contextPath>/${project.artifactId}</contextPath>
-            <!--<webAppConfig>
-              <contextPath>/${project.artifactId}</contextPath>
-              <defaultsDescriptor>${basedir}/../src/main/webapp/WEB-INF/jetty-pluto-web-default.xml</defaultsDescriptor>
-              <overrideDescriptor>${project.build.directory}/pluto-resources/web.xml</overrideDescriptor>
-            </webAppConfig>-->
+            <contextPath>/${project.artifactId}</contextPath>
             <webDefaultXml>${basedir}/../src/main/webapp/WEB-INF/jetty-pluto-web-default.xml</webDefaultXml>
             <webXml>${project.build.directory}/pluto-resources/web.xml</webXml>
+            <connectors>
+              <connector implementation="org.mortbay.jetty.nio.SelectChannelConnector">
+                <port>${bridge.tck.test.port}</port>
+                <maxIdleTime>60000</maxIdleTime>
+              </connector>
+            </connectors>
 
             <stopPort>9966</stopPort>
             <stopKey>foo</stopKey>
@@ -302,17 +297,70 @@
   
   <profiles>
     <profile>
-      <id>tck-default</id>
+      <id>generate-wars</id>
       <activation>
         <property>
-          <name>!tck.generate-war</name>
+          <name>!tck.client-only</name>
         </property>
       </activation>
 
       <properties>
         <maven.test.failure.ignore>true</maven.test.failure.ignore>
+        <bridge.tck.test.file.dir>${project.build.directory}/generated-resources/xml/xslt</bridge.tck.test.file.dir>
+        <bridge.tck.test.file.name>test.xml</bridge.tck.test.file.name>
+        <bridge.tck.test.file>${bridge.tck.test.file.dir}/${bridge.tck.test.file.name}</bridge.tck.test.file>
+        <bridge.tck.test.file.stylesheet>${basedir}/../src/test/resources/test.xsl</bridge.tck.test.file.stylesheet>
+        <bridge.tck.test.host>localhost</bridge.tck.test.host>
+        <bridge.tck.test.port>8080</bridge.tck.test.port>
       </properties>
       
+      <modules>
+        <module>portlet-bridge-testsuite-main</module>
+        <module>portlet-bridge-testsuite-section3-2-lifecycle-set</module>
+        <module>portlet-bridge-testsuite-section3-2-render-policy-always-delegate</module>
+        <module>portlet-bridge-testsuite-section3-2-render-policy-never-delegate</module>
+        <module>portlet-bridge-testsuite-section3-2-render-policy-default</module>
+      </modules>
+    </profile>
+
+    <profile>
+      <id>client-only</id>
+      <activation>
+        <property>
+          <name>tck.client-only</name>
+        </property>
+      </activation>
+
+      <properties>
+        <maven.test.failure.ignore>true</maven.test.failure.ignore>
+        <bridge.tck.home>.</bridge.tck.home>
+      </properties>
+
+      <modules>
+        <module>client</module>
+      </modules>
+
+      <build>
+        <plugins>
+          <plugin>
+            <groupId>org.codehaus.mojo</groupId>
+            <artifactId>selenium-maven-plugin</artifactId>
+          </plugin>
+          <plugin>
+            <artifactId>maven-surefire-plugin</artifactId>
+          </plugin>
+        </plugins>
+      </build>
+    </profile>
+
+    <profile>
+      <id>tck-default</id>
+      <activation>
+        <property>
+          <name>!tck.generate-war</name>
+        </property>
+      </activation>
+
       <dependencies>
         <dependency>
           <groupId>${jsf.api.groupId}</groupId>
@@ -378,34 +426,6 @@
       
     </profile>
     
-    <profile>
-      <!-- Using this profile the TCK acts as a client only, so only the test 
-           and selenium plugins are used.-->
-      <id>tck-client-only</id>
-      <activation>
-        <property>
-          <name>tck.generate-war</name>
-          <value>client-only</value>
-        </property>
-      </activation>
-
-      <properties>
-        <maven.test.skip>false</maven.test.skip>
-      </properties>
-
-      <build>
-        <plugins>
-          <plugin>
-            <groupId>org.codehaus.mojo</groupId>
-            <artifactId>selenium-maven-plugin</artifactId>
-          </plugin>
-          <plugin>
-            <artifactId>maven-surefire-plugin</artifactId>
-          </plugin>
-        </plugins>
-      </build>
-    </profile>
-    
     <!-- Generates a war file to work in a Pluto 1.x environment --> 
     <profile>
       <id>tck-war-pluto</id>

Modified: myfaces/portlet-bridge/testsuite/trunk/portlet-bridge-testsuite-main/src/main/webapp/tests/chapter6_5.jsp
URL: http://svn.apache.org/viewvc/myfaces/portlet-bridge/testsuite/trunk/portlet-bridge-testsuite-main/src/main/webapp/tests/chapter6_5.jsp?rev=936580&r1=936579&r2=936580&view=diff
==============================================================================
--- myfaces/portlet-bridge/testsuite/trunk/portlet-bridge-testsuite-main/src/main/webapp/tests/chapter6_5.jsp (original)
+++ myfaces/portlet-bridge/testsuite/trunk/portlet-bridge-testsuite-main/src/main/webapp/tests/chapter6_5.jsp Thu Apr 22 00:17:31 2010
@@ -211,6 +211,7 @@
   {
     status = false;
     detail += "JSF EL resolution of implict variable 'facesContext' failed<br>";
+    elFacesContext = FacesContext.getCurrentInstance();
   }
   
   UIViewRoot elView = (UIViewRoot) pageContext.getAttribute("tck_view");

Modified: myfaces/portlet-bridge/testsuite/trunk/src/test/java/org/apache/myfaces/portlet/faces/tckharness/TckTestCase.java
URL: http://svn.apache.org/viewvc/myfaces/portlet-bridge/testsuite/trunk/src/test/java/org/apache/myfaces/portlet/faces/tckharness/TckTestCase.java?rev=936580&r1=936579&r2=936580&view=diff
==============================================================================
--- myfaces/portlet-bridge/testsuite/trunk/src/test/java/org/apache/myfaces/portlet/faces/tckharness/TckTestCase.java (original)
+++ myfaces/portlet-bridge/testsuite/trunk/src/test/java/org/apache/myfaces/portlet/faces/tckharness/TckTestCase.java Thu Apr 22 00:17:31 2010
@@ -76,7 +76,7 @@ public class TckTestCase
   private static final String TEST_FAILED_XPATH
     = "//span[@id=\"{0}-result-status\" and text()=\"FAILED\"]";
 
-  private static final String TCK_HOME = "BRIDGE_TCK_HOME";
+  private static final String TCK_HOME = "BRIDGE_301_TCK_HOME";
   private static final String PROPS_FILE = "bridge.tck.properties";
   private static final String LOGIN_FILE = "bridge.tck.login.properties";
   private static final String LOGIN_FILE_KEY = "bridge.tck.login.file";
@@ -85,8 +85,8 @@ public class TckTestCase
   private static final String TEST_FILE_KEY = "bridge.tck.test.file";
   private static final String TEST_FILTER_KEY = "bridge.tck.test.filter";
   private static final String SELENIUM_BROWSER_KEY = "bridge.tck.browser";
-  private static final String SELENIUM_HOST_KEY = "bridge.tck.host";
-  private static final String SELENIUM_PORT_KEY = "bridge.tck.port";
+  private static final String SELENIUM_HOST_KEY = "bridge.tck.selenium.host";
+  private static final String SELENIUM_PORT_KEY = "bridge.tck.selenium.port";
 
   private static final String DEFAULT_SELENIUM_BROWSER = "*firefox";
   private static final String DEFAULT_SELENIUM_HOST = "localhost";

Added: myfaces/portlet-bridge/testsuite/trunk/src/test/resources/report-index.html
URL: http://svn.apache.org/viewvc/myfaces/portlet-bridge/testsuite/trunk/src/test/resources/report-index.html?rev=936580&view=auto
==============================================================================
--- myfaces/portlet-bridge/testsuite/trunk/src/test/resources/report-index.html (added)
+++ myfaces/portlet-bridge/testsuite/trunk/src/test/resources/report-index.html Thu Apr 22 00:17:31 2010
@@ -0,0 +1,30 @@
+
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html>
+  <head>
+    <title>Report Index</title>
+    <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"></meta>
+</head>
+
+<div class="section"><h2>Report Index</h2></div>
+<div class="section">
+  <ul>
+    <li><a href="../../../portlet-bridge-testsuite-main/target/site/surefire-report.html">Main tests</a></li>
+    <li><a href="../../../portlet-bridge-testsuite-section3-2-render-policy-always-delegate/target/site/surefire-report.html">Section 3.2: Render policy test with javax.portlet.faces.RENDER_POLICY set to ALWAYS_DELEGATE</a></li>
+    <li><a href="../../../portlet-bridge-testsuite-section3-2-render-policy-never-delegate/target/site/surefire-report.html">Section 3.2: Render policy test with javax.portlet.faces.RENDER_POLICY set to NEVER_DELEGATE</a></li>
+    <li><a href="../../../portlet-bridge-testsuite-section3-2-render-policy-default/target/site/surefire-report.html">Section 3.2: Render policy test with javax.portlet.faces.RENDER_POLICY set to DEFAULT</a></li>
+    <li><a href="../../../portlet-bridge-testsuite-section3-2-lifecycle-set/target/site/surefire-report.html">Section 3.2: Lifecycle test with javax.portlet.faces.LIFECYCLE_ID set to TCK_Lifecycle</a></li>
+  </ul>
+</div>
+
+<div class="clear">
+  <hr/>
+</div>
+<div id="footer">
+  <div class="xright">&#169; 2010, Apache Software Foundation</div>
+  <div class="clear">
+    <hr/>
+  </div>
+</div>
+</body>
+</html>

Added: myfaces/portlet-bridge/testsuite/trunk/tck.cmd
URL: http://svn.apache.org/viewvc/myfaces/portlet-bridge/testsuite/trunk/tck.cmd?rev=936580&view=auto
==============================================================================
--- myfaces/portlet-bridge/testsuite/trunk/tck.cmd (added)
+++ myfaces/portlet-bridge/testsuite/trunk/tck.cmd Thu Apr 22 00:17:31 2010
@@ -0,0 +1,48 @@
+@echo off
+
+if "%TCK_TEST_FILE%"=="" (
+  if "%TCK_HOME%"=="" (
+    echo Test definition file not found.  Either set TCK_HOME to point to a test definition file or set TCK_HOME to point to a directory with a test definition file called test.xml in it.
+    goto:eof
+  )
+  if not exist "%TCK_HOME%"\test.xml  (
+    echo Test definition file not found
+    goto:eof
+  )
+  set TCK_TEST_FILE=%TCK_HOME%\test.xml
+)
+
+if "%TCK_LOGIN_FILE%"=="" (
+  rem Look for login.properties in TCK HOME dir
+  if "%TCK_HOME%"=="" (
+    echo Login properties file not found
+    goto:eof
+  )
+  if not exist "%TCK_HOME%"\login.properties  (
+    echo Login properties file not found
+    goto:eof
+  )
+  set TCK_LOGIN_FILE=%TCK_HOME%\login.properties
+)
+
+if "%TCK_CLIENT_HOST%"=="" (
+  echo TCK_CLIENT_HOST environment variable must be set
+  goto:eof
+)
+
+if "%TCK_CLIENT_PORT%"=="" (
+  echo TCK_CLIENT_PORT environment variable must be set
+  goto:eof
+)
+
+echo TCK properties
+echo --------------
+echo Test definition file location: %TCK_TEST_FILE%
+echo Login properties file: %TCK_LOGIN_FILE%
+echo Client host: %TCK_CLIENT_HOST%
+echo Client port: %TCK_CLIENT_PORT%
+
+
+mvn clean surefire-report:report -Dtck.client-only -Dbridge.tck.test.file=%TCK_TEST_FILE% -Dbridge.tck.test.host=%TCK_CLIENT_HOST% -Dbridge.tck.test.port=%TCK_CLIENT_PORT% -Dbridge.tck.login-file=%TCK_LOGIN_FILE%
+  
+