GOMAuthorImpl impl = new GOMAuthorImpl();
try {
impl.writeRssOutput(null);
fail("writer is null");
} catch (GDataParseException e) {
}
StringWriter writer2 = new StringWriter();
GOMOutputWriter writer = new GOMStaxWriter(writer2);
impl.writeRssOutput(writer, "test");
writer.flush();
writer2.flush();
assertEquals("<test></test>", writer2.toString());
impl.setEmail("simonw@apache.org");
impl.setUri("someuri");
writer.close();
writer2 = new StringWriter();
writer = new GOMStaxWriter(writer2);
impl.writeRssOutput(writer);
writer.flush();
writer2.flush();
assertTrue(writer2.toString().length() > 0);
assertEquals("<" + GOMAuthor.LOCALNAME + ">" + impl.getEmail() + "</"
+ GOMAuthor.LOCALNAME + ">", writer2.toString());
writer.close();
impl.setName("simonw");
writer2 = new StringWriter();
writer = new GOMStaxWriter(writer2);
impl.writeRssOutput(writer);
writer.flush();
writer2.flush();
assertTrue(writer2.toString().length() > 0);
assertEquals("<" + GOMAuthor.LOCALNAME + ">" + impl.getEmail() + "("
+ impl.getName() + ")</" + GOMAuthor.LOCALNAME + ">", writer2
.toString());