Methods Summary |
---|
protected void | setUp()
this.iconImpl = new GOMIconImpl();
this.logoImpl = new GOMLogoImpl();
|
public void | testConstructor()
assertEquals(GOMIcon.LOCALNAME, this.iconImpl.getLocalName());
assertEquals(GOMIcon.LOCALNAME, this.iconImpl.getQname().getLocalPart());
assertEquals(GOMLogo.LOCALNAME, this.logoImpl.getLocalName());
assertEquals(GOMLogo.LOCALNAME, this.logoImpl.getQname().getLocalPart());
|
public void | testProcessEndElement()
try {
this.iconImpl.processEndElement();
fail("no text value");
} catch (GDataParseException e) {
assertTrue(e.getMessage().indexOf("requires a element value") > 0);
}
try {
this.iconImpl.setTextValue("test");
this.iconImpl.processEndElement();
fail("no text value");
} catch (GDataParseException e) {
assertTrue(e.getMessage().indexOf("must be a") > 0);
}
try {
this.iconImpl.setTextValue("/test");
this.iconImpl.processEndElement();
fail("no text value");
} catch (GDataParseException e) {
assertTrue(e.getMessage().indexOf("must be a") > 0);
}
this.iconImpl.xmlBase = "http://www.apache.org";
this.iconImpl.setTextValue("/test");
this.iconImpl.processEndElement();
this.iconImpl.xmlBase = null;
this.iconImpl.setTextValue("http://www.apache.org/test");
|
public void | testWriteAtomOutput()
{
StringWriter stW = new StringWriter();
GOMOutputWriter writer = new GOMStaxWriter(stW);
this.iconImpl.writeAtomOutput(writer);
assertEquals("<icon/>", stW.toString());
}
{
StringWriter stW = new StringWriter();
GOMOutputWriter writer = new GOMStaxWriter(stW);
this.iconImpl.setTextValue("test");
this.iconImpl.writeAtomOutput(writer);
assertEquals("<icon>test</icon>", stW.toString());
}
{
StringWriter stW = new StringWriter();
GOMOutputWriter writer = new GOMStaxWriter(stW);
this.logoImpl.writeAtomOutput(writer);
assertEquals("<logo/>", stW.toString());
}
{
StringWriter stW = new StringWriter();
GOMOutputWriter writer = new GOMStaxWriter(stW);
this.logoImpl.setTextValue("test");
this.logoImpl.writeAtomOutput(writer);
assertEquals("<logo>test</logo>", stW.toString());
}
|
public void | testWriteRssOutput()
{
StringWriter stW = new StringWriter();
GOMOutputWriter writer = new GOMStaxWriter(stW);
this.iconImpl.writeRssOutput(writer);
assertEquals("<url/>", stW.toString());
}
{
StringWriter stW = new StringWriter();
GOMOutputWriter writer = new GOMStaxWriter(stW);
this.iconImpl.setTextValue("test");
this.iconImpl.writeRssOutput(writer);
assertEquals("<url>test</url>", stW.toString());
}
{
StringWriter stW = new StringWriter();
GOMOutputWriter writer = new GOMStaxWriter(stW);
this.logoImpl.writeRssOutput(writer);
assertEquals("<url/>", stW.toString());
}
{
StringWriter stW = new StringWriter();
GOMOutputWriter writer = new GOMStaxWriter(stW);
this.logoImpl.setTextValue("test");
this.logoImpl.writeRssOutput(writer);
assertEquals("<url>test</url>", stW.toString());
}
|