throw new TestException(
"OutgoingMulticastAnnouncement.marshal returned non-1"
+ " array");
}
IncomingMulticastAnnouncement ann =
new IncomingMulticastAnnouncement(reqs[0]);
if (ann.getGroups().length != 0) {
throw new TestException("IncomingMulticastAnnouncement.getGroups "
+ "returned non-empty array");
}
/*
* Try marshalling a normal-looking announcement, so we can
* ensure that it contains everything it should.
*/
reqs = OutgoingMulticastAnnouncement.marshal(sid, loc, grps);
if (reqs == null) {
throw new TestException(
"OutgoingMulticastAnnouncement.marshal returned null");
}
if (reqs.length == 0) {
throw new TestException(
"OutgoingMulticastAnnouncement.marshal returned empty"
+ " array");
}
logger.log(Level.INFO, "Marshaled " + reqs.length + " packets");
Collection marshaledGroups = new HashSet();
for (int i = 0; i < reqs.length; i++) {
if (reqs[i].getData().length > 512) {
throw new TestException(
"request data is too large, at "
+ reqs[i].getData().length + " bytes");
}
IncomingMulticastAnnouncement req =
new IncomingMulticastAnnouncement(reqs[i]);
if (!req.getServiceID().equals(sid)) {
throw new TestException(
"unmarshaled a bad service ID");
}
if (!QAConfig.getConstrainedLocator(req.getLocator()).equals(loc)) {
throw new TestException(
"unmarshaled a bad locator");
}
String[] groupsU = req.getGroups();
for (int j = 0; j < groupsU.length; j++) {
if (!grpSet.contains(groupsU[j])) {
throw new TestException(
"unmarshaled a group we didn't marshal");