JBoss Rich Faces SVN: r21662 - in modules/tests/metamer/trunk/application/src/main: webapp/WEB-INF and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: lfryc(a)redhat.com
Date: 2011-02-15 05:43:22 -0500 (Tue, 15 Feb 2011)
New Revision: 21662
Added:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichCollapsibleSubTableTogglerBean.java
Removed:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichCollapsibleSubTableTogglerlBean.java
Modified:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichCollapsibleSubTableBean.java
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichInplaceSelectBean.java
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichTreeBean.java
modules/tests/metamer/trunk/application/src/main/webapp/WEB-INF/web.xml
Log:
@ManagedProperty replaced with obtaining from static reference
Modified: modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichCollapsibleSubTableBean.java
===================================================================
--- modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichCollapsibleSubTableBean.java 2011-02-15 10:42:18 UTC (rev 21661)
+++ modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichCollapsibleSubTableBean.java 2011-02-15 10:43:22 UTC (rev 21662)
@@ -29,7 +29,6 @@
import javax.annotation.PostConstruct;
import javax.faces.bean.ManagedBean;
-import javax.faces.bean.ManagedProperty;
import javax.faces.bean.ViewScoped;
import org.richfaces.component.UICollapsibleSubTable;
@@ -54,8 +53,8 @@
private static final long serialVersionUID = -1L;
private static Logger logger;
private Attributes attributes;
- @ManagedProperty(value = "#{model.employees}")
- private List<Employee> employees;
+ // FIXME: @ManagedProperty(value = "#{model.employees}")
+ private List<Employee> employees = Model.unmarshallEmployees();
private List<List<Employee>> lists;
private UICollapsibleSubTable binding;
// true = model, false = empty table
Copied: modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichCollapsibleSubTableTogglerBean.java (from rev 21661, modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichCollapsibleSubTableTogglerlBean.java)
===================================================================
--- modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichCollapsibleSubTableTogglerBean.java (rev 0)
+++ modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichCollapsibleSubTableTogglerBean.java 2011-02-15 10:43:22 UTC (rev 21662)
@@ -0,0 +1,122 @@
+/*******************************************************************************
+ * 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.bean;
+
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.annotation.PostConstruct;
+import javax.faces.bean.ManagedBean;
+import javax.faces.bean.ViewScoped;
+
+import org.richfaces.component.UICollapsibleSubTableToggleControl;
+import org.richfaces.tests.metamer.Attributes;
+import org.richfaces.tests.metamer.model.Employee;
+import org.richfaces.tests.metamer.model.Employee.Sex;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * Managed bean for rich:collapsibleSubTableToggler.
+ *
+ * @author <a href="mailto:ppitonak@redhat.com">Pavol Pitonak</a>
+ * @version $Revision$
+ */
+@ManagedBean(name="richSubTableTogglerBean")
+@ViewScoped
+public class RichCollapsibleSubTableTogglerBean implements Serializable {
+
+ private static final long serialVersionUID = -1L;
+ private static Logger logger;
+ private Attributes attributes;
+ // FIXME: @ManagedProperty(value = "#{model.employees}")
+ private List<Employee> employees = Model.unmarshallEmployees();
+ private List<List<Employee>> lists;
+ // true = model, false = empty table
+ private boolean state;
+
+ /**
+ * Initializes the managed bean.
+ */
+ @PostConstruct
+ public void init() {
+ logger = LoggerFactory.getLogger(getClass());
+ logger.debug("initializing bean " + getClass().getName());
+
+ attributes = Attributes.getComponentAttributesFromFacesConfig(UICollapsibleSubTableToggleControl.class, getClass());
+ attributes.setAttribute("event", "click");
+ attributes.setAttribute("rendered", true);
+ // TODO these attributes have to be tested in another way
+ attributes.remove("for");
+
+ List<Employee> men = new ArrayList<Employee>();
+ List<Employee> women = new ArrayList<Employee>();
+
+ for (Employee e : employees) {
+ if (e.getSex() == Sex.MALE) {
+ men.add(e);
+ } else {
+ women.add(e);
+ }
+ }
+
+ lists = new ArrayList<List<Employee>>();
+ lists.add(men);
+ lists.add(women);
+
+ state = true;
+ }
+
+ public Attributes getAttributes() {
+ return attributes;
+ }
+
+ public void setAttributes(Attributes attributes) {
+ this.attributes = attributes;
+ }
+
+ public List<Employee> getEmployees() {
+ return employees;
+ }
+
+ public void setEmployees(List<Employee> employees) {
+ this.employees = employees;
+ }
+
+ public List<List<Employee>> getLists() {
+ return lists;
+ }
+
+ public void setLists(List<List<Employee>> lists) {
+ this.lists = lists;
+ }
+
+ public boolean isState() {
+ return state;
+ }
+
+ public void setState(boolean state) {
+ this.state = state;
+ }
+
+}
Deleted: modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichCollapsibleSubTableTogglerlBean.java
===================================================================
--- modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichCollapsibleSubTableTogglerlBean.java 2011-02-15 10:42:18 UTC (rev 21661)
+++ modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichCollapsibleSubTableTogglerlBean.java 2011-02-15 10:43:22 UTC (rev 21662)
@@ -1,123 +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.bean;
-
-import java.io.Serializable;
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.annotation.PostConstruct;
-import javax.faces.bean.ManagedBean;
-import javax.faces.bean.ManagedProperty;
-import javax.faces.bean.ViewScoped;
-
-import org.richfaces.component.UICollapsibleSubTableToggleControl;
-import org.richfaces.tests.metamer.Attributes;
-import org.richfaces.tests.metamer.model.Employee;
-import org.richfaces.tests.metamer.model.Employee.Sex;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * Managed bean for rich:collapsibleSubTableToggler.
- *
- * @author <a href="mailto:ppitonak@redhat.com">Pavol Pitonak</a>
- * @version $Revision$
- */
-@ManagedBean(name="richSubTableTogglerBean")
-@ViewScoped
-public class RichCollapsibleSubTableTogglerlBean implements Serializable {
-
- private static final long serialVersionUID = -1L;
- private static Logger logger;
- private Attributes attributes;
- @ManagedProperty(value = "#{model.employees}")
- private List<Employee> employees;
- private List<List<Employee>> lists;
- // true = model, false = empty table
- private boolean state;
-
- /**
- * Initializes the managed bean.
- */
- @PostConstruct
- public void init() {
- logger = LoggerFactory.getLogger(getClass());
- logger.debug("initializing bean " + getClass().getName());
-
- attributes = Attributes.getComponentAttributesFromFacesConfig(UICollapsibleSubTableToggleControl.class, getClass());
- attributes.setAttribute("event", "click");
- attributes.setAttribute("rendered", true);
- // TODO these attributes have to be tested in another way
- attributes.remove("for");
-
- List<Employee> men = new ArrayList<Employee>();
- List<Employee> women = new ArrayList<Employee>();
-
- for (Employee e : employees) {
- if (e.getSex() == Sex.MALE) {
- men.add(e);
- } else {
- women.add(e);
- }
- }
-
- lists = new ArrayList<List<Employee>>();
- lists.add(men);
- lists.add(women);
-
- state = true;
- }
-
- public Attributes getAttributes() {
- return attributes;
- }
-
- public void setAttributes(Attributes attributes) {
- this.attributes = attributes;
- }
-
- public List<Employee> getEmployees() {
- return employees;
- }
-
- public void setEmployees(List<Employee> employees) {
- this.employees = employees;
- }
-
- public List<List<Employee>> getLists() {
- return lists;
- }
-
- public void setLists(List<List<Employee>> lists) {
- this.lists = lists;
- }
-
- public boolean isState() {
- return state;
- }
-
- public void setState(boolean state) {
- this.state = state;
- }
-
-}
Modified: modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichInplaceSelectBean.java
===================================================================
--- modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichInplaceSelectBean.java 2011-02-15 10:42:18 UTC (rev 21661)
+++ modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichInplaceSelectBean.java 2011-02-15 10:43:22 UTC (rev 21662)
@@ -27,7 +27,6 @@
import javax.annotation.PostConstruct;
import javax.faces.bean.ManagedBean;
-import javax.faces.bean.ManagedProperty;
import javax.faces.bean.ViewScoped;
import javax.faces.event.ValueChangeEvent;
import javax.faces.model.SelectItem;
@@ -51,8 +50,8 @@
private static final long serialVersionUID = -1L;
private static Logger logger;
private Attributes attributes;
- @ManagedProperty(value = "#{model.capitals}")
- private List<Capital> capitals;
+ // FIXME: @ManagedProperty(value = "#{model.capitals}")
+ private List<Capital> capitals = Model.unmarshallCapitals();
private List<SelectItem> capitalsOptions = null;
/**
Modified: modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichTreeBean.java
===================================================================
--- modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichTreeBean.java 2011-02-15 10:42:18 UTC (rev 21661)
+++ modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichTreeBean.java 2011-02-15 10:43:22 UTC (rev 21662)
@@ -31,7 +31,6 @@
import javax.annotation.PostConstruct;
import javax.faces.bean.ManagedBean;
-import javax.faces.bean.ManagedProperty;
import javax.faces.bean.ViewScoped;
import javax.faces.event.ComponentSystemEvent;
import javax.swing.tree.TreeNode;
@@ -59,8 +58,8 @@
private List<TreeNode> root = new ArrayList<TreeNode>();
private Collection<Object> selection;
- @ManagedProperty(value = "#{model}")
- private Model model;
+ // FIXME: @ManagedProperty(value = "#{model}")
+ // private Model model;
private Map<String, Country> countriesCache = new HashMap<String, Country>();
private Map<String, Company> companiesCache = new HashMap<String, Company>();
@@ -92,7 +91,7 @@
attributes.remove("stateVar");
attributes.remove("nodeType");
- for (CompactDiscXmlDescriptor descriptor : model.getCompactDiscs()) {
+ for (CompactDiscXmlDescriptor descriptor : Model.unmarshallCompactDiscs()) {
createCompactDisc(descriptor);
}
}
@@ -144,10 +143,6 @@
return country;
}
- public void setModel(Model model) {
- this.model = model;
- }
-
public List<TreeNode> getRoot() {
return root;
Modified: modules/tests/metamer/trunk/application/src/main/webapp/WEB-INF/web.xml
===================================================================
--- modules/tests/metamer/trunk/application/src/main/webapp/WEB-INF/web.xml 2011-02-15 10:42:18 UTC (rev 21661)
+++ modules/tests/metamer/trunk/application/src/main/webapp/WEB-INF/web.xml 2011-02-15 10:43:22 UTC (rev 21662)
@@ -14,7 +14,7 @@
</context-param>
<context-param>
<param-name>org.jboss.jbossfaces.WAR_BUNDLES_JSF_IMPL</param-name>
- <param-value>false</param-value>
+ <param-value>true</param-value>
</context-param>
<context-param>
<param-name>org.richfaces.skin</param-name>
15 years, 2 months
JBoss Rich Faces SVN: r21661 - in modules/tests/metamer/trunk/application/src/main/webapp/components: a4jStatus and 1 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: lfryc(a)redhat.com
Date: 2011-02-15 05:42:18 -0500 (Tue, 15 Feb 2011)
New Revision: 21661
Modified:
modules/tests/metamer/trunk/application/src/main/webapp/components/a4jQueue/globalQueue.xhtml
modules/tests/metamer/trunk/application/src/main/webapp/components/a4jStatus/instantAttributes.xhtml
modules/tests/metamer/trunk/application/src/main/webapp/components/a4jStatus/viewUsage.xhtml
modules/tests/metamer/trunk/application/src/main/webapp/components/richPopupPanel/outsideForm.xhtml
Log:
refactor all dontRenderForm expressions to composition parameters (MyFaces compatibility) (RFPL-1105)
Modified: modules/tests/metamer/trunk/application/src/main/webapp/components/a4jQueue/globalQueue.xhtml
===================================================================
--- modules/tests/metamer/trunk/application/src/main/webapp/components/a4jQueue/globalQueue.xhtml 2011-02-15 10:41:29 UTC (rev 21660)
+++ modules/tests/metamer/trunk/application/src/main/webapp/components/a4jQueue/globalQueue.xhtml 2011-02-15 10:42:18 UTC (rev 21661)
@@ -28,13 +28,13 @@
-->
<ui:composition template="/templates/template.xhtml">
+ <ui:param name="dontRenderForm" value="true" />
<ui:define name="head">
<f:metadata>
<f:viewParam name="templates" value="#{templateBean.templates}">
<f:converter converterId="templatesListConverter" />
</f:viewParam>
- <c:set var="dontRenderForm" value="#{true}" />
</f:metadata>
<h:outputStylesheet library="css" name="a4jQueue.css" />
<script type="text/javascript">
Modified: modules/tests/metamer/trunk/application/src/main/webapp/components/a4jStatus/instantAttributes.xhtml
===================================================================
--- modules/tests/metamer/trunk/application/src/main/webapp/components/a4jStatus/instantAttributes.xhtml 2011-02-15 10:41:29 UTC (rev 21660)
+++ modules/tests/metamer/trunk/application/src/main/webapp/components/a4jStatus/instantAttributes.xhtml 2011-02-15 10:42:18 UTC (rev 21661)
@@ -28,13 +28,13 @@
-->
<ui:composition template="/templates/template.xhtml">
+ <ui:param name="dontRenderForm" value="true" />
<ui:define name="head">
<f:metadata>
<f:viewParam name="templates" value="#{templateBean.templates}">
<f:converter converterId="templatesListConverter" />
</f:viewParam>
- <c:set var="dontRenderForm" value="#{true}" />
</f:metadata>
</ui:define>
Modified: modules/tests/metamer/trunk/application/src/main/webapp/components/a4jStatus/viewUsage.xhtml
===================================================================
--- modules/tests/metamer/trunk/application/src/main/webapp/components/a4jStatus/viewUsage.xhtml 2011-02-15 10:41:29 UTC (rev 21660)
+++ modules/tests/metamer/trunk/application/src/main/webapp/components/a4jStatus/viewUsage.xhtml 2011-02-15 10:42:18 UTC (rev 21661)
@@ -28,13 +28,13 @@
-->
<ui:composition template="/templates/template.xhtml">
+ <ui:param name="dontRenderForm" value="true" />
<ui:define name="head">
<f:metadata>
<f:viewParam name="templates" value="#{templateBean.templates}">
<f:converter converterId="templatesListConverter" />
</f:viewParam>
- <c:set var="dontRenderForm" value="#{true}"/>
</f:metadata>
</ui:define>
Modified: modules/tests/metamer/trunk/application/src/main/webapp/components/richPopupPanel/outsideForm.xhtml
===================================================================
--- modules/tests/metamer/trunk/application/src/main/webapp/components/richPopupPanel/outsideForm.xhtml 2011-02-15 10:41:29 UTC (rev 21660)
+++ modules/tests/metamer/trunk/application/src/main/webapp/components/richPopupPanel/outsideForm.xhtml 2011-02-15 10:42:18 UTC (rev 21661)
@@ -28,6 +28,7 @@
-->
<ui:composition template="/templates/template.xhtml">
+ <ui:param name="dontRenderForm" value="true" />
<ui:define name="head">
<f:metadata>
@@ -35,7 +36,6 @@
<f:converter converterId="templatesListConverter" />
</f:viewParam>
</f:metadata>
- <c:set var="dontRenderForm" value="#{true}"/>
</ui:define>
<ui:define name="outOfTemplateBefore">
15 years, 2 months
JBoss Rich Faces SVN: r21660 - in modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest: richTooltip and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: lfryc(a)redhat.com
Date: 2011-02-15 05:41:29 -0500 (Tue, 15 Feb 2011)
New Revision: 21660
Added:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/DelayTester.java
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/TooltipModel.java
Log:
added DelayTester helper (RFPL-1129), used in TestTooltipSimple (showDelay, hideDelay), added issue tracking for RF-10522
Added: 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 (rev 0)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/DelayTester.java 2011-02-15 10:41:29 UTC (rev 21660)
@@ -0,0 +1,129 @@
+/*******************************************************************************
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, 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;
+
+import static org.jboss.test.selenium.SystemProperties.isSeleniumDebug;
+import static org.jboss.test.selenium.utils.text.SimplifiedFormat.format;
+import static org.testng.Assert.assertTrue;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+import org.jboss.test.selenium.SystemProperties;
+
+/**
+ * @author <a href="mailto:lfryc@redhat.com">Lukas Fryc</a>
+ * @version $Revision$
+ */
+public abstract class DelayTester {
+
+ private static final int ITERATION_COUNT = 10;
+ private static final int ONE_PASS_MINIMUM = 250;
+
+ long actualDelay;
+ long expectedDelay;
+
+ public DelayTester(long expectedDelay) {
+ this.expectedDelay = expectedDelay;
+ }
+
+ List<Long> deviations = new ArrayList<Long>();
+
+ public abstract void action();
+
+ public void beforeTest() {
+ }
+
+ public void beforeAction() {
+ }
+
+ public void afterAction() {
+ }
+
+ public void afterTest() {
+ }
+
+ public void run() {
+ beforeTest();
+ for (int i = 0; i < ITERATION_COUNT; i++) {
+ beforeAction();
+ actualDelay = System.currentTimeMillis();
+ action();
+ actualDelay = System.currentTimeMillis() - actualDelay;
+ validateOnePass();
+ afterAction();
+ }
+ checkDeviationMedian();
+ afterTest();
+ }
+
+ protected long getMaximumSingleDeviation() {
+ return Math.max(ONE_PASS_MINIMUM, 2 * actualDelay);
+ }
+
+ protected long getMaximumDeviationMedian() {
+ return getMinMax(200, expectedDelay / 4, 500);
+ }
+
+ private void validateOnePass() {
+ long deviation = Math.abs(expectedDelay - actualDelay);
+ long maxDelay = getMaximumSingleDeviation();
+
+ if (SystemProperties.isSeleniumDebug()) {
+ System.out.println(format("deviation for preset delay {0}: {1} (delay {2})", expectedDelay, deviation, actualDelay));
+ }
+
+ assertTrue(deviation <= maxDelay,
+ format("Deviation ({0}) is greater than defined maximum ({1})", deviation, maxDelay));
+
+ deviations.add(deviation);
+ }
+
+ private void checkDeviationMedian() {
+ long maximumDeviationMedian = getMaximumDeviationMedian();
+ long deviationMedian = getMedian(deviations);
+ if (isSeleniumDebug()) {
+ System.out.println("deviationMedian: " + deviationMedian);
+ }
+ assertTrue(
+ deviationMedian <= maximumDeviationMedian,
+ format("Deviation median ({0}) should not be greater than defined maximum {1}", deviationMedian,
+ maximumDeviationMedian));
+ }
+
+ private <T extends Comparable<T>> T getMedian(List<T> list) {
+ List<T> listCopy = new ArrayList<T>(list);
+ Collections.sort(listCopy);
+ return listCopy.get(listCopy.size() / 2);
+ }
+
+ protected long getMinMax(long min, long value, long max) {
+ if (value < min) {
+ return min;
+ }
+ if (value > max) {
+ return max;
+ }
+ return value;
+ }
+}
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-02-15 10:40:41 UTC (rev 21659)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTooltip/TestTooltipSimple.java 2011-02-15 10:41:29 UTC (rev 21660)
@@ -33,10 +33,8 @@
import static org.jboss.test.selenium.dom.Event.MOUSEUP;
import static org.jboss.test.selenium.locator.LocatorFactory.jq;
import static org.jboss.test.selenium.utils.URLUtils.buildUrl;
-import static org.jboss.test.selenium.utils.text.SimplifiedFormat.format;
import static org.testng.Assert.assertEquals;
import static org.testng.Assert.assertFalse;
-import static org.testng.Assert.assertTrue;
import java.net.URL;
@@ -50,6 +48,7 @@
import org.richfaces.TooltipMode;
import org.richfaces.component.Positioning;
import org.richfaces.tests.metamer.ftest.AbstractMetamerTest;
+import org.richfaces.tests.metamer.ftest.DelayTester;
import org.richfaces.tests.metamer.ftest.annotations.Inject;
import org.richfaces.tests.metamer.ftest.annotations.IssueTracking;
import org.richfaces.tests.metamer.ftest.annotations.Use;
@@ -138,7 +137,7 @@
super.testDir(tooltip);
}
- // ////@Test
+ @Test
@Uses({ @Use(field = "direction", enumeration = true), @Use(field = "verticalOffset", value = "offsets"),
@Use(field = "horizontalOffset", value = "offsets") })
public void testPositioning() {
@@ -206,17 +205,16 @@
attributes.setMode(TooltipMode.ajax);
attributes.setHideDelay(presetDelay);
- tooltip.recall();
- long delay = System.currentTimeMillis();
- tooltip.hide();
- waitGui.timeout(6000).until(isNotDisplayed.locator(tooltip));
- delay = System.currentTimeMillis() - delay;
+ new DelayTester(presetDelay) {
+ public void beforeAction() {
+ tooltip.recall();
+ }
- long deviation = Math.abs(presetDelay - delay);
- long maxDeviation = Math.max(250, presetDelay / 2);
-
- assertTrue(deviation < maxDeviation,
- format("deviation '{0}' is greater than maxDeviation '{1}'", deviation, maxDeviation));
+ public void action() {
+ tooltip.hide();
+ waitGui.timeout(presetDelay + 2000).until(isNotDisplayed.locator(tooltip));
+ }
+ }.run();
}
@Test
@@ -294,21 +292,22 @@
@Test
@Use(field = "presetDelay", ints = { 0, 1000, 5000 })
+ @IssueTracking("https://issues.jboss.org/browse/RF-10522")
public void testShowDelay() {
attributes.setMode(TooltipMode.client);
attributes.setShowDelay(presetDelay);
- long delay = System.currentTimeMillis();
- tooltip.recall();
- waitGui.timeout(6000).until(isDisplayed.locator(tooltip));
- delay = System.currentTimeMillis() - delay;
+ new DelayTester(presetDelay) {
+ public void action() {
+ tooltip.recall();
+ waitGui.timeout(presetDelay + 2000).until(isDisplayed.locator(tooltip));
+ }
- long deviation = Math.abs(presetDelay - delay);
- long maxDeviation = Math.max(200, presetDelay / 2);
-
- assertTrue(deviation < maxDeviation,
- format("deviation '{0}' is greater than maxDeviation '{1}'", deviation, maxDeviation));
+ public void afterAction() {
+ tooltip.hide();
+ }
+ }.run();
}
@Test
Modified: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTooltip/TooltipModel.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTooltip/TooltipModel.java 2011-02-15 10:40:41 UTC (rev 21659)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTooltip/TooltipModel.java 2011-02-15 10:41:29 UTC (rev 21660)
@@ -71,6 +71,7 @@
guard(selenium, getRequestType()).mouseMoveAt(target, new Point(x, y));
} else {
guard(selenium, getRequestType()).mouseOverAt(target, new Point(x, y));
+ selenium.mouseMoveAt(target, new Point(x, y));
}
waitAjax().dontFail().interval(50).timeout(2000).until(IsDisplayed.getInstance().locator(this));
}
15 years, 2 months
JBoss Rich Faces SVN: r21659 - modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richPanelMenuItem.
by richfaces-svn-commits@lists.jboss.org
Author: lfryc(a)redhat.com
Date: 2011-02-15 05:40:41 -0500 (Tue, 15 Feb 2011)
New Revision: 21659
Modified:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richPanelMenuItem/TestPanelMenuItemSimple.java
Log:
added issue tracking for RF-10519
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-02-15 10:39:59 UTC (rev 21658)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richPanelMenuItem/TestPanelMenuItemSimple.java 2011-02-15 10:40:41 UTC (rev 21659)
@@ -11,6 +11,7 @@
import org.jboss.test.selenium.request.RequestType;
import org.richfaces.PanelMenuMode;
import org.richfaces.tests.metamer.ftest.AbstractMetamerTest;
+import org.richfaces.tests.metamer.ftest.annotations.IssueTracking;
import org.richfaces.tests.metamer.ftest.model.PanelMenu;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
@@ -35,7 +36,7 @@
public URL getTestUrl() {
return buildUrl(contextPath, "faces/components/richPanelMenuItem/simple.xhtml");
}
-
+
@BeforeMethod
public void setupMode() {
attributes.setMode(PanelMenuMode.ajax);
@@ -144,6 +145,7 @@
}
@Test
+ @IssueTracking("https://issues.jboss.org/browse/RF-10519")
public void testRightIcon() {
attributes.setRightIcon(CHEVRON_DOWN);
@@ -155,6 +157,7 @@
}
@Test
+ @IssueTracking("https://issues.jboss.org/browse/RF-10519")
public void testRightIconClass() {
super.testStyleClass(rightIcon, "rightIconClass");
}
15 years, 2 months
JBoss Rich Faces SVN: r21658 - modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTreeNode.
by richfaces-svn-commits@lists.jboss.org
Author: lfryc(a)redhat.com
Date: 2011-02-15 05:39:59 -0500 (Tue, 15 Feb 2011)
New Revision: 21658
Modified:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTreeNode/TestTreeNodeSimple.java
Log:
added issue tracking for RFPL-1124
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-02-15 10:39:20 UTC (rev 21657)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTreeNode/TestTreeNodeSimple.java 2011-02-15 10:39:59 UTC (rev 21658)
@@ -225,7 +225,7 @@
@Test
@Use(field = "event", value = "events")
- @IssueTracking("https://issues.jboss.org/browse/RF-10483")
+ @IssueTracking("https://issues.jboss.org/browse/RFPL-1124")
public void testClientEvents() {
String attributeName = event.getEventName();
ElementLocator<?> eventInput = pjq("span[id$=treeNode1Attributes:panel] input[id$=on" + attributeName
15 years, 2 months
JBoss Rich Faces SVN: r21657 - modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTreeModelAdaptor.
by richfaces-svn-commits@lists.jboss.org
Author: lfryc(a)redhat.com
Date: 2011-02-15 05:39:20 -0500 (Tue, 15 Feb 2011)
New Revision: 21657
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/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/richTreeModelAdaptor/TestTreeModelAdaptorToggling.java
Log:
added issue tracking for RF-10497
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-02-15 10:38:35 UTC (rev 21656)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTreeModelAdaptor/TestTreeModelAdaptorLazyLoading.java 2011-02-15 10:39:20 UTC (rev 21657)
@@ -38,6 +38,7 @@
import org.apache.commons.lang.StringUtils;
import org.jboss.test.selenium.locator.JQueryLocator;
import org.richfaces.tests.metamer.ftest.AbstractMetamerTest;
+import org.richfaces.tests.metamer.ftest.annotations.IssueTracking;
import org.richfaces.tests.metamer.ftest.richTree.TreeAttributes;
import org.richfaces.tests.metamer.ftest.richTree.TreeModel;
import org.richfaces.tests.metamer.ftest.richTree.TreeNodeModel;
@@ -47,6 +48,7 @@
* @author <a href="mailto:lfryc@redhat.com">Lukas Fryc</a>
* @version $Revision$
*/
+@IssueTracking("https://issues.jboss.org/browse/RF-10497")
public class TestTreeModelAdaptorLazyLoading extends AbstractMetamerTest {
@Override
public URL getTestUrl() {
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-02-15 10:38:35 UTC (rev 21656)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTreeModelAdaptor/TestTreeModelAdaptorSelection.java 2011-02-15 10:39:20 UTC (rev 21657)
@@ -45,6 +45,7 @@
* @author <a href="mailto:lfryc@redhat.com">Lukas Fryc</a>
* @version $Revision$
*/
+@IssueTracking("https://issues.jboss.org/browse/RF-10497")
public class TestTreeModelAdaptorSelection extends TestTreeSelection {
@Inject
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-02-15 10:38:35 UTC (rev 21656)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTreeModelAdaptor/TestTreeModelAdaptorSimple.java 2011-02-15 10:39:20 UTC (rev 21657)
@@ -33,6 +33,7 @@
import org.jboss.test.selenium.locator.JQueryLocator;
import org.richfaces.tests.metamer.ftest.AbstractComponentAttributes;
import org.richfaces.tests.metamer.ftest.AbstractMetamerTest;
+import org.richfaces.tests.metamer.ftest.annotations.IssueTracking;
import org.richfaces.tests.metamer.ftest.richTree.TreeAttributes;
import org.richfaces.tests.metamer.ftest.richTree.TreeModel;
import org.richfaces.tests.metamer.ftest.richTree.TreeNodeModel;
@@ -42,6 +43,7 @@
* @author <a href="mailto:lfryc@redhat.com">Lukas Fryc</a>
* @version $Revision$
*/
+@IssueTracking("https://issues.jboss.org/browse/RF-10497")
public class TestTreeModelAdaptorSimple extends AbstractMetamerTest {
protected TreeAttributes treeAttributes = new TreeAttributes(jq("span[id*=treeAttributes]"));
Modified: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTreeModelAdaptor/TestTreeModelAdaptorToggling.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTreeModelAdaptor/TestTreeModelAdaptorToggling.java 2011-02-15 10:38:35 UTC (rev 21656)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTreeModelAdaptor/TestTreeModelAdaptorToggling.java 2011-02-15 10:39:20 UTC (rev 21657)
@@ -28,6 +28,7 @@
import java.net.URL;
import org.richfaces.tests.metamer.ftest.annotations.Inject;
+import org.richfaces.tests.metamer.ftest.annotations.IssueTracking;
import org.richfaces.tests.metamer.ftest.annotations.Use;
import org.richfaces.tests.metamer.ftest.richTree.TestTreeToggling;
import org.richfaces.tests.metamer.ftest.richTree.TreeAttributes;
@@ -39,6 +40,7 @@
* @author <a href="mailto:lfryc@redhat.com">Lukas Fryc</a>
* @version $Revision$
*/
+@IssueTracking("https://issues.jboss.org/browse/RF-10497")
public class TestTreeModelAdaptorToggling extends TestTreeToggling {
@Inject
15 years, 2 months
JBoss Rich Faces SVN: r21656 - modules/tests/metamer/trunk/application/src/main/webapp/components/richCollapsibleSubTable.
by richfaces-svn-commits@lists.jboss.org
Author: lfryc(a)redhat.com
Date: 2011-02-15 05:38:35 -0500 (Tue, 15 Feb 2011)
New Revision: 21656
Modified:
modules/tests/metamer/trunk/application/src/main/webapp/components/richCollapsibleSubTable/facets.xhtml
Log:
rich:collapsibleSutTable - fixed nested component control by noDataFacet test
Modified: modules/tests/metamer/trunk/application/src/main/webapp/components/richCollapsibleSubTable/facets.xhtml
===================================================================
--- modules/tests/metamer/trunk/application/src/main/webapp/components/richCollapsibleSubTable/facets.xhtml 2011-02-15 10:38:02 UTC (rev 21655)
+++ modules/tests/metamer/trunk/application/src/main/webapp/components/richCollapsibleSubTable/facets.xhtml 2011-02-15 10:38:35 UTC (rev 21656)
@@ -41,7 +41,7 @@
<br/>
<h:outputText value="Show data in table: " />
<h:selectBooleanCheckbox id="noDataCheckbox" value="#{richSubTableBean.state}">
- <a4j:ajax render="richDataTable"/>
+ <a4j:ajax render="#{nestedComponentId}"/>
</h:selectBooleanCheckbox>
<br/><br/>
</ui:define>
15 years, 2 months
JBoss Rich Faces SVN: r21655 - modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richFunctions.
by richfaces-svn-commits@lists.jboss.org
Author: lfryc(a)redhat.com
Date: 2011-02-15 05:38:02 -0500 (Tue, 15 Feb 2011)
New Revision: 21655
Modified:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richFunctions/TestClientFunctions.java
Log:
added issue tracking for RF-10465
Modified: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richFunctions/TestClientFunctions.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richFunctions/TestClientFunctions.java 2011-02-15 10:37:19 UTC (rev 21654)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richFunctions/TestClientFunctions.java 2011-02-15 10:38:02 UTC (rev 21655)
@@ -28,6 +28,7 @@
import java.net.URL;
import org.jboss.test.selenium.locator.JQueryLocator;
import org.richfaces.tests.metamer.ftest.AbstractMetamerTest;
+import org.richfaces.tests.metamer.ftest.annotations.IssueTracking;
import org.testng.annotations.Test;
/**
@@ -54,6 +55,7 @@
}
@Test
+ @IssueTracking("https://issues.jboss.org/browse/RF-10465")
public void testFunctions() {
String clientId = selenium.getText(clientIdOutput);
assertNotNull(clientId, "Function clientId() doesn't work.");
15 years, 2 months
JBoss Rich Faces SVN: r21654 - modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest.
by richfaces-svn-commits@lists.jboss.org
Author: lfryc(a)redhat.com
Date: 2011-02-15 05:37:19 -0500 (Tue, 15 Feb 2011)
New Revision: 21654
Modified:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/AbstractComponentAttributes.java
Log:
AbstractComponentAttributes - repeat method invocation 3 times when attribute element not found
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 2011-02-15 10:04:00 UTC (rev 21653)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/AbstractComponentAttributes.java 2011-02-15 10:37:19 UTC (rev 21654)
@@ -30,6 +30,9 @@
import org.jboss.test.selenium.dom.Event;
import org.jboss.test.selenium.framework.AjaxSelenium;
import org.jboss.test.selenium.framework.AjaxSeleniumProxy;
+import org.jboss.test.selenium.interception.CommandContext;
+import org.jboss.test.selenium.interception.CommandInterceptionException;
+import org.jboss.test.selenium.interception.CommandInterceptor;
import org.jboss.test.selenium.locator.Attribute;
import org.jboss.test.selenium.locator.AttributeLocator;
import org.jboss.test.selenium.locator.ElementLocator;
@@ -39,7 +42,10 @@
import org.jboss.test.selenium.locator.reference.LocatorReference;
import org.jboss.test.selenium.locator.reference.ReferencedLocator;
import org.jboss.test.selenium.request.RequestType;
+import org.jboss.test.selenium.waiting.Wait;
+import com.thoughtworks.selenium.SeleniumException;
+
/**
* @author <a href="mailto:lfryc@redhat.com">Lukas Fryc</a>
* @version $Revision$
@@ -59,11 +65,11 @@
public <T extends ExtendedLocator<JQueryLocator>> AbstractComponentAttributes(T root) {
this.root.setLocator(root);
}
-
+
public ExtendedLocator<JQueryLocator> getRoot() {
return root.getLocator();
}
-
+
public void setRoot(ExtendedLocator<JQueryLocator> root) {
this.root.setLocator(root);
}
@@ -77,6 +83,8 @@
}
protected void setProperty(String propertyName, Object value) {
+ selenium.getInterceptionProxy().registerInterceptor(new RepeatForElementNotFound());
+
ExtendedLocator<JQueryLocator> locator = propertyLocator.format(propertyName, "");
final AttributeLocator<?> typeLocator = locator.getAttribute(Attribute.TYPE);
final ExtendedLocator<JQueryLocator> optionLocator = locator.getChild(jq("option"));
@@ -115,6 +123,8 @@
}
applySelect(locator, valueAsString);
}
+
+ selenium.getInterceptionProxy().unregisterInterceptorType(RepeatForElementNotFound.class);
}
public void setRequestType(RequestType requestType) {
@@ -146,4 +156,25 @@
public void setOncomplete(String oncomplete) {
setProperty("oncomplete", oncomplete);
}
+
+ private class RepeatForElementNotFound implements CommandInterceptor {
+ @Override
+ public void intercept(CommandContext ctx) throws CommandInterceptionException {
+ for (int i = 1; i <= 3; i++) {
+ try {
+ ctx.invoke();
+ break;
+ } catch (SeleniumException e) {
+ if (i == 3) {
+ throw e;
+ }
+ if (e.getMessage().matches("ERROR: Element .* not found")) {
+ Wait.waitAjax().timeout(500).interval(100).waitForTimeout();
+ continue;
+ }
+ throw e;
+ }
+ }
+ }
+ }
}
15 years, 2 months