Author: jjamrich
Date: 2011-05-19 03:46:35 -0400 (Thu, 19 May 2011)
New Revision: 22499
Modified:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/jboss/cheiron/retriever/ColorRetriever.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/jboss/test/selenium/JQuerySelectors.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/jboss/test/selenium/waiting/WaitFactory.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/AbstractMetamerTest.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/DelayTester.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/MatrixConfigurator.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/MetamerFailureLoggingTestListener.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jLog/TestA4JLog.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jQueue/QueueModel.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jRepeat/TestSimple.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/abstractions/DataTableFilteringTest.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/model/CollapsibleSubTableToggler.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/model/DataGrid.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/model/ModelIterable.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/model/PanelMenu.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richAutocomplete/TestAutocompleteByKeys.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richCollapsibleSubTable/TestCollapsibleSubTableFiltering.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richCollapsibleSubTable/TestCollapsibleSubTableSorting.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richCollapsibleSubTableToggler/TestCollapsibleSubTableToggler.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richColumn/AbstractColumnModelTest.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richColumn/AbstractColumnSortingTest.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richColumn/TestColumnFiltering.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richDataGrid/AbstractScrollerTest.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richDataGrid/TestSimple.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richDragIndicator/Indicator.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richDragIndicator/TestDragIndicator.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richDropTarget/TestDropTarget.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richInputNumberSlider/AbstractSliderTest.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richInputNumberSpinner/AbstractSpinnerTest.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richInputNumberSpinner/TestRichSpinnerFAjax.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richList/AbstractListTest.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richList/ListModel.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richMessage/AbstractRichMessageTest.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richPanelMenu/TestPanelMenuIcon.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richPanelMenuGroup/TestPanelMenuGroupClientSideHandlers.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richPanelMenuGroup/TestPanelMenuGroupSimple.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richPanelMenuItem/TestPanelMenuItemSimple.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTooltip/TestTooltipSimple.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTree/AbstractTreeNodeModel.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTree/TestTreeSelection.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTree/TestTreeSimple.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTree/TestTreeToggling.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTreeModelAdaptor/TestTreeModelAdaptorLazyLoading.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTreeModelAdaptor/TestTreeModelAdaptorSelection.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTreeModelAdaptor/TestTreeModelAdaptorSimple.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTreeNode/TestTreeNodeSimple.java
Log:
Fix first group of checkstyle violations
Fixed issues like unused imports, attributes order according to access
level, fixed intendation, added default state in case, attributes case
according to final/non final declaration
Modified:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/jboss/cheiron/retriever/ColorRetriever.java
===================================================================
---
modules/tests/metamer/trunk/ftest-source/src/main/java/org/jboss/cheiron/retriever/ColorRetriever.java 2011-05-17
23:53:24 UTC (rev 22498)
+++
modules/tests/metamer/trunk/ftest-source/src/main/java/org/jboss/cheiron/retriever/ColorRetriever.java 2011-05-19
07:46:35 UTC (rev 22499)
@@ -21,6 +21,9 @@
*/
package org.jboss.cheiron.retriever;
+import static org.jboss.test.selenium.encapsulated.JavaScript.js;
+import static org.jboss.test.selenium.utils.text.SimplifiedFormat.format;
+
import java.awt.Color;
import org.apache.commons.lang.Validate;
@@ -31,13 +34,9 @@
import org.jboss.test.selenium.locator.ElementLocator;
import org.jboss.test.selenium.utils.ColorUtils;
import org.jboss.test.selenium.waiting.conversion.Convertor;
-import org.jboss.test.selenium.waiting.conversion.PassOnConvertor;
import org.jboss.test.selenium.waiting.retrievers.AbstractRetriever;
import org.jboss.test.selenium.waiting.retrievers.Retriever;
-import static org.jboss.test.selenium.utils.text.SimplifiedFormat.format;
-import static org.jboss.test.selenium.encapsulated.JavaScript.js;
-
/**
* @author <a href="mailto:lfryc@redhat.com">Lukas Fryc</a>
* @version $Revision$
Modified:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/jboss/test/selenium/JQuerySelectors.java
===================================================================
---
modules/tests/metamer/trunk/ftest-source/src/main/java/org/jboss/test/selenium/JQuerySelectors.java 2011-05-17
23:53:24 UTC (rev 22498)
+++
modules/tests/metamer/trunk/ftest-source/src/main/java/org/jboss/test/selenium/JQuerySelectors.java 2011-05-19
07:46:35 UTC (rev 22499)
@@ -1,3 +1,24 @@
+/*
+ * 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.jboss.test.selenium;
import static org.jboss.test.selenium.locator.LocatorFactory.jq;
@@ -6,7 +27,17 @@
import org.jboss.test.selenium.locator.JQueryLocator;
import org.jboss.test.selenium.utils.text.SimplifiedFormat;
-public class JQuerySelectors {
+/**
+ * JQuery selectors store
+ * @author <a href="mailto:lfryc@redhat.com">Lukas Fryc</a>
+ * @version $Revision$
+ */
+public final class JQuerySelectors {
+
+ /* According to checkstyle made class final, without default ctor.
+ * In case of need modify class accordingly */
+ private JQuerySelectors() { };
+
public static JQueryLocator not(ExtendedLocator<JQueryLocator> locator, String
expression) {
return jq(SimplifiedFormat.format("{0}:not({1})",
locator.getRawLocator(), expression));
}
Modified:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/jboss/test/selenium/waiting/WaitFactory.java
===================================================================
---
modules/tests/metamer/trunk/ftest-source/src/main/java/org/jboss/test/selenium/waiting/WaitFactory.java 2011-05-17
23:53:24 UTC (rev 22498)
+++
modules/tests/metamer/trunk/ftest-source/src/main/java/org/jboss/test/selenium/waiting/WaitFactory.java 2011-05-19
07:46:35 UTC (rev 22499)
@@ -42,7 +42,7 @@
import org.jboss.test.selenium.waiting.conditions.TextEquals;
import org.jboss.test.selenium.waiting.selenium.SeleniumWaiting;
-/**
+/**
* @author <a href="mailto:lfryc@redhat.com">Lukas Fryc</a>
* @version $Revision$
*/
Modified:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/AbstractMetamerTest.java
===================================================================
---
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/AbstractMetamerTest.java 2011-05-17
23:53:24 UTC (rev 22498)
+++
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/AbstractMetamerTest.java 2011-05-19
07:46:35 UTC (rev 22499)
@@ -79,6 +79,11 @@
* @version $Revision$
*/
public abstract class AbstractMetamerTest extends AbstractTestCase {
+
+ /**
+ * timeout in miliseconds
+ */
+ public static final long TIMEOUT = 5000;
protected JQueryLocator time = jq("span[id$=requestTime]");
protected JQueryLocator renderChecker = jq("span[id$=renderChecker]");
@@ -90,10 +95,7 @@
protected PhaseInfo phaseInfo = new PhaseInfo();
protected LocatorReference<JQueryLocator> attributesRoot = new
LocatorReference<JQueryLocator>(
pjq("span[id$=:attributes:panel]"));
- /**
- * timeout in miliseconds
- */
- public static final long TIMEOUT = 5000;
+
@Inject
@Templates({ "plain", "richAccordion", "richDataTable",
"richCollapsibleSubTable", "richExtendedDataTable",
"richDataGrid", "richList", "richCollapsiblePanel",
"richPanel", "richTabPanel", "richTogglePanel",
Modified:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/DelayTester.java
===================================================================
---
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/DelayTester.java 2011-05-17
23:53:24 UTC (rev 22498)
+++
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/DelayTester.java 2011-05-19
07:46:35 UTC (rev 22499)
@@ -42,13 +42,13 @@
long actualDelay;
long expectedDelay;
+
+ List<Long> deviations = new ArrayList<Long>();
public DelayTester(long expectedDelay) {
this.expectedDelay = expectedDelay;
}
- List<Long> deviations = new ArrayList<Long>();
-
public abstract void action();
public void beforeTest() {
Modified:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/MatrixConfigurator.java
===================================================================
---
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/MatrixConfigurator.java 2011-05-17
23:53:24 UTC (rev 22498)
+++
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/MatrixConfigurator.java 2011-05-19
07:46:35 UTC (rev 22499)
@@ -324,21 +324,21 @@
}
if (useAnnotation.decimals().length > 0) {
- if (parameterType == double.class || parameterType == Double.class) {
-
result.addAll(Arrays.asList(ArrayUtils.toObject(useAnnotation.decimals())));
- }
+ if (parameterType == double.class || parameterType == Double.class) {
+
result.addAll(Arrays.asList(ArrayUtils.toObject(useAnnotation.decimals())));
+ }
}
if (useAnnotation.strings().length > 0) {
- if (parameterType == String.class) {
- result.addAll(Arrays.asList(useAnnotation.strings()));
- }
+ if (parameterType == String.class) {
+ result.addAll(Arrays.asList(useAnnotation.strings()));
+ }
}
if (useAnnotation.booleans().length > 0) {
- if (parameterType == boolean.class || parameterType == Boolean.class) {
-
result.addAll(Arrays.asList(ArrayUtils.toObject(useAnnotation.booleans())));
- }
+ if (parameterType == boolean.class || parameterType == Boolean.class) {
+
result.addAll(Arrays.asList(ArrayUtils.toObject(useAnnotation.booleans())));
+ }
}
if (useAnnotation.enumeration()) {
Modified:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/MetamerFailureLoggingTestListener.java
===================================================================
---
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/MetamerFailureLoggingTestListener.java 2011-05-17
23:53:24 UTC (rev 22498)
+++
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/MetamerFailureLoggingTestListener.java 2011-05-19
07:46:35 UTC (rev 22499)
@@ -21,9 +21,10 @@
*******************************************************************************/
package org.richfaces.tests.metamer.ftest;
+import static java.util.Arrays.asList;
+
import java.io.File;
import java.io.IOException;
-import java.util.Arrays;
import java.util.LinkedList;
import java.util.List;
@@ -33,8 +34,6 @@
import org.richfaces.tests.metamer.ftest.annotations.IssueTracking;
import org.testng.ITestResult;
-import static java.util.Arrays.asList;
-
/**
* @author <a href="mailto:lfryc@redhat.com">Lukas Fryc</a>
* @version $Revision$
Modified:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jLog/TestA4JLog.java
===================================================================
---
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jLog/TestA4JLog.java 2011-05-17
23:53:24 UTC (rev 22498)
+++
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jLog/TestA4JLog.java 2011-05-19
07:46:35 UTC (rev 22499)
@@ -21,7 +21,6 @@
*******************************************************************************/
package org.richfaces.tests.metamer.ftest.a4jLog;
-import java.awt.event.KeyEvent;
import static org.jboss.test.selenium.locator.LocatorFactory.jq;
import static org.jboss.test.selenium.locator.option.OptionLocatorFactory.optionLabel;
import static org.jboss.test.selenium.utils.URLUtils.buildUrl;
Modified:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jQueue/QueueModel.java
===================================================================
---
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jQueue/QueueModel.java 2011-05-17
23:53:24 UTC (rev 22498)
+++
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jQueue/QueueModel.java 2011-05-19
07:46:35 UTC (rev 22499)
@@ -27,14 +27,13 @@
import org.jboss.test.selenium.locator.reference.ReferencedLocator;
import org.jboss.test.selenium.waiting.retrievers.Retriever;
+/**
+ * Queue Model
+ * @version $Revision$
+ */
public class QueueModel {
-
- private AjaxSelenium selenium = AjaxSeleniumProxy.getInstance();
-
- private Boolean event2Present = null;
-
+
List<Long> deviations = new ArrayList<Long>();
-
LocatorReference<JQueryLocator> form = new
LocatorReference<JQueryLocator>(null);
ReferencedLocator<JQueryLocator> input1 = ref(form,
"input:text[id$=input1]");
@@ -61,7 +60,11 @@
Retriever<Long> retrieveEvent2Time =
longAdapter(RETRIEVE_ATTRIBUTE.attributeLocator(event2Time));
Retriever<Long> retrieveBeginTime =
longAdapter(RETRIEVE_ATTRIBUTE.attributeLocator(beginTime));
Retriever<Long> retrieveCompleteTime =
longAdapter(RETRIEVE_ATTRIBUTE.attributeLocator(completeTime));
+
+ private AjaxSelenium selenium = AjaxSeleniumProxy.getInstance();
+ private Boolean event2Present = null;
+
public QueueModel() {
this(pjq(""));
}
Modified:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jRepeat/TestSimple.java
===================================================================
---
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jRepeat/TestSimple.java 2011-05-17
23:53:24 UTC (rev 22498)
+++
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jRepeat/TestSimple.java 2011-05-19
07:46:35 UTC (rev 22499)
@@ -91,7 +91,7 @@
@Test
@IssueTracking("https://issues.jboss.org/browse/RF-10589")
@Use(field = "rows", ints = { -2, -1, 0, 1, ELEMENTS_TOTAL / 2,
ELEMENTS_TOTAL - 1, ELEMENTS_TOTAL,
- ELEMENTS_TOTAL + 1 })
+ ELEMENTS_TOTAL + 1 })
public void testRowsAttribute() {
verifyRepeat();
}
Modified:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/abstractions/DataTableFilteringTest.java
===================================================================
---
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/abstractions/DataTableFilteringTest.java 2011-05-17
23:53:24 UTC (rev 22498)
+++
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/abstractions/DataTableFilteringTest.java 2011-05-19
07:46:35 UTC (rev 22499)
@@ -48,7 +48,11 @@
private static final String[] FILTER_NAMES = new String[] { "ivan",
"Гог", null, "Š" };
private static final String[] FILTER_TITLES = new String[] { "Director",
null, "CEO" };
private static final Integer[] FILTER_NUMBER_OF_KIDS = new Integer[] { 2, 100, 0, 5
};
-
+
+ public ExpectedEmployee filterEmployee;
+ public List<Employee> expectedEmployees;
+ public int rows;
+
JQueryLocator selectSex = jq("select");
JQueryLocator inputName = jq("input");
JQueryLocator inputTitle = jq("input");
@@ -56,11 +60,7 @@
JQueryLocator inputNumberOfKids2 = jq("input");
FilteringDataTable filtering = new FilteringDataTable();
-
- public ExpectedEmployee filterEmployee;
- public List<Employee> expectedEmployees;
- public int rows;
-
+
@BeforeMethod
public void setup() {
filterEmployee = new ExpectedEmployee();
Modified:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/model/CollapsibleSubTableToggler.java
===================================================================
---
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/model/CollapsibleSubTableToggler.java 2011-05-17
23:53:24 UTC (rev 22498)
+++
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/model/CollapsibleSubTableToggler.java 2011-05-19
07:46:35 UTC (rev 22499)
@@ -8,13 +8,13 @@
public class CollapsibleSubTableToggler extends AbstractModel<JQueryLocator> {
+ ReferencedLocator<JQueryLocator> collapsedTogglers = ref(root, ">
span[id$=collapsed]");
+ ReferencedLocator<JQueryLocator> expandedTogglers = ref(root, ">
span[id$=expanded]");
+
public CollapsibleSubTableToggler(JQueryLocator root) {
super(root);
}
-
- ReferencedLocator<JQueryLocator> collapsedTogglers = ref(root, ">
span[id$=collapsed]");
- ReferencedLocator<JQueryLocator> expandedTogglers = ref(root, ">
span[id$=expanded]");
-
+
public ExtendedLocator<JQueryLocator> getCollapsed() {
return collapsedTogglers;
}
Modified:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/model/DataGrid.java
===================================================================
---
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/model/DataGrid.java 2011-05-17
23:53:24 UTC (rev 22498)
+++
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/model/DataGrid.java 2011-05-19
07:46:35 UTC (rev 22499)
@@ -21,9 +21,8 @@
*******************************************************************************/
package org.richfaces.tests.metamer.ftest.model;
+import static org.jboss.test.selenium.locator.LocatorFactory.jq;
import static org.jboss.test.selenium.locator.reference.ReferencedLocator.ref;
-import static
org.jboss.test.selenium.locator.reference.ReferencedLocator.referenceInferred;
-import static org.jboss.test.selenium.locator.LocatorFactory.*;
import java.util.Iterator;
Modified:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/model/ModelIterable.java
===================================================================
---
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/model/ModelIterable.java 2011-05-17
23:53:24 UTC (rev 22498)
+++
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/model/ModelIterable.java 2011-05-19
07:46:35 UTC (rev 22499)
@@ -3,7 +3,6 @@
import java.lang.reflect.Constructor;
import java.util.Iterator;
-import org.apache.commons.lang.ArrayUtils;
import org.jboss.test.selenium.locator.ExtendedLocator;
public class ModelIterable<E extends ExtendedLocator<E>, T extends
AbstractModel<E>> implements Iterable<T> {
@@ -43,8 +42,9 @@
public T next() {
ExtendedLocator<E> locator = iterator.next();
- try {
- constructorLoop: for (Constructor<?> constructor :
classT.getConstructors()) {
+ try {
+ constructorLoop:
+ for (Constructor<?> constructor : classT.getConstructors()) {
if
(ExtendedLocator.class.isAssignableFrom(constructor.getParameterTypes()[0])) {
if (constructorParamTypes.length ==
constructor.getParameterTypes().length - 1) {
Object[] params = new Object[constructorParamTypes.length +
1];
Modified:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/model/PanelMenu.java
===================================================================
---
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/model/PanelMenu.java 2011-05-17
23:53:24 UTC (rev 22498)
+++
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/model/PanelMenu.java 2011-05-19
07:46:35 UTC (rev 22499)
@@ -21,6 +21,9 @@
public class PanelMenu extends AbstractModel<JQueryLocator> implements Model {
AjaxSelenium selenium = AjaxSeleniumProxy.getInstance();
+
+ PanelMenuMode groupMode;
+ PanelMenuMode itemMode;
private ReferencedLocator<JQueryLocator> topItems = ref(root, ">
.rf-pm-top-itm");
private ReferencedLocator<JQueryLocator> topGroups = ref(root, ">
.rf-pm-top-gr");
@@ -29,9 +32,6 @@
private ReferencedLocator<JQueryLocator> anyDisabledItem = ref(root,
"div[class*=rf-pm-][class*=-itm-dis]");
private ReferencedLocator<JQueryLocator> anyDisabledGroup = ref(root,
"div[class*=rf-pm-][class*=-gr-dis]");
- PanelMenuMode groupMode;
- PanelMenuMode itemMode;
-
public PanelMenu(JQueryLocator root) {
super(root);
}
@@ -289,14 +289,14 @@
}
public abstract class Icon extends AbstractModel<JQueryLocator> {
+
+ ReferencedLocator<JQueryLocator> img = ref(root, "> img");
+ AttributeLocator<?> imgSrc = img.getAttribute(SRC);
public Icon(JQueryLocator root) {
super(root);
}
- ReferencedLocator<JQueryLocator> img = ref(root, "> img");
- AttributeLocator<?> imgSrc = img.getAttribute(SRC);
-
public abstract ElementLocator<JQueryLocator> getIcon();
public boolean isTransparent() {
Modified:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richAutocomplete/TestAutocompleteByKeys.java
===================================================================
---
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richAutocomplete/TestAutocompleteByKeys.java 2011-05-17
23:53:24 UTC (rev 22498)
+++
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richAutocomplete/TestAutocompleteByKeys.java 2011-05-19
07:46:35 UTC (rev 22499)
@@ -50,12 +50,7 @@
AutocompleteAttributes attributes = new AutocompleteAttributes();
Autocomplete autocomplete = new Autocomplete();
-
- @Override
- public URL getTestUrl() {
- return buildUrl(contextPath,
"faces/components/richAutocomplete/autocomplete.xhtml");
- }
-
+
@Inject
@Use(booleans = { true, false })
Boolean autofill;
@@ -68,6 +63,11 @@
StringBuilder partialInput;
+ @Override
+ public URL getTestUrl() {
+ return buildUrl(contextPath,
"faces/components/richAutocomplete/autocomplete.xhtml");
+ }
+
@BeforeMethod
public void prepareProperties() {
attributes.setAutofill(autofill);
Modified:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richCollapsibleSubTable/TestCollapsibleSubTableFiltering.java
===================================================================
---
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richCollapsibleSubTable/TestCollapsibleSubTableFiltering.java 2011-05-17
23:53:24 UTC (rev 22498)
+++
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richCollapsibleSubTable/TestCollapsibleSubTableFiltering.java 2011-05-19
07:46:35 UTC (rev 22499)
@@ -48,13 +48,13 @@
*/
public class TestCollapsibleSubTableFiltering extends AbstractCollapsibleSubTableTest {
+ int rows = 0;
+
@Override
public URL getTestUrl() {
return buildUrl(contextPath,
"faces/components/richCollapsibleSubTable/filtering.xhtml");
}
- int rows = 0;
-
@BeforeMethod
public void prepare() {
attributes.setRows(rows);
Modified:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richCollapsibleSubTable/TestCollapsibleSubTableSorting.java
===================================================================
---
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richCollapsibleSubTable/TestCollapsibleSubTableSorting.java 2011-05-17
23:53:24 UTC (rev 22498)
+++
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richCollapsibleSubTable/TestCollapsibleSubTableSorting.java 2011-05-19
07:46:35 UTC (rev 22499)
@@ -48,12 +48,7 @@
* @version $Revision$
*/
public class TestCollapsibleSubTableSorting extends AbstractCollapsibleSubTableTest {
-
- @Override
- public URL getTestUrl() {
- return buildUrl(contextPath,
"faces/components/richCollapsibleSubTable/sorting-using-column.xhtml");
- }
-
+
@Inject
@Use(enumeration = true)
SortMode sortMode;
@@ -61,6 +56,10 @@
int rows = 0;
List<Column> sortPriority = new LinkedList<Column>();
+ @Override
+ public URL getTestUrl() {
+ return buildUrl(contextPath,
"faces/components/richCollapsibleSubTable/sorting-using-column.xhtml");
+ }
@BeforeMethod
public void prepare() {
Modified:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richCollapsibleSubTableToggler/TestCollapsibleSubTableToggler.java
===================================================================
---
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richCollapsibleSubTableToggler/TestCollapsibleSubTableToggler.java 2011-05-17
23:53:24 UTC (rev 22498)
+++
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richCollapsibleSubTableToggler/TestCollapsibleSubTableToggler.java 2011-05-19
07:46:35 UTC (rev 22499)
@@ -1,4 +1,6 @@
+package org.richfaces.tests.metamer.ftest.richCollapsibleSubTableToggler;
/*******************************************************************************
+
* 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
@@ -19,12 +21,7 @@
* 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.richCollapsibleSubTableToggler;
-/**
- * @author <a href="mailto:lfryc@redhat.com">Lukas Fryc</a>
- * @version $Revision$
- */
import static org.jboss.test.selenium.dom.Event.DBLCLICK;
import static org.jboss.test.selenium.dom.Event.MOUSEDOWN;
import static org.jboss.test.selenium.dom.Event.MOUSEUP;
@@ -47,10 +44,17 @@
import org.richfaces.tests.metamer.ftest.model.DataTable;
import org.testng.annotations.Test;
+/**
+ * @author <a href="mailto:lfryc@redhat.com">Lukas Fryc</a>
+ * @version $Revision$
+ */
public class TestCollapsibleSubTableToggler extends AbstractMetamerTest {
- private final static String IMAGE_URL = "/resources/images/star.png";
- private final static String LABEL = "Label";
+ private static final String IMAGE_URL = "/resources/images/star.png";
+ private static final String LABEL = "Label";
+
+ CollapsibleSubTableTogglerAttributes attributes = new
CollapsibleSubTableTogglerAttributes();
+ DataTable dataTable = new DataTable(pjq("table.rf-dt"));
JQueryLocator link = jq("a");
JQueryLocator image = jq("img");
@@ -66,9 +70,6 @@
return buildUrl(contextPath,
"faces/components/richCollapsibleSubTableToggler/simple.xhtml");
}
- CollapsibleSubTableTogglerAttributes attributes = new
CollapsibleSubTableTogglerAttributes();
- DataTable dataTable = new DataTable(pjq("table.rf-dt"));
-
@Test
@Use(field = "event", value = "events")
public void testEvent() {
Modified:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richColumn/AbstractColumnModelTest.java
===================================================================
---
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richColumn/AbstractColumnModelTest.java 2011-05-17
23:53:24 UTC (rev 22498)
+++
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richColumn/AbstractColumnModelTest.java 2011-05-19
07:46:35 UTC (rev 22499)
@@ -27,7 +27,6 @@
import org.richfaces.tests.metamer.ftest.AbstractMetamerTest;
import org.richfaces.tests.metamer.model.Capital;
import org.testng.annotations.BeforeMethod;
-import org.testng.annotations.Test;
/**
* @author <a href="mailto:lfryc@redhat.com">Lukas Fryc</a>
Modified:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richColumn/AbstractColumnSortingTest.java
===================================================================
---
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richColumn/AbstractColumnSortingTest.java 2011-05-17
23:53:24 UTC (rev 22498)
+++
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richColumn/AbstractColumnSortingTest.java 2011-05-19
07:46:35 UTC (rev 22499)
@@ -53,6 +53,10 @@
case descending:
Collections.sort(capitals,
Collections.reverseOrder(RichColumnBean.STATE_NAME_LENGTH_COMPARATOR));
break;
+
+ default:
+ // default case required by checkstyle
+ break;
}
for (int i = 0; i < capitals.size(); i++) {
Modified:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richColumn/TestColumnFiltering.java
===================================================================
---
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richColumn/TestColumnFiltering.java 2011-05-17
23:53:24 UTC (rev 22498)
+++
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richColumn/TestColumnFiltering.java 2011-05-19
07:46:35 UTC (rev 22499)
@@ -44,15 +44,17 @@
*/
public class TestColumnFiltering extends AbstractColumnModelTest {
+ private static final String STATE_NAME = "Maryland";
+ JQueryLocator stateNameToFilter =
pjq("input:text[id$=stateNameToFilter]");
+ JQueryLocator tableWithFilter = pjq("table.rf-dt[id$=richDataTable1]");
+ JQueryLocator tableWithFilterExpression =
pjq("table.rf-dt[id$=richDataTable2]");
+ RichColumnBean richColumnBean = new RichColumnBean();
+
@Override
public URL getTestUrl() {
return buildUrl(contextPath,
"faces/components/richColumn/filtering.xhtml");
}
- JQueryLocator stateNameToFilter =
pjq("input:text[id$=stateNameToFilter]");
- private final static String stateName = "Maryland";
- JQueryLocator tableWithFilter = pjq("table.rf-dt[id$=richDataTable1]");
- JQueryLocator tableWithFilterExpression =
pjq("table.rf-dt[id$=richDataTable2]");
-
+
@Test
public void testFilterAttribute() {
model.setRoot(tableWithFilter);
@@ -66,8 +68,8 @@
}
public void testFiltering() {
- for (int i = 1; i <= stateName.length(); i++) {
- String namePart = stateName.substring(0, i);
+ for (int i = 1; i <= STATE_NAME.length(); i++) {
+ String namePart = STATE_NAME.substring(0, i);
selenium.type(stateNameToFilter, namePart);
guardXhr(selenium).fireEvent(stateNameToFilter, Event.KEYUP);
@@ -86,8 +88,7 @@
assertEqualsCapitals(actualCapitals, expectedCapitals);
}
}
- RichColumnBean richColumnBean = new RichColumnBean();
-
+
private void assertEqualsCapitals(Collection<Capital> actualCapitals,
Collection<Capital> expectedCapitals) {
assertEquals(actualCapitals.size(), expectedCapitals.size());
Modified:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richDataGrid/AbstractScrollerTest.java
===================================================================
---
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richDataGrid/AbstractScrollerTest.java 2011-05-17
23:53:24 UTC (rev 22498)
+++
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richDataGrid/AbstractScrollerTest.java 2011-05-19
07:46:35 UTC (rev 22499)
@@ -78,7 +78,7 @@
}
@Use(field = "columns", ints = { 1, 3, 11, ELEMENTS_TOTAL / 2,
ELEMENTS_TOTAL - 1, ELEMENTS_TOTAL,
- ELEMENTS_TOTAL + 1 })
+ ELEMENTS_TOTAL + 1 })
public void testColumnsAttribute() {
paginationTester.testNumberedPages();
}
Modified:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richDataGrid/TestSimple.java
===================================================================
---
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richDataGrid/TestSimple.java 2011-05-17
23:53:24 UTC (rev 22498)
+++
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richDataGrid/TestSimple.java 2011-05-19
07:46:35 UTC (rev 22499)
@@ -50,7 +50,7 @@
@Test
@Use(field = "columns", ints = { 1, 3, 11, ELEMENTS_TOTAL / 2,
ELEMENTS_TOTAL - 1, ELEMENTS_TOTAL,
- ELEMENTS_TOTAL + 1 })
+ ELEMENTS_TOTAL + 1 })
public void testColumnsAttribute() {
verifyGrid();
}
Modified:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richDragIndicator/Indicator.java
===================================================================
---
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richDragIndicator/Indicator.java 2011-05-17
23:53:24 UTC (rev 22498)
+++
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richDragIndicator/Indicator.java 2011-05-19
07:46:35 UTC (rev 22499)
@@ -121,6 +121,9 @@
verifyCustomClass(acceptClass, false);
verifyCustomClass(rejectClass, true);
break;
+ default:
+ // default case required by checkstyle
+ break;
}
}
Modified:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richDragIndicator/TestDragIndicator.java
===================================================================
---
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richDragIndicator/TestDragIndicator.java 2011-05-17
23:53:24 UTC (rev 22498)
+++
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richDragIndicator/TestDragIndicator.java 2011-05-19
07:46:35 UTC (rev 22499)
@@ -39,9 +39,9 @@
*/
public class TestDragIndicator extends AbstractDragNDropTest {
- private final static String ACCEPT_CLASS = "sample-accept-class";
- private final static String REJECT_CLASS = "sample-reject-class";
- private final static String DRAGGING_CLASS = "sample-dragging-class";
+ private static final String ACCEPT_CLASS = "sample-accept-class";
+ private static final String REJECT_CLASS = "sample-reject-class";
+ private static final String DRAGGING_CLASS = "sample-dragging-class";
private DragIndicatorAttributes attributes = new DragIndicatorAttributes();
Modified:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richDropTarget/TestDropTarget.java
===================================================================
---
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richDropTarget/TestDropTarget.java 2011-05-17
23:53:24 UTC (rev 22498)
+++
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richDropTarget/TestDropTarget.java 2011-05-19
07:46:35 UTC (rev 22499)
@@ -56,6 +56,13 @@
*/
public class TestDropTarget extends AbstractDragNDropTest {
+ TextRetriever retrieveDrop1 = retrieveText.locator(drop1);
+ TextRetriever retrieveDrop2 = retrieveText.locator(drop2);
+
+ JQueryLocator clientId = jq("span[id$=:clientId]");
+ JQueryLocator dragValue = jq("span[id$=:dragValue]");
+ JQueryLocator dropValue = jq("span[id$=:dropValue]");
+
private DropTargetAttributes attributes = new DropTargetAttributes();
@Override
@@ -63,13 +70,6 @@
return buildUrl(contextPath,
"faces/components/richDropTarget/simple.xhtml");
}
- TextRetriever retrieveDrop1 = retrieveText.locator(drop1);
- TextRetriever retrieveDrop2 = retrieveText.locator(drop2);
-
- JQueryLocator clientId = jq("span[id$=:clientId]");
- JQueryLocator dragValue = jq("span[id$=:dragValue]");
- JQueryLocator dropValue = jq("span[id$=:dropValue]");
-
@Test
public void testAcceptedTypes() {
attributes.setAcceptedTypes("drg2");
Modified:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richInputNumberSlider/AbstractSliderTest.java
===================================================================
---
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richInputNumberSlider/AbstractSliderTest.java 2011-05-17
23:53:24 UTC (rev 22498)
+++
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richInputNumberSlider/AbstractSliderTest.java 2011-05-19
07:46:35 UTC (rev 22499)
@@ -29,14 +29,12 @@
import java.net.URL;
-import org.jboss.test.selenium.css.CssProperty;
import org.jboss.test.selenium.encapsulated.JavaScript;
import org.jboss.test.selenium.geometry.Point;
import org.jboss.test.selenium.locator.JQueryLocator;
import org.richfaces.tests.metamer.ftest.AbstractMetamerTest;
import org.richfaces.tests.metamer.ftest.annotations.Inject;
import org.richfaces.tests.metamer.ftest.annotations.Use;
-import org.testng.annotations.Test;
/**
* Abstract test case for rich:inputNumberSlider.
Modified:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richInputNumberSpinner/AbstractSpinnerTest.java
===================================================================
---
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richInputNumberSpinner/AbstractSpinnerTest.java 2011-05-17
23:53:24 UTC (rev 22498)
+++
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richInputNumberSpinner/AbstractSpinnerTest.java 2011-05-19
07:46:35 UTC (rev 22499)
@@ -25,15 +25,12 @@
import static org.jboss.test.selenium.guard.request.RequestTypeGuardFactory.guardXhr;
import static org.testng.Assert.assertEquals;
-
-
import org.jboss.test.selenium.encapsulated.JavaScript;
import org.jboss.test.selenium.locator.ElementLocator;
import org.jboss.test.selenium.locator.JQueryLocator;
import org.richfaces.tests.metamer.ftest.AbstractMetamerTest;
import org.richfaces.tests.metamer.ftest.annotations.Inject;
import org.richfaces.tests.metamer.ftest.annotations.Use;
-import org.testng.annotations.Test;
/**
* Abstract test case for rich:inputNumberSpinner.
Modified:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richInputNumberSpinner/TestRichSpinnerFAjax.java
===================================================================
---
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richInputNumberSpinner/TestRichSpinnerFAjax.java 2011-05-17
23:53:24 UTC (rev 22498)
+++
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richInputNumberSpinner/TestRichSpinnerFAjax.java 2011-05-19
07:46:35 UTC (rev 22499)
@@ -21,13 +21,10 @@
*******************************************************************************/
package org.richfaces.tests.metamer.ftest.richInputNumberSpinner;
-import static org.jboss.test.selenium.guard.request.RequestTypeGuardFactory.guardXhr;
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.richfaces.tests.metamer.ftest.annotations.Use;
import org.testng.annotations.Test;
Modified:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richList/AbstractListTest.java
===================================================================
---
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richList/AbstractListTest.java 2011-05-17
23:53:24 UTC (rev 22498)
+++
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richList/AbstractListTest.java 2011-05-19
07:46:35 UTC (rev 22499)
@@ -27,11 +27,11 @@
import org.testng.annotations.BeforeMethod;
public abstract class AbstractListTest extends AbstractMetamerTest {
- protected static List<Employee> EMPLOYESS = Model.unmarshallEmployees();
- protected static final int ELEMENTS_TOTAL = EMPLOYESS.size();
- protected static final Event[] events = { CLICK, DBLCLICK, KEYDOWN, KEYPRESS, KEYUP,
MOUSEDOWN, MOUSEMOVE,
+ protected static List<Employee> employees = Model.unmarshallEmployees();
+ protected static final int ELEMENTS_TOTAL = employees.size();
+ protected static final Event[] EVENTS = { CLICK, DBLCLICK, KEYDOWN, KEYPRESS, KEYUP,
MOUSEDOWN, MOUSEMOVE,
MOUSEOUT, MOUSEOVER, MOUSEUP };
- protected static final Integer[] ints = { -1, 0, 1, ELEMENTS_TOTAL / 2,
ELEMENTS_TOTAL - 1, ELEMENTS_TOTAL,
+ protected static final Integer[] INTS = { -1, 0, 1, ELEMENTS_TOTAL / 2,
ELEMENTS_TOTAL - 1, ELEMENTS_TOTAL,
ELEMENTS_TOTAL + 1 };
ListModel list;
@@ -126,7 +126,7 @@
expectedEnd = rows - 1;
}
- expectedEmployees = EMPLOYESS.subList(expectedBegin, expectedBegin +
displayedRows);
+ expectedEmployees = employees.subList(expectedBegin, expectedBegin +
displayedRows);
}
private int minMax(int min, int value, int max) {
Modified:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richList/ListModel.java
===================================================================
---
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richList/ListModel.java 2011-05-17
23:53:24 UTC (rev 22498)
+++
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richList/ListModel.java 2011-05-19
07:46:35 UTC (rev 22499)
@@ -37,15 +37,15 @@
*/
public class ListModel extends AbstractModel<JQueryLocator> {
- public ListModel(JQueryLocator root) {
- super(root);
- }
-
ListType type;
ReferencedLocator<JQueryLocator> rows = ref(root, "li");
private AjaxSelenium selenium = AjaxSeleniumProxy.getInstance();
+
+ public ListModel(JQueryLocator root) {
+ super(root);
+ }
public ListType getType() {
return type;
@@ -83,6 +83,10 @@
return jq("li.rf-ulst-itm");
case definitions:
return jq("dd.rf-dlst-dfn");
+ default:
+ // default case required by checkstyle.
+ // Kept Exception throw as without 'default'
+ break;
}
throw new IllegalStateException();
}
Modified:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richMessage/AbstractRichMessageTest.java
===================================================================
---
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richMessage/AbstractRichMessageTest.java 2011-05-17
23:53:24 UTC (rev 22498)
+++
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richMessage/AbstractRichMessageTest.java 2011-05-19
07:46:35 UTC (rev 22499)
@@ -46,18 +46,20 @@
*/
public abstract class AbstractRichMessageTest extends AbstractMetamerTest {
+ // component's locators
+ protected static JQueryLocator message4Input1 =
pjq("span[id$=simpleInputMsg1]");
+ protected static JQueryLocator message4Input2 =
pjq("span[id$=simpleInputMsg2]");
+ protected static JQueryLocator messages = pjq("span[id$=msgs]");
+
private static Logger logger =
LoggerFactory.getLogger(AbstractRichMessageTest.class);
+
protected RichMessageComponentAttributes attributes = new
RichMessageComponentAttributes();
// controls
protected JQueryLocator wrongValuesBtn =
pjq("input[type=button][id$=setWrongValuesButton]");
protected JQueryLocator correctValuesBtn =
pjq("input[type=button][id$=setCorrectValuesButton]");
protected JQueryLocator hCommandBtn = pjq("input[id$=hButton]");
protected JQueryLocator a4jCommandBtn = pjq("input[id$=a4jButton]");
- // component's locators
- protected static JQueryLocator message4Input1 =
pjq("span[id$=simpleInputMsg1]");
- protected static JQueryLocator message4Input2 =
pjq("span[id$=simpleInputMsg2]");
- protected static JQueryLocator messages = pjq("span[id$=msgs]");
-
+
/**
* Because of message and messages have many attributes very similar,
* this method helps test method distinguish between metamer
@@ -165,7 +167,9 @@
}
protected void waitForAttribute(RichMessageAttributes attr) {
- waitGui.until(attributeEquals.locator(getTestElemLocator().getAttribute(new
Attribute(attr.toString()))).text(attr.toString()));
+ waitGui.until(attributeEquals.locator(
+ getTestElemLocator().getAttribute(new Attribute(attr.toString())))
+ .text(attr.toString()));
}
// ==================== test methods ====================
Modified:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richPanelMenu/TestPanelMenuIcon.java
===================================================================
---
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richPanelMenu/TestPanelMenuIcon.java 2011-05-17
23:53:24 UTC (rev 22498)
+++
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richPanelMenu/TestPanelMenuIcon.java 2011-05-19
07:46:35 UTC (rev 22499)
@@ -32,41 +32,41 @@
*/
public class TestPanelMenuIcon extends AbstractPanelMenuTest {
- private static String CUSTOM_URL = "/resources/images/loading.gif";
+ private static String customURL = "/resources/images/loading.gif";
@Test
public void testGroupCollapsedLeftIcon() {
- attributes.setGroupCollapsedLeftIcon(CUSTOM_URL);
+ attributes.setGroupCollapsedLeftIcon(customURL);
group2.toggle();
verifyIcon(group24.getLeftIcon());
}
@Test
public void testGroupCollapsedRightIcon() {
- attributes.setGroupCollapsedRightIcon(CUSTOM_URL);
+ attributes.setGroupCollapsedRightIcon(customURL);
group2.toggle();
verifyIcon(group24.getRightIcon());
}
@Test
public void testGroupDisabledLeftIcon() {
- attributes.setGroupDisabledLeftIcon(CUSTOM_URL);
+ attributes.setGroupDisabledLeftIcon(customURL);
group2.toggle();
assertTrue(group26.getLeftIcon().isCustomURL());
- assertTrue(group26.getLeftIcon().getCustomURL().endsWith(CUSTOM_URL));
+ assertTrue(group26.getLeftIcon().getCustomURL().endsWith(customURL));
verifyIcon(group26.getLeftIcon());
}
@Test
public void testDisabledRightIcon() {
- attributes.setGroupDisabledRightIcon(CUSTOM_URL);
+ attributes.setGroupDisabledRightIcon(customURL);
group2.toggle();
verifyIcon(group26.getRightIcon());
}
@Test
public void testGroupExpandedLeftIcon() {
- attributes.setGroupExpandedLeftIcon(CUSTOM_URL);
+ attributes.setGroupExpandedLeftIcon(customURL);
group2.toggle();
group24.toggle();
verifyIcon(group24.getLeftIcon());
@@ -74,7 +74,7 @@
@Test
public void testGroupExpandedRightIcon() {
- attributes.setGroupExpandedRightIcon(CUSTOM_URL);
+ attributes.setGroupExpandedRightIcon(customURL);
group2.toggle();
group24.toggle();
verifyIcon(group24.getRightIcon());
@@ -82,96 +82,96 @@
@Test
public void testItemDisabledLeftIcon() {
- attributes.setItemDisabledLeftIcon(CUSTOM_URL);
+ attributes.setItemDisabledLeftIcon(customURL);
group2.toggle();
verifyIcon(item25.getLeftIcon());
}
@Test
public void testItemDisabledRightIcon() {
- attributes.setItemDisabledRightIcon(CUSTOM_URL);
+ attributes.setItemDisabledRightIcon(customURL);
group2.toggle();
verifyIcon(item25.getRightIcon());
}
@Test
public void testItemLeftIcon() {
- attributes.setItemLeftIcon(CUSTOM_URL);
+ attributes.setItemLeftIcon(customURL);
group2.toggle();
verifyIcon(item22.getLeftIcon());
}
@Test
public void testItemRightIcon() {
- attributes.setItemRightIcon(CUSTOM_URL);
+ attributes.setItemRightIcon(customURL);
group2.toggle();
verifyIcon(item22.getRightIcon());
}
@Test
public void testTopGroupCollapsedLeftIcon() {
- attributes.setTopGroupCollapsedLeftIcon(CUSTOM_URL);
+ attributes.setTopGroupCollapsedLeftIcon(customURL);
verifyIcon(group1.getLeftIcon());
}
@Test
public void testTopGroupCollapsedRightIcon() {
- attributes.setTopGroupCollapsedRightIcon(CUSTOM_URL);
+ attributes.setTopGroupCollapsedRightIcon(customURL);
verifyIcon(group1.getRightIcon());
}
@Test
public void testTopGroupDisabledLeftIcon() {
- attributes.setTopGroupDisabledLeftIcon(CUSTOM_URL);
+ attributes.setTopGroupDisabledLeftIcon(customURL);
verifyIcon(group4.getLeftIcon());
}
@Test
public void testTopGroupDisabledRightIcon() {
- attributes.setTopGroupDisabledRightIcon(CUSTOM_URL);
+ attributes.setTopGroupDisabledRightIcon(customURL);
verifyIcon(group4.getRightIcon());
}
@Test
public void testTopGroupExpandedLeftIcon() {
- attributes.setTopGroupExpandedLeftIcon(CUSTOM_URL);
+ attributes.setTopGroupExpandedLeftIcon(customURL);
group1.toggle();
verifyIcon(group1.getLeftIcon());
}
@Test
public void testTopGroupExpandedRightIcon() {
- attributes.setTopGroupExpandedRightIcon(CUSTOM_URL);
+ attributes.setTopGroupExpandedRightIcon(customURL);
group1.toggle();
verifyIcon(group1.getRightIcon());
}
@Test
public void testTopItemDisabledLeftIcon() {
- attributes.setTopItemDisabledLeftIcon(CUSTOM_URL);
+ attributes.setTopItemDisabledLeftIcon(customURL);
verifyIcon(item4.getLeftIcon());
}
@Test
public void testTopItemDisabledRightIcon() {
- attributes.setTopItemDisabledRightIcon(CUSTOM_URL);
+ attributes.setTopItemDisabledRightIcon(customURL);
verifyIcon(item4.getRightIcon());
}
@Test
public void testTopItemLeftIcon() {
- attributes.setTopItemLeftIcon(CUSTOM_URL);
+ attributes.setTopItemLeftIcon(customURL);
verifyIcon(item3.getLeftIcon());
}
@Test
public void testTopItemRightIcon() {
- attributes.setTopItemRightIcon(CUSTOM_URL);
+ attributes.setTopItemRightIcon(customURL);
verifyIcon(item3.getRightIcon());
}
private void verifyIcon(Icon icon) {
assertTrue(icon.isCustomURL());
- assertTrue(icon.getCustomURL().endsWith(CUSTOM_URL));
+ assertTrue(icon.getCustomURL().endsWith(customURL));
}
}
Modified:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richPanelMenuGroup/TestPanelMenuGroupClientSideHandlers.java
===================================================================
---
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richPanelMenuGroup/TestPanelMenuGroupClientSideHandlers.java 2011-05-17
23:53:24 UTC (rev 22498)
+++
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richPanelMenuGroup/TestPanelMenuGroupClientSideHandlers.java 2011-05-19
07:46:35 UTC (rev 22499)
@@ -40,6 +40,8 @@
* @version $Revision$
*/
public class TestPanelMenuGroupClientSideHandlers extends AbstractPanelMenuGroupTest {
+
+ PanelMenu.Group group1 = menu.getGroupContains("Group 1");
@Inject
@Use(empty = true)
@@ -59,8 +61,7 @@
public URL getTestUrl() {
return buildUrl(contextPath,
"faces/components/richPanelMenuGroup/simple.xhtml");
}
- PanelMenu.Group group1 = menu.getGroupContains("Group 1");
-
+
@Test
@Use(field = "event", value = "ajaxCollapsionEvents")
public void testClientSideCollapsionEvent() {
Modified:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richPanelMenuGroup/TestPanelMenuGroupSimple.java
===================================================================
---
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richPanelMenuGroup/TestPanelMenuGroupSimple.java 2011-05-17
23:53:24 UTC (rev 22498)
+++
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richPanelMenuGroup/TestPanelMenuGroupSimple.java 2011-05-19
07:46:35 UTC (rev 22499)
@@ -16,9 +16,9 @@
*/
public class TestPanelMenuGroupSimple extends AbstractPanelMenuGroupTest {
- private static String SAMPLE_IMAGE = "/resources/images/loading.gif";
- private static String CHEVRON_DOWN = "chevronDown";
- private static String CHEVRON_DOWN_CLASS = "rf-ico-chevron-down";
+ private static String sampleImage = "/resources/images/loading.gif";
+ private static String chevronDown = "chevronDown";
+ private static String chevronDownClass = "rf-ico-chevron-down";
@Test
public void testData() {
@@ -60,7 +60,7 @@
@Test
public void testLeftDisabledIcon() {
- attributes.setLeftDisabledIcon(SAMPLE_IMAGE);
+ attributes.setLeftDisabledIcon(sampleImage);
assertTrue(leftIcon.isTransparent());
assertFalse(leftIcon.isCustomURL());
@@ -68,16 +68,16 @@
attributes.setDisabled(true);
assertTrue(leftIcon.isCustomURL());
- assertTrue(leftIcon.getCustomURL().endsWith(SAMPLE_IMAGE));
+ assertTrue(leftIcon.getCustomURL().endsWith(sampleImage));
}
@Test
public void testLeftCollapsedIcon() {
- attributes.setLeftCollapsedIcon(CHEVRON_DOWN);
+ attributes.setLeftCollapsedIcon(chevronDown);
topGroup.toggle();
- assertTrue(leftIcon.containsClass(CHEVRON_DOWN_CLASS));
+ assertTrue(leftIcon.containsClass(chevronDownClass));
attributes.setDisabled(true);
@@ -86,9 +86,9 @@
@Test
public void testLeftExpandedIcon() {
- attributes.setLeftExpandedIcon(CHEVRON_DOWN);
+ attributes.setLeftExpandedIcon(chevronDown);
- assertTrue(leftIcon.containsClass(CHEVRON_DOWN_CLASS));
+ assertTrue(leftIcon.containsClass(chevronDownClass));
attributes.setDisabled(true);
@@ -118,7 +118,7 @@
@Test
public void testRightDisabledIcon() {
- attributes.setRightDisabledIcon(SAMPLE_IMAGE);
+ attributes.setRightDisabledIcon(sampleImage);
assertTrue(rightIcon.isTransparent());
assertFalse(rightIcon.isCustomURL());
@@ -126,14 +126,14 @@
attributes.setDisabled(true);
assertTrue(rightIcon.isCustomURL());
- assertTrue(rightIcon.getCustomURL().endsWith(SAMPLE_IMAGE));
+ assertTrue(rightIcon.getCustomURL().endsWith(sampleImage));
}
@Test
public void testRightExpandedIcon() {
- attributes.setRightExpandedIcon(CHEVRON_DOWN);
+ attributes.setRightExpandedIcon(chevronDown);
- assertTrue(rightIcon.containsClass(CHEVRON_DOWN_CLASS));
+ assertTrue(rightIcon.containsClass(chevronDownClass));
attributes.setDisabled(true);
@@ -142,11 +142,11 @@
@Test
public void testRightCollapsedIcon() {
- attributes.setRightCollapsedIcon(CHEVRON_DOWN);
+ attributes.setRightCollapsedIcon(chevronDown);
topGroup.toggle();
- assertTrue(rightIcon.containsClass(CHEVRON_DOWN_CLASS));
+ assertTrue(rightIcon.containsClass(chevronDownClass));
attributes.setDisabled(true);
Modified:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richPanelMenuItem/TestPanelMenuItemSimple.java
===================================================================
---
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richPanelMenuItem/TestPanelMenuItemSimple.java 2011-05-17
23:53:24 UTC (rev 22498)
+++
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richPanelMenuItem/TestPanelMenuItemSimple.java 2011-05-19
07:46:35 UTC (rev 22499)
@@ -22,9 +22,9 @@
*/
public class TestPanelMenuItemSimple extends AbstractMetamerTest {
- private static String SAMPLE_IMAGE = "/resources/images/loading.gif";
- private static String CHEVRON_DOWN = "chevronDown";
- private static String CHEVRON_DOWN_CLASS = "rf-ico-chevron-down";
+ private static String sampleImage = "/resources/images/loading.gif";
+ private static String chevronDown = "chevronDown";
+ private static String chevronDownClass = "rf-ico-chevron-down";
PanelMenuItemAttributes attributes = new PanelMenuItemAttributes();
PanelMenu menu = new PanelMenu(pjq("div.rf-pm[id$=panelMenu]"));
@@ -83,7 +83,7 @@
@Test
public void testLeftDisabledIcon() {
- attributes.setLeftDisabledIcon(SAMPLE_IMAGE);
+ attributes.setLeftDisabledIcon(sampleImage);
assertTrue(leftIcon.isTransparent());
assertFalse(leftIcon.isCustomURL());
@@ -91,14 +91,14 @@
attributes.setDisabled(true);
assertTrue(leftIcon.isCustomURL());
- assertTrue(leftIcon.getCustomURL().endsWith(SAMPLE_IMAGE));
+ assertTrue(leftIcon.getCustomURL().endsWith(sampleImage));
}
@Test
public void testLeftIcon() {
- attributes.setLeftIcon(CHEVRON_DOWN);
+ attributes.setLeftIcon(chevronDown);
- assertTrue(leftIcon.containsClass(CHEVRON_DOWN_CLASS));
+ assertTrue(leftIcon.containsClass(chevronDownClass));
attributes.setDisabled(true);
@@ -133,7 +133,7 @@
@Test
public void testRightDisabledIcon() {
- attributes.setRightDisabledIcon(SAMPLE_IMAGE);
+ attributes.setRightDisabledIcon(sampleImage);
assertTrue(rightIcon.isTransparent());
assertFalse(rightIcon.isCustomURL());
@@ -141,15 +141,15 @@
attributes.setDisabled(true);
assertTrue(rightIcon.isCustomURL());
- assertTrue(rightIcon.getCustomURL().endsWith(SAMPLE_IMAGE));
+ assertTrue(rightIcon.getCustomURL().endsWith(sampleImage));
}
@Test
@IssueTracking("https://issues.jboss.org/browse/RF-10519")
public void testRightIcon() {
- attributes.setRightIcon(CHEVRON_DOWN);
+ attributes.setRightIcon(chevronDown);
- assertTrue(rightIcon.containsClass(CHEVRON_DOWN_CLASS));
+ assertTrue(rightIcon.containsClass(chevronDownClass));
attributes.setDisabled(true);
Modified:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTooltip/TestTooltipSimple.java
===================================================================
---
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTooltip/TestTooltipSimple.java 2011-05-17
23:53:24 UTC (rev 22498)
+++
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTooltip/TestTooltipSimple.java 2011-05-19
07:46:35 UTC (rev 22499)
@@ -171,7 +171,9 @@
case LEFT:
assertEquals(tooltipPosition.getX() + tooltipDimension.getWidth(),
eventPosition.getX()
- horizontalOffset);
+ break;
default:
+ break;
}
}
@@ -183,7 +185,9 @@
case TOP:
assertEquals(tooltipPosition.getY() + tooltipDimension.getHeight(),
eventPosition.getY()
- verticalOffset);
+ break;
default:
+ break;
}
}
}
Modified:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTree/AbstractTreeNodeModel.java
===================================================================
---
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTree/AbstractTreeNodeModel.java 2011-05-17
23:53:24 UTC (rev 22498)
+++
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTree/AbstractTreeNodeModel.java 2011-05-19
07:46:35 UTC (rev 22499)
@@ -36,24 +36,24 @@
* @version $Revision$
*/
public class AbstractTreeNodeModel extends AbstractModel<JQueryLocator> {
-
- public AbstractTreeNodeModel(JQueryLocator root) {
- super(root);
- }
-
- private AjaxSelenium selenium = AjaxSeleniumProxy.getInstance();
- protected TreeModel tree;
-
+
static JQueryLocator treeNode = jq("div.rf-tr-nd");
static JQueryLocator treeNodeExpanded = jq("div.rf-tr-nd-exp");
static JQueryLocator treeNodeCollapsed = jq("div.rf-tr-nd-colps");
static JQueryLocator treeNodeSelected = jq("div.rf-tr-nd:has(> .rf-trn >
.rf-trn-sel)");
-
+
+ protected TreeModel tree;
ReferencedLocator<JQueryLocator> nodes = ref(root, "> " +
treeNode.getRawLocator());
ReferencedLocator<JQueryLocator> anyNodes = ref(root,
treeNode.getRawLocator());
ReferencedLocator<JQueryLocator> nodesCollapsed = ref(root, "> " +
treeNodeCollapsed.getRawLocator());
ReferencedLocator<JQueryLocator> nodesExpanded = ref(root, "> " +
treeNodeExpanded.getRawLocator());
ReferencedLocator<JQueryLocator> anyNodesSelected = ref(root,
treeNodeSelected.getRawLocator());
+
+ private AjaxSelenium selenium = AjaxSeleniumProxy.getInstance();
+
+ public AbstractTreeNodeModel(JQueryLocator root) {
+ super(root);
+ }
public Iterable<TreeNodeModel> getNodes() {
Iterable<TreeNodeModel> result = new ModelIterable<JQueryLocator,
TreeNodeModel>(nodes.getAllOccurrences(),
Modified:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTree/TestTreeSelection.java
===================================================================
---
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTree/TestTreeSelection.java 2011-05-17
23:53:24 UTC (rev 22498)
+++
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTree/TestTreeSelection.java 2011-05-19
07:46:35 UTC (rev 22499)
@@ -50,14 +50,9 @@
@Use(field = "selectionPaths", value = "")
public class TestTreeSelection extends AbstractMetamerTest {
- protected Integer[][] selectionPaths = new Integer[][] { { 2, 3 }, { 3, 4 }, { 4, 1,
1 }, { 4 }, { 4, 1 },
- { 1, 5 }, { 2, 3, 3 } };
-
- @Override
- public URL getTestUrl() {
- return buildUrl(contextPath,
"faces/components/richTree/simple.xhtml");
- }
-
+ protected Integer[][] selectionPaths = new Integer[][] {{2, 3}, {3, 4}, {4, 1, 1},
{4}, {4, 1},
+ {1, 5 }, {2, 3, 3 } };
+
protected TreeAttributes treeAttributes = new
TreeAttributes(jq("span[id*=attributes]"));
protected TreeModel tree = new TreeModel(pjq("div.rf-tr[id$=richTree]"));
protected TreeNodeModel treeNode;
@@ -65,8 +60,8 @@
@Inject
@Use(value = "selectionTypes")
SwitchType selectionType;
- SwitchType[] selectionTypes = new SwitchType[] { SwitchType.ajax, SwitchType.client
};
- SwitchType[] eventEnabledSelectionTypes = new SwitchType[] { SwitchType.ajax };
+ SwitchType[] selectionTypes = new SwitchType[] {SwitchType.ajax, SwitchType.client};
+ SwitchType[] eventEnabledSelectionTypes = new SwitchType[] {SwitchType.ajax};
JQueryLocator expandAll = jq("input:submit[id$=expandAll]");
JQueryLocator selection = jq("span[id$=selection]");
@@ -74,6 +69,12 @@
JQueryLocator newSelection = jq("span[id$=selectionEventNewSelection]");
JQueryLocator oldSelection = jq("span[id$=selectionEventOldSelection]");
+
+ @Override
+ public URL getTestUrl() {
+ return buildUrl(contextPath,
"faces/components/richTree/simple.xhtml");
+ }
+
@BeforeMethod
public void testInitialize() {
treeAttributes.setSelectionType(selectionType);
Modified:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTree/TestTreeSimple.java
===================================================================
---
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTree/TestTreeSimple.java 2011-05-17
23:53:24 UTC (rev 22498)
+++
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTree/TestTreeSimple.java 2011-05-19
07:46:35 UTC (rev 22499)
@@ -64,18 +64,26 @@
* @version $Revision$
*/
public class TestTreeSimple extends AbstractMetamerTest {
+
+ private static final String IMAGE_URL = "/resources/images/loading.gif";
+
+ SeleniumCondition treeNodeExpanded = new SeleniumCondition() {
- private final static String IMAGE_URL = "/resources/images/loading.gif";
+ @Override
+ public boolean isTrue() {
+ return treeNode.isExpanded();
+ }
+ };
@Inject
@Use(empty = true)
Event eventToFire;
- Event[] eventsToFire = new Event[] { MOUSEDOWN, MOUSEUP, MOUSEOVER, MOUSEOUT };
+ Event[] eventsToFire = new Event[] {MOUSEDOWN, MOUSEUP, MOUSEOVER, MOUSEOUT};
@Inject
@Use(empty = true)
Event domEvent;
- Event[] domEvents = { CLICK, DBLCLICK, KEYDOWN, KEYPRESS, KEYUP, MOUSEDOWN,
MOUSEMOVE, MOUSEOUT, MOUSEOVER, MOUSEUP };
+ Event[] domEvents = {CLICK, DBLCLICK, KEYDOWN, KEYPRESS, KEYUP, MOUSEDOWN, MOUSEMOVE,
MOUSEOUT, MOUSEOVER, MOUSEUP};
TreeModel tree = new TreeModel(pjq("div.rf-tr[id$=richTree]"));
TreeNodeModel treeNode;
@@ -333,14 +341,6 @@
}
}
- SeleniumCondition treeNodeExpanded = new SeleniumCondition() {
-
- @Override
- public boolean isTrue() {
- return treeNode.isExpanded();
- }
- };
-
private void fireEvent(ElementLocator<?> target, Event eventToFire, Event
eventToSetup) {
RequestType requestType = (eventToFire == eventToSetup) ? RequestType.XHR :
RequestType.NONE;
if (eventToFire == MOUSEDOWN) {
@@ -381,7 +381,9 @@
treeNode2.expand();
}
}
+ break;
default:
+ break;
}
}
}
Modified:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTree/TestTreeToggling.java
===================================================================
---
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTree/TestTreeToggling.java 2011-05-17
23:53:24 UTC (rev 22498)
+++
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTree/TestTreeToggling.java 2011-05-19
07:46:35 UTC (rev 22499)
@@ -45,15 +45,15 @@
private static final int TOP_LEVEL_NODES = 4;
- protected int[][] paths = new int[][] { { 3, 2, 1 }, { 2, 4, 1 } };
-
+ protected int[][] paths = new int[][] {{3, 2, 1 }, {2, 4, 1 }};
protected TreeAttributes treeAttributes = new
TreeAttributes(jq("span[id*=attributes]"));
- private TreeModel tree = new TreeModel(pjq("div.rf-tr[id$=richTree]"));
- private TreeNodeModel treeNode;
-
+
@Inject
@Use(enumeration = true)
SwitchType toggleType = SwitchType.ajax;
+
+ private TreeModel tree = new TreeModel(pjq("div.rf-tr[id$=richTree]"));
+ private TreeNodeModel treeNode;
@Override
public URL getTestUrl() {
Modified:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTreeModelAdaptor/TestTreeModelAdaptorLazyLoading.java
===================================================================
---
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTreeModelAdaptor/TestTreeModelAdaptorLazyLoading.java 2011-05-17
23:53:24 UTC (rev 22498)
+++
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTreeModelAdaptor/TestTreeModelAdaptorLazyLoading.java 2011-05-19
07:46:35 UTC (rev 22499)
@@ -48,19 +48,20 @@
* @version $Revision$
*/
public class TestTreeModelAdaptorLazyLoading extends AbstractMetamerTest {
- @Override
- public URL getTestUrl() {
- return buildUrl(contextPath,
"faces/components/richTree/treeAdaptors.xhtml");
- }
-
+
protected TreeAttributes treeAttributes = new
TreeAttributes(jq("span[id*=treeAttributes]"));
protected TreeModel tree = new TreeModel(pjq("div.rf-tr[id$=richTree]"));
protected TreeNodeModel treeNode;
+
+ protected Integer[][] paths = new Integer[][] {{1, 1, 1, 8, 1}, {4, 4, 11, 4}};
JQueryLocator lazyInitialized = pjq("span[id$=lazyInitialized]");
+
+ @Override
+ public URL getTestUrl() {
+ return buildUrl(contextPath,
"faces/components/richTree/treeAdaptors.xhtml");
+ }
- protected Integer[][] paths = new Integer[][] { { 1, 1, 1, 8, 1 }, { 4, 4, 11, 4 }
};
-
@Test
public void testLazyLoading() {
List<String> expected = getListOfVisibleNodes();
Modified:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTreeModelAdaptor/TestTreeModelAdaptorSelection.java
===================================================================
---
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTreeModelAdaptor/TestTreeModelAdaptorSelection.java 2011-05-17
23:53:24 UTC (rev 22498)
+++
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTreeModelAdaptor/TestTreeModelAdaptorSelection.java 2011-05-19
07:46:35 UTC (rev 22499)
@@ -47,19 +47,19 @@
public class TestTreeModelAdaptorSelection extends TestTreeSelection {
@Inject
- PathsCrate paths;
- PathsCrate pathsForListModel = new PathsCrate("listModel", new Integer[][]
{ { 2, 1, 3 }, { 3, 3, 2, 2 } });
- PathsCrate pathsForMapModel = new PathsCrate("mapModel", new Integer[][] {
{ 2, 1, 5 }, { 3, 3, 2, 6 } });
- PathsCrate pathsForRecursiveModel = new PathsCrate("recursiveModel", new
Integer[][] { { 4, 1, 10, 2 },
- { 1, 4, 3, 11, 4 } });
-
- @Inject
@Use(enumeration = true)
public RecursiveModelRepresentation representation;
@Inject
@Use(booleans = { true, false })
public boolean recursiveLeafChildrenNullable;
+
+ @Inject
+ PathsCrate paths;
+ PathsCrate pathsForListModel = new PathsCrate("listModel", new Integer[][]
{ { 2, 1, 3 }, { 3, 3, 2, 2 } });
+ PathsCrate pathsForMapModel = new PathsCrate("mapModel", new Integer[][] {
{ 2, 1, 5 }, { 3, 3, 2, 6 } });
+ PathsCrate pathsForRecursiveModel = new PathsCrate("recursiveModel", new
Integer[][] { { 4, 1, 10, 2 },
+ { 1, 4, 3, 11, 4 } });
public URL getTestUrl() {
return buildUrl(contextPath,
"http://localhost:8080/metamer/faces/components/richTree/treeAdaptors.xhtml");
Modified:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTreeModelAdaptor/TestTreeModelAdaptorSimple.java
===================================================================
---
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTreeModelAdaptor/TestTreeModelAdaptorSimple.java 2011-05-17
23:53:24 UTC (rev 22498)
+++
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTreeModelAdaptor/TestTreeModelAdaptorSimple.java 2011-05-19
07:46:35 UTC (rev 22499)
@@ -47,7 +47,13 @@
protected TreeAttributes treeAttributes = new
TreeAttributes(jq("span[id*=treeAttributes]"));
protected TreeModel tree = new TreeModel(pjq("div.rf-tr[id$=richTree]"));
protected TreeNodeModel treeNode;
+
+ private ModelAdaptorAttributes modelAdaptorAttributes = new ModelAdaptorAttributes(
+ pjq("span[id$=:listAttributes:panel]"));
+ private RecursiveModelAdaptorAttributes recursiveModelAdaptorAttributes = new
RecursiveModelAdaptorAttributes(
+ pjq("span[id$=:recursiveAttributes:panel]"));
+
@Override
public URL getTestUrl() {
return buildUrl(contextPath,
"faces/components/richTree/treeAdaptors.xhtml");
@@ -87,12 +93,7 @@
}
}
}
-
- private ModelAdaptorAttributes modelAdaptorAttributes = new ModelAdaptorAttributes(
- pjq("span[id$=:listAttributes:panel]"));
- private RecursiveModelAdaptorAttributes recursiveModelAdaptorAttributes = new
RecursiveModelAdaptorAttributes(
- pjq("span[id$=:recursiveAttributes:panel]"));
-
+
private class ModelAdaptorAttributes extends AbstractComponentAttributes {
public <T extends ExtendedLocator<JQueryLocator>>
ModelAdaptorAttributes(T root) {
Modified:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTreeNode/TestTreeNodeSimple.java
===================================================================
---
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTreeNode/TestTreeNodeSimple.java 2011-05-17
23:53:24 UTC (rev 22498)
+++
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTreeNode/TestTreeNodeSimple.java 2011-05-19
07:46:35 UTC (rev 22499)
@@ -75,17 +75,22 @@
TreeNodeModel treeNode = tree.getNode(1);
TreeNodeModel subTreeNode = treeNode.getNode(1);
TreeNodeModel leaf = subTreeNode.getNode(1);
+
+ ElementLocator<?> iconImage = treeNode.getIcon();
+ AttributeLocator<?> imageSrc = iconImage.getAttribute(SRC);
+ AttributeRetriever retrieveImageSrc = retrieveAttribute.attributeLocator(imageSrc);
+
@Inject
@Use(empty = true)
Event event = CLICK;
- Event[] events = new Event[] { CLICK, DBLCLICK, MOUSEDOWN, MOUSEMOVE, MOUSEOUT,
+ Event[] events = new Event[] {CLICK, DBLCLICK, MOUSEDOWN, MOUSEMOVE, MOUSEOUT,
MOUSEOVER, MOUSEUP };
@Inject
@Use(empty = true)
SwitchType toggleType;
- SwitchType[] toggleTypes = new SwitchType[] { SwitchType.ajax, SwitchType.server };
+ SwitchType[] toggleTypes = new SwitchType[] {SwitchType.ajax, SwitchType.server };
@BeforeMethod
public void init() {
@@ -123,10 +128,6 @@
assertEquals(selenium.getCount(not(tree.getAnyNode().getIcon(),
JQ_SAMPLE_CLASS)), 4);
}
- ElementLocator<?> iconImage = treeNode.getIcon();
- AttributeLocator<?> imageSrc = iconImage.getAttribute(SRC);
- AttributeRetriever retrieveImageSrc = retrieveAttribute.attributeLocator(imageSrc);
-
@Test
public void testIconCollapsed() {
assertTrue(selenium.isElementPresent(iconImage));