/*
* atom:entry elements that contain no child atom:content element MUST
* contain at least one atom:link element with a rel attribute value of
* "alternate".
*/
GOMLink link = new GOMLinkImpl();
link.setRel("alternate");
this.impl.addLink(link);
/*
* atom:entry elements MUST contain exactly one atom:title element.
*/
this.impl.setTitle(new GOMTitleImpl());
/*
* atom:entry elements MUST contain exactly one atom:updated element.
*/
this.impl.setUpdated(new GOMUpdatedImpl());
{
this.impl.setId(null);
try {
this.impl.processEndElement();
fail("id is missing");
} catch (GDataParseException e) {
//
}
this.impl.setId(new GOMIdImpl());
}
{
this.impl.getLinks().clear();
try {
this.impl.processEndElement();
fail("link alternate is missing");
} catch (GDataParseException e) {
//
}
this.impl.setContent(new GOMContentImpl());
this.impl.processEndElement();
this.impl.setContent(null);
this.impl.addLink(link);
}
{
this.impl.setTitle(null);
try {
this.impl.processEndElement();
fail("title is missing");
} catch (GDataParseException e) {
//
}
this.impl.setTitle(new GOMTitleImpl());
}
{
this.impl.setUpdated(null);
try {
this.impl.processEndElement();
fail("Updated is missing");
} catch (GDataParseException e) {
//
}
this.impl.setUpdated(new GOMUpdatedImpl());
}
/*
* atom:entry elements MUST NOT contain more than one atom:link element
* with a rel attribute value of "alternate" that has the same
* combination of type and hreflang attribute values.
*/
link.setType("test");
link.setHrefLang("http://www.apache.org");
this.impl.addLink(link);
try {
this.impl.processEndElement();
fail("doulbe alternate link with same type and hreflang");