JBoss Rich Faces SVN: r16131 - branches/sandbox/rf-demo-ftest-iexplore/src/test/java/org/jboss/richfaces/integrationTest/progressBar.
by richfaces-svn-commits@lists.jboss.org
Author: lfryc(a)redhat.com
Date: 2009-12-15 04:19:04 -0500 (Tue, 15 Dec 2009)
New Revision: 16131
Modified:
branches/sandbox/rf-demo-ftest-iexplore/src/test/java/org/jboss/richfaces/integrationTest/progressBar/ProgressBarTestCase.java
Log:
* ProgressBar - method is now recognizing length unit in px and % instead of px only
Modified: branches/sandbox/rf-demo-ftest-iexplore/src/test/java/org/jboss/richfaces/integrationTest/progressBar/ProgressBarTestCase.java
===================================================================
--- branches/sandbox/rf-demo-ftest-iexplore/src/test/java/org/jboss/richfaces/integrationTest/progressBar/ProgressBarTestCase.java 2009-12-15 09:17:19 UTC (rev 16130)
+++ branches/sandbox/rf-demo-ftest-iexplore/src/test/java/org/jboss/richfaces/integrationTest/progressBar/ProgressBarTestCase.java 2009-12-15 09:19:04 UTC (rev 16131)
@@ -64,7 +64,7 @@
}
public boolean isTrue() {
- newValue = (int) Double.parseDouble(getStyle(locator, "width").replace("px", ""));
+ newValue = (int) Double.parseDouble(getStyle(locator, "width").replaceAll("(px|%)$", ""));
return newValue > oldValue;
}
}
14 years, 6 months
JBoss Rich Faces SVN: r16130 - branches/sandbox/rf-demo-ftest-iexplore/src/test/resources/org/jboss/richfaces/integrationTest/panelMenu.
by richfaces-svn-commits@lists.jboss.org
Author: lfryc(a)redhat.com
Date: 2009-12-15 04:17:19 -0500 (Tue, 15 Dec 2009)
New Revision: 16130
Modified:
branches/sandbox/rf-demo-ftest-iexplore/src/test/resources/org/jboss/richfaces/integrationTest/panelMenu/locators.properties
Log:
* PanelMenu - removed backslash in locator
Modified: branches/sandbox/rf-demo-ftest-iexplore/src/test/resources/org/jboss/richfaces/integrationTest/panelMenu/locators.properties
===================================================================
--- branches/sandbox/rf-demo-ftest-iexplore/src/test/resources/org/jboss/richfaces/integrationTest/panelMenu/locators.properties 2009-12-15 06:36:15 UTC (rev 16129)
+++ branches/sandbox/rf-demo-ftest-iexplore/src/test/resources/org/jboss/richfaces/integrationTest/panelMenu/locators.properties 2009-12-15 09:17:19 UTC (rev 16130)
@@ -1,5 +1,5 @@
EXAMPLE_HEADER=jquery=fieldset > legend
-PANEL=jquery=fieldset span[id=form\\:current]
+PANEL=jquery\=fieldset span[id\=form\:current]
GROUP_N_IMAGE_BEFORE=jquery=fieldset table.rich-pmenu-top-group:eq({0}) td:eq(0) img@src
GROUP_N_IMAGE_AFTER=jquery=fieldset table.rich-pmenu-top-group:eq({0}) td:eq(2) img@src
14 years, 6 months
JBoss Rich Faces SVN: r16129 - branches/community/3.3.X/docs/userguide/en/src/main/docbook/included.
by richfaces-svn-commits@lists.jboss.org
Author: SeanRogers
Date: 2009-12-15 01:36:15 -0500 (Tue, 15 Dec 2009)
New Revision: 16129
Modified:
branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/rich_modalPanel.xml
Log:
Updated for RF-2288
Modified: branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/rich_modalPanel.xml
===================================================================
--- branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/rich_modalPanel.xml 2009-12-14 20:52:53 UTC (rev 16128)
+++ branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/rich_modalPanel.xml 2009-12-15 06:36:15 UTC (rev 16129)
@@ -108,13 +108,17 @@
<para>
- The component can restore it's previous state (including position on the screen) after submitting and reloading.
+ The component can restore its previous state (including position on the screen) after submitting and reloading.
Set <emphasis><property>"keepVisualState"</property></emphasis> to <code>true</code> to submit and pass <emphasis role="bold"><property><rich:modalPanel></property></emphasis> current parameters to a new page.
- The <emphasis><property>"showWhenRendered"</property></emphasis> bolean attribute is used in cases when component should be rendered after first page loading.
+ The <emphasis><property>"showWhenRendered"</property></emphasis> boolean attribute is used in cases when component should be rendered after first page loading.
</para>
<para>
- To understand sence of the <emphasis><property>"domElementAttachment"</property></emphasis> attribute it is necessary to understand
+ The <emphasis><property>"trimOverlayedElements"</property></emphasis> boolean attribute can be used to determine if the modal panel will expand to show other components inside it. Set the attribute to <code>false</code> to ensure components are not cut off.
+ </para>
+
+ <para>
+ To understand sense of the <emphasis><property>"domElementAttachment"</property></emphasis> attribute it is necessary to understand
what is <emphasis>stacking context</emphasis> and how it works in the HTML makeup.
Since each <emphasis>positioned</emphasis> or <emphasis>z-indexed</emphasis> element (CSS <code>position:absolute</code> or <code>relative</code> and <code>z-index:*any integer different from 0*</code>)
form their own stacking context the <emphasis role="bold"><property><rich:modalPanel></property></emphasis> rendered as a child of such element may be overlapped with an element
@@ -123,7 +127,7 @@
To make the <emphasis role="bold"><property><rich:modalPanel></property></emphasis> rendered in "closest" to an observer layer and avoid such overlapping,
the component was designed in way when it is always being automatically assimilated with <code><body></code> with a very high rendering layer (<code>z-index</code>).
But our panel should be assimilated with <code><body></code> not always, because of some side effects that take place in this case.
- The <emphasis><property>"domElementAttachment"</property></emphasis> attribute helps to reassign the panel to it <emphasis>parent</emphasis> or <emphasis>form</emphasis> element.
+ The <emphasis><property>"domElementAttachment"</property></emphasis> attribute helps to reassign the panel to its <emphasis>parent</emphasis> or <emphasis>form</emphasis> element.
If <emphasis>form</emphasis> is used and no parent form is available the panel is functioning as if it is assimilated with <code><body></code>.
</para>
@@ -516,4 +520,4 @@
</section>
-</section>
\ No newline at end of file
+</section>
14 years, 6 months
JBoss Rich Faces SVN: r16128 - branches/community/3.3.X/ui/effect/src/main/java/org/richfaces/component.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2009-12-14 15:52:53 -0500 (Mon, 14 Dec 2009)
New Revision: 16128
Modified:
branches/community/3.3.X/ui/effect/src/main/java/org/richfaces/component/UIEffect.java
Log:
https://jira.jboss.org/jira/browse/RF-8203
Modified: branches/community/3.3.X/ui/effect/src/main/java/org/richfaces/component/UIEffect.java
===================================================================
--- branches/community/3.3.X/ui/effect/src/main/java/org/richfaces/component/UIEffect.java 2009-12-14 20:52:39 UTC (rev 16127)
+++ branches/community/3.3.X/ui/effect/src/main/java/org/richfaces/component/UIEffect.java 2009-12-14 20:52:53 UTC (rev 16128)
@@ -25,7 +25,7 @@
import java.util.Map;
import org.ajax4jsf.Messages;
-import org.ajax4jsf.component.EventValueBinding;
+import org.ajax4jsf.component.EventValueExpression;
import javax.faces.component.UIComponent;
import javax.faces.component.UIComponentBase;
import javax.faces.context.FacesContext;
@@ -139,7 +139,7 @@
public void setParentProperties(UIComponent parent){
if (getFor() == "" && getEvent() !="" ) {
- parent.setValueBinding(getEvent(), new EventValueBinding(this));
+ parent.setValueExpression(getEvent(), new EventValueExpression(this));
}
}
14 years, 6 months
JBoss Rich Faces SVN: r16127 - in branches/community/3.3.X/framework/impl/src/main: java/org/richfaces/webapp/taglib and 2 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2009-12-14 15:52:39 -0500 (Mon, 14 Dec 2009)
New Revision: 16127
Added:
branches/community/3.3.X/framework/impl/src/main/java-jsf12/org/ajax4jsf/component/EventValueExpression.java
branches/community/3.3.X/framework/impl/src/main/java-jsf20/org/ajax4jsf/component/EventValueExpression.java
branches/community/3.3.X/framework/impl/src/main/java/org/ajax4jsf/component/AbstractEventValueExpression.java
Removed:
branches/community/3.3.X/framework/impl/src/main/java/org/ajax4jsf/component/EventValueExpression.java
Modified:
branches/community/3.3.X/framework/impl/src/main/java/org/ajax4jsf/component/EventValueBinding.java
branches/community/3.3.X/framework/impl/src/main/java/org/richfaces/webapp/taglib/ValueBindingValueExpressionAdaptor.java
Log:
https://jira.jboss.org/jira/browse/RF-8203
Added: branches/community/3.3.X/framework/impl/src/main/java/org/ajax4jsf/component/AbstractEventValueExpression.java
===================================================================
--- branches/community/3.3.X/framework/impl/src/main/java/org/ajax4jsf/component/AbstractEventValueExpression.java (rev 0)
+++ branches/community/3.3.X/framework/impl/src/main/java/org/ajax4jsf/component/AbstractEventValueExpression.java 2009-12-14 20:52:39 UTC (rev 16127)
@@ -0,0 +1,150 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright ${year}, 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.ajax4jsf.component;
+
+import javax.el.ELContext;
+import javax.el.ELException;
+import javax.el.ValueExpression;
+import javax.faces.component.UIComponent;
+
+import org.ajax4jsf.Messages;
+
+/**
+ * @author Nick Belaevski
+ *
+ */
+public abstract class AbstractEventValueExpression extends ValueExpression {
+
+ /**
+ *
+ */
+ private static final long serialVersionUID = -2600139922687495517L;
+
+ protected abstract AjaxSupport getComponent();
+
+ /**
+ * @param component
+ * the component to set
+ */
+ public abstract void setComponent(AjaxSupport component);
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see javax.el.Expression#equals(java.lang.Object)
+ */
+ @Override
+ public boolean equals(Object obj) {
+ return false;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see javax.el.ValueExpression#getExpectedType()
+ */
+ @Override
+ public Class<?> getExpectedType() {
+ return String.class;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see javax.el.Expression#getExpressionString()
+ */
+ @Override
+ public String getExpressionString() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see javax.el.ValueExpression#getType(javax.el.ELContext)
+ */
+ @Override
+ public Class<?> getType(ELContext context) {
+ return String.class;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see javax.el.ValueExpression#getValue(javax.el.ELContext)
+ */
+ @Override
+ public Object getValue(ELContext context) {
+ AjaxSupport ajaxSupport = getComponent();
+ if (((UIComponent) ajaxSupport).isRendered()) {
+ return ajaxSupport.getEventString();
+ } else {
+ return null;
+ }
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see javax.el.Expression#hashCode()
+ */
+ @Override
+ public int hashCode() {
+ // TODO Auto-generated method stub
+ return 0;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see javax.el.Expression#isLiteralText()
+ */
+ @Override
+ public boolean isLiteralText() {
+ // TODO Auto-generated method stub
+ return false;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see javax.el.ValueExpression#isReadOnly(javax.el.ELContext)
+ */
+ @Override
+ public boolean isReadOnly(ELContext context) {
+ return true;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see javax.el.ValueExpression#setValue(javax.el.ELContext,
+ * java.lang.Object)
+ */
+ @Override
+ public void setValue(ELContext context, Object value) {
+ throw new ELException(Messages.getMessage(Messages.EVENT_IS_READ_ONLY));
+ }
+
+
+}
Modified: branches/community/3.3.X/framework/impl/src/main/java/org/ajax4jsf/component/EventValueBinding.java
===================================================================
--- branches/community/3.3.X/framework/impl/src/main/java/org/ajax4jsf/component/EventValueBinding.java 2009-12-14 15:24:21 UTC (rev 16126)
+++ branches/community/3.3.X/framework/impl/src/main/java/org/ajax4jsf/component/EventValueBinding.java 2009-12-14 20:52:39 UTC (rev 16127)
@@ -21,15 +21,8 @@
package org.ajax4jsf.component;
-import javax.faces.component.StateHolder;
-import javax.faces.component.UIComponent;
-import javax.faces.context.FacesContext;
-import javax.faces.el.EvaluationException;
-import javax.faces.el.PropertyNotFoundException;
-import javax.faces.el.ValueBinding;
+import org.richfaces.webapp.taglib.ValueBindingValueExpressionAdaptor;
-import org.ajax4jsf.Messages;
-import org.ajax4jsf.renderkit.AjaxRendererUtils;
/**
* Inner class for build event string for parent component.
@@ -39,168 +32,44 @@
* not rebuild event string setted as EL expression. TODO - save
* expressions for build event string at render phase.
*/
-public class EventValueBinding extends ValueBinding implements StateHolder {
+public class EventValueBinding extends ValueBindingValueExpressionAdaptor {
- /**
+ /**
*
*/
- private static final long serialVersionUID = -6583167387542332290L;
+ private static final long serialVersionUID = -6583167387542332290L;
- private String _componentId;
+ /**
+ * Default constructor for restoreState.
+ */
+ public EventValueBinding() {
+ super(new EventValueExpression());
+ }
- /**
- * current update component. transient since saved state as component.
- */
- transient private AjaxSupport _component = null;
-
- /**
- * Default constructor for restoreState.
- */
- public EventValueBinding() {
-
- }
-
- /**
- * Constructor for build from AjaxComponent.
- *
- * @param update
- */
- public EventValueBinding(AjaxSupport update) {
- _component = update;
- // _componentId = string;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see javax.faces.el.ValueBinding#getType(javax.faces.context.FacesContext)
- */
- public Class getType(FacesContext facesContext) throws EvaluationException,
- PropertyNotFoundException {
-
- return String.class;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see javax.faces.el.ValueBinding#getValue(javax.faces.context.FacesContext)
- */
- public Object getValue(FacesContext facesContext)
- throws EvaluationException, PropertyNotFoundException {
- if (((UIComponent) getComponent(facesContext)).isRendered()) {
- return getComponent(facesContext).getEventString();
-
- } else {
- return null;
+ /**
+ * Constructor for build from AjaxComponent.
+ *
+ * @param update
+ */
+ public EventValueBinding(AjaxSupport update) {
+ super(new EventValueExpression(update));
}
- }
- private AjaxSupport getComponent(FacesContext facesContext)
- throws EvaluationException {
-
- if (_component == null) {
- UIComponent uiComponent = facesContext.getViewRoot().findComponent(
- _componentId);
- if (null != uiComponent && uiComponent instanceof AjaxSupport) {
- _component = (AjaxSupport) uiComponent;
- } else {
- throw new EvaluationException(Messages.getMessage(
- Messages.COMPONENT_NOT_FOUND, _componentId));
- }
-
+ /*
+ * (non-Javadoc)
+ *
+ * @see javax.faces.component.StateHolder#isTransient()
+ */
+ public boolean isTransient() {
+ return false;
}
- return _component;
- }
-
- /**
- * @param component
- * the component to set
- */
- public void setComponent(AjaxSupport component) {
- _component = component;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see javax.faces.el.ValueBinding#isReadOnly(javax.faces.context.FacesContext)
- */
- public boolean isReadOnly(FacesContext facesContext)
- throws EvaluationException, PropertyNotFoundException {
- // TODO Auto-generated method stub
- return true;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see javax.faces.el.ValueBinding#setValue(javax.faces.context.FacesContext,
- * java.lang.Object)
- */
- public void setValue(FacesContext facesContext, Object value)
- throws EvaluationException, PropertyNotFoundException {
- throw new EvaluationException(Messages
- .getMessage(Messages.EVENT_IS_READ_ONLY));
-
- }
-
- /*
- * (non-Javadoc)
- *
- * @see javax.faces.component.StateHolder#saveState(javax.faces.context.FacesContext)
- */
- public Object saveState(FacesContext context) {
- if (null == _component) {
- return _componentId;
- } else {
- return AjaxRendererUtils
- .getAbsoluteId((UIComponent) getComponent(context));
+ /*
+ * (non-Javadoc)
+ *
+ * @see javax.faces.component.StateHolder#setTransient(boolean)
+ */
+ public void setTransient(boolean newTransientValue) {
}
- }
- /*
- * (non-Javadoc)
- *
- * @see javax.faces.component.StateHolder#restoreState(javax.faces.context.FacesContext,
- * java.lang.Object)
- */
- public void restoreState(FacesContext context, Object state) {
- // TODO Auto-generated method stub
- _componentId = (String) state;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see javax.faces.component.StateHolder#isTransient()
- */
- public boolean isTransient() {
- // TODO Auto-generated method stub
- return false;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see javax.faces.component.StateHolder#setTransient(boolean)
- */
- public void setTransient(boolean newTransientValue) {
- // TODO Auto-generated method stub
-
- }
-
- /*
- * (non-Javadoc)
- *
- * @see javax.faces.el.ValueBinding#getExpressionString()
- */
- public String getExpressionString() {
- // FacesContext context = FacesContext.getCurrentInstance();
- // UIComponent component = (UIComponent) getComponent(context);
- // return "#{ajaxSupport["+component.getClientId(context)+"]}";
- return null;
- }
-
}
\ No newline at end of file
Deleted: branches/community/3.3.X/framework/impl/src/main/java/org/ajax4jsf/component/EventValueExpression.java
===================================================================
--- branches/community/3.3.X/framework/impl/src/main/java/org/ajax4jsf/component/EventValueExpression.java 2009-12-14 15:24:21 UTC (rev 16126)
+++ branches/community/3.3.X/framework/impl/src/main/java/org/ajax4jsf/component/EventValueExpression.java 2009-12-14 20:52:39 UTC (rev 16127)
@@ -1,216 +0,0 @@
-/**
- * License Agreement.
- *
- * Rich Faces - Natural Ajax for Java Server Faces (JSF)
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library 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 library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-package org.ajax4jsf.component;
-
-import javax.el.ELContext;
-import javax.el.ELException;
-import javax.el.ValueExpression;
-import javax.faces.component.StateHolder;
-import javax.faces.component.UIComponent;
-import javax.faces.context.FacesContext;
-
-import org.ajax4jsf.Messages;
-import org.ajax4jsf.renderkit.AjaxRendererUtils;
-
-/**
- * @author Maksim Kaszynski
- *
- */
-public class EventValueExpression extends ValueExpression implements
- StateHolder {
-
- /**
- *
- */
- private static final long serialVersionUID = -6583167387542332290L;
-
- private String componentId;
-
- /**
- * current update component. transient since saved state as component.
- */
- transient private AjaxSupport component = null;
-
-
- public EventValueExpression() {
- // TODO Auto-generated constructor stub
- }
-
- public EventValueExpression(AjaxSupport component) {
- super();
- this.component = component;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see javax.el.Expression#equals(java.lang.Object)
- */
- @Override
- public boolean equals(Object obj) {
- // TODO Auto-generated method stub
- return false;
- }
-
- private AjaxSupport getComponent(FacesContext facesContext)
- throws ELException {
-
- if (component == null) {
- UIComponent uiComponent = facesContext.getViewRoot().findComponent(
- componentId);
- if (null != uiComponent && uiComponent instanceof AjaxSupport) {
- component = (AjaxSupport) uiComponent;
- } else {
- throw new ELException(Messages.getMessage(
- Messages.COMPONENT_NOT_FOUND, componentId));
- }
-
- }
-
- return component;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see javax.el.ValueExpression#getExpectedType()
- */
- @Override
- public Class<?> getExpectedType() {
- return String.class;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see javax.el.Expression#getExpressionString()
- */
- @Override
- public String getExpressionString() {
- // TODO Auto-generated method stub
- return null;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see javax.el.ValueExpression#getType(javax.el.ELContext)
- */
- @Override
- public Class<?> getType(ELContext context) {
- return String.class;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see javax.el.ValueExpression#getValue(javax.el.ELContext)
- */
- @Override
- public Object getValue(ELContext context) {
- FacesContext facesContext = FacesContext.getCurrentInstance();
- AjaxSupport component = getComponent(facesContext);
- if (((UIComponent) component).isRendered()) {
- return component.getEventString();
-
- } else {
- return null;
- }
- }
-
- /*
- * (non-Javadoc)
- *
- * @see javax.el.Expression#hashCode()
- */
- @Override
- public int hashCode() {
- // TODO Auto-generated method stub
- return 0;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see javax.el.Expression#isLiteralText()
- */
- @Override
- public boolean isLiteralText() {
- // TODO Auto-generated method stub
- return false;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see javax.el.ValueExpression#isReadOnly(javax.el.ELContext)
- */
- @Override
- public boolean isReadOnly(ELContext context) {
- return true;
- }
-
- public boolean isTransient() {
- return false;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see javax.faces.component.StateHolder#restoreState(javax.faces.context.FacesContext,
- * java.lang.Object)
- */
- public void restoreState(FacesContext context, Object state) {
- componentId = (String) state;
- }
-
- public Object saveState(FacesContext context) {
- if (null == component) {
- return componentId;
- } else {
- return AjaxRendererUtils
- .getAbsoluteId((UIComponent) getComponent(context));
- }
- }
-
- /**
- * @param component
- * the component to set
- */
- public void setComponent(AjaxSupport component) {
- this.component = component;
- }
-
- public void setTransient(boolean newTransientValue) {
- }
-
- /*
- * (non-Javadoc)
- *
- * @see javax.el.ValueExpression#setValue(javax.el.ELContext,
- * java.lang.Object)
- */
- @Override
- public void setValue(ELContext context, Object value) {
- throw new ELException(Messages.getMessage(Messages.EVENT_IS_READ_ONLY));
- }
-
-}
Modified: branches/community/3.3.X/framework/impl/src/main/java/org/richfaces/webapp/taglib/ValueBindingValueExpressionAdaptor.java
===================================================================
--- branches/community/3.3.X/framework/impl/src/main/java/org/richfaces/webapp/taglib/ValueBindingValueExpressionAdaptor.java 2009-12-14 15:24:21 UTC (rev 16126)
+++ branches/community/3.3.X/framework/impl/src/main/java/org/richfaces/webapp/taglib/ValueBindingValueExpressionAdaptor.java 2009-12-14 20:52:39 UTC (rev 16127)
@@ -20,9 +20,12 @@
*/
package org.richfaces.webapp.taglib;
+import java.io.Serializable;
+
import javax.el.ELException;
import javax.el.ValueExpression;
import javax.faces.component.StateHolder;
+import javax.faces.component.UIComponentBase;
import javax.faces.context.FacesContext;
import javax.faces.el.EvaluationException;
import javax.faces.el.PropertyNotFoundException;
@@ -33,8 +36,13 @@
*
*/
@SuppressWarnings("deprecation")
-public class ValueBindingValueExpressionAdaptor extends ValueBinding implements StateHolder {
+public class ValueBindingValueExpressionAdaptor extends ValueBinding implements StateHolder, Serializable {
+ /**
+ *
+ */
+ private static final long serialVersionUID = 3242030160417022811L;
+
private ValueExpression expression;
private boolean tranzient;
@@ -105,11 +113,11 @@
}
public void restoreState(FacesContext context, Object state) {
- expression = (ValueExpression) state;
+ expression = (ValueExpression) UIComponentBase.restoreAttachedState(context, state);
}
public Object saveState(FacesContext context) {
- return expression;
+ return UIComponentBase.saveAttachedState(context, expression);
}
public void setTransient(boolean newTransientValue) {
Added: branches/community/3.3.X/framework/impl/src/main/java-jsf12/org/ajax4jsf/component/EventValueExpression.java
===================================================================
--- branches/community/3.3.X/framework/impl/src/main/java-jsf12/org/ajax4jsf/component/EventValueExpression.java (rev 0)
+++ branches/community/3.3.X/framework/impl/src/main/java-jsf12/org/ajax4jsf/component/EventValueExpression.java 2009-12-14 20:52:39 UTC (rev 16127)
@@ -0,0 +1,112 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright ${year}, 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.ajax4jsf.component;
+
+import javax.el.ELException;
+import javax.faces.component.StateHolder;
+import javax.faces.component.UIComponent;
+import javax.faces.context.FacesContext;
+
+import org.ajax4jsf.Messages;
+import org.ajax4jsf.renderkit.AjaxRendererUtils;
+
+/**
+ * @author Nick Belaevski
+ *
+ */
+public class EventValueExpression extends AbstractEventValueExpression
+ implements StateHolder {
+
+ /**
+ *
+ */
+ private static final long serialVersionUID = -6583167387542332290L;
+
+ private String componentId;
+
+ /**
+ * current update component. transient since saved state as component.
+ */
+ transient private AjaxSupport component = null;
+
+ public EventValueExpression() {
+ }
+
+ public EventValueExpression(AjaxSupport component) {
+
+ super();
+ this.component = component;
+ }
+
+ public boolean isTransient() {
+ return false;
+ }
+
+ public void setTransient(boolean newTransientValue) {
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @seejavax.faces.component.StateHolder#restoreState(javax.faces.context.
+ * FacesContext, java.lang.Object)
+ */
+ public void restoreState(FacesContext context, Object state) {
+ componentId = (String) state;
+ }
+
+ public Object saveState(FacesContext context) {
+ if (null == component) {
+ return componentId;
+ } else {
+ return AjaxRendererUtils
+ .getAbsoluteId((UIComponent) getComponent());
+ }
+ }
+
+ /**
+ * @param component
+ * the component to set
+ */
+ public void setComponent(AjaxSupport component) {
+ this.component = component;
+ }
+
+ @Override
+ protected AjaxSupport getComponent() {
+ if (component == null) {
+ FacesContext facesContext = FacesContext.getCurrentInstance();
+ UIComponent uiComponent = facesContext.getViewRoot().findComponent(
+ componentId);
+ if (null != uiComponent && uiComponent instanceof AjaxSupport) {
+ component = (AjaxSupport) uiComponent;
+ } else {
+ throw new ELException(Messages.getMessage(
+ Messages.COMPONENT_NOT_FOUND, componentId));
+ }
+
+ }
+
+ return component;
+ }
+
+}
Added: branches/community/3.3.X/framework/impl/src/main/java-jsf20/org/ajax4jsf/component/EventValueExpression.java
===================================================================
--- branches/community/3.3.X/framework/impl/src/main/java-jsf20/org/ajax4jsf/component/EventValueExpression.java (rev 0)
+++ branches/community/3.3.X/framework/impl/src/main/java-jsf20/org/ajax4jsf/component/EventValueExpression.java 2009-12-14 20:52:39 UTC (rev 16127)
@@ -0,0 +1,98 @@
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library 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 library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+package org.ajax4jsf.component;
+
+import javax.el.ELException;
+import javax.faces.component.UIComponent;
+import javax.faces.context.FacesContext;
+
+import org.ajax4jsf.Messages;
+
+/**
+ * @author Maksim Kaszynski
+ *
+ */
+public class EventValueExpression extends AbstractEventValueExpression {
+
+ /**
+ *
+ */
+ private static final long serialVersionUID = -6583167387542332290L;
+
+ private String componentId;
+
+ public EventValueExpression() {
+ super();
+ }
+
+ public EventValueExpression(AjaxSupport component) {
+ super();
+
+ this.componentId = ((UIComponent) component).getId();
+ }
+
+ private UIComponent quickFindComponent(UIComponent component, String componentId) {
+ UIComponent result = null;
+
+ if (component.getFacetCount() > 0) {
+ for (UIComponent c : component.getFacets().values()) {
+ if (componentId.equals(c.getId())) {
+ result = c;
+ break;
+ }
+ }
+ }
+
+ if (result == null && component.getChildCount() > 0) {
+ for (UIComponent c : component.getChildren()) {
+ if (componentId.equals(c.getId())) {
+ result = c;
+ break;
+ }
+ }
+ }
+
+ return result;
+ }
+
+ protected AjaxSupport getComponent() {
+ FacesContext facesContext = FacesContext.getCurrentInstance();
+ UIComponent currentComponent = UIComponent.getCurrentComponent(facesContext);
+ UIComponent foundComponent = null;
+
+ if (currentComponent != null) {
+ foundComponent = quickFindComponent(currentComponent, componentId);
+ }
+
+ if (foundComponent == null || !(foundComponent instanceof AjaxSupport)) {
+ throw new ELException(Messages.getMessage(
+ Messages.COMPONENT_NOT_FOUND, componentId));
+ }
+
+ return (AjaxSupport) foundComponent;
+ }
+
+ @Override
+ public void setComponent(AjaxSupport ajaxSupport) {
+ this.componentId = ((UIComponent) ajaxSupport).getId();
+ }
+
+}
14 years, 6 months
JBoss Rich Faces SVN: r16126 - branches/sandbox/rf-demo-ftest-iexplore/src/test/java/org/jboss/richfaces/integrationTest/keepAlive.
by richfaces-svn-commits@lists.jboss.org
Author: lfryc(a)redhat.com
Date: 2009-12-14 10:24:21 -0500 (Mon, 14 Dec 2009)
New Revision: 16126
Modified:
branches/sandbox/rf-demo-ftest-iexplore/src/test/java/org/jboss/richfaces/integrationTest/keepAlive/KeepAliveTestCase.java
Log:
* KeepAlive
- uncompability in handling @disabled - IE is using 'false' when enabling instead of Firefoxe's removing of the attribute
Modified: branches/sandbox/rf-demo-ftest-iexplore/src/test/java/org/jboss/richfaces/integrationTest/keepAlive/KeepAliveTestCase.java
===================================================================
--- branches/sandbox/rf-demo-ftest-iexplore/src/test/java/org/jboss/richfaces/integrationTest/keepAlive/KeepAliveTestCase.java 2009-12-14 15:22:15 UTC (rev 16125)
+++ branches/sandbox/rf-demo-ftest-iexplore/src/test/java/org/jboss/richfaces/integrationTest/keepAlive/KeepAliveTestCase.java 2009-12-14 15:24:21 UTC (rev 16126)
@@ -66,13 +66,8 @@
selenium.fireEvent(LOC_INPUT_INCORRECT2, Event.KEYUP);
// wait for "equal sign" button became enabled (lost disabled status)
- Wait.failWith("Button \"=\" never became enabled").until(new Condition() {
- public boolean isTrue() {
- return !selenium.isElementPresent(format("{0}/@disabled", LOC_BUTTON_INCORRECT));
+ Wait.failWith("Button \"=\" never became enabled").until(new ButtonDisabled(LOC_BUTTON_INCORRECT));
- }
- });
-
// try to count result
selenium.click(LOC_BUTTON_INCORRECT);
@@ -101,11 +96,7 @@
selenium.fireEvent(LOC_INPUT_CORRECT2, Event.KEYUP);
// wait for "equal sign" button became enabled (lost disabled status)
- Wait.failWith("Button \"=\" never became enabled").until(new Condition() {
- public boolean isTrue() {
- return !selenium.isElementPresent(format("{0}/@disabled", LOC_BUTTON_CORRECT));
- }
- });
+ Wait.failWith("Button \"=\" never became enabled").until(new ButtonDisabled(LOC_BUTTON_CORRECT));
// try to count result
selenium.click(LOC_BUTTON_CORRECT);
@@ -119,6 +110,25 @@
}
});
}
+
+ private class ButtonDisabled implements Condition {
+ private String locButton;
+
+ public ButtonDisabled(String locButton) {
+ this.locButton = locButton;
+ }
+
+ public boolean isTrue() {
+ final String attrDisabled = format("{0} @disabled", locButton);
+
+ if (!selenium.isElementPresent(attrDisabled)) {
+ return true;
+ }
+
+ return "false".equals(selenium.getValue(attrDisabled));
+ }
+
+ }
@SuppressWarnings("unused")
@BeforeMethod
14 years, 6 months
JBoss Rich Faces SVN: r16125 - branches/sandbox/rf-demo-ftest-iexplore/src/test/resources/org/jboss/richfaces/integrationTest/graphValidator.
by richfaces-svn-commits@lists.jboss.org
Author: lfryc(a)redhat.com
Date: 2009-12-14 10:22:15 -0500 (Mon, 14 Dec 2009)
New Revision: 16125
Modified:
branches/sandbox/rf-demo-ftest-iexplore/src/test/resources/org/jboss/richfaces/integrationTest/graphValidator/locators.properties
Log:
* GraphValidator - fixed locator to don't use absolute parenting (>)
Modified: branches/sandbox/rf-demo-ftest-iexplore/src/test/resources/org/jboss/richfaces/integrationTest/graphValidator/locators.properties
===================================================================
--- branches/sandbox/rf-demo-ftest-iexplore/src/test/resources/org/jboss/richfaces/integrationTest/graphValidator/locators.properties 2009-12-14 15:20:55 UTC (rev 16124)
+++ branches/sandbox/rf-demo-ftest-iexplore/src/test/resources/org/jboss/richfaces/integrationTest/graphValidator/locators.properties 2009-12-14 15:22:15 UTC (rev 16125)
@@ -8,4 +8,4 @@
BUTTON_SUBMIT_ACTIVITIES=jquery=input[value=Store my details]
OUTPUT_VALIDATION_MESSAGE=jquery=form#graphValidatorForm2 span.rich-messages-label
CLASS_VALIDATION_MESSAGE=jquery=form#graphValidatorForm2 dt@class
-INPUT_ACTIVITY_HOURS_PREFORMATTED=jquery=form#graphValidatorForm2 > table > tbody > tr:nth-child({0}) input.rich-spinner-input
+INPUT_ACTIVITY_HOURS_PREFORMATTED=jquery\=form\#graphValidatorForm2 tr\:nth-child({0}) input.rich-spinner-input
14 years, 6 months
JBoss Rich Faces SVN: r16124 - branches/sandbox/rf-demo-ftest-iexplore/src/test/java/org/jboss/richfaces/integrationTest/inputNumberSlider.
by richfaces-svn-commits@lists.jboss.org
Author: lfryc(a)redhat.com
Date: 2009-12-14 10:20:55 -0500 (Mon, 14 Dec 2009)
New Revision: 16124
Modified:
branches/sandbox/rf-demo-ftest-iexplore/src/test/java/org/jboss/richfaces/integrationTest/inputNumberSlider/InputNumberSliderTestCase.java
Log:
* InputNumberSlider
- fixed method getting offset of slider handler - using jQuery's element.location().left - JavaScript implementation (needs to have the handle visible when getting position in Firefox)
Modified: branches/sandbox/rf-demo-ftest-iexplore/src/test/java/org/jboss/richfaces/integrationTest/inputNumberSlider/InputNumberSliderTestCase.java
===================================================================
--- branches/sandbox/rf-demo-ftest-iexplore/src/test/java/org/jboss/richfaces/integrationTest/inputNumberSlider/InputNumberSliderTestCase.java 2009-12-14 15:17:14 UTC (rev 16123)
+++ branches/sandbox/rf-demo-ftest-iexplore/src/test/java/org/jboss/richfaces/integrationTest/inputNumberSlider/InputNumberSliderTestCase.java 2009-12-14 15:20:55 UTC (rev 16124)
@@ -79,16 +79,16 @@
*/
@Test
public void testFirstSliderMouse() {
- assertTrue(Math.abs(getOffset(LOC_FIRST_HANDLE + "@style") - 75) < DELTA, format(MSG_HANDLE_N_PX, 75));
- assertTrue(Math.abs(getOffset(LOC_FIRST_TIP + "@style") - 75) < DELTA, format(MSG_TIP_N_PX, 75));
+ assertTrue(Math.abs(getOffset(LOC_FIRST_HANDLE) - 75) < DELTA, format(MSG_HANDLE_N_PX, 75));
+ assertTrue(Math.abs(getOffset(LOC_FIRST_TIP) - 75) < DELTA, format(MSG_TIP_N_PX, 75));
assertFalse(isDisplayed(LOC_FIRST_TIP), MSG_TIP_SHOULD_NOT_BE_VISIBLE);
selenium.mouseDownAt(LOC_FIRST, "20,3");
assertTrue(isDisplayed(LOC_FIRST_TIP), MSG_TIP_SHOULD_BE_VISIBLE);
selenium.mouseUp(LOC_FIRST);
- int tipOffset = getOffset(LOC_FIRST_TIP + "@style");
- int handleOffset = getOffset(LOC_FIRST_HANDLE + "@style");
+ int tipOffset = getOffset(LOC_FIRST_TIP);
+ int handleOffset = getOffset(LOC_FIRST_HANDLE);
int value = Integer.parseInt(selenium.getValue(LOC_FIRST_INPUT));
assertEquals(tipOffset, handleOffset, MSG_OFFSETS_SHOULD_BE_THE_SAME);
@@ -107,16 +107,16 @@
@Test
public void testFirstSliderKeyboard() {
selenium.type(LOC_FIRST_INPUT, "10");
- int tipOffset = getOffset(LOC_FIRST_TIP + "@style");
- int handleOffset = getOffset(LOC_FIRST_HANDLE + "@style");
+ int tipOffset = getOffset(LOC_FIRST_TIP);
+ int handleOffset = getOffset(LOC_FIRST_HANDLE);
assertEquals(tipOffset, handleOffset, MSG_OFFSETS_SHOULD_BE_THE_SAME);
assertTrue(Math.abs(tipOffset - 10 * 1.5) < DELTA, MSG_TIP_FIRST_HALF);
assertTrue(handleOffset < 75, MSG_HANDLE_FIRST_HALF);
selenium.type(LOC_FIRST_INPUT, "90");
- tipOffset = getOffset(LOC_FIRST_TIP + "@style");
- handleOffset = getOffset(LOC_FIRST_HANDLE + "@style");
+ tipOffset = getOffset(LOC_FIRST_TIP);
+ handleOffset = getOffset(LOC_FIRST_HANDLE);
assertEquals(tipOffset, handleOffset, MSG_OFFSETS_SHOULD_BE_THE_SAME);
assertTrue(Math.abs(tipOffset - 90 * 1.5) < DELTA, MSG_TIP_SECOND_HALF);
@@ -151,8 +151,8 @@
*/
@Test
public void testSecondSlider() {
- assertTrue(Math.abs(getOffset(LOC_SECOND_HANDLE + "@style") - 96) < DELTA, format(MSG_HANDLE_N_PX, 96));
- assertTrue(Math.abs(getOffset(LOC_SECOND_TIP + "@style") - 96) < DELTA, format(MSG_TIP_N_PX, 96));
+ assertTrue(Math.abs(getOffset(LOC_SECOND_HANDLE) - 96) < DELTA, format(MSG_HANDLE_N_PX, 96));
+ assertTrue(Math.abs(getOffset(LOC_SECOND_TIP) - 96) < DELTA, format(MSG_TIP_N_PX, 96));
assertFalse(isDisplayed(LOC_SECOND_TIP), MSG_TIP_SHOULD_NOT_BE_VISIBLE);
selenium.mouseDownAt(LOC_SECOND, "20,3");
@@ -160,8 +160,8 @@
assertFalse(isDisplayed(LOC_SECOND_TIP), MSG_TIP_SHOULD_NOT_BE_VISIBLE);
selenium.mouseUp(LOC_SECOND);
- int tipOffset = getOffset(LOC_SECOND_TIP + "@style");
- int handleOffset = getOffset(LOC_SECOND_HANDLE + "@style");
+ int tipOffset = getOffset(LOC_SECOND_TIP);
+ int handleOffset = getOffset(LOC_SECOND_HANDLE);
int value = Integer.parseInt(selenium.getValue(LOC_SECOND_INPUT));
assertEquals(tipOffset, handleOffset, MSG_OFFSETS_SHOULD_BE_THE_SAME);
@@ -177,8 +177,8 @@
*/
@Test
public void testThirdSliderMouse() {
- assertTrue(Math.abs(getOffset(LOC_THIRD_HANDLE + "@style") - 225) < DELTA, format(MSG_HANDLE_N_PX, 225));
- assertTrue(Math.abs(getOffset(LOC_THIRD_TIP + "@style") - 225) < DELTA, format(MSG_TIP_N_PX, 225));
+ assertTrue(Math.abs(getOffset(LOC_THIRD_HANDLE) - 225) < DELTA, format(MSG_HANDLE_N_PX, 225));
+ assertTrue(Math.abs(getOffset(LOC_THIRD_TIP) - 225) < DELTA, format(MSG_TIP_N_PX, 225));
assertFalse(isDisplayed(LOC_THIRD_TIP), MSG_TIP_SHOULD_NOT_BE_VISIBLE);
selenium.mouseDownAt(LOC_THIRD, "20,3");
@@ -186,8 +186,8 @@
assertFalse(isDisplayed(LOC_THIRD_TIP), MSG_TIP_SHOULD_NOT_BE_VISIBLE);
selenium.mouseUp(LOC_THIRD);
- int tipOffset = getOffset(LOC_THIRD_TIP + "@style");
- int handleOffset = getOffset(LOC_THIRD_HANDLE + "@style");
+ int tipOffset = getOffset(LOC_THIRD_TIP);
+ int handleOffset = getOffset(LOC_THIRD_HANDLE);
int value = Integer.parseInt(selenium.getValue(LOC_THIRD_INPUT));
assertEquals(tipOffset, handleOffset, MSG_OFFSETS_SHOULD_BE_THE_SAME);
@@ -207,16 +207,16 @@
@Test
public void testThirdSliderKeyboard() {
selenium.type(LOC_THIRD_INPUT, "10"); // 10 -> 0
- int tipOffset = getOffset(LOC_THIRD_TIP + "@style");
- int handleOffset = getOffset(LOC_THIRD_HANDLE + "@style");
+ int tipOffset = getOffset(LOC_THIRD_TIP);
+ int handleOffset = getOffset(LOC_THIRD_HANDLE);
assertEquals(tipOffset, handleOffset, MSG_OFFSETS_SHOULD_BE_THE_SAME);
assertTrue(tipOffset < 5, MSG_TIP_FIRST_HALF);
assertTrue(handleOffset < 75, MSG_HANDLE_FIRST_HALF);
selenium.type(LOC_THIRD_INPUT, "690"); // 690 -> 700
- tipOffset = getOffset(LOC_THIRD_TIP + "@style");
- handleOffset = getOffset(LOC_THIRD_HANDLE + "@style");
+ tipOffset = getOffset(LOC_THIRD_TIP);
+ handleOffset = getOffset(LOC_THIRD_HANDLE);
assertEquals(tipOffset, handleOffset, MSG_OFFSETS_SHOULD_BE_THE_SAME);
assertTrue(Math.abs(tipOffset - 0.69 * 450) < DELTA, MSG_TIP_SECOND_HALF);
@@ -269,24 +269,24 @@
};
abstractTestSource(1, "View Source", strings);
- }
-
+ }
+
/**
- * Returns the offset of the element. It requires a locator for an
- * attribute, e.g. //div@style. It returns the 'left' attribute, e.g. for
- * style="visibility: visible; left: 51px;" would return 51.
+ * Returns the offset of the element for given locator. It returns the
+ * 'left' attribute.
*/
private int getOffset(String locator) {
- StringBuilder attr = new StringBuilder(selenium.getAttribute(locator));
- attr = attr.delete(0, attr.indexOf("left: "));
- attr = attr.delete(0, 6);
- attr = attr.delete(attr.indexOf("px;"), attr.length());
- return Integer.parseInt(attr.toString());
+ String jquery = locator.replaceAll("^jquery=", "");
+ String eval = "var inDocument = this.browserbot.getCurrentWindow().document;"
+ + "var handle = $('{0}', inDocument); var hidden = handle.css('display') === 'none';"
+ + "hidden ? handle.css('display', '') : true;" + "var result = handle.position().left;"
+ + "hidden ? handle.css('display','none') : true;" + "result";
+ return Integer.parseInt(selenium.getEval(format(eval, jquery)));
}
/**
- * Loads the page containing needed component.
- */
+ * Loads the page containing needed component.
+ */
@SuppressWarnings("unused")
@BeforeMethod
private void loadPage() {
14 years, 6 months
JBoss Rich Faces SVN: r16123 - branches/sandbox/rf-demo-ftest-iexplore/src/test/java/org/jboss/richfaces/integrationTest/extendedDataTable.
by richfaces-svn-commits@lists.jboss.org
Author: lfryc(a)redhat.com
Date: 2009-12-14 10:17:14 -0500 (Mon, 14 Dec 2009)
New Revision: 16123
Modified:
branches/sandbox/rf-demo-ftest-iexplore/src/test/java/org/jboss/richfaces/integrationTest/extendedDataTable/AbstractExtendedDataTableTestCase.java
branches/sandbox/rf-demo-ftest-iexplore/src/test/java/org/jboss/richfaces/integrationTest/extendedDataTable/FilteringTestCase.java
branches/sandbox/rf-demo-ftest-iexplore/src/test/java/org/jboss/richfaces/integrationTest/extendedDataTable/GroupingTestCase.java
Log:
* EDT - Filtering, Grouping
- added method recognizing type of browser: boolean browserIsInternetExplorer()
- when counting number of rows in EDT, the result is by 1 greater than in actual row count - actually the first row is empty, so added platform dependent skip of first row
Modified: branches/sandbox/rf-demo-ftest-iexplore/src/test/java/org/jboss/richfaces/integrationTest/extendedDataTable/AbstractExtendedDataTableTestCase.java
===================================================================
--- branches/sandbox/rf-demo-ftest-iexplore/src/test/java/org/jboss/richfaces/integrationTest/extendedDataTable/AbstractExtendedDataTableTestCase.java 2009-12-14 15:12:25 UTC (rev 16122)
+++ branches/sandbox/rf-demo-ftest-iexplore/src/test/java/org/jboss/richfaces/integrationTest/extendedDataTable/AbstractExtendedDataTableTestCase.java 2009-12-14 15:17:14 UTC (rev 16123)
@@ -21,9 +21,12 @@
*******************************************************************************/
package org.jboss.richfaces.integrationTest.extendedDataTable;
+import org.apache.commons.lang.StringUtils;
import org.jboss.richfaces.integrationTest.AbstractDataIterationTestCase;
import org.jboss.test.selenium.waiting.Condition;
+import org.testng.annotations.BeforeClass;
import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Parameters;
/**
* @author <a href="mailto:lfryc@redhat.com">Lukas Fryc</a>
@@ -47,6 +50,8 @@
private final String MSG_OPTION_SELECTION_MODE_PREFORMATTED = getMsg("OPTION_SELECTION_MODE_PREFORMATTED");
+ private String browser;
+
@BeforeMethod
protected void loadPage() {
openComponent("Extended Data Table");
@@ -55,6 +60,22 @@
selenium.allowNativeXpath("true");
}
+ @BeforeClass
+ @Parameters( { "browser" })
+ public void detectBrowser(String browser) {
+ this.browser = browser;
+ }
+
+ protected boolean browserIsInternetExplorer() {
+ String[] ies = new String[] { "*iexplore", "*piiexplore", "*iehta" };
+ for (String ie : ies) {
+ if (StringUtils.defaultString(browser).startsWith(ie)) {
+ return true;
+ }
+ }
+ return false;
+ }
+
/**
* Wait for splash screen indicating request of table rerendering disappears
*/
Modified: branches/sandbox/rf-demo-ftest-iexplore/src/test/java/org/jboss/richfaces/integrationTest/extendedDataTable/FilteringTestCase.java
===================================================================
--- branches/sandbox/rf-demo-ftest-iexplore/src/test/java/org/jboss/richfaces/integrationTest/extendedDataTable/FilteringTestCase.java 2009-12-14 15:12:25 UTC (rev 16122)
+++ branches/sandbox/rf-demo-ftest-iexplore/src/test/java/org/jboss/richfaces/integrationTest/extendedDataTable/FilteringTestCase.java 2009-12-14 15:17:14 UTC (rev 16123)
@@ -21,7 +21,7 @@
*******************************************************************************/
package org.jboss.richfaces.integrationTest.extendedDataTable;
-import static org.testng.Assert.*;
+import static org.testng.Assert.assertTrue;
import org.apache.commons.lang.StringUtils;
import org.jboss.test.selenium.dom.Event;
@@ -79,6 +79,10 @@
int rows = getJQueryCount(format(cellsState, 0));
for (int row = 1; row <= rows; row++) {
+ if (row == 1 && browserIsInternetExplorer()) {
+ continue;
+ }
+
if (statePrefix.length() > 0) {
String state = selenium.getText(format(cellsState, row));
assertTrue(state.startsWith(statePrefix), format("'{0}' doesn't start with prefix '{1}'", state,
Modified: branches/sandbox/rf-demo-ftest-iexplore/src/test/java/org/jboss/richfaces/integrationTest/extendedDataTable/GroupingTestCase.java
===================================================================
--- branches/sandbox/rf-demo-ftest-iexplore/src/test/java/org/jboss/richfaces/integrationTest/extendedDataTable/GroupingTestCase.java 2009-12-14 15:12:25 UTC (rev 16122)
+++ branches/sandbox/rf-demo-ftest-iexplore/src/test/java/org/jboss/richfaces/integrationTest/extendedDataTable/GroupingTestCase.java 2009-12-14 15:17:14 UTC (rev 16123)
@@ -58,6 +58,10 @@
String expectedGroup = null;
for (int row = 1; row <= rows; row++) {
+ if (row == 1 && browserIsInternetExplorer()) {
+ continue;
+ }
+
if (belongsClass(MSG_TR_CLASS, format(LOC_TR_PREFORMATTED, row))) {
// table row is type group
expectedGroup = selenium.getText(format(LOC_TD_GROUP_PREFORMATTED, row)).replace("State Name: ", "").replace("(1)", "");
14 years, 6 months
JBoss Rich Faces SVN: r16122 - in branches/sandbox/rf-demo-ftest-iexplore/src/test: resources/org/jboss/richfaces/integrationTest/dataTable and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: lfryc(a)redhat.com
Date: 2009-12-14 10:12:25 -0500 (Mon, 14 Dec 2009)
New Revision: 16122
Modified:
branches/sandbox/rf-demo-ftest-iexplore/src/test/java/org/jboss/richfaces/integrationTest/dataTable/DataTableTestCase.java
branches/sandbox/rf-demo-ftest-iexplore/src/test/resources/org/jboss/richfaces/integrationTest/dataTable/messages-DataTableTestCase.properties
Log:
* DataTableTestCase
- string was normalized by deleting all whitespaces - the expected content of whole data table was changes adequately in messages
Modified: branches/sandbox/rf-demo-ftest-iexplore/src/test/java/org/jboss/richfaces/integrationTest/dataTable/DataTableTestCase.java
===================================================================
--- branches/sandbox/rf-demo-ftest-iexplore/src/test/java/org/jboss/richfaces/integrationTest/dataTable/DataTableTestCase.java 2009-12-14 15:11:00 UTC (rev 16121)
+++ branches/sandbox/rf-demo-ftest-iexplore/src/test/java/org/jboss/richfaces/integrationTest/dataTable/DataTableTestCase.java 2009-12-14 15:12:25 UTC (rev 16122)
@@ -23,6 +23,7 @@
import static org.testng.Assert.*;
+import org.apache.commons.lang.StringUtils;
import org.jboss.richfaces.integrationTest.AbstractDataIterationTestCase;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
@@ -47,7 +48,9 @@
openTab(MSG_TAB_TO_OPEN);
scrollIntoView(LOC_FIELDSET_HEADER, true);
- assertEquals(selenium.getText(LOC_TABLE), MSG_TABLE_TEXT_CONTENT, "Table doesn't contain expected text");
+ String tableText = selenium.getText(LOC_TABLE);
+ tableText = StringUtils.deleteWhitespace(tableText);
+ assertEquals(tableText, MSG_TABLE_TEXT_CONTENT, "Table doesn't contain expected text");
}
@SuppressWarnings("unused")
Modified: branches/sandbox/rf-demo-ftest-iexplore/src/test/resources/org/jboss/richfaces/integrationTest/dataTable/messages-DataTableTestCase.properties
===================================================================
--- branches/sandbox/rf-demo-ftest-iexplore/src/test/resources/org/jboss/richfaces/integrationTest/dataTable/messages-DataTableTestCase.properties 2009-12-14 15:11:00 UTC (rev 16121)
+++ branches/sandbox/rf-demo-ftest-iexplore/src/test/resources/org/jboss/richfaces/integrationTest/dataTable/messages-DataTableTestCase.properties 2009-12-14 15:12:25 UTC (rev 16122)
@@ -1,2 +1,2 @@
TAB_TO_OPEN=Usage
-TABLE_TEXT_CONTENT=ExpensessubtotalsMealsHotelsTransportTotals$196.27$442.00$162.00$800.27San Jose25-Aug-97$37.74$112.00$45.0026-Aug-97$27.28$112.00$45.00$65.02$224.00$90.00$379.02Seattle27-Aug-97$96.25$109.00$36.0028-Aug-97$35.00$109.00$36.00$131.25$218.00$72.00$421.25
+TABLE_TEXT_CONTENT=ExpensessubtotalsMealsHotelsTransportTotals$196.27$442.00$162.00$800.27SanJose25-Aug-97$37.74$112.00$45.0026-Aug-97$27.28$112.00$45.00$65.02$224.00$90.00$379.02Seattle27-Aug-97$96.25$109.00$36.0028-Aug-97$35.00$109.00$36.00$131.25$218.00$72.00$421.25
14 years, 6 months