Address address = factory.createSMTPAddress("alice@volantis.com");
Recipient recipient = factory.createRecipient(address, "Nokia-6600");
recipient.setChannel("smtp");
Failures failures = factory.createFailures();
failures.add(recipient);
address = factory.createSMTPAddress("bob@volantis.com");
recipient = factory.createRecipient(address, "Nokia-6800");
recipient.setChannel("smtp");
failures.add(recipient);
address = factory.createSMTPAddress("dave@volantis.com");
recipient = factory.createRecipient(address, "Samsung-D700");
recipient.setChannel("smtp");
failures.add(recipient);
ByteArrayOutputStream out = new ByteArrayOutputStream();
parser.write(failures, out);
assertXMLEqual(FAILURES_BASIC, out.toString(UTF_8));