Author: pferraro
Date: 2008-10-22 12:23:30 -0400 (Wed, 22 Oct 2008)
New Revision: 1984
Modified:
trunk/mod_cluster/src/test/java/org/jboss/modcluster/ha/HASingletonAwareResetRequestSourceTestCase.java
Log:
Unit tests pass again
Modified:
trunk/mod_cluster/src/test/java/org/jboss/modcluster/ha/HASingletonAwareResetRequestSourceTestCase.java
===================================================================
---
trunk/mod_cluster/src/test/java/org/jboss/modcluster/ha/HASingletonAwareResetRequestSourceTestCase.java 2008-10-22
16:21:27 UTC (rev 1983)
+++
trunk/mod_cluster/src/test/java/org/jboss/modcluster/ha/HASingletonAwareResetRequestSourceTestCase.java 2008-10-22
16:23:30 UTC (rev 1984)
@@ -113,11 +113,8 @@
EasyMock.expect(server.findServices()).andReturn(new Service[] { service });
EasyMock.expect(service.getContainer()).andReturn(engine);
- EasyMock.expect(engine.getJvmRoute()).andReturn("host");
-
- EasyMock.expect(engine.getService()).andReturn(service);
- EasyMock.expect(service.findConnectors()).andReturn(new Connector[] { connector
});
EasyMock.expect(engine.getJvmRoute()).andReturn("host1");
+ EasyMock.expect(service.findConnectors()).andReturn(new Connector[] { connector
});
EasyMock.expect(this.nodeConfig.getDomain()).andReturn("domain");
EasyMock.expect(this.nodeConfig.getFlushPackets()).andReturn(Boolean.TRUE);
@@ -136,15 +133,11 @@
EasyMock.expect(engine.findChildren()).andReturn(new Container[] { container });
EasyMock.expect(container.findChildren()).andReturn(new Container[] { context });
- EasyMock.expect(context.isStarted()).andReturn(true);
-
EasyMock.expect(context.getPath()).andReturn("/context");
+ EasyMock.expect(context.isStarted()).andReturn(true);
EasyMock.expect(context.getParent()).andReturn(host);
EasyMock.expect(host.getName()).andReturn("host");
EasyMock.expect(host.findAliases()).andReturn(new String[] { "alias1",
"alias2" });
- EasyMock.expect(context.getParent()).andReturn(container);
- EasyMock.expect(container.getParent()).andReturn(engine);
- EasyMock.expect(engine.getJvmRoute()).andReturn("host1");
EasyMock.replay(this.singleton, this.key, this.partition, server, service, engine,
container, context, host, this.nodeConfig, this.balancerConfig);
@@ -152,19 +145,11 @@
EasyMock.verify(this.singleton, this.key, this.partition, server, service, engine,
container, context, host, this.nodeConfig, this.balancerConfig);
- Assert.assertEquals(5, results.size());
+ Assert.assertEquals(4, results.size());
MCMPRequest request = results.get(0);
Map<String, String> parameters = request.getParameters();
- Assert.assertSame(MCMPRequestType.REMOVE_APP, request.getRequestType());
- Assert.assertTrue(request.isWildcard());
- Assert.assertEquals("host", request.getJvmRoute());
- Assert.assertTrue(request.getParameters().isEmpty());
-
- request = results.get(1);
- parameters = request.getParameters();
-
Assert.assertSame(MCMPRequestType.CONFIG, request.getRequestType());
Assert.assertFalse(request.isWildcard());
Assert.assertEquals("host1", request.getJvmRoute());
@@ -186,7 +171,7 @@
Assert.assertEquals("6", parameters.get("WaitWorker"));
Assert.assertEquals("7", parameters.get("Maxattempts"));
- request = results.get(2);
+ request = results.get(1);
parameters = request.getParameters();
Assert.assertSame(MCMPRequestType.ENABLE_APP, request.getRequestType());
@@ -196,8 +181,8 @@
Assert.assertEquals("/context", parameters.get("Context"));
Assert.assertEquals("host,alias1,alias2",
parameters.get("Alias"));
- Assert.assertSame(request1, results.get(3));
- Assert.assertSame(request2, results.get(4));
+ Assert.assertSame(request1, results.get(2));
+ Assert.assertSame(request2, results.get(3));
EasyMock.reset(this.singleton, this.key, this.partition, server, service, engine,
container, context, host, this.nodeConfig, this.balancerConfig);
@@ -231,11 +216,8 @@
EasyMock.expect(server.findServices()).andReturn(new Service[] { service });
EasyMock.expect(service.getContainer()).andReturn(engine);
- EasyMock.expect(engine.getJvmRoute()).andReturn("host");
-
- EasyMock.expect(engine.getService()).andReturn(service);
- EasyMock.expect(service.findConnectors()).andReturn(new Connector[] { connector
});
EasyMock.expect(engine.getJvmRoute()).andReturn("host1");
+ EasyMock.expect(service.findConnectors()).andReturn(new Connector[] { connector
});
EasyMock.expect(this.nodeConfig.getDomain()).andReturn("domain");
EasyMock.expect(this.nodeConfig.getFlushPackets()).andReturn(Boolean.TRUE);
@@ -254,15 +236,11 @@
EasyMock.expect(engine.findChildren()).andReturn(new Container[] { container });
EasyMock.expect(container.findChildren()).andReturn(new Container[] { context });
- EasyMock.expect(context.isStarted()).andReturn(true);
-
EasyMock.expect(context.getPath()).andReturn("/context");
+ EasyMock.expect(context.isStarted()).andReturn(true);
EasyMock.expect(context.getParent()).andReturn(host);
EasyMock.expect(host.getName()).andReturn("host");
EasyMock.expect(host.findAliases()).andReturn(new String[] { "alias1",
"alias2" });
- EasyMock.expect(context.getParent()).andReturn(container);
- EasyMock.expect(container.getParent()).andReturn(engine);
- EasyMock.expect(engine.getJvmRoute()).andReturn("host1");
EasyMock.replay(this.singleton, this.key, this.partition, server, service, engine,
container, context, host, this.nodeConfig, this.balancerConfig);
@@ -270,16 +248,9 @@
EasyMock.verify(this.singleton, this.key, this.partition, server, service, engine,
container, context, host, this.nodeConfig, this.balancerConfig);
- Assert.assertEquals(3, results.size());
+ Assert.assertEquals(2, results.size());
MCMPRequest request = results.get(0);
-
- Assert.assertSame(MCMPRequestType.REMOVE_APP, request.getRequestType());
- Assert.assertTrue(request.isWildcard());
- Assert.assertEquals("host", request.getJvmRoute());
- Assert.assertTrue(request.getParameters().isEmpty());
-
- request = results.get(1);
Map<String, String> parameters = request.getParameters();
Assert.assertSame(MCMPRequestType.CONFIG, request.getRequestType());
@@ -303,7 +274,7 @@
Assert.assertEquals("6", parameters.get("WaitWorker"));
Assert.assertEquals("7", parameters.get("Maxattempts"));
- request = results.get(2);
+ request = results.get(1);
parameters = request.getParameters();
Assert.assertSame(MCMPRequestType.ENABLE_APP, request.getRequestType());