JBoss Rich Faces SVN: r10945 - in trunk/ui/inplaceSelect/src/main: java/org/richfaces/renderkit and 2 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: dmorozov
Date: 2008-10-28 11:04:43 -0400 (Tue, 28 Oct 2008)
New Revision: 10945
Modified:
trunk/ui/inplaceSelect/src/main/java/org/richfaces/component/UIInplaceSelect.java
trunk/ui/inplaceSelect/src/main/java/org/richfaces/renderkit/InplaceSelectBaseRenderer.java
trunk/ui/inplaceSelect/src/main/resources/org/richfaces/renderkit/html/scripts/inplaceselect.js
trunk/ui/inplaceSelect/src/main/templates/inplaceselect.jspx
Log:
https://jira.jboss.org/jira/browse/RF-4302
Modified: trunk/ui/inplaceSelect/src/main/java/org/richfaces/component/UIInplaceSelect.java
===================================================================
--- trunk/ui/inplaceSelect/src/main/java/org/richfaces/component/UIInplaceSelect.java 2008-10-28 15:03:43 UTC (rev 10944)
+++ trunk/ui/inplaceSelect/src/main/java/org/richfaces/component/UIInplaceSelect.java 2008-10-28 15:04:43 UTC (rev 10945)
@@ -32,4 +32,6 @@
public abstract class UIInplaceSelect extends UISelectOne{
public static final String COMPONENT_TYPE = "org.richfaces.InplaceSelect";
public static final String COMPONENT_FAMILY = "org.richfaces.InplaceSelect";
+ public abstract boolean isShowValueInView();
+ public abstract void setShowValueInView(boolean showValueInView);
}
Modified: trunk/ui/inplaceSelect/src/main/java/org/richfaces/renderkit/InplaceSelectBaseRenderer.java
===================================================================
--- trunk/ui/inplaceSelect/src/main/java/org/richfaces/renderkit/InplaceSelectBaseRenderer.java 2008-10-28 15:03:43 UTC (rev 10944)
+++ trunk/ui/inplaceSelect/src/main/java/org/richfaces/renderkit/InplaceSelectBaseRenderer.java 2008-10-28 15:04:43 UTC (rev 10945)
@@ -137,14 +137,14 @@
return getItemLabel(context, component, value);
}
- protected String getItemLabel(FacesContext context, UIComponent component, Object value) {
+ protected String getItemLabel(FacesContext context, UIInplaceSelect component, Object value) {
String itemLabel = null;
// TODO: SelectUtils.getSelectItems is called minimum twice during encode
List<SelectItem> selectItems = SelectUtils.getSelectItems(context, component);
if (!selectItems.isEmpty()) {
for (SelectItem item : selectItems) {
if (value.equals(item.getValue())) {
- itemLabel = item.getLabel();
+ itemLabel = component.isShowValueInView() ? getConvertedStringValue(context, component, item.getValue()) : item.getLabel();
break;
}
}
Modified: trunk/ui/inplaceSelect/src/main/resources/org/richfaces/renderkit/html/scripts/inplaceselect.js
===================================================================
--- trunk/ui/inplaceSelect/src/main/resources/org/richfaces/renderkit/html/scripts/inplaceselect.js 2008-10-28 15:03:43 UTC (rev 10944)
+++ trunk/ui/inplaceSelect/src/main/resources/org/richfaces/renderkit/html/scripts/inplaceselect.js 2008-10-28 15:04:43 UTC (rev 10945)
@@ -3,6 +3,7 @@
initialize : function($super, listObj, clientId, temValueKeepId, valueKeepId, tabberId, attributes, events, userStyles, commonStyles, barParams, buttonId) {
this.button = $(buttonId);
this.comboList = listObj;
+ this.showValueInView = attributes.showValueInView;
$super(clientId, temValueKeepId, valueKeepId, tabberId, attributes, events, userStyles, commonStyles, barParams);
this.clickOnBar = false;
this.inplaceSelect = $(clientId);
@@ -233,6 +234,9 @@
if (this.comboList.activeItem) {
var userLabel = this.comboList.activeItem.innerHTML.unescapeHTML();
this.currentItemValue = this.comboList.activeItem.value;
+ if(this.showValueInView) {
+ userLabel = this.currentItemValue;
+ }
this.tempValueKeeper.value = userLabel;
this.comboList.selectedItem = this.comboList.activeItem;
}
@@ -280,7 +284,8 @@
this.comboList.hide();
if (item) {
this.comboList.doSelectItem(item);
- $super(e, item.innerHTML.unescapeHTML());
+ var value = this.showValueInView ? this.valueKeeper.value : item.innerHTML.unescapeHTML();
+ $super(e, value);
} else {
$super(e, "");
}
Modified: trunk/ui/inplaceSelect/src/main/templates/inplaceselect.jspx
===================================================================
--- trunk/ui/inplaceSelect/src/main/templates/inplaceselect.jspx 2008-10-28 15:03:43 UTC (rev 10944)
+++ trunk/ui/inplaceSelect/src/main/templates/inplaceselect.jspx 2008-10-28 15:04:43 UTC (rev 10945)
@@ -37,13 +37,13 @@
value = component.getAttributes().get("value");
value = getConvertedStringValue(context, component,value);
}
+
+ String fieldValue = (String)value;
String fieldLabel = getSelectedItemLabel(context, component);
- String fieldValue = (String)value;
-
- if (value == null || value.equals("")) {
+
+ if (value == null || value.equals("")) {
fieldValue = "";
}
-
String encodedFieldValue = encodeValue(fieldValue);
@@ -231,7 +231,8 @@
minInputWidth : '#{component.attributes["minSelectWidth"]}',
maxInputWidth : '#{component.attributes["maxSelectWidth"]}',
openOnEdit: #{component.attributes["openOnEdit"]},
- closeOnSelect: true},
+ showValueInView: #{component.attributes["showValueInView"]},
+ closeOnSelect: true},
{oneditactivation : #{this:getAsEventHandler(context, component, "oneditactivation")},
onviewactivation : #{this:getAsEventHandler(context, component, "onviewactivation")},
oneditactivated : #{this:getAsEventHandler(context, component, "oneditactivated")},
17 years, 6 months
JBoss Rich Faces SVN: r10944 - trunk/ui/inplaceSelect/src/main/config/component.
by richfaces-svn-commits@lists.jboss.org
Author: dmorozov
Date: 2008-10-28 11:03:43 -0400 (Tue, 28 Oct 2008)
New Revision: 10944
Modified:
trunk/ui/inplaceSelect/src/main/config/component/inplaceselect.xml
Log:
https://jira.jboss.org/jira/browse/RF-4302
Modified: trunk/ui/inplaceSelect/src/main/config/component/inplaceselect.xml
===================================================================
--- trunk/ui/inplaceSelect/src/main/config/component/inplaceselect.xml 2008-10-28 14:58:07 UTC (rev 10943)
+++ trunk/ui/inplaceSelect/src/main/config/component/inplaceselect.xml 2008-10-28 15:03:43 UTC (rev 10944)
@@ -83,6 +83,15 @@
<defaultvalue>false</defaultvalue>
</property>
<property>
+ <name>showValueInView</name>
+ <classname>boolean</classname>
+ <description>
+ If true show the SelectItem labels in the InplaceSelect's pull-down list but display the value in the field in view mode once an item is selected
+ </description>
+ <defaultvalue>false</defaultvalue>
+ </property>
+
+ <property>
<name>saveControlIcon</name>
<classname>java.lang.String</classname>
<description>Defines custom save icon</description>
17 years, 6 months
JBoss Rich Faces SVN: r10942 - in trunk/test-applications/seleniumTest/richfaces/src: main/webapp/pages/inplaceInput/includes and 2 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: vmolotkov
Date: 2008-10-28 10:15:39 -0400 (Tue, 28 Oct 2008)
New Revision: 10942
Added:
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/inplaceInput/testEditEventAttribute.xhtml
Modified:
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/inplaceInput/includes/testBody.xhtml
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/template/caseTemplate.xhtml
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/InplaceInputTest.java
Log:
tests for inplaceinput
Modified: trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/inplaceInput/includes/testBody.xhtml
===================================================================
--- trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/inplaceInput/includes/testBody.xhtml 2008-10-28 13:58:48 UTC (rev 10941)
+++ trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/inplaceInput/includes/testBody.xhtml 2008-10-28 14:15:39 UTC (rev 10942)
@@ -7,14 +7,16 @@
<h:form id="_form">
<rich:inplaceInput id="ii_#{test_prefix}" required="#{required}"
requiredMessage="#{requiredMessage}"
+ editEvent="#{editEvent}"
value="#{value}"/>
 
+ value: <h:outputText value="#{inplaceInputBean.text}" id="data1_#{test_prefix}"/>
+  
+ <span id="text_#{test_prefix}" >
+ text: <h:message for="ii_#{test_prefix}"/><h:outputText value="#{inplaceInputBean.text}"></h:outputText>
+ </span>
+ <br/>
+ <br/>
<h:commandButton id="bn_#{test_prefix}" action="#{inplaceInputBean.action}" value="Submit"></h:commandButton>
- <div>
- value: <h:outputText style="font-weight: bold; border: 1px solid green" value="#{inplaceInputBean.text}" id="data1_#{test_prefix}"/>
- </div>
- <div id="text_#{test_prefix}">
- text: <h:message for="ii_#{test_prefix}"/><h:outputText value="#{inplaceInputBean.text}"></h:outputText>
- </div>
</h:form>
</ui:composition>
\ No newline at end of file
Added: trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/inplaceInput/testEditEventAttribute.xhtml
===================================================================
--- trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/inplaceInput/testEditEventAttribute.xhtml (rev 0)
+++ trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/inplaceInput/testEditEventAttribute.xhtml 2008-10-28 14:15:39 UTC (rev 10942)
@@ -0,0 +1,19 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<ui:composition
+ xmlns:a4j="http://richfaces.org/a4j"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:rich="http://richfaces.org/rich"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ template="../../template/caseTemplate.xhtml">
+ <ui:define name="caseName">testEditEventAttribute</ui:define>
+ <ui:define name="caseBody">
+ <ui:include src="includes/testBody.xhtml">
+ <ui:param name="test_prefix" value="teea"/>
+ <ui:param name="required" value="false"/>
+ <ui:param name="value" value="value"/>
+ <ui:param name="requiredMessage" value="" />
+ <ui:param name="editEvent" value="ondblclick" />
+ </ui:include>
+ </ui:define>
+</ui:composition>
Modified: trunk/test-applications/seleniumTest/richfaces/src/main/webapp/template/caseTemplate.xhtml
===================================================================
--- trunk/test-applications/seleniumTest/richfaces/src/main/webapp/template/caseTemplate.xhtml 2008-10-28 13:58:48 UTC (rev 10941)
+++ trunk/test-applications/seleniumTest/richfaces/src/main/webapp/template/caseTemplate.xhtml 2008-10-28 14:15:39 UTC (rev 10942)
@@ -9,13 +9,9 @@
<ui:composition template="#{templateBean.templatePath}">
<ui:define name="component">
<table width="100%">
- <colgroup>
- <col width="30%"/>
- <col width="70%"/>
- </colgroup>
<tr>
- <td><ui:insert name="caseName"/></td>
- <td>
+ <td width="30%"><ui:insert name="caseName"/></td>
+ <td width="70%">
<ui:insert name="caseBody"/>
</td>
</tr>
Modified: trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/InplaceInputTest.java
===================================================================
--- trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/InplaceInputTest.java 2008-10-28 13:58:48 UTC (rev 10941)
+++ trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/InplaceInputTest.java 2008-10-28 14:15:39 UTC (rev 10942)
@@ -1,5 +1,8 @@
package org.richfaces.testng;
+import java.util.HashMap;
+import java.util.Map;
+
import org.ajax4jsf.template.Template;
import org.richfaces.SeleniumTestBase;
import org.richfaces.testng.util.CommonUtils;
@@ -28,6 +31,10 @@
private static final String REQUIRED_ATTRIBUTES_ID_PREFIX = "_tra";
+ private static final String EDITEVENT_ATTRIBUTES_PAGE = "testEditEventAttribute.xhtml";
+
+ private static final String EDITEVENT_ATTRIBUTES_ID_PREFIX = "_teea";
+
private String testUrl;
private String formId;
@@ -174,11 +181,27 @@
waitForPageToLoad();
checkMessage(messageId + REQUIRED_ATTRIBUTES_ID_PREFIX, "requiredMsg", CommonUtils.getSuccessfulTestMessage(inplaceInputId), CommonUtils.getFailedTestMessage(inplaceInputId));
}
+
+ /**
+ * Check 'editEvent' attribute
+ *
+ * @param template - current template
+ */
+ @Test
+ public void testEditEventAttribute(Template template) {
+ setTestUrl(EDITEVENT_ATTRIBUTES_PAGE);
+ init(template);
+
+ selenium.doubleClick(inplaceInputId + EDITEVENT_ATTRIBUTES_ID_PREFIX);
+ Map<String, String> expMap = new HashMap<String, String>();
+ expMap.put("clip", "rect(auto, auto, auto, auto)");
+ assertStyleAttributes(inplaceInputId + EDITEVENT_ATTRIBUTES_ID_PREFIX + "tempValue", expMap);
+ }
private void checkMessage(String elementId, String expectedValue, String okMsg, String errMsg) {
String currentValue = getTextById(elementId);
if (("text:" + expectedValue).equals(currentValue)) {
- writeStatus(okMsg, true);
+ writeStatus(okMsg);
} else {
writeStatus(errMsg, true);
Assert.fail(errMsg);
17 years, 6 months
JBoss Rich Faces SVN: r10941 - in trunk/test-applications/seleniumTest/richfaces/src: test/java/org/richfaces/testng and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: andrei_exadel
Date: 2008-10-28 09:58:48 -0400 (Tue, 28 Oct 2008)
New Revision: 10941
Modified:
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/contextMenu/contextMenu.xhtml
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/ContextMenuTest.java
Log:
RF-4763
Modified: trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/contextMenu/contextMenu.xhtml
===================================================================
(Binary files differ)
Modified: trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/ContextMenuTest.java
===================================================================
--- trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/ContextMenuTest.java 2008-10-28 13:55:57 UTC (rev 10940)
+++ trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/ContextMenuTest.java 2008-10-28 13:58:48 UTC (rev 10941)
@@ -27,8 +27,34 @@
import org.testng.annotations.Test;
public class ContextMenuTest extends SeleniumTestBase {
+
+
+
+ @Test
+ public void testContextMenuStandAlone(Template template) {
+ renderPage(template);
+ String parentId = getParentId() + "_form:";
+ String contextMenuId = parentId + "contextMenu";
+ String menuItemId = parentId + "item1";
+ String autoCreatedId = contextMenuId + ":_auto_created";
+
+ String linkId = "showMenu";
- @Test
+ AssertNotPresent(menuItemId, "Context menu should be hidden");
+ AssertNotPresent(autoCreatedId, "Context menu should be hidden");
+
+ clickById(linkId);
+
+ AssertPresent(menuItemId, "Context menu has not been shown");
+ AssertPresent(autoCreatedId, "Context menu has not been shown");
+ AssertTextEquals(menuItemId, "Menu1", "Context menu displays incorrect.");
+
+ menuItemId = parentId + "item2";
+ AssertTextEquals(menuItemId, "Menu2", "Macrosubstitution does not work.");
+
+ }
+
+ //@Test
public void testContextMenuComponent(Template template) {
renderPage(template);
17 years, 6 months
JBoss Rich Faces SVN: r10940 - in trunk/sandbox/ui/editor/src/main: resources/org/richfaces/renderkit/html/scripts/tiny_mce and 1 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: pyaschenko
Date: 2008-10-28 09:55:57 -0400 (Tue, 28 Oct 2008)
New Revision: 10940
Modified:
trunk/sandbox/ui/editor/src/main/resources/org/richfaces/renderkit/html/scripts/editor.js
trunk/sandbox/ui/editor/src/main/resources/org/richfaces/renderkit/html/scripts/tiny_mce/tiny_mce_src.js
trunk/sandbox/ui/editor/src/main/templates/editor.jspx
Log:
Modified: trunk/sandbox/ui/editor/src/main/resources/org/richfaces/renderkit/html/scripts/editor.js
===================================================================
--- trunk/sandbox/ui/editor/src/main/resources/org/richfaces/renderkit/html/scripts/editor.js 2008-10-28 13:28:49 UTC (rev 10939)
+++ trunk/sandbox/ui/editor/src/main/resources/org/richfaces/renderkit/html/scripts/editor.js 2008-10-28 13:55:57 UTC (rev 10940)
@@ -1,29 +1,28 @@
if (!window.Richfaces) window.Richfaces = {};
Richfaces.Editor = {};
Richfaces.Editor.REGEXP_CSS = /(\/tiny_mce\/(?:themes|plugins)\/[\w\.\\\/]*[\w\.]+\.)(c|C)[sS]{2}$/;
-/*Richfaces.Editor.getResourceURL = function (baseURL, type) {
- return Richfaces.Editor.ResourceHTML.replace("$1", baseURL);
-};*/
+Richfaces.Editor.extSuffix = ".jsf";
-
RichEditor = Class.create();
Object.extend(RichEditor.prototype, {
- initialize: function(id, parameters, suffix) {
+ initialize: function(id, params, tinyparams) {
+ //TODO: suffix
this.id = id;
this.editorTextAreaId = this.id +'TextArea';
- this.params = parameters;
- this.suffix = suffix;
var obj = $(this.id);
obj.component = this;
obj.richfacesComponent="richfaces:editor";
this["rich:destructor"] = "destruct";
- tinymce.extSuffix = this.suffix;
+ Richfaces.Editor.extSuffix = params.suffix;
+ this.tinyMCE_editor = null;
+ this.onInitInstanceCallback = tinyparams.onInitInstanceCallback;
+
tinyMCE.init({
- mode: this.params.mode,
- theme: this.params.theme,
+ mode: this.tinyparams.mode,
+ theme: this.tinyparams.theme,
init_instance_callback : this.onInitInstanceCallback.bind(this)
});
@@ -43,10 +42,9 @@
this.tinyMCE_editor.save();
},
- onInitInstanceCallback: function() {
+ onInitInstanceCallback: function(inst) {
this.tinyMCE_editor = tinyMCE.get(this.editorTextAreaId);
-
- //TODO add user init_instance_callback function
+ if (this.onInitInstanceCallback) this.onInitInstanceCallback.call(this, inst);
}
Modified: trunk/sandbox/ui/editor/src/main/resources/org/richfaces/renderkit/html/scripts/tiny_mce/tiny_mce_src.js
===================================================================
--- trunk/sandbox/ui/editor/src/main/resources/org/richfaces/renderkit/html/scripts/tiny_mce/tiny_mce_src.js 2008-10-28 13:28:49 UTC (rev 10939)
+++ trunk/sandbox/ui/editor/src/main/resources/org/richfaces/renderkit/html/scripts/tiny_mce/tiny_mce_src.js 2008-10-28 13:55:57 UTC (rev 10940)
@@ -410,7 +410,7 @@
// RF: added by PY
u = u.replace(Richfaces.Editor.REGEXP_CSS, function($1,$2,$3){return $2+($3=='c' ? "xcss":"XCSS");});
- if (this.extSuffix) u += this.extSuffix;
+ if (Richfaces && Richfaces.Editor) u += Richfaces.Editor.extSuffix;
// RF: end
if (!this.query)
Modified: trunk/sandbox/ui/editor/src/main/templates/editor.jspx
===================================================================
--- trunk/sandbox/ui/editor/src/main/templates/editor.jspx 2008-10-28 13:28:49 UTC (rev 10939)
+++ trunk/sandbox/ui/editor/src/main/templates/editor.jspx 2008-10-28 13:55:57 UTC (rev 10940)
@@ -22,10 +22,9 @@
</textarea>
<script type="text/javascript">
- new RichEditor('#{clientId}', {
- mode: '#{component.attributes['mode']}',
- theme: '#{component.attributes['theme']}'},
- '#{this:getFacesMappingSuffix(context)}'
+ new RichEditor('#{clientId}', {extSuffix:'#{this:getFacesMappingSuffix(context)}'}, {
+ mode: '#{component.attributes["mode"]}',
+ theme: '#{component.attributes["theme"]}'}
);
</script>
</div>
17 years, 6 months
JBoss Rich Faces SVN: r10939 - in trunk/test-applications/seleniumTest/richfaces/src: main/webapp/pages/ajaxSupport and 4 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: vmolotkov
Date: 2008-10-28 09:28:49 -0400 (Tue, 28 Oct 2008)
New Revision: 10939
Added:
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/inplaceInput/includes/
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/inplaceInput/includes/testBody.xhtml
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/inplaceInput/testRequiredAttributes.xhtml
Removed:
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/ajaxSupport/ajaxSupport.xhtml
Modified:
trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/InplaceInputTestBean.java
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/InplaceInputTest.java
trunk/test-applications/seleniumTest/richfaces/src/test/testng/win/local_testng.xml
Log:
tests for inplaceinput
Modified: trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/InplaceInputTestBean.java
===================================================================
--- trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/InplaceInputTestBean.java 2008-10-28 12:55:05 UTC (rev 10938)
+++ trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/InplaceInputTestBean.java 2008-10-28 13:28:49 UTC (rev 10939)
@@ -2,8 +2,12 @@
public class InplaceInputTestBean {
+ public final static class Messages {
+ public final static String ACTION_CALLED = "action called";
+ }
+
private String text ="";
-
+
/**
* Gets value of text field.
* @return value of text field
@@ -20,5 +24,7 @@
this.text = text;
}
-
+ public void action() {
+ setText(InplaceInputTestBean.Messages.ACTION_CALLED);
+ }
}
Deleted: trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/ajaxSupport/ajaxSupport.xhtml
===================================================================
(Binary files differ)
Added: trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/inplaceInput/includes/testBody.xhtml
===================================================================
--- trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/inplaceInput/includes/testBody.xhtml (rev 0)
+++ trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/inplaceInput/includes/testBody.xhtml 2008-10-28 13:28:49 UTC (rev 10939)
@@ -0,0 +1,20 @@
+<ui:composition xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:a4j="http://richfaces.org/a4j"
+ xmlns:rich="http://richfaces.org/rich"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:ui="http://java.sun.com/jsf/facelets">
+ <h:form id="_form">
+ <rich:inplaceInput id="ii_#{test_prefix}" required="#{required}"
+ requiredMessage="#{requiredMessage}"
+ value="#{value}"/>
+  
+ <h:commandButton id="bn_#{test_prefix}" action="#{inplaceInputBean.action}" value="Submit"></h:commandButton>
+ <div>
+ value: <h:outputText style="font-weight: bold; border: 1px solid green" value="#{inplaceInputBean.text}" id="data1_#{test_prefix}"/>
+ </div>
+ <div id="text_#{test_prefix}">
+ text: <h:message for="ii_#{test_prefix}"/><h:outputText value="#{inplaceInputBean.text}"></h:outputText>
+ </div>
+ </h:form>
+</ui:composition>
\ No newline at end of file
Added: trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/inplaceInput/testRequiredAttributes.xhtml
===================================================================
--- trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/inplaceInput/testRequiredAttributes.xhtml (rev 0)
+++ trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/inplaceInput/testRequiredAttributes.xhtml 2008-10-28 13:28:49 UTC (rev 10939)
@@ -0,0 +1,18 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<ui:composition
+ xmlns:a4j="http://richfaces.org/a4j"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:rich="http://richfaces.org/rich"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ template="../../template/caseTemplate.xhtml">
+ <ui:define name="caseName">testRequiredAttributes</ui:define>
+ <ui:define name="caseBody">
+ <ui:include src="includes/testBody.xhtml">
+ <ui:param name="test_prefix" value="tra"/>
+ <ui:param name="required" value="true"/>
+ <ui:param name="value" value=""/>
+ <ui:param name="requiredMessage" value="requiredMsg" />
+ </ui:include>
+ </ui:define>
+</ui:composition>
Modified: trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/InplaceInputTest.java
===================================================================
--- trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/InplaceInputTest.java 2008-10-28 12:55:05 UTC (rev 10938)
+++ trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/InplaceInputTest.java 2008-10-28 13:28:49 UTC (rev 10939)
@@ -2,6 +2,7 @@
import org.ajax4jsf.template.Template;
import org.richfaces.SeleniumTestBase;
+import org.richfaces.testng.util.CommonUtils;
import org.testng.Assert;
import org.testng.annotations.Test;
@@ -20,126 +21,188 @@
private final static String EVENT_TEST_RESULT_FAILED_TEXT = "No";
private final static String EVENT_TEST_RESULT_PASSED_TEXT = "Passed";
+
+ private static final String INPLACE_INPUT_PAGE = "inplaceInputTest.xhtml";
+
+ private static final String REQUIRED_ATTRIBUTES_PAGE = "testRequiredAttributes.xhtml";
+
+ private static final String REQUIRED_ATTRIBUTES_ID_PREFIX = "_tra";
+
+ private String testUrl;
+
+ private String formId;
+
+ private String buttonId;
+
+ private String inplaceInputId;
+
+ private String messageId;
+// @Test
+// public void testInplaceInputComponentLayout(Template template) {
+// setTestUrl(INPLACE_INPUT_PAGE);
+// renderPage(template);
+// writeStatus("Check component layout");
+//
+// String inplaceInputS = getParentId() + "_form:" + INPLACE_INPUT_SIMPLE;
+// String inplaceInputD = getParentId() + "_form:" + INPLACE_INPUT_DECORATED;
+//
+// Assert.assertTrue(isPresentById(inplaceInputS));
+// int count = selenium.getXpathCount("//*[@id='" + inplaceInputS + "' and (name()='span' or name()='SPAN')]").intValue();
+// Assert.assertTrue(count == 1, "InplaceInput[" + inplaceInputS + "] has layout=inline(default) and should be rendered as 'span' element");
+//
+// Assert.assertTrue(isPresentById(inplaceInputD));
+// count = selenium.getXpathCount("//*[@id='" + inplaceInputD + "' and (name()='DIV' or name()='div')]").intValue();
+// Assert.assertTrue(count == 1, "InplaceInput [" + inplaceInputD + "] has layout=block and should be rendered as 'div' element");
+//
+// }
+//
+// @Test
+// public void testInplaceInputClientAPI(Template template) {
+// setTestUrl(INPLACE_INPUT_PAGE);
+// renderPage(template);
+// writeStatus("Check component client API");
+// }
+//
+// @Test
+// public void testInplaceInputEvents(Template template) {
+// setTestUrl(INPLACE_INPUT_PAGE);
+// renderPage(template);
+//
+// writeStatus("Check component event triggering");
+//
+// String inplaceInputS = getParentId() + "_form:" + INPLACE_INPUT_SIMPLE;
+// String inplaceInputD = getParentId() + "_form:" + INPLACE_INPUT_DECORATED;
+// String inplaceInputDOk = getParentId() + "_form:" + INPLACE_INPUT_DECORATED_OK;
+// String inplaceInputDCancel = getParentId() + "_form:" + INPLACE_INPUT_DECORATED_CANCEL;
+//
+// writeStatus("Click first component being tested");
+//
+// clickById(inplaceInputS);
+// AssertTextEquals(inplaceInputS + "_edit", EVENT_TEST_RESULT_PASSED_TEXT, "oneditactivated event is not fired");
+//
+// writeStatus("Stop editing first component being tested");
+//
+// String inplaceInputSInput = inplaceInputS + INPLACE_INPUT_FIELD_POSTFIX;
+// selenium.fireEvent(inplaceInputSInput, "blur");
+//
+// AssertTextEquals(inplaceInputS + "_view", EVENT_TEST_RESULT_PASSED_TEXT, "onviewactivated event is not fired");
+//
+// writeStatus("Double-click second component being tested");
+//
+// selenium.doubleClick(inplaceInputD);
+// AssertTextEquals(inplaceInputD + "_edit", EVENT_TEST_RESULT_PASSED_TEXT, "oneditactivated event is not fired");
+// type(inplaceInputSInput, "Hello");
+//
+// writeStatus("Stop editing second component being tested");
+//
+// selenium.mouseDown(inplaceInputDOk);
+//
+// AssertTextEquals(inplaceInputD + "_view", EVENT_TEST_RESULT_PASSED_TEXT, "onviewactivated event is not fired");
+// }
+//
+// @Test
+// public void testInplaceInputKeyAttributes(Template template) {
+// setTestUrl(INPLACE_INPUT_PAGE);
+// renderPage(template);
+//
+// String inplaceInputS = getParentId() + "_form:" + INPLACE_INPUT_SIMPLE;
+// String inplaceInputD = getParentId() + "_form:" + INPLACE_INPUT_DECORATED;
+//
+// String inplaceInputSInput = inplaceInputS + INPLACE_INPUT_FIELD_POSTFIX;
+// String inplaceInputDInput = inplaceInputD + INPLACE_INPUT_FIELD_POSTFIX;
+//
+// writeStatus("Check component's key attributes");
+//
+// writeStatus("test 'editEvent' attribute");
+//
+// writeStatus("The first component must change your state by single clicking only");
+// clickById(inplaceInputS);
+// AssertVisible(inplaceInputSInput);
+//
+// writeStatus("The second component must change your state by double clicking only");
+// selenium.doubleClick(inplaceInputD);
+// AssertVisible(inplaceInputDInput);
+// }
+//
+// @Test
+// public void testInplaceInputComponentCore(Template template) {
+// setTestUrl(INPLACE_INPUT_PAGE);
+// renderPage(template);
+//
+// String inplaceInputD = getParentId() + "_form:" + INPLACE_INPUT_DECORATED;
+// String inplaceInputDInput = inplaceInputD + INPLACE_INPUT_FIELD_POSTFIX;
+// String inplaceInputDOk = getParentId() + "_form:" + INPLACE_INPUT_DECORATED_OK;
+// String inplaceInputDCancel = getParentId() + "_form:" + INPLACE_INPUT_DECORATED_CANCEL;
+//
+// writeStatus("Check component's core functionality");
+//
+// writeStatus("Double-click the second component and type an initial text");
+// selenium.doubleClick(inplaceInputD);
+// type(inplaceInputDInput, "Sun");
+//
+// writeStatus("Stop editing with ok. The input has to be saved");
+// selenium.mouseDown(inplaceInputDOk);
+// String sun = invokeFromComponent(inplaceInputD, "getValue", null);
+// Assert.assertEquals(sun, "Sun", "An inputted text has not been saved with ok");
+// //AssertTextEquals(inplaceInputD, "Sun", "An inputted text has not been saved with ok");
+//
+// writeStatus("Double-click the second component again and type a new text");
+// selenium.doubleClick(inplaceInputD);
+// type(inplaceInputDInput, "Moon");
+//
+// writeStatus("Stop editing with cancel. The input has not to be saved");
+// selenium.mouseDown(inplaceInputDCancel);
+//
+// sun = invokeFromComponent(inplaceInputD, "getValue", null);
+// Assert.assertEquals(sun, "Sun", "An inputted text has not to be saved with cancel");
+// //AssertTextEquals(inplaceInputD, "Sun", "An inputted text has not to be saved with cancel");
+//
+// }
+
+ /**
+ * 'required' and 'requiredMessage' attributes work
+ *
+ * @param template - current template
+ */
@Test
- public void testInplaceInputComponentLayout(Template template) {
- renderPage(template);
- writeStatus("Check component layout");
-
- String inplaceInputS = getParentId() + "_form:" + INPLACE_INPUT_SIMPLE;
- String inplaceInputD = getParentId() + "_form:" + INPLACE_INPUT_DECORATED;
-
- Assert.assertTrue(isPresentById(inplaceInputS));
- int count = selenium.getXpathCount("//*[@id='" + inplaceInputS + "' and (name()='span' or name()='SPAN')]").intValue();
- Assert.assertTrue(count == 1, "InplaceInput[" + inplaceInputS + "] has layout=inline(default) and should be rendered as 'span' element");
-
- Assert.assertTrue(isPresentById(inplaceInputD));
- count = selenium.getXpathCount("//*[@id='" + inplaceInputD + "' and (name()='DIV' or name()='div')]").intValue();
- Assert.assertTrue(count == 1, "InplaceInput [" + inplaceInputD + "] has layout=block and should be rendered as 'div' element");
-
+ public void testRequiredAttributes(Template template) {
+ setTestUrl(REQUIRED_ATTRIBUTES_PAGE);
+ init(template);
+
+ selenium.click("id=" + buttonId + REQUIRED_ATTRIBUTES_ID_PREFIX);
+ waitForPageToLoad();
+ checkMessage(messageId + REQUIRED_ATTRIBUTES_ID_PREFIX, "requiredMsg", CommonUtils.getSuccessfulTestMessage(inplaceInputId), CommonUtils.getFailedTestMessage(inplaceInputId));
}
- @Test
- public void testInplaceInputClientAPI(Template template) {
- renderPage(template);
- writeStatus("Check component client API");
+ private void checkMessage(String elementId, String expectedValue, String okMsg, String errMsg) {
+ String currentValue = getTextById(elementId);
+ if (("text:" + expectedValue).equals(currentValue)) {
+ writeStatus(okMsg, true);
+ } else {
+ writeStatus(errMsg, true);
+ Assert.fail(errMsg);
+ }
}
-
- @Test
- public void testInplaceInputEvents(Template template) {
- renderPage(template);
-
- writeStatus("Check component event triggering");
-
- String inplaceInputS = getParentId() + "_form:" + INPLACE_INPUT_SIMPLE;
- String inplaceInputD = getParentId() + "_form:" + INPLACE_INPUT_DECORATED;
- String inplaceInputDOk = getParentId() + "_form:" + INPLACE_INPUT_DECORATED_OK;
- String inplaceInputDCancel = getParentId() + "_form:" + INPLACE_INPUT_DECORATED_CANCEL;
-
- writeStatus("Click first component being tested");
-
- clickById(inplaceInputS);
- AssertTextEquals(inplaceInputS + "_edit", EVENT_TEST_RESULT_PASSED_TEXT, "oneditactivated event is not fired");
-
- writeStatus("Stop editing first component being tested");
-
- String inplaceInputSInput = inplaceInputS + INPLACE_INPUT_FIELD_POSTFIX;
- selenium.fireEvent(inplaceInputSInput, "blur");
-
- AssertTextEquals(inplaceInputS + "_view", EVENT_TEST_RESULT_PASSED_TEXT, "onviewactivated event is not fired");
-
- writeStatus("Double-click second component being tested");
-
- selenium.doubleClick(inplaceInputD);
- AssertTextEquals(inplaceInputD + "_edit", EVENT_TEST_RESULT_PASSED_TEXT, "oneditactivated event is not fired");
- type(inplaceInputSInput, "Hello");
-
- writeStatus("Stop editing second component being tested");
-
- selenium.mouseDown(inplaceInputDOk);
-
- AssertTextEquals(inplaceInputD + "_view", EVENT_TEST_RESULT_PASSED_TEXT, "onviewactivated event is not fired");
+
+ private void init(Template template) {
+ renderPage(template);
+ initIds();
}
-
- @Test
- public void testInplaceInputKeyAttributes(Template template) {
- renderPage(template);
-
- String inplaceInputS = getParentId() + "_form:" + INPLACE_INPUT_SIMPLE;
- String inplaceInputD = getParentId() + "_form:" + INPLACE_INPUT_DECORATED;
-
- String inplaceInputSInput = inplaceInputS + INPLACE_INPUT_FIELD_POSTFIX;
- String inplaceInputDInput = inplaceInputD + INPLACE_INPUT_FIELD_POSTFIX;
-
- writeStatus("Check component's key attributes");
-
- writeStatus("test 'editEvent' attribute");
-
- writeStatus("The first component must change your state by single clicking only");
- clickById(inplaceInputS);
- AssertVisible(inplaceInputSInput);
-
- writeStatus("The second component must change your state by double clicking only");
- selenium.doubleClick(inplaceInputD);
- AssertVisible(inplaceInputDInput);
+
+ private void initIds() {
+ formId = getParentId() + "_form:";
+ buttonId = formId + "bn";
+ inplaceInputId = formId + "ii";
+ messageId = "text";
}
-
- @Test
- public void testInplaceInputComponentCore(Template template) {
- renderPage(template);
-
- String inplaceInputD = getParentId() + "_form:" + INPLACE_INPUT_DECORATED;
- String inplaceInputDInput = inplaceInputD + INPLACE_INPUT_FIELD_POSTFIX;
- String inplaceInputDOk = getParentId() + "_form:" + INPLACE_INPUT_DECORATED_OK;
- String inplaceInputDCancel = getParentId() + "_form:" + INPLACE_INPUT_DECORATED_CANCEL;
-
- writeStatus("Check component's core functionality");
-
- writeStatus("Double-click the second component and type an initial text");
- selenium.doubleClick(inplaceInputD);
- type(inplaceInputDInput, "Sun");
-
- writeStatus("Stop editing with ok. The input has to be saved");
- selenium.mouseDown(inplaceInputDOk);
- String sun = invokeFromComponent(inplaceInputD, "getValue", null);
- Assert.assertEquals(sun, "Sun", "An inputted text has not been saved with ok");
- //AssertTextEquals(inplaceInputD, "Sun", "An inputted text has not been saved with ok");
-
- writeStatus("Double-click the second component again and type a new text");
- selenium.doubleClick(inplaceInputD);
- type(inplaceInputDInput, "Moon");
-
- writeStatus("Stop editing with cancel. The input has not to be saved");
- selenium.mouseDown(inplaceInputDCancel);
-
- sun = invokeFromComponent(inplaceInputD, "getValue", null);
- Assert.assertEquals(sun, "Sun", "An inputted text has not to be saved with cancel");
- //AssertTextEquals(inplaceInputD, "Sun", "An inputted text has not to be saved with cancel");
-
- }
-
+
@Override
public String getTestUrl() {
- return "pages/inplaceInput/inplaceInputTest.xhtml";
+ return testUrl;
}
+
+ public void setTestUrl(String testUrl) {
+ this.testUrl = "pages/inplaceInput/" + testUrl;
+ }
}
Modified: trunk/test-applications/seleniumTest/richfaces/src/test/testng/win/local_testng.xml
===================================================================
--- trunk/test-applications/seleniumTest/richfaces/src/test/testng/win/local_testng.xml 2008-10-28 12:55:05 UTC (rev 10938)
+++ trunk/test-applications/seleniumTest/richfaces/src/test/testng/win/local_testng.xml 2008-10-28 13:28:49 UTC (rev 10939)
@@ -7,7 +7,7 @@
<parameter name="loadScriptStrategy" value="DEFAULT" />
<parameter name="filterPrefix" value="/faces/NEKO/" />
<classes>
- <class name="org.richfaces.testng.AjaxSupportTest" />
+ <class name="org.richfaces.testng.InplaceInputTest" />
</classes>
</test>
</suite>
17 years, 6 months
JBoss Rich Faces SVN: r10938 - trunk/test-applications.
by richfaces-svn-commits@lists.jboss.org
Author: mvitenkov
Date: 2008-10-28 08:55:05 -0400 (Tue, 28 Oct 2008)
New Revision: 10938
Modified:
trunk/test-applications/pom.xml
Log:
new "auto-jsp" module
Modified: trunk/test-applications/pom.xml
===================================================================
--- trunk/test-applications/pom.xml 2008-10-28 08:13:33 UTC (rev 10937)
+++ trunk/test-applications/pom.xml 2008-10-28 12:55:05 UTC (rev 10938)
@@ -60,6 +60,7 @@
<modules>
<module>jsp</module>
<module>facelets</module>
+ <module>auto-jsp</module>
</modules>
<build>
17 years, 6 months
JBoss Rich Faces SVN: r10937 - trunk/test-applications/seleniumTest/richfaces/src/test/testng/win.
by richfaces-svn-commits@lists.jboss.org
Author: vmolotkov
Date: 2008-10-28 04:13:33 -0400 (Tue, 28 Oct 2008)
New Revision: 10937
Added:
trunk/test-applications/seleniumTest/richfaces/src/test/testng/win/local_testng.xml
Log:
local configuration
Added: trunk/test-applications/seleniumTest/richfaces/src/test/testng/win/local_testng.xml
===================================================================
--- trunk/test-applications/seleniumTest/richfaces/src/test/testng/win/local_testng.xml (rev 0)
+++ trunk/test-applications/seleniumTest/richfaces/src/test/testng/win/local_testng.xml 2008-10-28 08:13:33 UTC (rev 10937)
@@ -0,0 +1,13 @@
+<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
+<suite name="seleniumTestDDNe">
+ <parameter name="templates" value="SIMPLE,DATA_TABLE,MODAL_PANEL" />
+ <test name="FireFoxFunctionalTestsDDNe">
+ <parameter name="browser" value="*firefox" />
+ <parameter name="loadStyleStrategy" value="DEFAULT" />
+ <parameter name="loadScriptStrategy" value="DEFAULT" />
+ <parameter name="filterPrefix" value="/faces/NEKO/" />
+ <classes>
+ <class name="org.richfaces.testng.AjaxSupportTest" />
+ </classes>
+ </test>
+</suite>
17 years, 6 months
JBoss Rich Faces SVN: r10936 - trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng.
by richfaces-svn-commits@lists.jboss.org
Author: vmolotkov
Date: 2008-10-28 04:11:21 -0400 (Tue, 28 Oct 2008)
New Revision: 10936
Modified:
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/AjaxSupportTest.java
Log:
tests for a4j:support component
Modified: trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/AjaxSupportTest.java
===================================================================
--- trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/AjaxSupportTest.java 2008-10-28 05:38:57 UTC (rev 10935)
+++ trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/AjaxSupportTest.java 2008-10-28 08:11:21 UTC (rev 10936)
@@ -72,96 +72,96 @@
private String dataId2;
-// /**
-// * action and actionListener defined as component attributes and actionListener
-// * defined as nested tag are invoked on the server after event of attached
-// * to component occurs, navigation occurs
-// */
-// @Test
-// public void testDefaultBehaviour(Template template) {
-// setTestUrl(DEFAULT_BEHAVIOUR_PAGE);
-// init(template);
-// passExternalValidation();
-// checkBasicFunctionality(template, DEFAULT_BEHAVIOUR_ID_PREFIX, true);
-// }
-//
-// /** component re-renders another component (h:outputText) */
-// @Test
-// public void testRerenderFunctionality(Template template) {
-// setTestUrl(RERENDER_ATTRIBUTE_PAGE);
-// init(template);
-// passExternalValidation();
-// checkBasicFunctionality(template, RERENDER_ATTRIBUTE_ID_PREFIX, true);
-// }
-//
-// /**
-// * @see #testDefaultBehaviour(Template template)
-// *
-// * the same for the case of external validation
-// * failure - listeners and navigation do not work
-// */
-// @Test
-// public void testValidationFailed(Template template) {
-// setTestUrl(VALIDATION_FAILED_PAGE);
-// init(template);
-// breakExternalValidation();
-// checkBasicFunctionality(template, VALIDATION_FAILED_ID_PREFIX, false);
-// }
-//
-// /**
-// * @see #testDefaultBehaviour(Template template)
-// *
-// * the same for immediate = true component
-// */
-// @Test
-// public void testImmediateAttribute1(Template template) {
-// setTestUrl(IMMEDIATE_ATTRIBUTE1_PAGE);
-// init(template);
-// passExternalValidation();
-// checkBasicFunctionality(template, IMMEDIATE_ATTRIBUTE1_ID_PREFIX, true);
-// }
-//
-// /**
-// * @see #testDefaultBehaviour(Template template)
-// *
-// * the same for immediate = true component for
-// * the case of external validation failure
-// */
-// @Test
-// public void testImmediateAttribute2(Template template) {
-// setTestUrl(IMMEDIATE_ATTRIBUTE2_PAGE);
-// init(template);
-// breakExternalValidation();
-// checkBasicFunctionality(template, IMMEDIATE_ATTRIBUTE2_ID_PREFIX, true);
-// }
-//
-// /**
-// * @see #testDefaultBehaviour()
-// *
-// * the same for ajaxSingle = true component
-// */
-// @Test
-// public void testAjaxSingleAttribute1(Template template) {
-// setTestUrl(AJAXSINGLE_ATTRIBUTE1_PAGE);
-// init(template);
-// passExternalValidation();
-// checkBasicFunctionality(template, AJAXSINGLE_ATTRIBUTE1_ID_PREFIX, true);
-// }
-//
-// /**
-// * @see #testDefaultBehaviour()
-// *
-// * the same for ajaxSingle = true component for the case
-// * of external validation failure
-// */
-// @Test
-// public void testAjaxSingleAttribute2(Template template) {
-// setTestUrl(AJAXSINGLE_ATTRIBUTE2_PAGE);
-// init(template);
-// breakExternalValidation();
-// checkBasicFunctionality(template, AJAXSINGLE_ATTRIBUTE2_ID_PREFIX, true);
-// }
+ /**
+ * action and actionListener defined as component attributes and actionListener
+ * defined as nested tag are invoked on the server after event of attached
+ * to component occurs, navigation occurs
+ */
+ @Test
+ public void testDefaultBehaviour(Template template) {
+ setTestUrl(DEFAULT_BEHAVIOUR_PAGE);
+ init(template);
+ passExternalValidation();
+ checkBasicFunctionality(template, DEFAULT_BEHAVIOUR_ID_PREFIX, true);
+ }
+ /** component re-renders another component (h:outputText) */
+ @Test
+ public void testRerenderFunctionality(Template template) {
+ setTestUrl(RERENDER_ATTRIBUTE_PAGE);
+ init(template);
+ passExternalValidation();
+ checkBasicFunctionality(template, RERENDER_ATTRIBUTE_ID_PREFIX, true);
+ }
+
+ /**
+ * @see #testDefaultBehaviour(Template template)
+ *
+ * the same for the case of external validation
+ * failure - listeners and navigation do not work
+ */
+ @Test
+ public void testValidationFailed(Template template) {
+ setTestUrl(VALIDATION_FAILED_PAGE);
+ init(template);
+ breakExternalValidation();
+ checkBasicFunctionality(template, VALIDATION_FAILED_ID_PREFIX, false);
+ }
+
+ /**
+ * @see #testDefaultBehaviour(Template template)
+ *
+ * the same for immediate = true component
+ */
+ @Test
+ public void testImmediateAttribute1(Template template) {
+ setTestUrl(IMMEDIATE_ATTRIBUTE1_PAGE);
+ init(template);
+ passExternalValidation();
+ checkBasicFunctionality(template, IMMEDIATE_ATTRIBUTE1_ID_PREFIX, true);
+ }
+
+ /**
+ * @see #testDefaultBehaviour(Template template)
+ *
+ * the same for immediate = true component for
+ * the case of external validation failure
+ */
+ @Test
+ public void testImmediateAttribute2(Template template) {
+ setTestUrl(IMMEDIATE_ATTRIBUTE2_PAGE);
+ init(template);
+ breakExternalValidation();
+ checkBasicFunctionality(template, IMMEDIATE_ATTRIBUTE2_ID_PREFIX, true);
+ }
+
+ /**
+ * @see #testDefaultBehaviour()
+ *
+ * the same for ajaxSingle = true component
+ */
+ @Test
+ public void testAjaxSingleAttribute1(Template template) {
+ setTestUrl(AJAXSINGLE_ATTRIBUTE1_PAGE);
+ init(template);
+ passExternalValidation();
+ checkBasicFunctionality(template, AJAXSINGLE_ATTRIBUTE1_ID_PREFIX, true);
+ }
+
+ /**
+ * @see #testDefaultBehaviour()
+ *
+ * the same for ajaxSingle = true component for the case
+ * of external validation failure
+ */
+ @Test
+ public void testAjaxSingleAttribute2(Template template) {
+ setTestUrl(AJAXSINGLE_ATTRIBUTE2_PAGE);
+ init(template);
+ breakExternalValidation();
+ checkBasicFunctionality(template, AJAXSINGLE_ATTRIBUTE2_ID_PREFIX, true);
+ }
+
// /**
// * component encodes nested f:param tags and their values are present as request parameters
// */
17 years, 6 months