}
@Test
public void testFactory() throws Exception {
Factory factory = getFactory();
Person author = factory.newAuthor();
assertNotNull(author);
author = factory.newAuthor();
author.setName("a");
author.setEmail("b");
author.setUri("c");
assertNotNull(author);
assertEquals("a", author.getName());
assertEquals("b", author.getEmail());
assertEquals("c", author.getUri().toString());
author = factory.newAuthor();
author.setName("a");
author.setEmail("b");
author.setUri("c");
assertNotNull(author);
assertEquals("a", author.getName());
assertEquals("b", author.getEmail());
assertEquals("c", author.getUri().toString());
Category category = factory.newCategory();
assertNotNull(category);
category = factory.newCategory();
category.setScheme("a");
category.setTerm("b");
category.setLabel("c");
assertNotNull(category);
assertEquals("a", category.getScheme().toString());
assertEquals("b", category.getTerm());
assertEquals("c", category.getLabel());
Collection collection = factory.newCollection();
assertNotNull(collection);
Content content = factory.newContent(Content.Type.TEXT);
assertNotNull(content);
assertEquals(Content.Type.TEXT, content.getContentType());
content = factory.newContent(Content.Type.HTML);
assertEquals(Content.Type.HTML, content.getContentType());
content = factory.newContent(Content.Type.XHTML);
assertEquals(Content.Type.XHTML, content.getContentType());
content = factory.newContent(Content.Type.MEDIA);
assertEquals(Content.Type.MEDIA, content.getContentType());
content = factory.newContent(Content.Type.XML);
assertEquals(Content.Type.XML, content.getContentType());
content = factory.newContent(new MimeType("text/foo"));
assertEquals(Content.Type.MEDIA, content.getContentType());
assertEquals("text/foo", content.getMimeType().toString());
Person contributor = factory.newContributor();
assertNotNull(contributor);
contributor = factory.newContributor();
contributor.setName("a");
contributor.setEmail("b");
contributor.setUri("c");
assertNotNull(contributor);
assertEquals("a", contributor.getName());
assertEquals("b", contributor.getEmail());
assertEquals("c", contributor.getUri().toString());
contributor = factory.newContributor();
contributor.setName("a");
contributor.setEmail("b");
contributor.setUri("c");
assertNotNull(contributor);
assertEquals("a", contributor.getName());
assertEquals("b", contributor.getEmail());
assertEquals("c", contributor.getUri().toString());
Control control = factory.newControl();
assertNotNull(control);
control = factory.newControl();
control.setDraft(true);
assertTrue(control.isDraft());
Date now = new Date();
DateTime dateTime = factory.newDateTime(Constants.UPDATED, null);
dateTime.setValue(AtomDate.valueOf(now));
assertEquals(now, dateTime.getDate());
Calendar cal = Calendar.getInstance();
dateTime = factory.newDateTime(Constants.UPDATED, null);
dateTime.setCalendar(cal);
assertEquals(cal, dateTime.getCalendar());
dateTime = factory.newDateTime(Constants.UPDATED, null);
dateTime.setDate(now);
assertEquals(now, dateTime.getDate());
dateTime = factory.newDateTime(Constants.UPDATED, null);
assertNotNull(dateTime);
dateTime = factory.newDateTime(Constants.UPDATED, null);
dateTime.setTime(now.getTime());
assertEquals(now.getTime(), dateTime.getTime());
dateTime = factory.newDateTime(Constants.UPDATED, null);
dateTime.setString(AtomDate.format(now));
assertEquals(AtomDate.format(now), dateTime.getString());
assertEquals(now, dateTime.getDate());
Generator generator = factory.newDefaultGenerator();
assertNotNull(generator);
assertEquals(Version.APP_NAME, generator.getText());
assertEquals(Version.VERSION, generator.getVersion());
assertEquals(Version.URI, generator.getUri().toString());
Div div = factory.newDiv();
assertNotNull(div);
Document<?> doc = factory.newDocument();
assertNotNull(doc);
Element el = factory.newEmail();
assertNotNull(el);
el = factory.newEmail();
el.setText("a");
assertEquals("a", el.getText());
Entry entry = factory.newEntry();
assertNotNull(entry);
entry = factory.newEntry();
assertNotNull(entry);
Element ee = factory.newExtensionElement(new QName("urn:foo", "bar", "b"));
assertNotNull(ee);
assertEquals(new QName("urn:foo", "bar", "b"), ee.getQName());
Feed feed = factory.newFeed();
assertNotNull(feed);
generator = factory.newGenerator();
assertNotNull(generator);
generator = factory.newGenerator();
generator.setUri(Version.URI);
generator.setVersion(Version.VERSION);
generator.setText(Version.APP_NAME);
assertNotNull(generator);
assertEquals(Version.APP_NAME, generator.getText());
assertEquals(Version.VERSION, generator.getVersion());
assertEquals(Version.URI, generator.getUri().toString());
content = factory.newContent(Content.Type.HTML);
content.setValue("a");
assertNotNull(content);
assertEquals("a", content.getValue());
assertEquals(Content.Type.HTML, content.getContentType());
Text text = factory.newRights(Text.Type.HTML);
text.setValue("a");
assertNotNull(text);
assertEquals("a", text.getValue());
assertEquals(Text.Type.HTML, text.getTextType());
text = factory.newSubtitle(Text.Type.HTML);
text.setValue("a");
assertEquals("a", text.getValue());
assertEquals(Text.Type.HTML, text.getTextType());
text = factory.newSummary(Text.Type.HTML);
text.setValue("a");
assertEquals("a", text.getValue());
assertEquals(Text.Type.HTML, text.getTextType());
text = factory.newText(Constants.TITLE, Text.Type.HTML, null);
text.setValue("a");
assertEquals("a", text.getValue());
assertEquals(Text.Type.HTML, text.getTextType());
assertEquals(Constants.TITLE, text.getQName());
text = factory.newTitle(Text.Type.HTML);
text.setValue("a");
assertEquals("a", text.getValue());
assertEquals(Text.Type.HTML, text.getTextType());
IRIElement iri = factory.newIcon();
assertNotNull(iri);
iri = factory.newIcon();
iri.setValue("http://example.org/foo");
assertEquals("http://example.org/foo", iri.getValue().toString());
iri = factory.newIcon();
iri.setValue("http://example.org/foo");
assertEquals("http://example.org/foo", iri.getValue().toString());
iri = factory.newID();
assertNotNull(iri);
iri = factory.newID();
iri.setValue("http://example.org/foo");
assertEquals("http://example.org/foo", iri.getValue().toString());
iri = factory.newID();
iri.setValue("http://example.org/foo");
assertEquals("http://example.org/foo", iri.getValue().toString());
iri = factory.newIRIElement(Constants.ID, null);
assertNotNull(iri);
iri = factory.newIRIElement(Constants.ID, null);
iri.setValue("http://example.org/foo");
assertEquals("http://example.org/foo", iri.getValue().toString());
iri = factory.newIRIElement(Constants.ID, null);
iri.setValue("http://example.org/foo");
assertEquals("http://example.org/foo", iri.getValue().toString());
Link link = factory.newLink();
assertNotNull(link);
link = factory.newLink();
link.setHref("http://example.org/foo");
link.setRel("a");
link.setMimeType("text/foo");
link.setTitle("b");
link.setHrefLang("en");
link.setLength(10);
assertEquals("http://example.org/foo", link.getHref().toString());
assertEquals("a", link.getRel());
assertEquals("text/foo", link.getMimeType().toString());
assertEquals("b", link.getTitle());
assertEquals("en", link.getHrefLang());
assertEquals(10, link.getLength());
link = factory.newLink();
link.setHref("http://example.org/foo");
link.setRel("a");
link.setMimeType("text/foo");
link.setTitle("b");
link.setHrefLang("en");
link.setLength(10);
assertEquals("http://example.org/foo", link.getHref().toString());
assertEquals("a", link.getRel());
assertEquals("text/foo", link.getMimeType().toString());
assertEquals("b", link.getTitle());
assertEquals("en", link.getHrefLang());
assertEquals(10, link.getLength());
iri = factory.newLogo();
assertNotNull(iri);
iri = factory.newLogo();
iri.setValue("http://example.org/foo");
assertEquals("http://example.org/foo", iri.getValue().toString());
iri = factory.newLogo();
iri.setValue("http://example.org/foo");
assertEquals("http://example.org/foo", iri.getValue().toString());
content = factory.newContent(new MimeType("text/foo"));
content.setSrc("foo");
assertNotNull(content);
assertEquals("text/foo", content.getMimeType().toString());
assertEquals("foo", content.getSrc().toString());
content = factory.newContent(new MimeType("text/foo"));
content.setDataHandler(new DataHandler(new ByteArrayDataSource("foo".getBytes())));
assertEquals("Zm9v", content.getValue());
assertEquals(Content.Type.MEDIA, content.getContentType());
el = factory.newName();
assertNotNull(el);
el = factory.newName();
el.setText("a");
assertEquals("a", el.getText());
Parser parser = factory.newParser();
assertNotNull(parser);
Person person = factory.newPerson(Constants.AUTHOR, null);
assertNotNull(person);
assertEquals(Constants.AUTHOR, person.getQName());
person = factory.newPerson(Constants.AUTHOR, null);
person.setName("a");
person.setEmail("b");
person.setUri("c");
assertEquals("a", person.getName());
assertEquals("b", person.getEmail());
assertEquals("c", person.getUri().toString());
person = factory.newPerson(Constants.AUTHOR, null);
person.setName("a");
person.setEmail("b");
person.setUri("c");
assertEquals("a", person.getName());
assertEquals("b", person.getEmail());
assertEquals("c", person.getUri().toString());
now = new Date();
dateTime = factory.newPublished();
dateTime.setValue(AtomDate.valueOf(now));
assertEquals(now, dateTime.getDate());
cal = Calendar.getInstance();