if(expectedViewSize>1 && isMuxChannelUsed())
{
for (Iterator iter = channels.iterator(); iter.hasNext();)
{
FlushTestReceiver receiver = (FlushTestReceiver) iter.next();
MuxChannel ch = (MuxChannel)receiver.getChannel();
int servicePairs = 1;
for (Iterator it = channels.iterator(); it.hasNext();)
{
FlushTestReceiver receiver2 = (FlushTestReceiver) it.next();
MuxChannel ch2 = (MuxChannel)receiver2.getChannel();
if(ch.getId().equals(ch2.getId()) && !ch.getLocalAddress().equals(ch2.getLocalAddress()))
{
assertEquals("Correct view for service pair",ch.getView(),ch2.getView());
assertTrue("Presence in view",ch.getView().getMembers().contains(ch.getLocalAddress()));
assertTrue("Presence in view",ch.getView().getMembers().contains(ch2.getLocalAddress()));
assertTrue("Presence in view",ch2.getView().getMembers().contains(ch2.getLocalAddress()));
assertTrue("Presence in view",ch2.getView().getMembers().contains(ch.getLocalAddress()));
servicePairs++;
}
}
assertEquals("Correct service count",expectedViewSize,servicePairs);
}