Re 1) Each of the different preferred master definitions is in a different test method,
i.e. testIpPort, testHostPort, testOnlyPort, testNonNumericPort, testUnknownHost... that
should be enough, shouldn't it?
Re 2) I think I have that one covered, i.e.
public void testUnknownHost() throws Exception
| {
| policy.setPreferredMaster("onceuponatimeinalandfarfaraway:1199");
| /* invalid preferred master definiton, so 1st candidate in the list
| * should be chosen */
| assertEquals(candidates.get(0), policy.elect());
| }
|
Btw, while running the the clustered tests for ha singleton election, I have spotted the
following WARN message when the last node in the cluster stops and this is the node where
the ha singleton was running:
| 2008-02-10 22:50:57,675 WARN [org.jboss.ha.singleton.HASingletonController] Stopping
failed test:service=HASingletonController_1
| java.lang.IllegalStateException: list of cluster node candidates where to run the
singleton cannot be null
| at
org.jboss.ha.singleton.HASingletonElectionPolicyBase.elect(HASingletonElectionPolicyBase.java:103)
| at
org.jboss.ha.singleton.HASingletonSupport.partitionTopologyChanged(HASingletonSupport.java:169)
| at
org.jboss.ha.jmx.HAServiceMBeanSupport$1.replicantsChanged(HAServiceMBeanSupport.java:244)
|
I'm gonna change HASingletonElectionPolicyBase so that it doesn't throw a ISE when
the list of candidates, but instead logs a debug message.
I'll make HASingletonElectionPolicy.elect() return null on those occasions which
requires noting it in the javadoc and a couple of extra lines in
HASingletonSupport.partitionTopologyChanged():
boolean isElectedNewMaster;
| if (mElectionPolicyMB != null)
| {
| ClusterNode electedNode = mElectionPolicyMB.elect();
| isElectedNewMaster = electedNode != null ?
electedNode.equals(getHAPartition().getClusterNode()) : false;
| }
| else
| {
| isElectedNewMaster = isDRMMasterReplica();
| }
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4128213#...
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&a...