[richfaces-svn-commits] JBoss Rich Faces SVN: r18831 - in modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest: a4jStatus and 1 other directories.
richfaces-svn-commits at lists.jboss.org
richfaces-svn-commits at lists.jboss.org
Thu Aug 19 19:22:48 EDT 2010
Author: lfryc at redhat.com
Date: 2010-08-19 19:22:47 -0400 (Thu, 19 Aug 2010)
New Revision: 18831
Modified:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/AbstractComponentAttributes.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jStatus/StatusFacets.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jStatus/TestFacets.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jStatus/TestSimple.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richJQuery/TestTiming.java
Log:
fixed checkstyle errors in metamer-ftest-source
Modified: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/AbstractComponentAttributes.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/AbstractComponentAttributes.java 2010-08-19 21:50:20 UTC (rev 18830)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/AbstractComponentAttributes.java 2010-08-19 23:22:47 UTC (rev 18831)
@@ -39,31 +39,26 @@
*/
public class AbstractComponentAttributes {
- private Type type;
+ AjaxSelenium selenium = AjaxSeleniumProxy.getInstance();
- public static class Type {
- public static Type SERVER = new Type();
- public static Type AJAX = new Type();
- }
+ JQueryLocator propertyLocator = pjq("input[id$={0}Input]");
+ ApplyType applyType;
+
public AbstractComponentAttributes() {
- this(Type.SERVER);
+ this(ApplyType.SERVER);
}
- public AbstractComponentAttributes(Type type) {
+ public AbstractComponentAttributes(ApplyType type) {
Validate.notNull(type);
- this.type = type;
+ this.applyType = type;
}
- AjaxSelenium selenium = AjaxSeleniumProxy.getInstance();
-
- JQueryLocator propertyLocator = pjq("input[id$={0}Input]");
-
protected String getProperty(String propertyName) {
final ElementLocator<?> locator = propertyLocator.format(propertyName);
return selenium.getValue(locator);
}
-
+
protected void setProperty(String propertyName, Object value) {
final ElementLocator<?> locator = propertyLocator.format(propertyName);
final AttributeLocator<?> typeLocator = locator.getAttribute(new org.jboss.test.selenium.locator.Attribute(
@@ -74,21 +69,25 @@
String valueAsString = value.toString();
// INPUT TEXT
if ("text".equals(inputType)) {
- if (type == Type.SERVER) {
+ if (applyType == ApplyType.SERVER) {
guardHttp(selenium).type(locator, valueAsString);
- } else if (type == Type.AJAX) {
+ } else if (applyType == ApplyType.AJAX) {
guardXhr(selenium).type(locator, valueAsString);
}
// INPUT CHECKBOX
} else if ("checkbox".equals(inputType)) {
boolean checked = Boolean.valueOf(valueAsString);
- if (type == Type.SERVER) {
+ if (applyType == ApplyType.SERVER) {
guardHttp(selenium).check(locator, checked);
- } else if (type == Type.AJAX) {
+ } else if (applyType == ApplyType.AJAX) {
selenium.check(locator, checked);
guardXhr(selenium).fireEvent(locator, Event.CHANGE);
}
}
}
+
+ public static enum ApplyType {
+ SERVER, AJAX
+ }
}
Modified: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jStatus/StatusFacets.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jStatus/StatusFacets.java 2010-08-19 21:50:20 UTC (rev 18830)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jStatus/StatusFacets.java 2010-08-19 23:22:47 UTC (rev 18831)
@@ -5,7 +5,7 @@
public class StatusFacets extends AbstractComponentAttributes {
public StatusFacets() {
- super(AbstractComponentAttributes.Type.AJAX);
+ super(AbstractComponentAttributes.ApplyType.AJAX);
}
public void setStartText(String startText) {
Modified: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jStatus/TestFacets.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jStatus/TestFacets.java 2010-08-19 21:50:20 UTC (rev 18830)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jStatus/TestFacets.java 2010-08-19 23:22:47 UTC (rev 18831)
@@ -34,13 +34,13 @@
* @version $Revision$
*/
public class TestFacets extends AbstracStatusTest {
+ StatusFacets facets = new StatusFacets();
+
@Override
public URL getTestUrl() {
return buildUrl(contextPath, "faces/components/a4jStatus/simple.xhtml");
}
- StatusFacets facets = new StatusFacets();
-
@BeforeMethod
public void installStatusExtensions() {
super.installStatusExtensions();
@@ -66,6 +66,8 @@
case ERROR:
facets.setErrorText(facets.getErrorText() + "*");
break;
+ default:
+ throw new IllegalStateException();
}
final String startText = facets.getStartText();
Modified: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jStatus/TestSimple.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jStatus/TestSimple.java 2010-08-19 21:50:20 UTC (rev 18830)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jStatus/TestSimple.java 2010-08-19 23:22:47 UTC (rev 18831)
@@ -21,20 +21,13 @@
*******************************************************************************/
package org.richfaces.tests.metamer.ftest.a4jStatus;
+import static org.jboss.test.selenium.utils.URLUtils.buildUrl;
+
import java.net.URL;
-import org.jboss.test.selenium.encapsulated.JavaScript;
-import org.jboss.test.selenium.locator.ElementLocator;
-import org.jboss.test.selenium.locator.JQueryLocator;
-import org.jboss.test.selenium.waiting.retrievers.TextRetriever;
-import org.richfaces.tests.metamer.ftest.AbstractMetamerTest;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
-import static org.jboss.test.selenium.utils.URLUtils.*;
-import static org.jboss.test.selenium.encapsulated.JavaScript.js;
-import static org.testng.Assert.*;
-
/**
* @author <a href="mailto:lfryc at redhat.com">Lukas Fryc</a>
* @version $Revision$
Modified: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richJQuery/TestTiming.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richJQuery/TestTiming.java 2010-08-19 21:50:20 UTC (rev 18830)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richJQuery/TestTiming.java 2010-08-19 23:22:47 UTC (rev 18831)
@@ -36,16 +36,16 @@
* @version $Revision$
*/
public class TestTiming extends AbstractMetamerTest {
-
+
JQueryLocator button = jq("#jQueryTestButton");
-
+
+ RichJQueryAttributes attributes = new RichJQueryAttributes();
+
@Override
public URL getTestUrl() {
return buildUrl(contextPath, "faces/components/richJQuery/simple.xhtml");
}
- RichJQueryAttributes attributes = new RichJQueryAttributes();
-
@Test
public void testImmediate() {
attributes.setTiming(JQueryTiming.immediate);
More information about the richfaces-svn-commits
mailing list