[richfaces-svn-commits] JBoss Rich Faces SVN: r11783 - in trunk/test-applications/seleniumTest/richfaces/src: main/webapp/layout/autotest and 2 other directories.

richfaces-svn-commits at lists.jboss.org richfaces-svn-commits at lists.jboss.org
Mon Dec 15 11:21:07 EST 2008


Author: andrei_exadel
Date: 2008-12-15 11:21:07 -0500 (Mon, 15 Dec 2008)
New Revision: 11783

Modified:
   trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/autotest/bean/AutoTestBean.java
   trunk/test-applications/seleniumTest/richfaces/src/main/webapp/layout/autotest/autoTestControls.xhtml
   trunk/test-applications/seleniumTest/richfaces/src/main/webapp/layout/autotest/autoTestHiddens.xhtml
   trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/calendar/calendarAutoTest.xhtml
   trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/AutoTester.java
Log:
RF-5229

Modified: trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/autotest/bean/AutoTestBean.java
===================================================================
--- trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/autotest/bean/AutoTestBean.java	2008-12-15 16:07:59 UTC (rev 11782)
+++ trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/autotest/bean/AutoTestBean.java	2008-12-15 16:21:07 UTC (rev 11783)
@@ -51,6 +51,10 @@
     public static final String STATUS_ID = "_auto_status";
 
     public static final String UPDATE_MODEL_STATUS = "UpdateModel";
+    
+    public static final String PROCESS_INPUT_UPDATE_MODEL = "ProcessInputUpdateModel";
+    
+    public static final String PROCESS_INPUT_CHANGE_LISTENER = "ProcessInputChangeListener";
 
     public static final String ACTION_LISTENER_STATUS = "ActionListener";
 
@@ -96,6 +100,10 @@
    
     private boolean converterSet;
     
+    private String processInput;
+    
+    private boolean processSet = false;
+    
     public class AutoTestConverter implements Converter {
     	
     	public static final String AS_OBJECT_STRING = "AUTO_TEST_CONVERTER_AS_OBJECT";
@@ -143,8 +151,13 @@
     public void actionListener(DropEvent event) {
         setStatus(getStatus() + ACTION_LISTENER_STATUS);
     }
- 
- 
+    
+    public void processInputChangeListener(ValueChangeEvent event) {
+    	if (processSet) {
+            setStatus(getStatus() + PROCESS_INPUT_CHANGE_LISTENER);
+        }
+    }
+  
     public void valueChangeListener(ValueChangeEvent event) {
         setStatus(getStatus() + VALUE_CHANGE_LISTENER_STATUS);
     }
@@ -437,5 +450,38 @@
 		this.converterSet = converterSet;
 	}
 
+	/**
+	 * @return the processSet
+	 */
+	public boolean isProcessSet() {
+		return processSet;
+	}
 
+	/**
+	 * @param processSet the processSet to set
+	 */
+	public void setProcessSet(boolean processSet) {
+		this.processSet = processSet;
+	}
+
+	/**
+	 * @return the processInput
+	 */
+	public String getProcessInput() {
+		return null;
+	}
+
+	/**
+	 * @param processInput the processInput to set
+	 */
+	public void setProcessInput(String processInput) {
+		if (processSet) {
+            setStatus(getStatus() + PROCESS_INPUT_UPDATE_MODEL);
+        }
+	}
+
+	public String getProcess() {
+		return "_auto_process_input";
+	}
+
 }

Modified: trunk/test-applications/seleniumTest/richfaces/src/main/webapp/layout/autotest/autoTestControls.xhtml
===================================================================
--- trunk/test-applications/seleniumTest/richfaces/src/main/webapp/layout/autotest/autoTestControls.xhtml	2008-12-15 16:07:59 UTC (rev 11782)
+++ trunk/test-applications/seleniumTest/richfaces/src/main/webapp/layout/autotest/autoTestControls.xhtml	2008-12-15 16:21:07 UTC (rev 11783)
@@ -61,7 +61,13 @@
 					</td>
 				</tr>
 				<tr>
+					<td>Test process:</td>
 					<td>
+						<h:selectBooleanCheckbox id="_auto_process" value="#{autoTestBean.processSet}"></h:selectBooleanCheckbox>
+					</td>
+				</tr>
+				<tr>
+					<td>
 						<h:commandButton id="_auto_load" actionListener="#{templateBean.reset}" action="#{autoTestBean.load}" value="Load"></h:commandButton> 
 					</td>
 					<td>

Modified: trunk/test-applications/seleniumTest/richfaces/src/main/webapp/layout/autotest/autoTestHiddens.xhtml
===================================================================
--- trunk/test-applications/seleniumTest/richfaces/src/main/webapp/layout/autotest/autoTestHiddens.xhtml	2008-12-15 16:07:59 UTC (rev 11782)
+++ trunk/test-applications/seleniumTest/richfaces/src/main/webapp/layout/autotest/autoTestHiddens.xhtml	2008-12-15 16:21:07 UTC (rev 11783)
@@ -5,6 +5,7 @@
 	xmlns:f="http://java.sun.com/jsf/core"
 	xmlns:ui="http://java.sun.com/jsf/facelets">
 		<h:inputHidden id="_auto_input" value="#{autoTestBean.input}" required="true"></h:inputHidden>
+		<h:inputHidden id="_auto_process_input" value="#{autoTestBean.processInput}" valueChangeListener="#{autoTestBean.processInputChangeListener}"></h:inputHidden>
 		<a4j:outputPanel ajaxRendered="true">
 			<h:outputText id="_auto_status" style="display: none;" value="#{autoTestBean.status}"></h:outputText>
 		</a4j:outputPanel>

Modified: trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/calendar/calendarAutoTest.xhtml
===================================================================
--- trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/calendar/calendarAutoTest.xhtml	2008-12-15 16:07:59 UTC (rev 11782)
+++ trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/calendar/calendarAutoTest.xhtml	2008-12-15 16:21:07 UTC (rev 11783)
@@ -21,6 +21,7 @@
 							   converter="#{autoTestBean.converter}"
 							   mode="ajax"
 							   popup="false"
+							   process="#{autoTestBean.process}"
 							   >
 				<f:param name="parameter1" value="value1" />
 			</rich:calendar>

Modified: trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/AutoTester.java
===================================================================
--- trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/AutoTester.java	2008-12-15 16:07:59 UTC (rev 11782)
+++ trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/AutoTester.java	2008-12-15 16:21:07 UTC (rev 11783)
@@ -21,6 +21,7 @@
 package org.richfaces;
 
 import java.util.ArrayList;
+import java.util.Date;
 import java.util.List;
 import java.util.Map;
 
@@ -41,6 +42,8 @@
     private static final String AUTOTEST_FORM_ID = "autoTestForm:";
 
     private static final String INPUT_ID = "_auto_input";
+    
+    private static final String PROCESS_INPUT_ID = "_auto_process_input";
 
     public static final String STATUS_ID = "_auto_status";
     
@@ -393,6 +396,10 @@
     private void setInternalValidationFailed() {
         base.setInternalValidationFailed();
     }
+    
+    private void setProcessInputValue() {
+        base.setValueById(base.getParentId() + AUTOTEST_FORM_ID + PROCESS_INPUT_ID, String.valueOf(new Date().getTime()));
+    }
 
     private void changeValue() {
         base.changeValue();
@@ -420,6 +427,24 @@
         }
     }
     
+    public void testProcessAttribute() {
+    	reset();
+    	setupControl(TestSetupEntry.process, true);
+    	setupControl(TestSetupEntry.ajaxSingle, true);
+    	clickLoad();
+    	
+    	setProcessInputValue();
+    	base.sendAjax();
+    	
+    	try{
+    		checkProcessInputChangeListener(true);
+    		checkUpdateModelForProcessInput(true);
+    	}catch (AssertionError error) {
+			Assert.fail("Process attribute does not work. " + error);
+		}
+    	
+    }
+    
     public void testConverterAttribute() {
     	setupControl(TestSetupEntry.converter, true);
     	clickLoad();
@@ -468,6 +493,15 @@
             Assert.fail(status);
         }
     }
+    
+    public void checkProcessInputChangeListener(boolean passed) {
+        String status = getStatus();
+        if (passed && status != null && status.indexOf(AutoTestBean.PROCESS_INPUT_CHANGE_LISTENER) == -1) {
+            Assert.fail("ValueChangeListener for component specified in process attribute has been skipped");
+        } else if (!passed && status != null && status.indexOf(AutoTestBean.PROCESS_INPUT_CHANGE_LISTENER) != -1) {
+            Assert.fail(status);
+        }
+    }
 
     public void checkNestedActionListener(boolean passed) {
         String status = getStatus();
@@ -513,6 +547,15 @@
             Assert.fail("Update Model phase should be skipped");
         }
     }
+    
+    public void checkUpdateModelForProcessInput(boolean passed) {
+        String status = getStatus();
+        if (passed && status != null && status.indexOf(AutoTestBean.PROCESS_INPUT_UPDATE_MODEL) == -1) {
+            Assert.fail("Update Model phase for component defined in process attribute has been skipped");
+        } else if (!passed && status != null && status.indexOf(AutoTestBean.PROCESS_INPUT_UPDATE_MODEL) != -1) {
+            Assert.fail("Update Model phase for component defined in process attribute should be skipped");
+        }
+    }
 
     private String getStatus() {
         return base.getTextById(base.getParentId() + AUTOTEST_FORM_ID + STATUS_ID);
@@ -556,6 +599,8 @@
         public static final TestSetupEntry limitToList = new TestSetupEntry("limitToList", Boolean.class, Boolean.FALSE);
         
         public static final TestSetupEntry converter = new TestSetupEntry("converter", Boolean.class, Boolean.FALSE);
+        
+        public static final TestSetupEntry process = new TestSetupEntry("process", Boolean.class, Boolean.FALSE);
 
         public static final List<TestSetupEntry> list = new ArrayList<TestSetupEntry>();
         static {
@@ -568,6 +613,7 @@
             list.add(limitToList);
             list.add(oncomplete);
             list.add(converter);
+            list.add(process);
         }
 
     }




More information about the richfaces-svn-commits mailing list