Author: konstantin.mishin
Date: 2009-02-13 10:01:27 -0500 (Fri, 13 Feb 2009)
New Revision: 12657
Modified:
trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/ComboBoxTestBean.java
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/comboBox/comboBoxTest.xhtml
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/ComboBoxTest.java
Log:
RF-6067
Modified:
trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/ComboBoxTestBean.java
===================================================================
---
trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/ComboBoxTestBean.java 2009-02-13
14:18:07 UTC (rev 12656)
+++
trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/ComboBoxTestBean.java 2009-02-13
15:01:27 UTC (rev 12657)
@@ -27,12 +27,13 @@
import javax.faces.application.FacesMessage;
import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
+import javax.faces.convert.Converter;
import javax.faces.event.ValueChangeEvent;
import javax.faces.model.SelectItem;
import javax.faces.validator.Validator;
import javax.faces.validator.ValidatorException;
-public class ComboBoxTestBean implements Validator{
+public class ComboBoxTestBean implements Validator, Converter{
private String value;
private String trace;
@@ -102,4 +103,14 @@
throw new ValidatorException(new FacesMessage("Value mustn't be equal
44."));
}
}
+
+ public Object getAsObject(FacesContext context, UIComponent component,
+ String value) {
+ return value != null ? value.substring(2): null;
+ }
+
+ public String getAsString(FacesContext context, UIComponent component,
+ Object value) {
+ return value != null ? "c:" + value.toString(): null;
+ }
}
Modified:
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/comboBox/comboBoxTest.xhtml
===================================================================
(Binary files differ)
Modified:
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/ComboBoxTest.java
===================================================================
---
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/ComboBoxTest.java 2009-02-13
14:18:07 UTC (rev 12656)
+++
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/ComboBoxTest.java 2009-02-13
15:01:27 UTC (rev 12657)
@@ -197,6 +197,16 @@
autoTester.testRequiredAndRequiredMessageAttributes();
}
+ /**
+ * Check "converter" attribute
+ */
+ @Test
+ public void testConverter(Template template) {
+ init(template);
+ selenium.click(comboboxButton);
+ Assert.assertEquals(selenium.getText("xpath=id('" + list +
"')/span[3]"), "c:33");
+ }
+
@Override
public void setValueEmpty() {
selenium.type(getParentId() + "autoTestForm:componentIdcomboboxValue",
"");
Show replies by date