Author: jjamrich
Date: 2011-06-06 08:47:30 -0400 (Mon, 06 Jun 2011)
New Revision: 22526
Removed:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richValidator/TestValidators.java
Log:
Removed TestValidators class since need 2 classes for 2 similar pages
Deleted:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richValidator/TestValidators.java
===================================================================
---
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richValidator/TestValidators.java 2011-06-06
12:47:11 UTC (rev 22525)
+++
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richValidator/TestValidators.java 2011-06-06
12:47:30 UTC (rev 22526)
@@ -1,148 +0,0 @@
-/*******************************************************************************
- * JBoss, Home of Professional Open Source
- * Copyright 2010-2011, Red Hat, Inc. and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- *******************************************************************************/
-package org.richfaces.tests.metamer.ftest.richValidator;
-
-import static
org.jboss.test.selenium.guard.request.RequestTypeGuardFactory.guardNoRequest;
-import static org.jboss.test.selenium.locator.LocatorFactory.jq;
-
-import java.net.URL;
-import java.util.HashMap;
-import java.util.Map;
-
-import org.jboss.test.selenium.locator.JQueryLocator;
-import org.jboss.test.selenium.utils.URLUtils;
-import org.richfaces.tests.metamer.ftest.AbstractMetamerTest;
-import org.richfaces.tests.metamer.ftest.annotations.IssueTracking;
-import org.testng.annotations.BeforeClass;
-import org.testng.annotations.Test;
-
-/**
- * Selenium test for page faces/components/richValidator/csv.xhtml
- *
- * @author <a href="mailto:jjamrich@redhat.com">Jan Jamrich</a>
- * @version $Revision$
- */
-public class TestValidators extends AbstractMetamerTest {
-
-
- private enum ID {
- /** Boolean, true */ assertTrue,
- /** Boolean false */ assertFalse,
- /** Decimal from 2.5 to 9.688 */ decimalMinMax,
- /** Decimal 3 digits and 4 fract */ digits ,
- /** Integer max 10 */ max,
- /** Integer min 2 */ min,
- /** Integer from 2 to 10 */ minMax,
- /** Text, not empty */ notEmpty,
- /** Text, not null */ notNull,
- /** Text, pattern '[a-z].*' */ pattern,
- /** custom validator */ custom,
- /** custom regExp validator */ regexp,
- /** date past */ past,
- /** date future */ future,
- /** String size from 2 to 4 */ stringSize,
- /** Selection size */ size
- }
-
- private Map<ID, String> messages = new HashMap<TestValidators.ID,
String>();
-
- private JQueryLocator inputFormat = pjq("input[id$=:{0}]");
-
- private JQueryLocator setWrongBtn =
pjq("input[id$=setWrongValuesButton]");
- private JQueryLocator setCorrectBtn =
pjq("input[id$=setCorrectValuesButton]");
-
- private JQueryLocator hCommandBtn = pjq("input[id$=hButton]");
- private JQueryLocator a4jCommandBtn = pjq("input[id$=a4jButton]");
-
- private JQueryLocator selectionItem = inputFormat.format(ID.size)
- .getDescendant(jq("tr > td > input[id$=:size:{0}]"));
-
- private JQueryLocator msgFormat = pjq("span[id$={0}Msg] span.rf-msg-det");
-
- @BeforeClass
- private void init() {
- messages.put(ID.assertTrue, "must be true");
- messages.put(ID.assertFalse, "must be false");
- messages.put(ID.decimalMinMax, "must be less than or equal to 9.688");
- messages.put(ID.digits, "numeric value out of bounds (<3 digits>.<4
digits> expected)");
- messages.put(ID.max, "must be less than or equal to 10");
- messages.put(ID.min, "must be greater than or equal to 2");
- messages.put(ID.minMax, "must be greater than or equal to 2");
- messages.put(ID.notEmpty, "may not be empty");
- messages.put(ID.notNull, "may not be null");
- messages.put(ID.pattern, "must match \"[a-z].*\"");
- messages.put(ID.custom, "string is not \"RichFaces\"");
- messages.put(ID.regexp, "Regex pattern of '\\d{3}' not
matched");
- messages.put(ID.past, "must be in the past");
- messages.put(ID.future, "must be in the future");
- messages.put(ID.stringSize, "size must be between 2 and 4");
- messages.put(ID.size, "???????"); // RF-11035
- }
-
- @Override
- public URL getTestUrl() {
- return URLUtils.buildUrl(contextPath,
"faces/components/richValidator/csv.xhtml");
- }
-
- @Test
- public void testAllWrongWithAjaxSubmit() {
- selenium.click(setCorrectBtn);
- selenium.click(a4jCommandBtn);
-
-
waitGui.until(textEquals.locator(msgFormat.format(ID.assertTrue)).text(messages.get(ID.assertTrue)));
- }
-
- @Test
- @IssueTracking(value = "https://issues.jboss.org/browse/RF-11035")
- public void testAllWrongWithJSFSubmit() {
- selenium.click(setCorrectBtn);
- selenium.click(hCommandBtn);
-
-
waitGui.until(textEquals.locator(msgFormat.format(ID.assertTrue)).text(messages.get(ID.assertTrue)));
- }
-
- @Test
- public void testBooleanTrue() {
-
- selenium.click(setCorrectBtn);
-
- // checkBoolean to true
- selenium.check(inputFormat.format(ID.assertTrue), false);
-
- guardNoRequest(selenium).click(a4jCommandBtn);
-
-
waitGui.until(textEquals.locator(msgFormat.format(ID.assertTrue)).text(messages.get(ID.assertTrue)));
- }
-
- @Test
- public void testBooleanFalse() {
-
- selenium.click(setCorrectBtn);
-
- // checkBoolean to false
- selenium.check(inputFormat.format(ID.assertFalse), true);
- selenium.click(a4jCommandBtn);
-
-
waitGui.until(textEquals.locator(msgFormat.format(ID.assertFalse)).text(messages.get(ID.assertFalse)));
- }
-
-}