public void SMTest()
{
Address a = new DirectionalAddress(DirectionalAddress.Direction.Left);
TransportAddress ta = TransportAddressFactory.CreateInstance("brunet.tcp://127.0.0.1:5000");
NodeInfo ni = NodeInfo.CreateInstance(a, ta);
//Test with one neighbor:
ArrayList neighbors = new ArrayList();
neighbors.Add(ni);
StatusMessage sm1 = new StatusMessage(ConnectionType.Structured, neighbors);
RoundTripHT(sm1);
//Console.Error.WriteLine("\n{0}\n", sm1);
//Test with many neighbors:
for(int i = 5001; i < 5010; i++) {
neighbors.Add(NodeInfo.CreateInstance(a,
TransportAddressFactory.CreateInstance("brunet.tcp://127.0.0.1:"
+ i.ToString())));
}
StatusMessage sm2 = new StatusMessage(ConnectionType.Unstructured, neighbors);
RoundTripHT(sm2);
//Console.Error.WriteLine("\n{0}\n", sm2);
//Here is a StatusMessage with no neighbors (that has to be a possibility)
StatusMessage sm3 = new StatusMessage("structured", new ArrayList());
RoundTripHT(sm3);
//Console.Error.WriteLine("\n{0}\n", sm3);
}
}