Author: pferraro
Date: 2009-01-28 14:25:07 -0500 (Wed, 28 Jan 2009)
New Revision: 2239
Modified:
trunk/mod_cluster/src/test/java/org/jboss/modcluster/load/metric/ReceiveTrafficLoadMetricTestCase.java
trunk/mod_cluster/src/test/java/org/jboss/modcluster/load/metric/RequestCountLoadMetricTestCase.java
trunk/mod_cluster/src/test/java/org/jboss/modcluster/load/metric/SendTrafficLoadMetricTestCase.java
Log:
Relax allowable expected load delta to improve test success rate.
Modified:
trunk/mod_cluster/src/test/java/org/jboss/modcluster/load/metric/ReceiveTrafficLoadMetricTestCase.java
===================================================================
---
trunk/mod_cluster/src/test/java/org/jboss/modcluster/load/metric/ReceiveTrafficLoadMetricTestCase.java 2009-01-28
17:05:27 UTC (rev 2238)
+++
trunk/mod_cluster/src/test/java/org/jboss/modcluster/load/metric/ReceiveTrafficLoadMetricTestCase.java 2009-01-28
19:25:07 UTC (rev 2239)
@@ -59,8 +59,8 @@
EasyMock.reset(this.server);
- EasyMock.expect(this.server.getAttribute(this.name1,
ReceiveTrafficLoadMetric.DEFAULT_ATTRIBUTE)).andReturn(1000L);
- EasyMock.expect(this.server.getAttribute(this.name2,
ReceiveTrafficLoadMetric.DEFAULT_ATTRIBUTE)).andReturn(2000L);
+ EasyMock.expect(this.server.getAttribute(this.name1,
ReceiveTrafficLoadMetric.DEFAULT_ATTRIBUTE)).andReturn(10000L);
+ EasyMock.expect(this.server.getAttribute(this.name2,
ReceiveTrafficLoadMetric.DEFAULT_ATTRIBUTE)).andReturn(20000L);
EasyMock.replay(this.server);
@@ -77,12 +77,12 @@
EasyMock.verify(this.server);
- Assert.assertEquals(6.0, load, 0.5);
+ Assert.assertEquals(60.0, load, 1.0);
EasyMock.reset(this.server);
- EasyMock.expect(this.server.getAttribute(this.name1,
ReceiveTrafficLoadMetric.DEFAULT_ATTRIBUTE)).andReturn(2000L);
- EasyMock.expect(this.server.getAttribute(this.name2,
ReceiveTrafficLoadMetric.DEFAULT_ATTRIBUTE)).andReturn(3000L);
+ EasyMock.expect(this.server.getAttribute(this.name1,
ReceiveTrafficLoadMetric.DEFAULT_ATTRIBUTE)).andReturn(20000L);
+ EasyMock.expect(this.server.getAttribute(this.name2,
ReceiveTrafficLoadMetric.DEFAULT_ATTRIBUTE)).andReturn(30000L);
EasyMock.replay(this.server);
@@ -97,7 +97,7 @@
EasyMock.verify(this.server);
- Assert.assertEquals(4.0, load, 0.5);
+ Assert.assertEquals(40.0, load, 1.0);
EasyMock.reset(this.server);
}
Modified:
trunk/mod_cluster/src/test/java/org/jboss/modcluster/load/metric/RequestCountLoadMetricTestCase.java
===================================================================
---
trunk/mod_cluster/src/test/java/org/jboss/modcluster/load/metric/RequestCountLoadMetricTestCase.java 2009-01-28
17:05:27 UTC (rev 2238)
+++
trunk/mod_cluster/src/test/java/org/jboss/modcluster/load/metric/RequestCountLoadMetricTestCase.java 2009-01-28
19:25:07 UTC (rev 2239)
@@ -59,8 +59,8 @@
EasyMock.reset(this.server);
- EasyMock.expect(this.server.getAttribute(this.name1,
RequestCountLoadMetric.DEFAULT_ATTRIBUTE)).andReturn(1);
- EasyMock.expect(this.server.getAttribute(this.name2,
RequestCountLoadMetric.DEFAULT_ATTRIBUTE)).andReturn(2);
+ EasyMock.expect(this.server.getAttribute(this.name1,
RequestCountLoadMetric.DEFAULT_ATTRIBUTE)).andReturn(10);
+ EasyMock.expect(this.server.getAttribute(this.name2,
RequestCountLoadMetric.DEFAULT_ATTRIBUTE)).andReturn(20);
EasyMock.replay(this.server);
@@ -77,13 +77,13 @@
EasyMock.verify(this.server);
- Assert.assertEquals(6, load, 0.5);
+ Assert.assertEquals(60.0, load, 1.0);
EasyMock.reset(this.server);
// Test incremental load
- EasyMock.expect(this.server.getAttribute(this.name1,
RequestCountLoadMetric.DEFAULT_ATTRIBUTE)).andReturn(2);
- EasyMock.expect(this.server.getAttribute(this.name2,
RequestCountLoadMetric.DEFAULT_ATTRIBUTE)).andReturn(3);
+ EasyMock.expect(this.server.getAttribute(this.name1,
RequestCountLoadMetric.DEFAULT_ATTRIBUTE)).andReturn(20);
+ EasyMock.expect(this.server.getAttribute(this.name2,
RequestCountLoadMetric.DEFAULT_ATTRIBUTE)).andReturn(30);
EasyMock.replay(this.server);
@@ -98,7 +98,7 @@
EasyMock.verify(this.server);
- Assert.assertEquals(4, load, 0.5);
+ Assert.assertEquals(40.0, load, 1.0);
EasyMock.reset(this.server);
}
Modified:
trunk/mod_cluster/src/test/java/org/jboss/modcluster/load/metric/SendTrafficLoadMetricTestCase.java
===================================================================
---
trunk/mod_cluster/src/test/java/org/jboss/modcluster/load/metric/SendTrafficLoadMetricTestCase.java 2009-01-28
17:05:27 UTC (rev 2238)
+++
trunk/mod_cluster/src/test/java/org/jboss/modcluster/load/metric/SendTrafficLoadMetricTestCase.java 2009-01-28
19:25:07 UTC (rev 2239)
@@ -59,8 +59,8 @@
EasyMock.reset(this.server);
- EasyMock.expect(this.server.getAttribute(this.name1,
SendTrafficLoadMetric.DEFAULT_ATTRIBUTE)).andReturn(1000L);
- EasyMock.expect(this.server.getAttribute(this.name2,
SendTrafficLoadMetric.DEFAULT_ATTRIBUTE)).andReturn(2000L);
+ EasyMock.expect(this.server.getAttribute(this.name1,
SendTrafficLoadMetric.DEFAULT_ATTRIBUTE)).andReturn(10000L);
+ EasyMock.expect(this.server.getAttribute(this.name2,
SendTrafficLoadMetric.DEFAULT_ATTRIBUTE)).andReturn(20000L);
EasyMock.replay(this.server);
@@ -77,12 +77,12 @@
EasyMock.verify(this.server);
- Assert.assertEquals(6.0, load, 0.5);
+ Assert.assertEquals(60.0, load, 1.0);
EasyMock.reset(this.server);
- EasyMock.expect(this.server.getAttribute(this.name1,
SendTrafficLoadMetric.DEFAULT_ATTRIBUTE)).andReturn(2000L);
- EasyMock.expect(this.server.getAttribute(this.name2,
SendTrafficLoadMetric.DEFAULT_ATTRIBUTE)).andReturn(3000L);
+ EasyMock.expect(this.server.getAttribute(this.name1,
SendTrafficLoadMetric.DEFAULT_ATTRIBUTE)).andReturn(20000L);
+ EasyMock.expect(this.server.getAttribute(this.name2,
SendTrafficLoadMetric.DEFAULT_ATTRIBUTE)).andReturn(30000L);
EasyMock.replay(this.server);
@@ -97,7 +97,7 @@
EasyMock.verify(this.server);
- Assert.assertEquals(4.0, load, 0.5);
+ Assert.assertEquals(40.0, load, 1.0);
EasyMock.reset(this.server);
}