Author: jjamrich
Date: 2011-09-23 09:27:03 -0400 (Fri, 23 Sep 2011)
New Revision: 22745
Modified:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/attributes/AttributeList.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richGraphValidator/GraphValidatorAttributes.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richGraphValidator/TestRichGraphValidator.java
Log:
RFPL-1439: Update tests for grapValidator to use unified way to setting attributes
Modified:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/attributes/AttributeList.java
===================================================================
---
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/attributes/AttributeList.java 2011-09-23
13:26:37 UTC (rev 22744)
+++
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/attributes/AttributeList.java 2011-09-23
13:27:03 UTC (rev 22745)
@@ -21,6 +21,7 @@
import org.richfaces.tests.metamer.ftest.richDragSource.DragSourceAttributes;
import org.richfaces.tests.metamer.ftest.richDropTarget.DropTargetAttributes;
import org.richfaces.tests.metamer.ftest.richEditor.EditorAttributes;
+import org.richfaces.tests.metamer.ftest.richGraphValidator.GraphValidatorAttributes;
import org.richfaces.tests.metamer.ftest.richTooltip.TooltipAttributes;
public class AttributeList {
@@ -45,5 +46,6 @@
public static Attributes<DragSourceAttributes> dragSourceAttributes = new
Attributes<DragSourceAttributes>();
public static Attributes<DropTargetAttributes> dropTargetAttributes = new
Attributes<DropTargetAttributes>();
public static Attributes<EditorAttributes> editorAttributes = new
Attributes<EditorAttributes>();
+ public static Attributes<GraphValidatorAttributes> graphValidatorAttributes =
new Attributes<GraphValidatorAttributes>();
}
Modified:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richGraphValidator/GraphValidatorAttributes.java
===================================================================
---
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richGraphValidator/GraphValidatorAttributes.java 2011-09-23
13:26:37 UTC (rev 22744)
+++
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richGraphValidator/GraphValidatorAttributes.java 2011-09-23
13:27:03 UTC (rev 22745)
@@ -21,7 +21,7 @@
*******************************************************************************/
package org.richfaces.tests.metamer.ftest.richGraphValidator;
-import org.richfaces.tests.metamer.ftest.AbstractComponentAttributes;
+import org.richfaces.tests.metamer.ftest.attributes.AttributeEnum;
/**
* Component attributes for rich:graphValidator
@@ -29,22 +29,11 @@
* @author <a href="mailto:jjamrich@redhat.com">Jan Jamrich</a>
* @version $Revision$
*/
-public class GraphValidatorAttributes extends AbstractComponentAttributes {
+public enum GraphValidatorAttributes implements AttributeEnum {
- public void setRendered(Boolean rendered) {
- setProperty("rendered", rendered);
- }
+ rendered,
+ summary,
+ value,
+ groups
- public void setSummary(String summary) {
- setProperty("summary", summary);
- }
-
- public void setValue(String value) {
- setProperty("value", value);
- }
-
- public void setGroups(String groups) {
- setProperty("groups", groups);
- }
-
}
Modified:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richGraphValidator/TestRichGraphValidator.java
===================================================================
---
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richGraphValidator/TestRichGraphValidator.java 2011-09-23
13:26:37 UTC (rev 22744)
+++
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richGraphValidator/TestRichGraphValidator.java 2011-09-23
13:27:03 UTC (rev 22745)
@@ -23,10 +23,13 @@
import static org.jboss.test.selenium.locator.LocatorFactory.jq;
import static org.jboss.test.selenium.utils.URLUtils.buildUrl;
+import static
org.richfaces.tests.metamer.ftest.attributes.AttributeList.graphValidatorAttributes;
+import static
org.richfaces.tests.metamer.ftest.richGraphValidator.GraphValidatorAttributes.*;
import java.net.URL;
import java.text.SimpleDateFormat;
import java.util.Date;
+import java.util.GregorianCalendar;
import org.jboss.test.selenium.locator.JQueryLocator;
import org.jboss.test.selenium.locator.option.OptionValueLocator;
@@ -51,8 +54,6 @@
private static final int BOOLEAN_INPUTS_GROUP = 3;
private static final int NUMERIC_INPUTS_GROUP = 4;
- private GraphValidatorAttributes attributes = new GraphValidatorAttributes();
-
private JQueryLocator autocomplete = pjq("input[id$=autocompleteInput]");
private JQueryLocator inputSecret = pjq("input[id$=inputSecret]");
private JQueryLocator inputText = pjq("input[id$=inputText]");
@@ -83,7 +84,7 @@
@Test
public void testGroups() {
for (int i=0; i<GROUPS.length; ++i) {
- attributes.setGroups(GROUPS[i]);
+ graphValidatorAttributes.set(groups, GROUPS[i]);
setAllValidatedFields();
@@ -111,7 +112,7 @@
@Test
public void testSummary() {
String msg = "My own validation message!";
- attributes.setSummary(msg);
+ graphValidatorAttributes.set(summary, msg);
setAllValidatedFields();
allFieldsSetToWrong();
@@ -126,7 +127,7 @@
@Test
public void testValue() {
- attributes.setValue("testValue");
+ graphValidatorAttributes.set(value, "testValue");
setAllValidatedFields();
@@ -143,7 +144,7 @@
public void testRendered() {
setAllValidatedFields();
- attributes.setRendered(Boolean.FALSE);
+ graphValidatorAttributes.set(rendered, Boolean.FALSE);
waitGui.until(isNotDisplayed.locator(header));
}
Show replies by date