Author: lfryc(a)redhat.com
Date: 2010-09-17 03:56:40 -0400 (Fri, 17 Sep 2010)
New Revision: 19229
Modified:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jPoll/TestInterval.java
Log:
a4jPoll/TestInterval - reset deviation times between each method
Modified:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jPoll/TestInterval.java
===================================================================
---
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jPoll/TestInterval.java 2010-09-17
07:56:01 UTC (rev 19228)
+++
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jPoll/TestInterval.java 2010-09-17
07:56:40 UTC (rev 19229)
@@ -34,6 +34,7 @@
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.BeforeMethod;
import org.testng.annotations.Test;
import static org.jboss.test.selenium.utils.URLUtils.buildUrl;
@@ -64,13 +65,19 @@
long startTime;
long deviationTotal = 0;
- long devicationCount = 0;
+ long deviationCount = 0;
@Override
public URL getTestUrl() {
return buildUrl(contextPath, "faces/components/a4jPoll/simple.xhtml");
}
+ @BeforeMethod
+ public void resetDeviations() {
+ deviationTotal = 0;
+ deviationCount = 0;
+ }
+
@Test
@Use(field = "interval", ints = { 1000 })
public void testClientAllTemplates() throws HttpException, IOException {
@@ -144,12 +151,12 @@
format("Deviation ({0}) is greater than one interval {1}",
deviation, interval));
deviationTotal += deviation;
- devicationCount += 1;
+ deviationCount += 1;
}
private void validateAverageDeviation() {
long maximumAvgDeviation = Math.min(interval / 4, 1000);
- long averageDeviation = deviationTotal / devicationCount;
+ long averageDeviation = deviationTotal / deviationCount;
if (seleniumDebug) {
System.out.println("averageDeviation: " + averageDeviation);