You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by pa...@apache.org on 2006/11/30 06:35:19 UTC

svn commit: r480843 - in /myfaces/tomahawk/trunk/examples/simple/src: main/webapp/WEB-INF/ main/webapp/testSuite/ test/selenium/

Author: paulsp
Date: Wed Nov 29 21:35:17 2006
New Revision: 480843

URL: http://svn.apache.org/viewvc?view=rev&rev=480843
Log:
TOMAHAWK-809 Added test for <h:outputText> and initial jsp for <t:outputText>

Added:
    myfaces/tomahawk/trunk/examples/simple/src/main/webapp/testSuite/hOutputText.jsp
    myfaces/tomahawk/trunk/examples/simple/src/main/webapp/testSuite/tOutputText.jsp
    myfaces/tomahawk/trunk/examples/simple/src/test/selenium/hOutputText.html
Modified:
    myfaces/tomahawk/trunk/examples/simple/src/main/webapp/WEB-INF/testSuite-config.xml
    myfaces/tomahawk/trunk/examples/simple/src/main/webapp/testSuite/home.jsp
    myfaces/tomahawk/trunk/examples/simple/src/test/selenium/TestSuite.html

Modified: myfaces/tomahawk/trunk/examples/simple/src/main/webapp/WEB-INF/testSuite-config.xml
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/examples/simple/src/main/webapp/WEB-INF/testSuite-config.xml?view=diff&rev=480843&r1=480842&r2=480843
==============================================================================
--- myfaces/tomahawk/trunk/examples/simple/src/main/webapp/WEB-INF/testSuite-config.xml (original)
+++ myfaces/tomahawk/trunk/examples/simple/src/main/webapp/WEB-INF/testSuite-config.xml Wed Nov 29 21:35:17 2006
@@ -14,6 +14,14 @@
 			<to-view-id>/testSuite/home.jsp</to-view-id>
 		</navigation-case>
 		<navigation-case>
+			<from-outcome>hGraphicImage</from-outcome>
+			<to-view-id>/testSuite/hGraphicImage.jsp</to-view-id>
+		</navigation-case>
+		<navigation-case>
+			<from-outcome>hOutputText</from-outcome>
+			<to-view-id>/testSuite/hOutputText.jsp</to-view-id>
+		</navigation-case>
+		<navigation-case>
 			<from-outcome>hPanelGrid</from-outcome>
 			<to-view-id>/testSuite/hPanelGrid.jsp</to-view-id>
 		</navigation-case>
@@ -32,6 +40,10 @@
 		<navigation-case>
 			<from-outcome>page_4</from-outcome>
 			<to-view-id>/testSuite/page_4.jsp</to-view-id>
+		</navigation-case>
+		<navigation-case>
+			<from-outcome>tOutputText</from-outcome>
+			<to-view-id>/testSuite/tOutputText.jsp</to-view-id>
 		</navigation-case>
 		<navigation-case>
 			<from-outcome>tPanelNavigation</from-outcome>

Added: myfaces/tomahawk/trunk/examples/simple/src/main/webapp/testSuite/hOutputText.jsp
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/examples/simple/src/main/webapp/testSuite/hOutputText.jsp?view=auto&rev=480843
==============================================================================
--- myfaces/tomahawk/trunk/examples/simple/src/main/webapp/testSuite/hOutputText.jsp (added)
+++ myfaces/tomahawk/trunk/examples/simple/src/main/webapp/testSuite/hOutputText.jsp Wed Nov 29 21:35:17 2006
@@ -0,0 +1,93 @@
+<%@ page session="false" contentType="text/html;charset=utf-8"%>
+<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
+<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
+<%@ taglib uri="http://myfaces.apache.org/tomahawk" prefix="t"%>
+<!--
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+//-->
+
+<f:view>
+  <t:document>
+    <t:documentHead>
+      <t:htmlTag value="title">
+        <h:outputText value="h:outputText" />
+      </t:htmlTag>
+    </t:documentHead>
+    <t:documentBody>
+      <h:outputText value="h:outputText" />
+
+      <h:outputText id="outputText" lang="en"
+        style="background-color: gray;" title="title" styleClass="class"
+        value="text" />
+      <h:outputText id="dirLtr" dir="ltr" value="dir ltr" />
+      <h:outputText value=" | " />
+      <h:outputText id="dirRtl" dir="rtl" value="dir rtl" />
+      <h:outputText value=" | " />
+      <h:outputText id="click" onclick="alert('You Clicked');"
+        value="Click" />
+      <h:outputText value=" | " />
+      <h:outputText id="dblclick"
+        ondblclick="alert('You Double Clicked');" value="Double Click" />
+      <h:outputText value=" | " />
+      <h:outputText id="mouseDown"
+        onmousedown="alert('You Mouse Downed');" value="Mouse Down" />
+      <h:outputText value=" | " />
+      <h:outputText id="mouseUp" onmouseup="alert('You Mouse Uped');"
+        value="Mouse Up" />
+      <h:outputText value=" | " />
+      <h:outputText id="mouseOver"
+        onmouseover="alert('Your Mouse Overed');" value="Mouse Overed" />
+      <h:outputText value=" | " />
+      <h:outputText id="mouseMove"
+        onmousemove="alert('Your Mouse Moved');" value="Mouse Move" />
+      <h:outputText value=" | " />
+      <h:outputText id="mouseOut"
+        onmouseout="alert('Your Mouse Moved Out');" value="Mouse Out" />
+      <h:outputText value=" | " />
+      <h:outputText id="keyPress" onkeypress="alert('You Key Pressed');"
+        value="Key Press" />
+      <h:outputText value=" | " />
+      <h:outputText id="keyDown" onkeydown="alert('You Key Downed');"
+        value="Key Down" />
+      <h:outputText value=" | " />
+      <h:outputText id="keyUp" onkeyup="alert('You Key Uped');"
+        value="Key Up" />
+      <h:outputText value=" | " />
+      <h:outputText id="renderedTrue" value="You should see this"
+        style="color: green;" rendered="true" />
+      <h:outputText value=" | " />
+      <h:outputText id="renderedFalse" value="You should not see this"
+        style="color: red;" rendered="false" />
+      <h:outputText value=" | " />
+      <h:outputText id="escape" escape="true" value="10 &gt; 5" />
+      <h:outputText value=" | " />
+      <h:outputText id="notEscape" escape="false" value="10 &gt; 5" />
+
+      <h:form id="footerLinks">
+        <h:commandLink id="homeLink" action="home" value="Home" />
+        <h:outputText value=" " />
+        <h:outputLink id="sourceLink" target="sourceWindow"
+          value="#{facesContext.externalContext.requestContextPath}#{view.viewId}.source">
+          <h:outputText value="View source in popup window" />
+        </h:outputLink>
+      </h:form>
+    </t:documentBody>
+  </t:document>
+</f:view>

Modified: myfaces/tomahawk/trunk/examples/simple/src/main/webapp/testSuite/home.jsp
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/examples/simple/src/main/webapp/testSuite/home.jsp?view=diff&rev=480843&r1=480842&r2=480843
==============================================================================
--- myfaces/tomahawk/trunk/examples/simple/src/main/webapp/testSuite/home.jsp (original)
+++ myfaces/tomahawk/trunk/examples/simple/src/main/webapp/testSuite/home.jsp Wed Nov 29 21:35:17 2006
@@ -33,6 +33,8 @@
     <t:documentBody>
       <h:form>
         <t:panelNavigation2 layout="list">
+          <t:navigationMenuItem action="hGraphicImage" itemLabel="h:graphicImage" />
+          <t:navigationMenuItem action="hOutputText" itemLabel="h:outputText" />
           <t:navigationMenuItem action="hPanelGrid" itemLabel="h:panelGrid" />
           <t:navigationMenuItem action="tPanelNavigation" itemLabel="t:commandNavigation" />
           <t:navigationMenuItem action="tPanelNavigation2" itemLabel="t:commandNavigation2" />
@@ -40,6 +42,7 @@
           <t:navigationMenuItem action="tPanelNavigation2" itemLabel="t:navigationMenuItem #2" />
           <t:navigationMenuItem action="tPanelNavigation" itemLabel="t:panelNavigation" />
           <t:navigationMenuItem action="tPanelNavigation2" itemLabel="t:panelNavigation2" />
+          <t:navigationMenuItem action="tOutputText" itemLabel="t:outputText" />
         </t:panelNavigation2>
       </h:form>
     </t:documentBody>

Added: myfaces/tomahawk/trunk/examples/simple/src/main/webapp/testSuite/tOutputText.jsp
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/examples/simple/src/main/webapp/testSuite/tOutputText.jsp?view=auto&rev=480843
==============================================================================
--- myfaces/tomahawk/trunk/examples/simple/src/main/webapp/testSuite/tOutputText.jsp (added)
+++ myfaces/tomahawk/trunk/examples/simple/src/main/webapp/testSuite/tOutputText.jsp Wed Nov 29 21:35:17 2006
@@ -0,0 +1,58 @@
+<%@ page session="false" contentType="text/html;charset=utf-8"%>
+<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
+<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
+<%@ taglib uri="http://myfaces.apache.org/tomahawk" prefix="t"%>
+<!--
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+//-->
+
+<f:view>
+  <t:document>
+    <t:documentHead>
+      <t:htmlTag value="title">
+        <h:outputText value="t:outputText" />
+      </t:htmlTag>
+    </t:documentHead>
+    <t:documentBody>
+      <h:outputText value="t:outputText" />
+
+      <t:outputText id="unProtectedValue" value="unprotected" />
+      <h:outputText value=" | " />
+      <t:outputText id="enableProtected" enabledOnUserRole="role1"
+        value="Protected by enable" />
+      <h:outputText value=" | " />
+      <t:outputText id="visableProtected" visibleOnUserRole="role1"
+        value="Protected by visable" />
+      <h:outputText value=" | " />
+      <t:outputText id="visibleProtectedAndRendered"
+        visibleOnUserRole="role1" rendered="true"
+        value="Protected by visible and rendered" />
+
+      <h:form id="footerLinks">
+        <h:commandLink id="homeLink" action="home" value="Home" />
+        <h:outputText value=" " />
+        <h:outputLink id="sourceLink" target="sourceWindow"
+          value="#{facesContext.externalContext.requestContextPath}#{view.viewId}.source">
+          <h:outputText value="View source in popup window" />
+        </h:outputLink>
+      </h:form>
+    </t:documentBody>
+  </t:document>
+</f:view>

Modified: myfaces/tomahawk/trunk/examples/simple/src/test/selenium/TestSuite.html
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/examples/simple/src/test/selenium/TestSuite.html?view=diff&rev=480843&r1=480842&r2=480843
==============================================================================
--- myfaces/tomahawk/trunk/examples/simple/src/test/selenium/TestSuite.html (original)
+++ myfaces/tomahawk/trunk/examples/simple/src/test/selenium/TestSuite.html Wed Nov 29 21:35:17 2006
@@ -22,12 +22,17 @@
          </tr>
          <tr>
             <td>
-               <a href="hGraphicImage.html">h:GraphicImage</a>
+               <a href="hGraphicImage.html">hGraphicImage</a>
            </td>
          </tr>
          <tr>
             <td>
-               <a href="hPanelGridTest.html">hPanelGrid</a>
+               <a href="hOutputText.html">hOutputText</a>
+           </td>
+         </tr>
+         <tr>
+            <td>
+               <a href="hPanelGridTest.html">hpanelGrid</a>
            </td>
          </tr>
          <tr>

Added: myfaces/tomahawk/trunk/examples/simple/src/test/selenium/hOutputText.html
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/examples/simple/src/test/selenium/hOutputText.html?view=auto&rev=480843
==============================================================================
--- myfaces/tomahawk/trunk/examples/simple/src/test/selenium/hOutputText.html (added)
+++ myfaces/tomahawk/trunk/examples/simple/src/test/selenium/hOutputText.html Wed Nov 29 21:35:17 2006
@@ -0,0 +1,134 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+<title>hOutputText</title>
+</head>
+<body>
+<table cellpadding="1" cellspacing="1" border="1">
+<thead>
+<tr><td rowspan="1" colspan="3">hOutputText</td></tr>
+</thead><tbody>
+<tr>
+	<td>open</td>
+	<td>/myfaces-example-simple/testSuite/home.jsf</td>
+	<td></td>
+</tr>
+<tr>
+	<td>open</td>
+	<td>/myfaces-example-simple/testSuite/hOutputText.jsf</td>
+	<td></td>
+</tr>
+<tr>
+	<td>assertElementPresent</td>
+	<td>//span[@id='outputText']</td>
+	<td></td>
+</tr>
+<tr>
+	<td>assertText</td>
+	<td>//span[@id='outputText']</td>
+	<td>text</td>
+</tr>
+<tr>
+	<td>assertAttribute</td>
+	<td>//span[@id='outputText']@lang</td>
+	<td>en</td>
+</tr>
+<tr>
+	<td>assertAttribute</td>
+	<td>//span[@id='outputText']@class</td>
+	<td>class</td>
+</tr>
+<tr>
+	<td>verifyAttribute</td>
+	<td>//span[@id='outputText']@style</td>
+	<td>regexp:(\[object\]|background-color: gray;)</td>
+</tr>
+<tr>
+	<td>assertAttribute</td>
+	<td>//span[@id='outputText']@title</td>
+	<td>title</td>
+</tr>
+<tr>
+	<td>assertAttribute</td>
+	<td>//span[@id='dirLtr']@dir</td>
+	<td>ltr</td>
+</tr>
+<tr>
+	<td>assertAttribute</td>
+	<td>//span[@id='dirRtl']@dir</td>
+	<td>rtl</td>
+</tr>
+<tr>
+	<td>assertAttribute</td>
+	<td>//span[@id='click']@onclick</td>
+	<td>glob:*alert('You Clicked');*</td>
+</tr>
+<tr>
+	<td>assertAttribute</td>
+	<td>//span[@id='dblclick']@ondblclick</td>
+	<td>glob:*alert('You Double Clicked');*</td>
+</tr>
+<tr>
+	<td>assertAttribute</td>
+	<td>//span[@id='mouseDown']@onmousedown</td>
+	<td>glob:*alert('You Mouse Downed');*</td>
+</tr>
+<tr>
+	<td>assertAttribute</td>
+	<td>//span[@id='mouseUp']@onmouseup</td>
+	<td>glob:*alert('You Mouse Uped');*</td>
+</tr>
+<tr>
+	<td>assertAttribute</td>
+	<td>//span[@id='mouseOver']@onmouseover</td>
+	<td>glob:*alert('Your Mouse Overed');*</td>
+</tr>
+<tr>
+	<td>assertAttribute</td>
+	<td>//span[@id='mouseMove']@onmousemove</td>
+	<td>glob:*alert('Your Mouse Moved');*</td>
+</tr>
+<tr>
+	<td>assertAttribute</td>
+	<td>//span[@id='mouseOut']@onmouseout</td>
+	<td>glob:*alert('Your Mouse Moved Out');*</td>
+</tr>
+<tr>
+	<td>assertAttribute</td>
+	<td>//span[@id='keyPress']@onkeypress</td>
+	<td>glob:*alert('You Key Pressed');*</td>
+</tr>
+<tr>
+	<td>assertAttribute</td>
+	<td>//span[@id='keyDown']@onkeydown</td>
+	<td>glob:*alert('You Key Downed');*</td>
+</tr>
+<tr>
+	<td>assertAttribute</td>
+	<td>//span[@id='keyUp']@onkeyup</td>
+	<td>glob:*alert('You Key Uped');*</td>
+</tr>
+<tr>
+	<td>assertText</td>
+	<td>//span[@id='renderedTrue']</td>
+	<td>You should see this</td>
+</tr>
+<tr>
+	<td>assertElementNotPresent</td>
+	<td>//span[@id='renderedFalse']</td>
+	<td></td>
+</tr>
+<tr>
+	<td>assertText</td>
+	<td>//span[@id='escape']</td>
+	<td>10 &amp;gt; 5</td>
+</tr>
+<tr>
+	<td>assertText</td>
+	<td>//span[@id='notEscape']</td>
+	<td>10 > 5</td>
+</tr>
+
+</tbody></table>
+</body>
+</html>