JBoss Rich Faces SVN: r18304 - in root: archetypes/richfaces-archetype-simpleapp and 21 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: Alex.Kolonitsky
Date: 2010-07-30 15:53:36 -0400 (Fri, 30 Jul 2010)
New Revision: 18304
Added:
root/branches/
root/branches/richfaces-archetype-simpleapp-4.0.0.20100713-M1/
root/branches/richfaces-archetype-simpleapp-4.0.0.Alpha2/
root/branches/richfaces-cdk-4.0.0.20100713-M1/
root/branches/richfaces-cdk-4.0.0.Alpha2/
root/branches/richfaces-commons-4.0.0.20100713-M1/
root/branches/richfaces-commons-4.0.0.Alpha2/
root/branches/richfaces-core-4.0.0.20100713-M1/
root/branches/richfaces-core-4.0.0.Alpha2/
root/branches/richfaces-core-demo-4.0.0.20100713-M1/
root/branches/richfaces-core-demo-4.0.0.Alpha2/
root/branches/richfaces-dist-4.0.0.20100713-M1/
root/branches/richfaces-dist-4.0.0.Alpha2/
root/branches/richfaces-docs-4.0.0.Alpha1/
root/branches/richfaces-showcase-4.0.0.20100713-M1/
root/branches/richfaces-showcase-4.0.0.Alpha2/
root/branches/richfaces-ui-core-4.0.0.20100713-M1/
root/branches/richfaces-ui-dist-4.0.0.20100713-M1/
root/branches/richfaces-ui-dist-4.0.0.Alpha2/
root/branches/richfaces-ui-iteration-4.0.0.20100713-M1/
root/branches/richfaces-ui-iteration-4.0.0.Alpha2/
root/tags/
root/tags/archive/
root/tags/faces-shade-transformers-1/
root/tags/richfaces-archetype-simpleapp-4.0.0.20100713-M1/
root/tags/richfaces-archetype-simpleapp-4.0.0.20100715-M1/
root/tags/richfaces-archetype-simpleapp-4.0.0.Alpha2/
root/tags/richfaces-cdk-4.0.0.20100713-M1/
root/tags/richfaces-cdk-4.0.0.20100715-M1/
root/tags/richfaces-cdk-4.0.0.Alpha1/
root/tags/richfaces-cdk-4.0.0.Alpha2/
root/tags/richfaces-checkstyle-1/
root/tags/richfaces-commons-4.0.0.20100713-M1/
root/tags/richfaces-commons-4.0.0.20100715-M1/
root/tags/richfaces-commons-4.0.0.Alpha2/
root/tags/richfaces-core-4.0.0.20100713-M1/
root/tags/richfaces-core-4.0.0.20100715-M1/
root/tags/richfaces-core-4.0.0.Alpha1/
root/tags/richfaces-core-4.0.0.Alpha2/
root/tags/richfaces-core-demo-4.0.0.20100713-M1/
root/tags/richfaces-core-demo-4.0.0.20100715-M1/
root/tags/richfaces-core-demo-4.0.0.Alpha1/
root/tags/richfaces-core-demo-4.0.0.Alpha2/
root/tags/richfaces-dist-4.0.0.20100713-M1/
root/tags/richfaces-dist-4.0.0.20100715-M1/
root/tags/richfaces-dist-4.0.0.Alpha2/
root/tags/richfaces-docs-4.0.0.20100713-M1/
root/tags/richfaces-docs-4.0.0.20100715-M1/
root/tags/richfaces-docs-4.0.0.Alpha1/
root/tags/richfaces-docs-4.0.0.Alpha2/
root/tags/richfaces-shade-transformers-2/
root/tags/richfaces-showcase-4.0.0.20100713-M1/
root/tags/richfaces-showcase-4.0.0.20100715-M1/
root/tags/richfaces-showcase-4.0.0.Alpha2/
root/tags/richfaces-ui-core-4.0.0.20100713-M1/
root/tags/richfaces-ui-core-4.0.0.20100715-M1/
root/tags/richfaces-ui-core-4.0.0.Alpha1/
root/tags/richfaces-ui-core-4.0.0.Alpha2/
root/tags/richfaces-ui-dist-4.0.0.20100713-M1/
root/tags/richfaces-ui-dist-4.0.0.20100715-M1/
root/tags/richfaces-ui-dist-4.0.0.Alpha2/
root/tags/richfaces-ui-iteration-4.0.0.20100713-M1/
root/tags/richfaces-ui-iteration-4.0.0.20100715-M1/
root/tags/richfaces-ui-iteration-4.0.0.Alpha2/
Removed:
root/archetypes/richfaces-archetype-simpleapp/branches/
root/archetypes/richfaces-archetype-simpleapp/tags/
root/archetypes/richfaces-component-short/branches/
root/archetypes/richfaces-component-short/tags/
root/archetypes/richfaces-component/branches/
root/archetypes/richfaces-component/tags/
root/archetypes/richfaces-components-aggregator/branches/
root/archetypes/richfaces-components-aggregator/tags/
root/build/resources/branches/
root/build/resources/tags/
root/cdk/branches/
root/cdk/tags/
root/commons/branches/
root/commons/tags/
root/core/branches/
root/core/tags/
root/dist/branches/
root/dist/tags/
root/docs/branches/
root/docs/tags/
root/examples-sandbox/branches/
root/examples-sandbox/tags/
root/examples/core-demo/branches/
root/examples/core-demo/tags/
root/examples/iteration-demo/branches/
root/examples/iteration-demo/tags/
root/examples/misc-demo/branches/
root/examples/misc-demo/tags/
root/examples/output-demo/branches/
root/examples/output-demo/tags/
root/examples/repeater-demo/branches/
root/examples/repeater-demo/tags/
root/examples/richfaces-showcase/branches/
root/examples/richfaces-showcase/tags/
root/ui/core/branches/
root/ui/core/tags/
root/ui/dist/branches/
root/ui/dist/tags/
root/ui/iteration/branches/
root/ui/iteration/tags/
Log:
change svn structure 4.0
Copied: root/branches/richfaces-archetype-simpleapp-4.0.0.20100713-M1 (from rev 18212, root/archetypes/richfaces-archetype-simpleapp/branches/richfaces-archetype-simpleapp-4.0.0.20100713-M1)
Copied: root/branches/richfaces-archetype-simpleapp-4.0.0.Alpha2 (from rev 18212, root/archetypes/richfaces-archetype-simpleapp/branches/richfaces-archetype-simpleapp-4.0.0.Alpha2)
Copied: root/branches/richfaces-cdk-4.0.0.20100713-M1 (from rev 18212, root/cdk/branches/richfaces-cdk-4.0.0.20100713-M1)
Copied: root/branches/richfaces-cdk-4.0.0.Alpha2 (from rev 18212, root/cdk/branches/richfaces-cdk-4.0.0.Alpha2)
Copied: root/branches/richfaces-commons-4.0.0.20100713-M1 (from rev 18212, root/commons/branches/richfaces-commons-4.0.0.20100713-M1)
Copied: root/branches/richfaces-commons-4.0.0.Alpha2 (from rev 18212, root/commons/branches/richfaces-commons-4.0.0.Alpha2)
Copied: root/branches/richfaces-core-4.0.0.20100713-M1 (from rev 18212, root/core/branches/richfaces-core-4.0.0.20100713-M1)
Copied: root/branches/richfaces-core-4.0.0.Alpha2 (from rev 18212, root/core/branches/richfaces-core-4.0.0.Alpha2)
Copied: root/branches/richfaces-core-demo-4.0.0.20100713-M1 (from rev 18212, root/examples/core-demo/branches/richfaces-core-demo-4.0.0.20100713-M1)
Copied: root/branches/richfaces-core-demo-4.0.0.Alpha2 (from rev 18212, root/examples/core-demo/branches/richfaces-core-demo-4.0.0.Alpha2)
Copied: root/branches/richfaces-dist-4.0.0.20100713-M1 (from rev 18212, root/dist/branches/richfaces-dist-4.0.0.20100713-M1)
Copied: root/branches/richfaces-dist-4.0.0.Alpha2 (from rev 18212, root/dist/branches/richfaces-dist-4.0.0.Alpha2)
Copied: root/branches/richfaces-docs-4.0.0.Alpha1 (from rev 18212, root/docs/branches/4.0.0.ALPHA1)
Copied: root/branches/richfaces-showcase-4.0.0.20100713-M1 (from rev 18212, root/examples/richfaces-showcase/branches/richfaces-showcase-4.0.0.20100713-M1)
Copied: root/branches/richfaces-showcase-4.0.0.Alpha2 (from rev 18212, root/examples/richfaces-showcase/branches/richfaces-showcase-4.0.0.Alpha2)
Copied: root/branches/richfaces-ui-core-4.0.0.20100713-M1 (from rev 18212, root/ui/core/branches/richfaces-ui-core-4.0.0.20100713-M1)
Copied: root/branches/richfaces-ui-dist-4.0.0.20100713-M1 (from rev 18212, root/ui/dist/branches/richfaces-ui-dist-4.0.0.20100713-M1)
Copied: root/branches/richfaces-ui-dist-4.0.0.Alpha2 (from rev 18212, root/ui/dist/branches/richfaces-ui-dist-4.0.0.Alpha2)
Copied: root/branches/richfaces-ui-iteration-4.0.0.20100713-M1 (from rev 18212, root/ui/iteration/branches/richfaces-ui-iteration-4.0.0.20100713-M1)
Copied: root/branches/richfaces-ui-iteration-4.0.0.Alpha2 (from rev 18212, root/ui/iteration/branches/richfaces-ui-iteration-4.0.0.Alpha2)
Copied: root/tags/faces-shade-transformers-1 (from rev 18212, root/build/resources/tags/faces-shade-transformers-1)
Copied: root/tags/richfaces-archetype-simpleapp-4.0.0.20100713-M1 (from rev 18212, root/archetypes/richfaces-archetype-simpleapp/tags/richfaces-archetype-simpleapp-4.0.0.20100713-M1)
Copied: root/tags/richfaces-archetype-simpleapp-4.0.0.20100715-M1 (from rev 18212, root/archetypes/richfaces-archetype-simpleapp/tags/richfaces-archetype-simpleapp-4.0.0.20100715-M1)
Copied: root/tags/richfaces-archetype-simpleapp-4.0.0.Alpha2 (from rev 18212, root/archetypes/richfaces-archetype-simpleapp/tags/richfaces-archetype-simpleapp-4.0.0.Alpha2)
Copied: root/tags/richfaces-cdk-4.0.0.20100713-M1 (from rev 18212, root/cdk/tags/richfaces-cdk-4.0.0.20100713-M1)
Copied: root/tags/richfaces-cdk-4.0.0.20100715-M1 (from rev 18212, root/cdk/tags/richfaces-cdk-4.0.0.20100715-M1)
Copied: root/tags/richfaces-cdk-4.0.0.Alpha1 (from rev 18212, root/cdk/tags/4.0.0.ALPHA1)
Copied: root/tags/richfaces-cdk-4.0.0.Alpha2 (from rev 18212, root/cdk/tags/richfaces-cdk-4.0.0.Alpha2)
Copied: root/tags/richfaces-checkstyle-1 (from rev 18212, root/build/resources/tags/richfaces-checkstyle-1)
Copied: root/tags/richfaces-commons-4.0.0.20100713-M1 (from rev 18212, root/commons/tags/richfaces-commons-4.0.0.20100713-M1)
Copied: root/tags/richfaces-commons-4.0.0.20100715-M1 (from rev 18212, root/commons/tags/richfaces-commons-4.0.0.20100715-M1)
Copied: root/tags/richfaces-commons-4.0.0.Alpha2 (from rev 18212, root/commons/tags/richfaces-commons-4.0.0.Alpha2)
Copied: root/tags/richfaces-core-4.0.0.20100713-M1 (from rev 18212, root/core/tags/richfaces-core-4.0.0.20100713-M1)
Copied: root/tags/richfaces-core-4.0.0.20100715-M1 (from rev 18212, root/core/tags/richfaces-core-4.0.0.20100715-M1)
Copied: root/tags/richfaces-core-4.0.0.Alpha1 (from rev 18212, root/core/tags/4.0.0.ALPHA1)
Copied: root/tags/richfaces-core-4.0.0.Alpha2 (from rev 18212, root/core/tags/richfaces-core-4.0.0.Alpha2)
Copied: root/tags/richfaces-core-demo-4.0.0.20100713-M1 (from rev 18212, root/examples/core-demo/tags/richfaces-core-demo-4.0.0.20100713-M1)
Copied: root/tags/richfaces-core-demo-4.0.0.20100715-M1 (from rev 18212, root/examples/core-demo/tags/richfaces-core-demo-4.0.0.20100715-M1)
Copied: root/tags/richfaces-core-demo-4.0.0.Alpha1 (from rev 18212, root/examples/core-demo/tags/4.0.0.ALPHA1)
Copied: root/tags/richfaces-core-demo-4.0.0.Alpha2 (from rev 18212, root/examples/core-demo/tags/richfaces-core-demo-4.0.0.Alpha2)
Copied: root/tags/richfaces-dist-4.0.0.20100713-M1 (from rev 18212, root/dist/tags/richfaces-dist-4.0.0.20100713-M1)
Copied: root/tags/richfaces-dist-4.0.0.20100715-M1 (from rev 18212, root/dist/tags/richfaces-dist-4.0.0.20100715-M1)
Copied: root/tags/richfaces-dist-4.0.0.Alpha2 (from rev 18212, root/dist/tags/richfaces-dist-4.0.0.Alpha2)
Copied: root/tags/richfaces-docs-4.0.0.20100713-M1 (from rev 18212, root/docs/tags/richfaces-docs-4.0.0.20100713-M1)
Copied: root/tags/richfaces-docs-4.0.0.20100715-M1 (from rev 18212, root/docs/tags/richfaces-docs-4.0.0.20100715-M1)
Copied: root/tags/richfaces-docs-4.0.0.Alpha1 (from rev 18212, root/docs/tags/4.0.0.ALPHA1)
Copied: root/tags/richfaces-docs-4.0.0.Alpha2 (from rev 18212, root/docs/tags/richfaces-docs-4.0.0.Alpha2)
Copied: root/tags/richfaces-shade-transformers-2 (from rev 18212, root/build/resources/tags/richfaces-shade-transformers-2)
Copied: root/tags/richfaces-showcase-4.0.0.20100713-M1 (from rev 18212, root/examples/richfaces-showcase/tags/richfaces-showcase-4.0.0.20100713-M1)
Copied: root/tags/richfaces-showcase-4.0.0.20100715-M1 (from rev 18212, root/examples/richfaces-showcase/tags/richfaces-showcase-4.0.0.20100715-M1)
Copied: root/tags/richfaces-showcase-4.0.0.Alpha2 (from rev 18212, root/examples/richfaces-showcase/tags/richfaces-showcase-4.0.0.Alpha2)
Copied: root/tags/richfaces-ui-core-4.0.0.20100713-M1 (from rev 18212, root/ui/core/tags/richfaces-ui-core-4.0.0.20100713-M1)
Copied: root/tags/richfaces-ui-core-4.0.0.20100715-M1 (from rev 18212, root/ui/core/tags/richfaces-ui-core-4.0.0.20100715-M1)
Copied: root/tags/richfaces-ui-core-4.0.0.Alpha1 (from rev 18212, root/ui/core/tags/4.0.0.ALPHA1)
Copied: root/tags/richfaces-ui-core-4.0.0.Alpha2 (from rev 18212, root/ui/core/tags/richfaces-ui-core-4.0.0.Alpha2)
Copied: root/tags/richfaces-ui-dist-4.0.0.20100713-M1 (from rev 18212, root/ui/dist/tags/richfaces-ui-dist-4.0.0.20100713-M1)
Copied: root/tags/richfaces-ui-dist-4.0.0.20100715-M1 (from rev 18212, root/ui/dist/tags/richfaces-ui-dist-4.0.0.20100715-M1)
Copied: root/tags/richfaces-ui-dist-4.0.0.Alpha2 (from rev 18212, root/ui/dist/tags/richfaces-ui-dist-4.0.0.Alpha2)
Copied: root/tags/richfaces-ui-iteration-4.0.0.20100713-M1 (from rev 18212, root/ui/iteration/tags/richfaces-ui-iteration-4.0.0.20100713-M1)
Copied: root/tags/richfaces-ui-iteration-4.0.0.20100715-M1 (from rev 18212, root/ui/iteration/tags/richfaces-ui-iteration-4.0.0.20100715-M1)
Copied: root/tags/richfaces-ui-iteration-4.0.0.Alpha2 (from rev 18212, root/ui/iteration/tags/richfaces-ui-iteration-4.0.0.Alpha2)
14 years, 4 months
JBoss Rich Faces SVN: r18303 - in root/ui-sandbox/inputs/trunk/inputnumberslider/src/main: templates and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: konstantin.mishin
Date: 2010-07-30 13:32:02 -0400 (Fri, 30 Jul 2010)
New Revision: 18303
Modified:
root/ui-sandbox/inputs/trunk/inputnumberslider/src/main/config/faces-config.xml
root/ui-sandbox/inputs/trunk/inputnumberslider/src/main/templates/inputnumberslider.template.xml
Log:
RF-8983
Modified: root/ui-sandbox/inputs/trunk/inputnumberslider/src/main/config/faces-config.xml
===================================================================
--- root/ui-sandbox/inputs/trunk/inputnumberslider/src/main/config/faces-config.xml 2010-07-30 17:16:50 UTC (rev 18302)
+++ root/ui-sandbox/inputs/trunk/inputnumberslider/src/main/config/faces-config.xml 2010-07-30 17:32:02 UTC (rev 18303)
@@ -45,6 +45,20 @@
<cdk:generate>true</cdk:generate>
</property-extension>
</property>
+ <property>
+ <property-name>trackClass</property-name>
+ <property-class>java.lang.String</property-class>
+ <property-extension>
+ <cdk:generate>true</cdk:generate>
+ </property-extension>
+ </property>
+ <property>
+ <property-name>trackStyle</property-name>
+ <property-class>java.lang.String</property-class>
+ <property-extension>
+ <cdk:generate>true</cdk:generate>
+ </property-extension>
+ </property>
<component-extension>
<cdk:generate>true</cdk:generate>
<cdk:base-class>javax.faces.component.UIInput</cdk:base-class>
Modified: root/ui-sandbox/inputs/trunk/inputnumberslider/src/main/templates/inputnumberslider.template.xml
===================================================================
--- root/ui-sandbox/inputs/trunk/inputnumberslider/src/main/templates/inputnumberslider.template.xml 2010-07-30 17:16:50 UTC (rev 18302)
+++ root/ui-sandbox/inputs/trunk/inputnumberslider/src/main/templates/inputnumberslider.template.xml 2010-07-30 17:32:02 UTC (rev 18303)
@@ -44,7 +44,7 @@
<span class="rf-ins-ta">
<span class="rf-ins-mn">0</span>
<span class="rf-ins-mx">100</span>
- <span class="rf-ins-t">
+ <span class="rf-ins-t #{component.attributes['trackClass']}" style="#{component.attributes['trackStyle']}">
<span class="rf-ins-h" />
</span>
</span>
14 years, 4 months
JBoss Rich Faces SVN: r18302 - root/ui-sandbox/inputs/trunk/inputnumberslider/src/main/resources/META-INF/resources.
by richfaces-svn-commits@lists.jboss.org
Author: konstantin.mishin
Date: 2010-07-30 13:16:50 -0400 (Fri, 30 Jul 2010)
New Revision: 18302
Modified:
root/ui-sandbox/inputs/trunk/inputnumberslider/src/main/resources/META-INF/resources/inputNumberSlider.js
Log:
RF-8983
Modified: root/ui-sandbox/inputs/trunk/inputnumberslider/src/main/resources/META-INF/resources/inputNumberSlider.js
===================================================================
--- root/ui-sandbox/inputs/trunk/inputnumberslider/src/main/resources/META-INF/resources/inputNumberSlider.js 2010-07-30 15:36:47 UTC (rev 18301)
+++ root/ui-sandbox/inputs/trunk/inputnumberslider/src/main/resources/META-INF/resources/inputNumberSlider.js 2010-07-30 17:16:50 UTC (rev 18302)
@@ -29,6 +29,7 @@
minValue: 0,
maxValue: 100,
step: 5,
+ value: 0,
init: function (id) {
this.range = this.maxValue - this.minValue;
@@ -39,6 +40,7 @@
this.handle = this.track.children(".rf-ins-h");
this.tooltip = this.element.children(".rf-ins-tt");
+ this.value = Number(this.input.val());
this.track[0].tabIndex = 0;
this.handle.css("margin-left", this.input.val() * (this.track.width() - this.handle.width()) / this.range);
@@ -52,25 +54,32 @@
},
setValue: function (value) {
- value = Number(value);
- if (value > this.maxValue) {
- value = this.maxValue;
- } else if (value < this.minValue) {
- value = this.minValue;
- } else {
- value = Math.round(value / this.step) * this.step; //TODO Add normal support of float values. E.g. '0.3' should be instead of '0.30000000000000004'.
- }
- if (value != this.input.val()) {
- this.input.val(value);
- var left = value * (this.track.width() - this.handle.width()) / this.range;
- this.handle.css("margin-left", left);
- this.tooltip.text(value);
- this.tooltip.setPosition(this.handle,{from: 'LT', offset: [0, -3]}); //TODO Seems offset doesn't work now.
- }
+ if (!isNaN(value)) {
+ if (value > this.maxValue) {
+ value = this.maxValue;
+ } else if (value < this.minValue) {
+ value = this.minValue;
+ } else {
+ value = Math.round(value / this.step) * this.step; //TODO Add normal support of float values. E.g. '0.3' should be instead of '0.30000000000000004'.
+ }
+ if (value != this.value) {
+ this.input.val(value);
+ var left = value * (this.track.width() - this.handle.width()) / this.range;
+ this.handle.css("margin-left", left + "px");
+ this.tooltip.text(value);
+ this.tooltip.setPosition(this.handle,{from: 'LT', offset: [0, -3]}); //TODO Seems offset doesn't work now.
+ this.value = value;
+ }
+ }
},
__inputHandler: function () {
- this.setValue(this.input.val());
+ var value = Number(this.input.val());
+ if (isNaN(value)) {
+ this.input.val(this.value);
+ } else {
+ this.setValue(value);
+ }
},
__keydownHandler: function (event) {
@@ -99,11 +108,11 @@
jQueryDocument.one("mouseup", jQuery.proxy(this.__mouseupHandler, this));
this.handle.addClass("rf-ins-h-s");
this.tooltip.show();
- event.preventDefault();
},
__mousemoveHandler: function (event) {
- var value = this.range * (event.pageX - this.track.position().left) / (this.track.width() - this.handle.width()) + this.minValue;
+ var value = this.range * (event.pageX - this.track.position().left) / (this.track.width()
+ - this.handle.width()) + this.minValue;
this.setValue(value);
event.preventDefault();
},
14 years, 4 months
JBoss Rich Faces SVN: r18301 - root/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jPush.
by richfaces-svn-commits@lists.jboss.org
Author: lfryc(a)redhat.com
Date: 2010-07-30 11:36:47 -0400 (Fri, 30 Jul 2010)
New Revision: 18301
Modified:
root/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jPush/TestInterval.java
Log:
tweaked a4jPush/testInterval to be more stable
Modified: root/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jPush/TestInterval.java
===================================================================
--- root/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jPush/TestInterval.java 2010-07-30 15:36:03 UTC (rev 18300)
+++ root/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jPush/TestInterval.java 2010-07-30 15:36:47 UTC (rev 18301)
@@ -31,6 +31,9 @@
import org.apache.commons.httpclient.HttpException;
import org.jboss.test.selenium.locator.Attribute;
import org.jboss.test.selenium.locator.AttributeLocator;
+import org.richfaces.tests.metamer.ftest.annotations.Inject;
+import org.richfaces.tests.metamer.ftest.annotations.Templates;
+import org.richfaces.tests.metamer.ftest.annotations.Use;
import org.testng.annotations.Test;
/**
@@ -42,9 +45,6 @@
public class TestInterval extends AbstractPushTest {
private static final Attribute ATTRIBUTE_TITLE = new Attribute("title");
- private static final int[] INTERVAL_VALUES = new int[]{1000, 5000, 500};
- private static final long MAX_DEVIATION = 100;
- private static final long MAX_AVERAGE_DEVIATION = 75;
private static final int DEFAULT_COUNTER_STEP = 2;
private static final int ITERATION_COUNT = 3;
private static final int MULTIPLE_PUSH_COUNT = 5;
@@ -58,10 +58,13 @@
private long deviationTotal = 0;
private long deviationCount = 0;
+ @Inject
+ private int interval;
+
/**
* <p>
- * For 3 different intervals, test that the interval between push event triggered and event observered by client
- * haven't greater deviation than the specified interval.
+ * For interval 1000, test that the interval between push event triggered and event observered by client haven't
+ * greater deviation than the one interval.
* </p>
*
* <p>
@@ -73,31 +76,69 @@
* </p>
*
* <p>
- * Then repeat push and wait 6 times with 1 event triggered and 5 events triggered in sequence.
+ * Then repeat push and wait 6 times with 1 event triggered and 5 fast events triggered in sequence.
* </p>
*/
@Test
- public void testIntervalFromClientPerspective() throws HttpException, IOException {
- for (int interval : INTERVAL_VALUES) {
- counterStep = DEFAULT_COUNTER_STEP;
- pushAttributes.setInterval(interval);
+ @Use(field = "interval", ints = { 1000 })
+ public void testClientAllTemplates() throws HttpException, IOException {
+ counterStep = DEFAULT_COUNTER_STEP;
+ pushAttributes.setInterval(interval);
+ pushAndWait(1);
+ for (int i = 0; i < ITERATION_COUNT; i++) {
+ startIntervalAndCounter();
pushAndWait(1);
- for (int i = 0; i < ITERATION_COUNT; i++) {
- startIntervalAndCounter();
- pushAndWait(1);
- validateIntervalAndCounter(interval);
+ validateIntervalAndCounter(interval);
- startIntervalAndCounter();
- pushAndWait(MULTIPLE_PUSH_COUNT);
- validateIntervalAndCounter(interval);
- }
+ startIntervalAndCounter();
+ pushAndWait(MULTIPLE_PUSH_COUNT);
+ validateIntervalAndCounter(interval);
}
validateAverageDeviation();
}
/**
+ * <p>
+ * For interval two different values (small and big), test that the interval between push event triggered and event
+ * observered by client haven't greater deviation than the one interval.
+ * </p>
+ *
+ * <p>
+ * First set the given interval into the interval attribute.
+ * </p>
+ *
+ * <p>
+ * Then push and wait for result of update triggered by observation of push event.
+ * </p>
+ *
+ * <p>
+ * Then repeat push and wait 6 times with 1 event triggered and 5 fast events triggered in sequence.
+ * </p>
+ */
+ @Test
+ @Use(field = "interval", ints = { 500, 5000 })
+ @Templates(value = "plain")
+ public void testClientDifferentIntervals() throws HttpException, IOException {
+ counterStep = DEFAULT_COUNTER_STEP;
+ pushAttributes.setInterval(interval);
+
+ pushAndWait(1);
+ for (int i = 0; i < ITERATION_COUNT; i++) {
+ startIntervalAndCounter();
+ pushAndWait(1);
+ validateIntervalAndCounter(interval);
+
+ startIntervalAndCounter();
+ pushAndWait(MULTIPLE_PUSH_COUNT);
+ validateIntervalAndCounter(interval);
+ }
+
+ validateAverageDeviation();
+ }
+
+ /**
* Remembers start of the time frame and current value of counter.
*/
private void startIntervalAndCounter() {
@@ -125,13 +166,14 @@
private void validateIntervalAndCounter(int interval) {
long runTime = getClientTime() - startTime;
long deviation = Math.abs(interval - runTime);
- assertTrue(deviation <= MAX_DEVIATION, format("Deviation ({0}) is greater than defined maximum {1}", deviation,
- MAX_DEVIATION));
if (seleniumDebug) {
System.out.println(format("deviation for interval {0}: {1}", interval, deviation));
}
+ assertTrue(deviation <= interval,
+ format("Deviation ({0}) is greater than one interval {1}", deviation, interval));
+
deviationTotal += deviation;
deviationCount += 1;
@@ -145,13 +187,15 @@
* Validates the average deviations from intervals.
*/
private void validateAverageDeviation() {
+ long maximumAvgDeviation = Math.min(interval / 4, 1000);
long averageDeviation = deviationTotal / deviationCount;
if (seleniumDebug) {
System.out.println("averageDeviation: " + averageDeviation);
}
- assertTrue(averageDeviation <= MAX_AVERAGE_DEVIATION, format(
- "Average deviation for all the intervals ({0}) should not be greater than defined maximum {1}",
- averageDeviation, MAX_AVERAGE_DEVIATION));
+ assertTrue(
+ averageDeviation <= maximumAvgDeviation,
+ format("Average deviation for all the intervals ({0}) should not be greater than defined maximum {1}",
+ averageDeviation, maximumAvgDeviation));
}
/**
14 years, 4 months
JBoss Rich Faces SVN: r18300 - in root/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest: annotations and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: lfryc(a)redhat.com
Date: 2010-07-30 11:36:03 -0400 (Fri, 30 Jul 2010)
New Revision: 18300
Modified:
root/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/AbstractMetamerTest.java
root/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/MatrixConfigurator.java
root/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/annotations/Templates.java
Log:
support for parametrization of classes and methods with @Templates
Modified: root/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/AbstractMetamerTest.java
===================================================================
--- root/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/AbstractMetamerTest.java 2010-07-30 15:35:17 UTC (rev 18299)
+++ root/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/AbstractMetamerTest.java 2010-07-30 15:36:03 UTC (rev 18300)
@@ -54,8 +54,8 @@
public static final long TIMEOUT = 5000;
@Inject
- @Templates(include = { "plain", "richDataTable1,redDiv", "richDataTable2,redDiv", "a4jRepeat1", "a4jRepeat2",
- "hDataTable1", "hDataTable2", "uiRepeat1", "uiRepeat2" })
+ @Templates({ "plain", "richDataTable1,redDiv", "richDataTable2,redDiv", "a4jRepeat1", "a4jRepeat2", "hDataTable1",
+ "hDataTable2", "uiRepeat1", "uiRepeat2" })
private TemplatesList template;
/**
Modified: root/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/MatrixConfigurator.java
===================================================================
--- root/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/MatrixConfigurator.java 2010-07-30 15:35:17 UTC (rev 18299)
+++ root/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/MatrixConfigurator.java 2010-07-30 15:36:03 UTC (rev 18300)
@@ -70,6 +70,7 @@
Map<Class<?>, Map<Method, Configuration>> configurations = new HashMap<Class<?>, Map<Method, Configuration>>();
LinkedList<Method> methods = new LinkedList<Method>();
boolean methodConfigured = false;
+ Field templatesField = null;
public static Map<Field, Object> getCurrentConfiguration() {
@@ -157,21 +158,30 @@
parameters.put(field, getUseParameter(realClass, field.getType(), field.getAnnotation(Use.class)));
} else if (field.getAnnotation(Templates.class) != null) {
parameters.put(field,
- getTemplatesParameter(realClass, field.getType(), field.getAnnotation(Templates.class)));
+ getTemplatesParameter(realClass, field.getType(), field.getAnnotation(Templates.class), parameters));
+ templatesField = field;
} else {
parameters.put(field, null);
unsatisfied.add(field);
}
}
}
+
+ if (templatesField == null) {
+ throw new IllegalStateException("there is no field annotated @Templates in " + realClass.getName());
+ }
- // fulfill parameters by super classes' annotations
- fulfillParametersFromAnnotations(realClass, parameters, unsatisfied,
- getAnnotationsForAllSuperClasses(realClass));
+ try {
+ // fulfill parameters by super classes' annotations
+ fulfillParametersFromAnnotations(realClass, parameters, unsatisfied,
+ getAnnotationsForAllSuperClasses(realClass));
- // fulfill parameters by method annotations
- fulfillParametersFromAnnotations(realClass, parameters, unsatisfied, realMethod.getAnnotations());
-
+ // fulfill parameters by method annotations
+ fulfillParametersFromAnnotations(realClass, parameters, unsatisfied, realMethod.getAnnotations());
+ } finally {
+ templatesField = null;
+ }
+
if (!unsatisfied.isEmpty()) {
throw new IllegalStateException("cannot satisfy following injection points: " + unsatisfied.toString());
}
@@ -210,6 +220,10 @@
}
}
}
+ if (annotation.annotationType() == Templates.class) {
+ Templates templatesAnnotation = (Templates) annotation;
+ parameters.put(templatesField, getTemplatesParameter(testClass, templatesField.getType(), templatesAnnotation, parameters));
+ }
}
}
@@ -340,17 +354,54 @@
}
private List<TemplatesList> getTemplatesParameter(Class<?> testClass, Class<?> parameterType,
- Templates templatesAnnotation) {
+ Templates templatesAnnotation, Map<Field, List<? extends Object>> parameters) {
if (parameterType != TemplatesList.class) {
throw new IllegalStateException("only " + Template.class.getName()
+ " fields can be annotated with @Inject @Templates");
}
- List<TemplatesList> templates = MetamerProperties.getTemplates();
-
- if (templates == null) {
- templates = MetamerProperties.parseTemplates(templatesAnnotation.include());
+ List<TemplatesList> templates = null;
+
+ // if templates was already set, load them
+ if (templatesField != null) {
+ templates = (List<TemplatesList>) parameters.get(templatesField);
}
+
+ // get user defined templates
+ List<TemplatesList> userTemplates = MetamerProperties.getTemplates();
+
+ // if "value" is defined, takes precedens
+ if (templatesAnnotation.value().length > 0) {
+ templates = MetamerProperties.parseTemplates(templatesAnnotation.value());
+ }
+
+ // include all "include" to current list
+ if (templatesAnnotation.include().length > 0) {
+ List<TemplatesList> includeTemplates = MetamerProperties.parseTemplates(templatesAnnotation.include());
+ if (templates == null) {
+ templates = includeTemplates;
+ } else {
+ includeTemplates.removeAll(templates);
+ templates.addAll(includeTemplates);
+ }
+ }
+
+ // exclude all "exclude" from current list
+ if (templatesAnnotation.exclude().length > 0) {
+ List<TemplatesList> excludeTemplates = MetamerProperties.parseTemplates(templatesAnnotation.exclude());
+ if (templates != null) {
+ templates.removeAll(excludeTemplates);
+ }
+ }
+
+ // remove all templates which wasn't in user defined set
+ if (userTemplates != null) {
+ if (templates == null) {
+ templates = userTemplates;
+ } else {
+ templates.retainAll(userTemplates);
+ }
+ }
return templates;
}
Modified: root/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/annotations/Templates.java
===================================================================
--- root/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/annotations/Templates.java 2010-07-30 15:35:17 UTC (rev 18299)
+++ root/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/annotations/Templates.java 2010-07-30 15:36:03 UTC (rev 18300)
@@ -34,6 +34,7 @@
@Target({ TYPE, FIELD, METHOD, PARAMETER })
@Retention(RetentionPolicy.RUNTIME)
public @interface Templates {
+ String[] value() default {};
String[] include() default {};
String[] exclude() default {};
}
14 years, 4 months
JBoss Rich Faces SVN: r18299 - root/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: 2010-07-30 11:35:17 -0400 (Fri, 30 Jul 2010)
New Revision: 18299
Modified:
root/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/MetamerFailureLoggingTestListener.java
Log:
improved saving of failures to separated directories by package/class/method names and files by parameters
Modified: root/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/MetamerFailureLoggingTestListener.java
===================================================================
--- root/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/MetamerFailureLoggingTestListener.java 2010-07-30 13:26:25 UTC (rev 18298)
+++ root/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/MetamerFailureLoggingTestListener.java 2010-07-30 15:35:17 UTC (rev 18299)
@@ -22,6 +22,7 @@
package org.richfaces.tests.metamer.ftest;
import org.jboss.test.selenium.listener.FailureLoggingTestListener;
+import org.jboss.test.selenium.utils.testng.TestInfo;
import org.testng.ITestResult;
/**
@@ -31,9 +32,12 @@
public class MetamerFailureLoggingTestListener extends FailureLoggingTestListener {
@Override
protected String getFilenameIdentification(ITestResult result) {
- String testInfo = MetamerTestInfo.getConfigurationInfo();
- testInfo = testInfo.replaceAll(" ", "");
- return super.getFilenameIdentification(result) + "-" + testInfo;
+ String packageName = TestInfo.getContainingPackageName(result);
+ String className = TestInfo.getClassName(result);
+ String methodName = TestInfo.getMethodName(result);
+ String testInfo = MetamerTestInfo.getConfigurationInfo().replaceAll(" ", "");
+
+ return packageName + "/" + className + "/" + methodName + "/" + testInfo;
}
@Override
14 years, 4 months
JBoss Rich Faces SVN: r18298 - in root/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest: richDataGrid and 2 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: lfryc(a)redhat.com
Date: 2010-07-30 09:26:25 -0400 (Fri, 30 Jul 2010)
New Revision: 18298
Modified:
root/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/model/AbstractModel.java
root/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/model/AssertingDataScroller.java
root/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/model/DataGrid.java
root/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/model/DataScroller.java
root/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/model/DataTable.java
root/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richDataGrid/TestSimple.java
root/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richDataScroller/TestPagination.java
root/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richExtendedDataTable/TestScroller.java
Log:
introduced name parameter for AbstractModel (used on #toString() method)
Modified: root/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/model/AbstractModel.java
===================================================================
--- root/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/model/AbstractModel.java 2010-07-30 13:25:33 UTC (rev 18297)
+++ root/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/model/AbstractModel.java 2010-07-30 13:26:25 UTC (rev 18298)
@@ -21,8 +21,6 @@
*******************************************************************************/
package org.richfaces.tests.metamer.ftest.model;
-import org.apache.commons.lang.builder.ToStringBuilder;
-import org.apache.commons.lang.builder.ToStringStyle;
import org.jboss.test.selenium.locator.IterableLocator;
import org.jboss.test.selenium.locator.reference.LocatorReference;
@@ -38,14 +36,15 @@
public abstract class AbstractModel<T extends IterableLocator<T>> {
protected LocatorReference<T> root = new LocatorReference<T>(null);
+ private String name = this.getClass().getSimpleName();
public AbstractModel(T root) {
setRoot(root);
}
- @Override
- public String toString() {
- return new ToStringBuilder(this, ToStringStyle.SIMPLE_STYLE).append(root).toString();
+ public AbstractModel(String name, T root) {
+ setRoot(root);
+ this.name = name;
}
public void setRoot(T root) {
@@ -55,4 +54,9 @@
public T getRoot() {
return root.getLocator();
}
+
+ @Override
+ public String toString() {
+ return name;
+ }
}
Modified: root/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/model/AssertingDataScroller.java
===================================================================
--- root/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/model/AssertingDataScroller.java 2010-07-30 13:25:33 UTC (rev 18297)
+++ root/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/model/AssertingDataScroller.java 2010-07-30 13:26:25 UTC (rev 18298)
@@ -37,6 +37,10 @@
super(root);
}
+ public AssertingDataScroller(String name, JQueryLocator root) {
+ super(name, root);
+ }
+
@Override
public void gotoPage(int pageNumber) {
int startCount = this.getCountOfVisiblePages();
Modified: root/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/model/DataGrid.java
===================================================================
--- root/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/model/DataGrid.java 2010-07-30 13:25:33 UTC (rev 18297)
+++ root/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/model/DataGrid.java 2010-07-30 13:26:25 UTC (rev 18298)
@@ -24,6 +24,8 @@
import static org.jboss.test.selenium.locator.reference.ReferencedLocator.ref;
import static org.jboss.test.selenium.locator.LocatorFactory.*;
+import java.util.Iterator;
+
import org.jboss.test.selenium.framework.AjaxSelenium;
import org.jboss.test.selenium.framework.AjaxSeleniumProxy;
import org.jboss.test.selenium.locator.JQueryLocator;
@@ -36,27 +38,40 @@
public class DataGrid extends AbstractModel<JQueryLocator> {
AjaxSelenium selenium = AjaxSeleniumProxy.getInstance();
-
+
ReferencedLocator<JQueryLocator> rows = ref(root, "> tbody.rf-dg-body > tr.rf-dg-r");
- JQueryLocator rowToColumn = jq("td.rf-dg-c:not(:empty)");
+ JQueryLocator rowToNonEmptyElement = jq("td.rf-dg-c:not(:empty)");
+ JQueryLocator rowToElement = jq("td.rf-dg-c");
public DataGrid(JQueryLocator root) {
super(root);
}
+ public DataGrid(String name, JQueryLocator root) {
+ super(name, root);
+ }
+
public int getElementCount() {
- return selenium.getCount(rows.getChild(rowToColumn));
+ return selenium.getCount(rows.getChild(rowToNonEmptyElement));
}
-
+
public int getColumnCount() {
- return selenium.getCount(rows.getNthOccurence(1).getChild(rowToColumn));
+ return selenium.getCount(rows.getNthOccurence(1).getChild(rowToElement));
}
-
+
public int getRowCount() {
- return selenium.getCount(rows.getChild(rowToColumn).getNthChildElement(1));
+ return selenium.getCount(rows.getChild(rowToElement).getNthChildElement(1));
}
-
- public JQueryLocator getElement(int row, int column) {
- return rows.getNthOccurence(row).getChild(rowToColumn).getNthChildElement(column);
+
+ public JQueryLocator getElementOnCoordinates(int row, int column) {
+ return rows.getNthOccurence(row).getChild(rowToNonEmptyElement).getNthChildElement(column);
}
+
+ public JQueryLocator getElementOnIndex(int index) {
+ return rows.getChild(rowToNonEmptyElement).getNthOccurence(index);
+ }
+
+ public Iterator<JQueryLocator> iterateElements() {
+ return rows.getDescendants(rowToNonEmptyElement).iterator();
+ }
}
Modified: root/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/model/DataScroller.java
===================================================================
--- root/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/model/DataScroller.java 2010-07-30 13:25:33 UTC (rev 18297)
+++ root/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/model/DataScroller.java 2010-07-30 13:26:25 UTC (rev 18298)
@@ -39,7 +39,7 @@
public class DataScroller extends AbstractModel<JQueryLocator> {
protected static final String CLASS_DISABLED = "rf-ds-dis";
-
+
AjaxSelenium selenium = AjaxSeleniumProxy.getInstance();
ReferencedLocator<JQueryLocator> numberedPages = ref(root, "> .rf-ds-dtl");
@@ -53,18 +53,22 @@
ReferencedLocator<JQueryLocator> firstVisiblePage = ref(root, "> .rf-ds-dtl:first");
ReferencedLocator<JQueryLocator> lastVisiblePage = ref(root, "> .rf-ds-dtl:last");
ReferencedLocator<JQueryLocator> currentPage = ref(root, "> .rf-ds-cur");
-
+
Integer fastStep = null;
Integer lastPage = null;
public DataScroller(JQueryLocator root) {
super(root);
}
-
+
+ public DataScroller(String name, JQueryLocator root) {
+ super(name, root);
+ }
+
public void setFastStep(int fastStep) {
this.fastStep = fastStep;
}
-
+
public void setLastPage(int pageNumber) {
this.lastPage = pageNumber;
}
@@ -82,14 +86,14 @@
}
public void gotoPage(int pageNumber) {
- while (pageNumber > getLastVisiblePage()) {
+ while (pageNumber > getLastVisiblePage()) {
fastForward();
}
-
+
while (pageNumber < getFirstVisiblePage()) {
fastRewind();
}
-
+
clickPageButton(pageNumber);
}
@@ -146,7 +150,7 @@
}
return integer(selenium.getText(lastVisiblePage));
}
-
+
public int getLastPage() {
int startPage = getCurrentPage();
clickLastPageButton();
@@ -189,7 +193,7 @@
public void clickPageButton(int pageNumber) {
guardXhr(selenium).click(specificNumberedPage.format(pageNumber));
}
-
+
public void clickFastForward() {
guardXhr(selenium).click(fastForwardButton);
}
Modified: root/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/model/DataTable.java
===================================================================
--- root/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/model/DataTable.java 2010-07-30 13:25:33 UTC (rev 18297)
+++ root/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/model/DataTable.java 2010-07-30 13:26:25 UTC (rev 18298)
@@ -43,6 +43,10 @@
public DataTable(JQueryLocator root) {
super(root);
}
+
+ public DataTable(String name, JQueryLocator root) {
+ super(name, root);
+ }
public int getCountOfTableRows() {
return selenium.getCount(tableRows);
Modified: root/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richDataGrid/TestSimple.java
===================================================================
--- root/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richDataGrid/TestSimple.java 2010-07-30 13:25:33 UTC (rev 18297)
+++ root/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richDataGrid/TestSimple.java 2010-07-30 13:26:25 UTC (rev 18298)
@@ -23,8 +23,11 @@
import static org.jboss.test.selenium.guard.request.RequestTypeGuardFactory.guardHttp;
import static org.jboss.test.selenium.utils.URLUtils.buildUrl;
+import static java.lang.Math.*;
import java.net.URL;
+import java.util.Collections;
+import java.util.Iterator;
import java.util.List;
import javax.xml.bind.JAXBException;
@@ -37,9 +40,13 @@
import org.richfaces.tests.metamer.ftest.annotations.Use;
import org.richfaces.tests.metamer.ftest.model.DataGrid;
import org.richfaces.tests.metamer.model.Capital;
+import org.richfaces.util.CollectionsUtils;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
+import com.google.inject.internal.Collections2;
+import com.google.inject.internal.cglib.core.CollectionUtils;
+
import static org.jboss.test.selenium.locator.LocatorFactory.*;
import static org.testng.Assert.*;
@@ -55,6 +62,7 @@
JQueryLocator attributeColumns = pjq("input[id$=columnsInput]");
JQueryLocator attributeElements = pjq("input[id$=elementsInput]");
+ JQueryLocator attributeFirst = pjq("input[id$=firstInput]");
DataGrid dataGrid = new DataGrid(jq("table.rf-dg[id$=richDataGrid]"));
@@ -66,6 +74,10 @@
@Use(empty = true)
Integer elements;
+ @Inject
+ @Use(empty = true)
+ Integer first;
+
@SuppressWarnings("restriction")
public TestSimple() throws JAXBException {
capitals = Model.unmarshallCapitals();
@@ -80,6 +92,7 @@
public void prepareAttributes() {
prepareAttribute(attributeColumns, columns);
prepareAttribute(attributeElements, elements);
+ prepareAttribute(attributeFirst, first);
}
private void prepareAttribute(ElementLocator<?> inputLocator, Object value) {
@@ -88,35 +101,52 @@
}
@Test
- @Use(field = "columns", ints = { 1, 3, 11, ELEMENTS_TOTAL / 2, ELEMENTS_TOTAL })
+ @Use(field = "columns", ints = { 1, 3, 11, ELEMENTS_TOTAL / 2, ELEMENTS_TOTAL - 1, ELEMENTS_TOTAL,
+ ELEMENTS_TOTAL + 1 })
public void testColumnsAttribute() {
- elements = ELEMENTS_TOTAL;
verifyCounts();
-
- int columnCount = dataGrid.getColumnCount();
- int rowCount = dataGrid.getRowCount();
- rowIteration: for (int r = 1; r <= rowCount; r++) {
- for (int c = 1; c <= columnCount; c++) {
- final int index = ((r - 1) * columnCount) + c - 1;
- if (index >= ELEMENTS_TOTAL) {
- break rowIteration;
- }
- String expectedStateName = capitals.get(index).getState();
- String stateName = selenium.getText(dataGrid.getElement(r, c).getChild(jq("span")));
- assertEquals(stateName, expectedStateName);
- }
- }
+ verifyElements();
}
@Test
- @Use(field = "elements", ints = { 0, 1, 3, 5, 7 })
+ @Use(field = "elements", ints = { 0, 1, ELEMENTS_TOTAL / 2, ELEMENTS_TOTAL - 1, ELEMENTS_TOTAL, ELEMENTS_TOTAL + 1 })
public void testElementsAttribute() {
- assertEquals(dataGrid.getElementCount(), (int) elements);
+ verifyCounts();
+ verifyElements();
}
+ @Test
+ @Use(field = "first", ints = { 0, 1, ELEMENTS_TOTAL / 2, ELEMENTS_TOTAL - 1, ELEMENTS_TOTAL, ELEMENTS_TOTAL + 1 })
+ public void testFirstAttribute() {
+ verifyCounts();
+ verifyElements();
+ }
+
private void verifyCounts() {
- assertEquals(dataGrid.getElementCount(), (int) elements);
- assertEquals(dataGrid.getColumnCount(), (int) columns);
- assertEquals(dataGrid.getRowCount(), (int) Math.ceil((float) elements / columns));
+ int nFirst = first == null ? 0 : min(ELEMENTS_TOTAL, max(0, first));
+ int nElements = (elements == null ? ELEMENTS_TOTAL : min(elements, ELEMENTS_TOTAL)) - nFirst;
+ int nColumns = columns;
+ double nRows = ceil((float) nElements / columns);
+
+ assertEquals(dataGrid.getElementCount(), (int) nElements);
+ assertEquals(dataGrid.getColumnCount(), (int) nColumns);
+ assertEquals(dataGrid.getRowCount(), (int) nRows);
}
+
+ private void verifyElements() {
+ int nFirst = first == null ? 0 : min(ELEMENTS_TOTAL, max(0, first));
+ int nElements = (elements == null ? ELEMENTS_TOTAL : min(elements, ELEMENTS_TOTAL)) - nFirst;
+
+ Iterator<Capital> capitalIterator = capitals.subList(nFirst, nFirst + nElements).iterator();
+ Iterator<JQueryLocator> elementIterator = dataGrid.iterateElements();
+
+ while (capitalIterator.hasNext()) {
+ final Capital capital = capitalIterator.next();
+ if (!elementIterator.hasNext()) {
+ fail("there should be next element for state name: " + capital.getState());
+ }
+ final JQueryLocator element = elementIterator.next().getChild(jq("span"));
+ assertEquals(selenium.getText(element), capital.getState());
+ }
+ }
}
Modified: root/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richDataScroller/TestPagination.java
===================================================================
--- root/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richDataScroller/TestPagination.java 2010-07-30 13:25:33 UTC (rev 18297)
+++ root/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richDataScroller/TestPagination.java 2010-07-30 13:26:25 UTC (rev 18298)
@@ -46,12 +46,12 @@
public class TestPagination extends AbstractMetamerTest {
private static final int[] PAGES = new int[] { 3, 6, 1, 4, 6, 2, 4, 5 };
-
+
@Inject
@Use(value = { "dataScroller*" })
AssertingDataScroller dataScroller;
- AssertingDataScroller dataScroller1 = new AssertingDataScroller(pjq("span.rf-ds[id$=scroller1]"));
- AssertingDataScroller dataScroller2 = new AssertingDataScroller(pjq("span.rf-ds[id$=scroller2]"));
+ AssertingDataScroller dataScroller1 = new AssertingDataScroller("outside-table", pjq("span.rf-ds[id$=scroller1]"));
+ AssertingDataScroller dataScroller2 = new AssertingDataScroller("in-table-footer", pjq("span.rf-ds[id$=scroller2]"));
IdLocator attributeFastStep = id("form:attributes:fastStepInput");
IdLocator attributeMaxPages = id("form:attributes:maxPagesInput");
@@ -73,7 +73,7 @@
public URL getTestUrl() {
return buildUrl(contextPath, "faces/components/richDataScroller/simple.xhtml");
}
-
+
@BeforeMethod
public void prepareAttributes() {
guardHttp(selenium).type(attributeFastStep, String.valueOf(fastStep));
Modified: root/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richExtendedDataTable/TestScroller.java
===================================================================
--- root/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richExtendedDataTable/TestScroller.java 2010-07-30 13:25:33 UTC (rev 18297)
+++ root/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richExtendedDataTable/TestScroller.java 2010-07-30 13:26:25 UTC (rev 18298)
@@ -43,10 +43,10 @@
public class TestScroller extends AbstractMetamerTest {
private static final int TOTAL_ROW_COUNT = 50;
- private static final Integer[] ROW_COUNT_VALUES =
- new Integer[]{null, 10, 1, TOTAL_ROW_COUNT, 13, 9, 17, TOTAL_ROW_COUNT + 1, 2 * TOTAL_ROW_COUNT};
- DataScroller dataScroller1 = new AssertingDataScroller(pjq("span.rf-ds[id$=scroller1]"));
- DataScroller dataScroller2 = new AssertingDataScroller(pjq("span.rf-ds[id$=scroller2]"));
+ private static final Integer[] ROW_COUNT_VALUES = new Integer[] { null, 10, 1, TOTAL_ROW_COUNT, 13, 9, 17,
+ TOTAL_ROW_COUNT + 1, 2 * TOTAL_ROW_COUNT };
+ DataScroller dataScroller1 = new AssertingDataScroller("outside-table", pjq("span.rf-ds[id$=scroller1]"));
+ DataScroller dataScroller2 = new AssertingDataScroller("inside-table-footer", pjq("span.rf-ds[id$=scroller2]"));
DataTable table = new DataTable(pjq("div.rf-edt[id$=richEDT]"));
IdLocator attributeRowsInput = id("form:attributes:rowsInput");
14 years, 4 months
JBoss Rich Faces SVN: r18297 - root/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: 2010-07-30 09:25:33 -0400 (Fri, 30 Jul 2010)
New Revision: 18297
Modified:
root/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/AbstractMetamerTest.java
Log:
added waiting for isAlertPresent for testFireEvent methods
Modified: root/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/AbstractMetamerTest.java
===================================================================
--- root/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/AbstractMetamerTest.java 2010-07-30 13:24:55 UTC (rev 18296)
+++ root/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/AbstractMetamerTest.java 2010-07-30 13:25:33 UTC (rev 18297)
@@ -32,6 +32,7 @@
import org.jboss.test.selenium.encapsulated.JavaScript;
import org.jboss.test.selenium.locator.ElementLocator;
import org.jboss.test.selenium.locator.JQueryLocator;
+import org.jboss.test.selenium.waiting.ajax.JavaScriptCondition;
import org.richfaces.tests.metamer.TemplatesList;
import org.richfaces.tests.metamer.ftest.annotations.Inject;
import org.richfaces.tests.metamer.ftest.annotations.Templates;
@@ -78,7 +79,7 @@
selenium.open(buildUrl(getTestUrl() + "?templates=" + template.toString()));
selenium.waitForPageToLoad(TIMEOUT);
}
-
+
/**
* Invalidates session by clicking on a button on tested page.
*/
@@ -133,7 +134,13 @@
selenium.waitForPageToLoad(TIMEOUT);
selenium.fireEvent(element, event);
-
+
+ waitGui.until(new JavaScriptCondition() {
+ public JavaScript getJavaScriptCondition() {
+ return new JavaScript("selenium.isAlertPresent()");
+ }
+ });
+
assertEquals(selenium.getAlert(), event.getEventName(), event.getEventName()
+ " attribute did not change correctly");
}
14 years, 4 months
JBoss Rich Faces SVN: r18296 - in root/tests/metamer/trunk: ftest-source/src/main/java/org/richfaces/tests/metamer/ftest and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: lfryc(a)redhat.com
Date: 2010-07-30 09:24:55 -0400 (Fri, 30 Jul 2010)
New Revision: 18296
Added:
root/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/MetamerConsoleStatusTestListener.java
root/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/MetamerFailureLoggingTestListener.java
root/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/MetamerSeleniumLoggingTestListener.java
root/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/MetamerTestInfo.java
Removed:
root/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/ConsoleStatusTestListener.java
Modified:
root/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/MatrixConfigurator.java
root/tests/metamer/trunk/ftest/pom.xml
Log:
own extension to logging to include test parameters
Modified: root/tests/metamer/trunk/ftest/pom.xml
===================================================================
--- root/tests/metamer/trunk/ftest/pom.xml 2010-07-30 13:24:03 UTC (rev 18295)
+++ root/tests/metamer/trunk/ftest/pom.xml 2010-07-30 13:24:55 UTC (rev 18296)
@@ -275,7 +275,7 @@
<properties>
<property>
<name>listener</name>
- <value>org.richfaces.tests.metamer.ftest.MatrixConfigurator,org.richfaces.tests.metamer.ftest.ConsoleStatusTestListener,org.jboss.test.selenium.listener.SeleniumLoggingTestListener,org.jboss.test.selenium.listener.FailureLoggingTestListener</value>
+ <value>org.richfaces.tests.metamer.ftest.MatrixConfigurator,org.richfaces.tests.metamer.ftest.MetamerSeleniumLoggingTestListener,org.richfaces.tests.metamer.ftest.MetamerFailureLoggingTestListener,org.richfaces.tests.metamer.ftest.MetamerConsoleStatusTestListener</value>
</property>
</properties>
</configuration>
Deleted: root/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/ConsoleStatusTestListener.java
===================================================================
--- root/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/ConsoleStatusTestListener.java 2010-07-30 13:24:03 UTC (rev 18295)
+++ root/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/ConsoleStatusTestListener.java 2010-07-30 13:24:55 UTC (rev 18296)
@@ -1,96 +0,0 @@
-/*******************************************************************************
- * JBoss, Home of Professional Open Source
- * Copyright 2009-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 java.lang.reflect.Field;
-import java.util.Map;
-import java.util.Map.Entry;
-
-import org.jboss.test.selenium.utils.testng.TestLoggingUtils;
-import org.testng.ITestResult;
-import org.testng.TestListenerAdapter;
-
-/**
- * This class is used as ITestListener in testNG tests to put test's status to the console output
- *
- * @author <a href="mailto:lfryc@redhat.com">Lukas Fryc</a>, <a href="mailto:pjha@redhat.com">Prabhat Jha</a>, <a
- * href="mailto:ppitonak@redhat.com">Pavol Pitonak</a>
- * @version $Revision$
- *
- */
-public class ConsoleStatusTestListener extends TestListenerAdapter {
-
- @Override
- public void onTestStart(ITestResult result) {
- logStatus(result, true);
- }
-
- @Override
- public void onTestFailure(ITestResult result) {
- logStatus(result, false);
- }
-
- @Override
- public void onTestSkipped(ITestResult result) {
- logStatus(result, false);
- }
-
- @Override
- public void onTestSuccess(ITestResult result) {
- logStatus(result, false);
- }
-
- @Override
- public void onTestFailedButWithinSuccessPercentage(ITestResult result) {
- logStatus(result, false);
- }
-
- /**
- * This method will output method name and status on the standard output
- *
- * @param result
- * from the fine-grained listener's method such as onTestFailure(ITestResult)
- */
- private void logStatus(ITestResult result, boolean isTestStart) {
- String message = TestLoggingUtils.getTestDescription(result, isTestStart);
-
- Map<Field, Object> configuration = (Map<Field, Object>) result.getAttribute("matrix-configuration");
- if (!configuration.isEmpty()) {
- message += " {";
- for (Entry<Field, Object> entry : configuration.entrySet()) {
-
- final String name = entry.getKey().getName();
- final Object value = entry.getValue();
-
- if (value != null) {
- message += name + ": " + value + ", ";
- }
- }
- message += "}";
- }
-
- System.out.println(message);
- if (!isTestStart) {
- System.out.println();
- }
- }
-}
Modified: root/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/MatrixConfigurator.java
===================================================================
--- root/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/MatrixConfigurator.java 2010-07-30 13:24:03 UTC (rev 18295)
+++ root/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/MatrixConfigurator.java 2010-07-30 13:24:55 UTC (rev 18296)
@@ -54,7 +54,6 @@
import org.testng.IMethodInstance;
import org.testng.IMethodInterceptor;
import org.testng.ITestContext;
-import org.testng.ITestListener;
import org.testng.ITestNGMethod;
import org.testng.ITestResult;
import org.testng.annotations.ITestAnnotation;
@@ -64,12 +63,18 @@
* @version $Revision$
*/
public class MatrixConfigurator extends TestMethodSelector implements IAnnotationTransformer, IInvokedMethodListener,
- IMethodInterceptor, ITestListener {
+ IMethodInterceptor {
+ static Map<Field, Object> currentConfiguration;
+
Map<Class<?>, Map<Method, Configuration>> configurations = new HashMap<Class<?>, Map<Method, Configuration>>();
LinkedList<Method> methods = new LinkedList<Method>();
boolean methodConfigured = false;
- Map<Field, Object> currentConfiguration;
+
+
+ public static Map<Field, Object> getCurrentConfiguration() {
+ return currentConfiguration;
+ }
public List<IMethodInstance> intercept(List<IMethodInstance> methodInstances, ITestContext context) {
for (IMethodInstance methodInstance : methodInstances) {
@@ -410,34 +415,4 @@
throw new UnsupportedOperationException();
}
}
-
- public void onTestStart(ITestResult result) {
- setCurrentConfigurationToTestResultAttributes(result);
- }
-
- public void onTestSuccess(ITestResult result) {
- setCurrentConfigurationToTestResultAttributes(result);
- }
-
- public void onTestFailure(ITestResult result) {
- setCurrentConfigurationToTestResultAttributes(result);
- }
-
- public void onTestSkipped(ITestResult result) {
- setCurrentConfigurationToTestResultAttributes(result);
- }
-
- public void onTestFailedButWithinSuccessPercentage(ITestResult result) {
- setCurrentConfigurationToTestResultAttributes(result);
- }
-
- private void setCurrentConfigurationToTestResultAttributes(ITestResult result) {
- result.setAttribute("matrix-configuration", currentConfiguration);
- }
-
- public void onStart(ITestContext context) {
- }
-
- public void onFinish(ITestContext context) {
- }
}
Added: root/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/MetamerConsoleStatusTestListener.java
===================================================================
--- root/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/MetamerConsoleStatusTestListener.java (rev 0)
+++ root/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/MetamerConsoleStatusTestListener.java 2010-07-30 13:24:55 UTC (rev 18296)
@@ -0,0 +1,37 @@
+/*******************************************************************************
+ * JBoss, Home of Professional Open Source
+ * Copyright 2009-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 org.jboss.test.selenium.listener.ConsoleStatusTestListener;
+import org.testng.ITestResult;
+
+/**
+ * @author <a href="mailto:lfryc@redhat.com">Lukas Fryc</a>
+ * @version $Revision$
+ *
+ */
+public class MetamerConsoleStatusTestListener extends ConsoleStatusTestListener {
+ protected String getMessage(ITestResult result) {
+ String message = super.getMessage(result);
+ return message + " " + MetamerTestInfo.getConfigurationInfoInParenthesses();
+ }
+}
Added: root/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/MetamerFailureLoggingTestListener.java
===================================================================
--- root/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/MetamerFailureLoggingTestListener.java (rev 0)
+++ root/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/MetamerFailureLoggingTestListener.java 2010-07-30 13:24:55 UTC (rev 18296)
@@ -0,0 +1,44 @@
+/*******************************************************************************
+ * 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 org.jboss.test.selenium.listener.FailureLoggingTestListener;
+import org.testng.ITestResult;
+
+/**
+ * @author <a href="mailto:lfryc@redhat.com">Lukas Fryc</a>
+ * @version $Revision$
+ */
+public class MetamerFailureLoggingTestListener extends FailureLoggingTestListener {
+ @Override
+ protected String getFilenameIdentification(ITestResult result) {
+ String testInfo = MetamerTestInfo.getConfigurationInfo();
+ testInfo = testInfo.replaceAll(" ", "");
+ return super.getFilenameIdentification(result) + "-" + testInfo;
+ }
+
+ @Override
+ protected String getSeleniumLogIdentification(ITestResult result) {
+ String id = super.getSeleniumLogIdentification(result);
+ return id + " " + MetamerTestInfo.getConfigurationInfoInParenthesses();
+ }
+}
Added: root/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/MetamerSeleniumLoggingTestListener.java
===================================================================
--- root/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/MetamerSeleniumLoggingTestListener.java (rev 0)
+++ root/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/MetamerSeleniumLoggingTestListener.java 2010-07-30 13:24:55 UTC (rev 18296)
@@ -0,0 +1,37 @@
+/*******************************************************************************
+ * 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 org.jboss.test.selenium.listener.SeleniumLoggingTestListener;
+import org.testng.ITestResult;
+
+/**
+ * @author <a href="mailto:lfryc@redhat.com">Lukas Fryc</a>
+ * @version $Revision$
+ */
+public class MetamerSeleniumLoggingTestListener extends SeleniumLoggingTestListener {
+ @Override
+ protected String getMessage(ITestResult result) {
+ String message = super.getMessage(result);
+ return message + " " + MetamerTestInfo.getConfigurationInfoInParenthesses();
+ }
+}
Added: root/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/MetamerTestInfo.java
===================================================================
--- root/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/MetamerTestInfo.java (rev 0)
+++ root/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/MetamerTestInfo.java 2010-07-30 13:24:55 UTC (rev 18296)
@@ -0,0 +1,59 @@
+/*******************************************************************************
+ * 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 java.lang.reflect.Field;
+import java.util.Map;
+import java.util.Map.Entry;
+
+/**
+ * @author <a href="mailto:ppitonak@redhat.com">Lukas Fryc</a>
+ * @version $Revision$
+ */
+public final class MetamerTestInfo {
+ private MetamerTestInfo() {
+ }
+
+ public static String getConfigurationInfo() {
+ Map<Field, Object> configuration = MatrixConfigurator.getCurrentConfiguration();
+ StringBuffer info = new StringBuffer();
+ if (!configuration.isEmpty()) {
+ for (Entry<Field, Object> entry : configuration.entrySet()) {
+ final String name = entry.getKey().getName();
+ final Object value = entry.getValue();
+
+ if (value != null) {
+ if (info.length() > 0) {
+ info.append(", ");
+ }
+ info.append(name + ": " + value);
+ }
+ }
+ }
+
+ return info.toString();
+ }
+
+ public static String getConfigurationInfoInParenthesses() {
+ return "{ " + getConfigurationInfo() + " }";
+ }
+}
14 years, 4 months
JBoss Rich Faces SVN: r18295 - root/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer.
by richfaces-svn-commits@lists.jboss.org
Author: lfryc(a)redhat.com
Date: 2010-07-30 09:24:03 -0400 (Fri, 30 Jul 2010)
New Revision: 18295
Modified:
root/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/TemplatesList.java
Log:
changed output from TemplatesList#toString - do not write , at the end + do not write plain at the end with exception that only plain template is used
Modified: root/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/TemplatesList.java
===================================================================
--- root/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/TemplatesList.java 2010-07-30 13:23:25 UTC (rev 18294)
+++ root/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/TemplatesList.java 2010-07-30 13:24:03 UTC (rev 18295)
@@ -22,6 +22,7 @@
package org.richfaces.tests.metamer;
import java.util.ArrayList;
+import java.util.Iterator;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -87,9 +88,16 @@
public String toString() {
StringBuilder sb = new StringBuilder();
- for (int i = 0; i < size(); i++) {
- sb.append(get(i).toString());
- sb.append(",");
+ Iterator<Template> iterator = iterator();
+ while (iterator.hasNext()) {
+ final Template template = iterator.next();
+ if (sb.length() > 0) {
+ if (template == Template.PLAIN) {
+ continue;
+ }
+ sb.append(",");
+ }
+ sb.append(template.toString());
}
return sb.toString();
14 years, 4 months