Author: dsvyatobatsko
Date: 2008-09-17 12:13:57 -0400 (Wed, 17 Sep 2008)
New Revision: 10475
Added:
trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/validation/
trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/validation/Activity.java
trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/validation/Admin.java
trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/validation/OrderOfDay.java
trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/validation/User.java
trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/validation/ValidationBean.java
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/graphValidator/
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/graphValidator/graphValidatorTest.xhtml
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/GraphValidatorTest.java
Modified:
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/WEB-INF/faces-config.xml
Log:
GraphValidatorTest initial commit
Added:
trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/validation/Activity.java
===================================================================
---
trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/validation/Activity.java
(rev 0)
+++
trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/validation/Activity.java 2008-09-17
16:13:57 UTC (rev 10475)
@@ -0,0 +1,43 @@
+package org.ajax4jsf.bean.validation;
+
+import org.hibernate.validator.Length;
+import org.hibernate.validator.Max;
+import org.hibernate.validator.Min;
+import org.hibernate.validator.NotEmpty;
+import org.hibernate.validator.NotNull;
+
+/**
+ * renamed and copied from demo
+ */
+public class Activity {
+ public Activity(String title, Integer time) {
+ setTitle(title);
+ setTime(time);
+ }
+
+ @NotEmpty
+ @Length(min = 3, max = 15)
+ private String title;
+
+ public String getTitle() {
+ return title;
+ }
+
+ public void setTitle(String title) {
+ this.title = title;
+ }
+
+ @NotNull
+ @Min(0)
+ @Max(12)
+ private Integer time;
+
+ public Integer getTime() {
+ return time;
+ }
+
+ public void setTime(Integer time) {
+ this.time = time;
+ }
+
+}
Property changes on:
trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/validation/Activity.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Author Id Revision Date
Name: svn:eol-style
+ native
Added:
trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/validation/Admin.java
===================================================================
---
trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/validation/Admin.java
(rev 0)
+++
trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/validation/Admin.java 2008-09-17
16:13:57 UTC (rev 10475)
@@ -0,0 +1,54 @@
+package org.ajax4jsf.bean.validation;
+
+import org.hibernate.validator.Email;
+import org.hibernate.validator.Length;
+import org.hibernate.validator.Max;
+import org.hibernate.validator.Min;
+import org.hibernate.validator.NotEmpty;
+import org.hibernate.validator.NotNull;
+import org.hibernate.validator.Pattern;
+
+/**
+ * renamed and copied from demo
+ */
+public class Admin {
+
+ @NotEmpty
+ @Pattern(regex=".*[^\\s].*", message="This string contain only
spaces")
+ @Length(min=3,max=12)
+ private String name;
+
+ @NotNull
+ @Min(18)
+ @Max(100)
+ private Integer age;
+
+ @Email
+ @NotEmpty
+ private String email;
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public Integer getAge() {
+ return age;
+ }
+
+ public void setAge(Integer age) {
+ this.age = age;
+ }
+
+ public String getEmail() {
+ return email;
+ }
+
+ public void setEmail(String email) {
+ this.email = email;
+ }
+
+}
Property changes on:
trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/validation/Admin.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Author Id Revision Date
Name: svn:eol-style
+ native
Added:
trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/validation/OrderOfDay.java
===================================================================
---
trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/validation/OrderOfDay.java
(rev 0)
+++
trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/validation/OrderOfDay.java 2008-09-17
16:13:57 UTC (rev 10475)
@@ -0,0 +1,42 @@
+package org.ajax4jsf.bean.validation;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.hibernate.validator.Max;
+import org.hibernate.validator.Min;
+import org.hibernate.validator.NotNull;
+
+/**
+ * renamed and copied from demo
+ */
+public class OrderOfDay {
+ public OrderOfDay() {
+ activities.add(new Activity("Sport", 0));
+ activities.add(new Activity("Entertainment", 0));
+ activities.add(new Activity("Sleeping", 0));
+ activities.add(new Activity("Games", 0));
+ }
+
+ private List<Activity> activities = new ArrayList<Activity>();
+
+ public List<Activity> getActivities() {
+ return activities;
+ }
+
+ public void setActivities(List<Activity> activities) {
+ this.activities = activities;
+ }
+
+ @NotNull
+ @Min(value = 1, message = "Please fill at least one entry")
+ @Max(value = 24, message = "Only 24h in a day!")
+ public Integer getTotalTime() {
+ Integer retVal = 0;
+ for (Activity activity : activities) {
+ retVal += activity.getTime();
+ }
+ return retVal;
+ }
+
+}
Property changes on:
trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/validation/OrderOfDay.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Author Id Revision Date
Name: svn:eol-style
+ native
Added:
trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/validation/User.java
===================================================================
---
trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/validation/User.java
(rev 0)
+++
trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/validation/User.java 2008-09-17
16:13:57 UTC (rev 10475)
@@ -0,0 +1,38 @@
+package org.ajax4jsf.bean.validation;
+
+/**
+ * renamed and copied from demo
+ */
+public class User {
+
+ private String name;
+
+ private Integer age;
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public Integer getAge() {
+ return age;
+ }
+
+ public void setAge(Integer age) {
+ this.age = age;
+ }
+
+ private OrderOfDay orderOfDay = new OrderOfDay();
+
+ public OrderOfDay getOrderOfDay() {
+ return orderOfDay;
+ }
+
+ public void setOrderOfDay(OrderOfDay orderOfDay) {
+ this.orderOfDay = orderOfDay;
+ }
+
+}
Property changes on:
trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/validation/User.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Author Id Revision Date
Name: svn:eol-style
+ native
Added:
trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/validation/ValidationBean.java
===================================================================
---
trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/validation/ValidationBean.java
(rev 0)
+++
trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/validation/ValidationBean.java 2008-09-17
16:13:57 UTC (rev 10475)
@@ -0,0 +1,52 @@
+package org.ajax4jsf.bean.validation;
+
+import javax.faces.application.FacesMessage;
+import javax.faces.context.FacesContext;
+import javax.faces.event.ActionEvent;
+
+/**
+ * renamed and copied from demo
+ */
+public class ValidationBean {
+
+ private User user = new User();
+
+ public User getUser() {
+ return user;
+ }
+
+ public void setUser(User user) {
+ this.user = user;
+ }
+
+ private Admin admin = new Admin();
+
+ public Admin getAdmin() {
+ return admin;
+ }
+
+ public void setAdmin(Admin admin) {
+ this.admin = admin;
+ }
+
+ public void success() {
+ setProgressString(getProgressString() + "(Strored successfully)");
+ }
+
+ private String progressString = "Fill the form please";
+
+ public String getProgressString() {
+ return progressString;
+ }
+
+ public void setProgressString(String progressString) {
+ this.progressString = progressString;
+ }
+
+ public void storeOrderOfDay(ActionEvent event) {
+ FacesContext.getCurrentInstance().addMessage(
+ event.getComponent().getClientId(FacesContext.getCurrentInstance()),
+ new FacesMessage(FacesMessage.SEVERITY_INFO, "Changes Stored
Successfully",
+ "Changes Stored Successfully"));
+ }
+}
Property changes on:
trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/validation/ValidationBean.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Author Id Revision Date
Name: svn:eol-style
+ native
Modified:
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/WEB-INF/faces-config.xml
===================================================================
---
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/WEB-INF/faces-config.xml 2008-09-17
16:08:25 UTC (rev 10474)
+++
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/WEB-INF/faces-config.xml 2008-09-17
16:13:57 UTC (rev 10475)
@@ -220,6 +220,11 @@
<managed-bean-name>dataFilterSliderBean</managed-bean-name>
<managed-bean-class>org.ajax4jsf.bean.DataFilterSliderBean</managed-bean-class>
<managed-bean-scope>session</managed-bean-scope>
+ </managed-bean>
+ <managed-bean>
+ <managed-bean-name>validationBean</managed-bean-name>
+ <managed-bean-class>org.ajax4jsf.bean.validation.ValidationBean</managed-bean-class>
+ <managed-bean-scope>request</managed-bean-scope>
</managed-bean>
<navigation-rule>
<from-view-id>/pages/ajaxInclude/step1.xhtml</from-view-id>
Added:
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/graphValidator/graphValidatorTest.xhtml
===================================================================
(Binary files differ)
Property changes on:
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/graphValidator/graphValidatorTest.xhtml
___________________________________________________________________
Name: svn:mime-type
+ application/xhtml+xml
Added:
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/GraphValidatorTest.java
===================================================================
---
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/GraphValidatorTest.java
(rev 0)
+++
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/GraphValidatorTest.java 2008-09-17
16:13:57 UTC (rev 10475)
@@ -0,0 +1,18 @@
+package org.richfaces.testng;
+
+import org.ajax4jsf.template.Template;
+import org.richfaces.SeleniumTestBase;
+import org.testng.annotations.Test;
+
+public class GraphValidatorTest extends SeleniumTestBase {
+
+ @Test
+ public void testGraphValidatorComponent(Template template) {
+ renderPage(template);
+ }
+
+ @Override
+ public String getTestUrl() {
+ return "pages/graphValidator/graphValidatorTest.xhtml";
+ }
+}
Property changes on:
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/GraphValidatorTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Author Id Revision Date
Name: svn:eol-style
+ native
Show replies by date