Author: andrei_exadel
Date: 2008-05-26 10:16:02 -0400 (Mon, 26 May 2008)
New Revision: 8756
Modified:
trunk/test-applications/seleniumTest/src/main/webapp/WEB-INF/faces-config.xml
trunk/test-applications/seleniumTest/src/main/webapp/layout/layout.xhtml
trunk/test-applications/seleniumTest/src/main/webapp/pages/ajaxCommandButton/ajaxButtonTest.xhtml
Log:
Modified: trunk/test-applications/seleniumTest/src/main/webapp/WEB-INF/faces-config.xml
===================================================================
---
trunk/test-applications/seleniumTest/src/main/webapp/WEB-INF/faces-config.xml 2008-05-26
14:15:36 UTC (rev 8755)
+++
trunk/test-applications/seleniumTest/src/main/webapp/WEB-INF/faces-config.xml 2008-05-26
14:16:02 UTC (rev 8756)
@@ -11,14 +11,14 @@
<managed-bean>
<managed-bean-name>indexBean</managed-bean-name>
- <managed-bean-class>org.ajax4jsf.IndexBean</managed-bean-class>
+ <managed-bean-class>org.ajax4jsf.bean.IndexBean</managed-bean-class>
<managed-bean-scope>application</managed-bean-scope>
</managed-bean>
<!-- queue.xhtml -->
<managed-bean>
<managed-bean-name>bean</managed-bean-name>
- <managed-bean-class>org.ajax4jsf.Bean</managed-bean-class>
+ <managed-bean-class>org.ajax4jsf.bean.Bean</managed-bean-class>
<managed-bean-scope>request</managed-bean-scope>
<managed-property>
<property-name>text</property-name>
@@ -29,89 +29,89 @@
<managed-bean>
<managed-bean-name>templateBean</managed-bean-name>
- <managed-bean-class>org.ajax4jsf.TemplateBean</managed-bean-class>
+ <managed-bean-class>org.ajax4jsf.bean.TemplateBean</managed-bean-class>
<managed-bean-scope>session</managed-bean-scope>
</managed-bean>
<managed-bean>
<managed-bean-name>commandBean</managed-bean-name>
- <managed-bean-class>org.ajax4jsf.A4JCommandTestBean</managed-bean-class>
+ <managed-bean-class>org.ajax4jsf.bean.A4JCommandTestBean</managed-bean-class>
<managed-bean-scope>request</managed-bean-scope>
</managed-bean>
<managed-bean>
<managed-bean-name>progressBarBean</managed-bean-name>
- <managed-bean-class>org.ajax4jsf.ProgressBarTestBean</managed-bean-class>
+ <managed-bean-class>org.ajax4jsf.bean.ProgressBarTestBean</managed-bean-class>
<managed-bean-scope>session</managed-bean-scope>
</managed-bean>
<managed-bean>
<managed-bean-name>panelBean</managed-bean-name>
- <managed-bean-class>org.ajax4jsf.RichPanelTestBean</managed-bean-class>
+ <managed-bean-class>org.ajax4jsf.bean.RichPanelTestBean</managed-bean-class>
<managed-bean-scope>session</managed-bean-scope>
</managed-bean>
<managed-bean>
<managed-bean-name>jsFunctionBean</managed-bean-name>
- <managed-bean-class>org.ajax4jsf.JSFunctionBean</managed-bean-class>
+ <managed-bean-class>org.ajax4jsf.bean.JSFunctionBean</managed-bean-class>
<managed-bean-scope>request</managed-bean-scope>
</managed-bean>
<managed-bean>
<managed-bean-name>statusBean</managed-bean-name>
- <managed-bean-class>org.ajax4jsf.A4JStatusTestBean</managed-bean-class>
+ <managed-bean-class>org.ajax4jsf.bean.A4JStatusTestBean</managed-bean-class>
<managed-bean-scope>request</managed-bean-scope>
</managed-bean>
<managed-bean>
<managed-bean-name>pollBean</managed-bean-name>
- <managed-bean-class>org.ajax4jsf.A4JPollTestBean</managed-bean-class>
+ <managed-bean-class>org.ajax4jsf.bean.A4JPollTestBean</managed-bean-class>
<managed-bean-scope>request</managed-bean-scope>
</managed-bean>
<managed-bean>
<managed-bean-name>keepAliveBean</managed-bean-name>
- <managed-bean-class>org.ajax4jsf.A4JKeepAliveTestBean</managed-bean-class>
+ <managed-bean-class>org.ajax4jsf.bean.A4JKeepAliveTestBean</managed-bean-class>
<managed-bean-scope>request</managed-bean-scope>
</managed-bean>
<managed-bean>
<managed-bean-name>keepAliveAjaxOnlyBean</managed-bean-name>
- <managed-bean-class>org.ajax4jsf.A4JKeepAliveTestBean</managed-bean-class>
+ <managed-bean-class>org.ajax4jsf.bean.A4JKeepAliveTestBean</managed-bean-class>
<managed-bean-scope>request</managed-bean-scope>
</managed-bean>
<managed-bean>
<managed-bean-name>regionBean</managed-bean-name>
- <managed-bean-class>org.ajax4jsf.A4JRegionTestBean</managed-bean-class>
+ <managed-bean-class>org.ajax4jsf.bean.A4JRegionTestBean</managed-bean-class>
<managed-bean-scope>request</managed-bean-scope>
</managed-bean>
<managed-bean>
<managed-bean-name>comboBean</managed-bean-name>
- <managed-bean-class>org.ajax4jsf.ComboBoxTestBean</managed-bean-class>
+ <managed-bean-class>org.ajax4jsf.bean.ComboBoxTestBean</managed-bean-class>
<managed-bean-scope>session</managed-bean-scope>
</managed-bean>
<managed-bean>
<managed-bean-name>ddmenuBean</managed-bean-name>
- <managed-bean-class>org.ajax4jsf.DropDownMenuTestBean</managed-bean-class>
+ <managed-bean-class>org.ajax4jsf.bean.DropDownMenuTestBean</managed-bean-class>
<managed-bean-scope>session</managed-bean-scope>
</managed-bean>
<managed-bean>
<managed-bean-name>contextMenuBean</managed-bean-name>
- <managed-bean-class>org.ajax4jsf.ContextMenuTestBean</managed-bean-class>
+ <managed-bean-class>org.ajax4jsf.bean.ContextMenuTestBean</managed-bean-class>
<managed-bean-scope>session</managed-bean-scope>
</managed-bean>
<managed-bean>
<managed-bean-name>pickListBean</managed-bean-name>
- <managed-bean-class>org.ajax4jsf.PickListTestBean</managed-bean-class>
+ <managed-bean-class>org.ajax4jsf.bean.PickListTestBean</managed-bean-class>
<managed-bean-scope>session</managed-bean-scope>
</managed-bean>
<managed-bean>
<managed-bean-name>inplaceSelectBean</managed-bean-name>
- <managed-bean-class>org.ajax4jsf.InplaceSelectTestBean</managed-bean-class>
+ <managed-bean-class>org.ajax4jsf.bean.InplaceSelectTestBean</managed-bean-class>
<managed-bean-scope>session</managed-bean-scope>
</managed-bean>
<managed-bean>
<managed-bean-name>orderingListBean</managed-bean-name>
- <managed-bean-class>org.ajax4jsf.OrderingListTestBean</managed-bean-class>
+ <managed-bean-class>org.ajax4jsf.bean.OrderingListTestBean</managed-bean-class>
<managed-bean-scope>session</managed-bean-scope>
</managed-bean>
<managed-bean>
<managed-bean-name>dataTableBean</managed-bean-name>
- <managed-bean-class>org.ajax4jsf.DataTableBean</managed-bean-class>
+ <managed-bean-class>org.ajax4jsf.bean.DataTableBean</managed-bean-class>
<managed-bean-scope>session</managed-bean-scope>
- </managed-bean>
+ </managed-bean>
</faces-config>
\ No newline at end of file
Modified: trunk/test-applications/seleniumTest/src/main/webapp/layout/layout.xhtml
===================================================================
--- trunk/test-applications/seleniumTest/src/main/webapp/layout/layout.xhtml 2008-05-26
14:15:36 UTC (rev 8755)
+++ trunk/test-applications/seleniumTest/src/main/webapp/layout/layout.xhtml 2008-05-26
14:16:02 UTC (rev 8756)
@@ -27,16 +27,20 @@
}
function reRenderAll () {
- document.getElementById('_Selenium_Test_ReRender_Form:_reRender').onclick();
+ document.getElementById('_Selenium_Test_Template_Form:_reRender').onclick();
return;
}
function loadTemplate (name) {
- document.getElementById('_Selenium_Template_Name').value = name;
- document.getElementById('_Selenium_Test_ReRender_Form:_Selenium_Template_Setup').onclick();
+ document.getElementById('_Selenium_Test_Template_Form:_Selenium_Test_Template_id').value
= name;
+ document.getElementById('_Selenium_Test_Template_Form:_Selenium_Test_loadTemplate').onclick();
return;
}
+ function getParentId () {
+ return '#{templateBean.parentId}';
+ }
+
function writeStatus (mess) {
document.getElementById('_Selenium_Test_Status_Message').value = mess;
}
@@ -49,18 +53,6 @@
<body>
<div style="padding: 10px; font-size: 24px;">Rich faces component testing
by Selenium</div><br/>
-<h:form id="_Selenium_Test_ReRender_Form">
-<input type="hidden" name="t" value=""
id="_Selenium_Template_Name" />
- <table border="0" cellpadding="5" cellspacing="0"
style="display: none">
- <tr>
- <td colspan="2">
- <a4j:commandLink reRender="_Selenium_Test_Common_Grid"
value="ReRenderAll" id="_reRender">
- </a4j:commandLink>
- <h:commandLink value="setTemplate" style=""
id="_Selenium_Template_Setup"
actionListener="#{templateBean.initTemplate}" />
- </td>
- </tr>
- </table>
-</h:form>
<div id="_Selenium_Test_ControlPoint1" style="display:
none;">Control1</div>
<h:panelGrid id="_Selenium_Test_Common_Grid">
<div>
@@ -69,36 +61,41 @@
<br/>
<div>
<ui:insert name="template"/>
- </div>
+ </div>
</h:panelGrid>
-<script type="text/javascript">
- window.done=false; A4J.AJAX.AddListener(new
A4J.AJAX.Listener(function(){window.done=true;}));
-</script>
<div id="_Selenium_Test_ControlPoint2" style="display:
none;">Control2</div>
<hr />
+<h:form id="_Selenium_Test_Template_Form">
<table style="background-color: #F2F2F2">
<tr>
<td>
Current Template:
</td>
<td>
- <h:selectOneMenu value="#{templateBean.templateId}"
readonly="true" id="_Selenium_Test_Template_id">
+ <h:selectOneMenu value="#{templateBean.templateId}"
id="_Selenium_Test_Template_id">
<f:selectItem itemValue="simple" itemLabel="Simple"/>
<f:selectItem itemValue="dataTable" itemLabel="DataTable"/>
<f:selectItem itemValue="modalPanel" itemLabel="Modal
Panel"/>
</h:selectOneMenu>
</td>
<td>
- <a href="#"
onclick="loadTemplate(document.getElementById('_Selenium_Test_Template_id').value);
return false;">Load</a>
+ <h:commandLink id="_Selenium_Test_loadTemplate"
value="Load"></h:commandLink>
</td>
</tr>
<tr>
-<td colspan="2">
- <a
href="#{facesContext.externalContext.requestContextPath}/faces/index.xhtml">home</a>
+<td>
+ <a
href="#{facesContext.externalContext.requestContextPath}/faces/index.xhtml">Home</a>
</td>
+<td>
+ <a4j:commandLink reRender="_Selenium_Test_Common_Grid"
value="ReRenderAll" id="_reRender"/>
+</td>
</tr>
</table>
+</h:form>
+<script type="text/javascript">
+ window.done=false; A4J.AJAX.AddListener(new
A4J.AJAX.Listener(function(){window.done=true;}));
+</script>
</body>
</f:view>
</html>
\ No newline at end of file
Modified:
trunk/test-applications/seleniumTest/src/main/webapp/pages/ajaxCommandButton/ajaxButtonTest.xhtml
===================================================================
---
trunk/test-applications/seleniumTest/src/main/webapp/pages/ajaxCommandButton/ajaxButtonTest.xhtml 2008-05-26
14:15:36 UTC (rev 8755)
+++
trunk/test-applications/seleniumTest/src/main/webapp/pages/ajaxCommandButton/ajaxButtonTest.xhtml 2008-05-26
14:16:02 UTC (rev 8756)
@@ -7,64 +7,165 @@
xmlns:ui="http://java.sun.com/jsf/facelets">
<ui:composition template="#{templateBean.template}">
+ <ui:define name="style">
+ .yes {
+ font-weight: bold;
+ }
+
+ .no {
+ color: gray;
+ }
+ </ui:define>
<ui:define name="component">
- <h:form id="_form">
- <a4j:commandButton
- id="b1"
- action="#{commandBean.action}"
- actionListener="#{commandBean.actionListener}"
- reRender="_value"
- value="Button1">
- <a4j:ajaxListener
type="org.ajax4jsf.TestListener"></a4j:ajaxListener>
- <f:param name="_ID" value="_value" />
- </a4j:commandButton>
+ <script type="text/javascript">
+ <!--
+ var responseData = null;
+ function onCompleteHandler (data) {
+ responseData = data;
+ }
+
+ function checkButton(id, testData ,testAction, testActionListener, testFListener,
testInput) {
+ var b = '';
+ if (responseData) {
+ if (!equals(responseData.action,testAction)) {
+ b = (!responseData.action) ? 'Error: action has been skipped' : 'Error:
action should be skipped';
+ }
+ if (!equals(responseData.actionListener,testActionListener)) {
+ b = (!responseData.actionListener) ? 'Error: actionListener has been
skipped' : 'Error: actionListener should be skipped';
+ }
+ if (!equals(responseData.FListener,testFListener)) {
+ b = (!responseData.FListener) ? 'Error: calling f:listener has been
skipped' : 'Error: f:listener should be skipped';
+ }
+ if (!equals(responseData.input,testInput)) {
+ b = (!responseData.input) ? 'Error: input value has not been updated' :
'Error: input value should not been updated';
+ }
+ }else if (testData){
+ return "Error: no response data received";
+ }
+ responseData = null;
+ if (b == '') {
+ writeStatus('Test button id=['+id+'] passed succesfully');
+ }else {
+ writeStatus('Test button id=['+id+'] failed');
+ }
+ return b;
+ }
- <a4j:commandButton
- id="b2"
- action="#{commandBean.action}"
- actionListener="#{commandBean.actionListener}"
- immediate="true"
- reRender="_value"
- value="Button2">
- <a4j:ajaxListener
type="org.ajax4jsf.TestListener"></a4j:ajaxListener>
- <f:param name="_ID" value="_value" />
- </a4j:commandButton>
-
- <a4j:commandButton
- id="b3"
- action="#{commandBean.action}"
- immediate="true"
- reRender="_value"
- value="Button3">
- </a4j:commandButton>
+ function equals(o1, o2) {
+ if ((!o1 && o2) || (o1 && !o2)) {
+ return false;
+ }
+ return true;
+ }
- <a4j:commandButton
- id="b4"
- action="#{commandBean.action}"
- immediate="true"
- ajaxSingle="true"
- reRender="_value"
- value="Button4">
- <a4j:ajaxListener
type="org.ajax4jsf.TestListener"></a4j:ajaxListener>
- <f:param name="_ID" value="_value" />
- </a4j:commandButton>
+ function setValidation(success) {
+ var i = document.getElementById(getParentId() + '_form:_value');
+ if (i) {
+ if (success) {
+ i.value = 'text';
+ }else {
+ i.value = '';
+ }
+ }
+ }
+
+ -->
+ </script>
- <a4j:commandButton
- id="b5"
- action="#{commandBean.action}"
- actionListener="#{commandBean.actionListener}"
- ajaxSingle="true"
- reRender="_value"
- value="Button5">
- </a4j:commandButton>
-
- <br/>
- <h:inputText value="#{commandBean.value}"
id="_value"></h:inputText>
+ <h:form id="_form">
+ <table border="1px" cellspacing="0"
cellpadding="3">
+ <thead style="font-size: 13px; color: green; font-style: italic;">
+ <tr>
+ <th>button</th><th>Action</th><th>ActionListener</th><th>F:listener</th><th>AjaxSingle</th><th>Immediate</th><th>Validation</th>
+ </tr>
+ </thead>
+ <tbody>
+ <tr>
+ <td>
+ <a4j:commandButton value="Button [id=b1]"
+ id="b1"
+ action="#{commandBean.action}"
+ actionListener="#{commandBean.actionListener}"
+ oncomplete="onCompleteHandler(data);"
+ onmousedown="setValidation(true)"
+ reRender="_value"
+ >
+ <a4j:ajaxListener
type="org.ajax4jsf.bean.TestListener"></a4j:ajaxListener>
+ </a4j:commandButton>
+ </td>
+ <td class="yes">Yes</td>
+ <td class="yes">Yes</td>
+ <td class="yes">Yes</td>
+ <td class="no">No</td>
+ <td class="no">No</td>
+ <td class="no">Passed</td>
+ </tr>
+ <tr>
+ <td>
+ <a4j:commandButton value="Button [id=b2]"
+ id="b2"
+ action="#{commandBean.action}"
+ actionListener="#{commandBean.actionListener}"
+ oncomplete="onCompleteHandler(data);"
+ onmousedown="setValidation(false)"
+ reRender="_value"
+ >
+ </a4j:commandButton>
+ </td>
+ <td class="yes">Yes</td>
+ <td class="yes">Yes</td>
+ <td class="no">No</td>
+ <td class="no">No</td>
+ <td class="no">No</td>
+ <td class="yes">Failed</td>
+ </tr>
+ <tr>
+ <td>
+ <a4j:commandButton value="Button [id=b3]"
+ id="b3"
+ immediate="true"
+ action="#{commandBean.action}"
+ actionListener="#{commandBean.actionListener}"
+ oncomplete="onCompleteHandler(data);"
+ onmousedown="setValidation(true)"
+ reRender="_value"
+ >
+ <a4j:ajaxListener
type="org.ajax4jsf.bean.TestListener"></a4j:ajaxListener>
+ </a4j:commandButton>
+ </td>
+ <td class="yes">Yes</td>
+ <td class="yes">Yes</td>
+ <td class="yes">Yes</td>
+ <td class="no">No</td>
+ <td class="yes">Yes</td>
+ <td class="no">Passed</td>
+ </tr>
+ <tr>
+ <td>
+ <a4j:commandButton value="Button [id=b4]"
+ id="b4"
+ immediate="true"
+ ajaxSingle="true"
+ action="#{commandBean.action}"
+ actionListener="#{commandBean.actionListener}"
+ oncomplete="onCompleteHandler(data);"
+ onmousedown="setValidation(false)"
+ reRender="_value"
+ >
+ <a4j:ajaxListener
type="org.ajax4jsf.bean.TestListener"></a4j:ajaxListener>
+ </a4j:commandButton>
+ </td>
+ <td class="yes">Yes</td>
+ <td class="yes">Yes</td>
+ <td class="yes">Yes</td>
+ <td class="yes">Yes</td>
+ <td class="yes">Yes</td>
+ <td class="yes">Failed</td>
+ </tr>
+ </tbody>
+ </table>
+ <h:inputHidden id="_value" required="true"
value="#{commandBean.value}"></h:inputHidden>
</h:form>
- <br/>
</ui:define>
- <ui:define name="description">
- <ui:include src="ajaxButtonDescription.xhtml" />
- </ui:define>
</ui:composition>
</html>
\ No newline at end of file