Package com.colorfulsoftware.atom

Examples of com.colorfulsoftware.atom.Author


    // test extension namespaces
    try {
      feed1 = feedDoc.readFeedToBean(basicFeed4);
      List<Author> auths = feed1.getAuthors();
      Author author = auths.remove(0);
      List<Extension> extns = new LinkedList<Extension>();
      extns.add(feedDoc.buildExtension("whats:up", null,
          "nothing special"));
      auths.add(feedDoc.buildAuthor(author.getName(), author.getUri(),
          author.getEmail(), author.getAttributes(), extns));
      feedDoc.buildFeed(feed1.getId(), feed1.getTitle(), feed1
          .getUpdated(), feed1.getRights(), auths, feed1
          .getCategories(), feed1.getContributors(),
          feed1.getLinks(), feed1.getAttributes(), feed1
              .getExtensions(), feed1.getGenerator(), feed1
              .getSubtitle(), feed1.getIcon(), feed1.getLogo(),
          feed1.getEntries());
      fail("this should not happen.");
    } catch (Exception e) {
      e.printStackTrace();
      assertTrue(e instanceof AtomSpecException);
      assertEquals(
          e.getMessage(),
          "the following extension prefix(es) ( whats ) are not bound to a namespace declaration. See http://www.w3.org/TR/1999/REC-xml-names-19990114/#ns-decl.");
    }

    try {
      feed1 = feedDoc.readFeedToBean(basicFeed4);
      List<Author> auths = feed1.getAuthors();
      Author author = auths.remove(0);
      List<Extension> extns = new LinkedList<Extension>();
      extns.add(feedDoc.buildExtension("whats:up", null,
          "nothing special"));
      List<Attribute> attrs = feed1.getAttributes();
      attrs.add(feedDoc.buildAttribute("xmlns:whats",
          "http://www.yyy.zzz"));
      auths.add(feedDoc.buildAuthor(author.getName(), author.getUri(),
          author.getEmail(), author.getAttributes(), extns));
      feed1 = feedDoc.buildFeed(feed1.getId(), feed1.getTitle(), feed1
          .getUpdated(), feed1.getRights(), auths, feed1
          .getCategories(), feed1.getContributors(),
          feed1.getLinks(), attrs, feed1.getExtensions(), feed1
              .getGenerator(), feed1.getSubtitle(), feed1
View Full Code Here


    } catch (AtomSpecException r) {
      assertEquals(r.getMessage(), "The person name SHOULD NOT be blank.");
    }

    try {
      Author author = feedDoc.buildAuthor(feedDoc.buildName("someone"),
          feedDoc.buildURI(null), feedDoc.buildEmail(null), null,
          null);
      assertNotNull(author);
    } catch (AtomSpecException r) {
      fail("should not get here.");
View Full Code Here

        if (ent
            .getId()
            .getAtomUri()
            .equals(
                "http://colorfulsoftware.localhost/colorfulsoftware/projects/atomsphere/atom.xml#About")) {
          Author auth = ent.getAuthor("Bill Brown");
          assertNotNull(ent.getAttribute("xmlns"));
          assertNotNull(auth);
          assertNotNull(auth.getAttribute("local:testAttr"));
          Attribute attr1 = auth.getAttribute("local:testAttr");
          assertFalse(attr1.equals(auth.getAttribute("local:blank")));
          assertNull(auth.getAttribute("local:blank"));
          assertNotNull(auth.getExtension("test:test"));
          assertNull(auth.getExtension("local:bunky"));
          assertNull(ent.getAuthor("some other dude"));
          assertNotNull(ent.getContributor("Bill Brown"));
          assertNull(ent.getContributor("some other dude"));
          assertNotNull(ent.getCategory("science"));
          assertNull(ent.getCategory("nothing"));
          assertNotNull(ent.getLink("alternate"));
          assertNull(ent.getLink("http://www.fakeness.net"));
          assertNotNull(ent.getExtension("local:element"));
          assertNull(ent.getExtension("local:notthere"));
          assertNotNull(ent.getPublished().getAttribute("xmlns"));
          assertNotNull(ent.getPublished().getDateTime());
          assertNull(ent.getSummary().getAttribute("sayWhat"));

          Contributor cont = ent.getContributor("Bill Brown");
          assertNotNull(cont);
          assertNotNull(cont.getExtension("test:test"));
          assertNotNull(cont.getAttribute("local:testAttr"));
          attr1 = cont.getAttribute("local:testAttr");
          assertFalse(attr1.equals(auth.getAttribute("local:blank")));
          assertNull(auth.getAttribute("local:blank"));
          assertNotNull(auth.getExtension("test:test"));
          assertNull(auth.getExtension("local:bunky"));
          assertNull(ent.getAuthor("some other dude"));
          assertNotNull(ent.getContributor("Bill Brown"));
          assertNull(ent.getContributor("some other dude"));
          assertNotNull(ent.getCategory("science"));
          assertNull(ent.getCategory("nothing"));
View Full Code Here

    // test extension namespaces
    try {
      feed1 = feedDoc.readFeedToBean(basicFeed4);
      List<Author> auths = feed1.getAuthors();
      Author author = auths.remove(0);
      List<Extension> extns = new LinkedList<Extension>();
      extns.add(feedDoc.buildExtension("whats:up", null,
          "nothing special"));
      auths.add(feedDoc.buildAuthor(author.getName(), author.getUri(),
          author.getEmail(), author.getAttributes(), extns));
      feedDoc.buildFeed(feed1.getId(), feed1.getTitle(), feed1
          .getUpdated(), feed1.getRights(), auths, feed1
          .getCategories(), feed1.getContributors(),
          feed1.getLinks(), feed1.getAttributes(), feed1
              .getExtensions(), feed1.getGenerator(), feed1
              .getSubtitle(), feed1.getIcon(), feed1.getLogo(),
          feed1.getEntries());
      fail("this should not happen.");
    } catch (Exception e) {
      e.printStackTrace();
      assertTrue(e instanceof AtomSpecException);
      assertEquals(
          e.getMessage(),
          "the following extension prefix(es) ( whats ) are not bound to a namespace declaration. See http://www.w3.org/TR/1999/REC-xml-names-19990114/#ns-decl.");
    }

    try {
      feed1 = feedDoc.readFeedToBean(basicFeed4);
      List<Author> auths = feed1.getAuthors();
      Author author = auths.remove(0);
      List<Extension> extns = new LinkedList<Extension>();
      extns.add(feedDoc.buildExtension("whats:up", null,
          "nothing special"));
      List<Attribute> attrs = feed1.getAttributes();
      attrs.add(feedDoc.buildAttribute("xmlns:whats",
          "http://www.yyy.zzz"));
      auths.add(feedDoc.buildAuthor(author.getName(), author.getUri(),
          author.getEmail(), author.getAttributes(), extns));
      feed1 = feedDoc.buildFeed(feed1.getId(), feed1.getTitle(), feed1
          .getUpdated(), feed1.getRights(), auths, feed1
          .getCategories(), feed1.getContributors(),
          feed1.getLinks(), attrs, feed1.getExtensions(), feed1
              .getGenerator(), feed1.getSubtitle(), feed1
View Full Code Here

    } catch (AtomSpecException r) {
      assertEquals(r.getMessage(), "The person name SHOULD NOT be blank.");
    }

    try {
      Author author = feedDoc.buildAuthor(feedDoc.buildName("someone"),
          feedDoc.buildURI(null), feedDoc.buildEmail(null), null,
          null);
      assertNotNull(author);
    } catch (AtomSpecException r) {
      fail("should not get here.");
View Full Code Here

        if (ent
            .getId()
            .getAtomUri()
            .equals(
                "http://colorfulsoftware.localhost/colorfulsoftware/projects/atomsphere/atom.xml#About")) {
          Author auth = ent.getAuthor("Bill Brown");
          assertNotNull(ent.getAttribute("xmlns"));
          assertNotNull(auth);
          assertNotNull(auth.getAttribute("local:testAttr"));
          Attribute attr1 = auth.getAttribute("local:testAttr");
          assertFalse(attr1.equals(auth.getAttribute("local:blank")));
          assertNull(auth.getAttribute("local:blank"));
          assertNotNull(auth.getExtension("test:test"));
          assertNull(auth.getExtension("local:bunky"));
          assertNull(ent.getAuthor("some other dude"));
          assertNotNull(ent.getContributor("Bill Brown"));
          assertNull(ent.getContributor("some other dude"));
          assertNotNull(ent.getCategory("science"));
          assertNull(ent.getCategory("nothing"));
          assertNotNull(ent.getLink("alternate"));
          assertNull(ent.getLink("http://www.fakeness.net"));
          assertNotNull(ent.getExtension("local:element"));
          assertNull(ent.getExtension("local:notthere"));
          assertNotNull(ent.getPublished().getAttribute("xmlns"));
          assertNotNull(ent.getPublished().getDateTime());
          assertNull(ent.getSummary().getAttribute("sayWhat"));

          Contributor cont = ent.getContributor("Bill Brown");
          assertNotNull(cont);
          assertNotNull(cont.getExtension("test:test"));
          assertNotNull(cont.getAttribute("local:testAttr"));
          attr1 = cont.getAttribute("local:testAttr");
          assertFalse(attr1.equals(auth.getAttribute("local:blank")));
          assertNull(auth.getAttribute("local:blank"));
          assertNotNull(auth.getExtension("test:test"));
          assertNull(auth.getExtension("local:bunky"));
          assertNull(ent.getAuthor("some other dude"));
          assertNotNull(ent.getContributor("Bill Brown"));
          assertNull(ent.getContributor("some other dude"));
          assertNotNull(ent.getCategory("science"));
          assertNull(ent.getCategory("nothing"));
View Full Code Here

    // test extension namespaces
    try {
      feed1 = feedDoc.readFeedToBean(basicFeed4);
      List<Author> auths = feed1.getAuthors();
      Author author = auths.remove(0);
      List<Extension> extns = new LinkedList<Extension>();
      extns.add(feedDoc.buildExtension("whats:up", null,
          "nothing special"));
      auths.add(feedDoc.buildAuthor(author.getName(), author.getUri(),
          author.getEmail(), author.getAttributes(), extns));
      feedDoc.buildFeed(feed1.getId(), feed1.getTitle(), feed1
          .getUpdated(), feed1.getRights(), auths, feed1
          .getCategories(), feed1.getContributors(),
          feed1.getLinks(), feed1.getAttributes(), feed1
              .getExtensions(), feed1.getGenerator(), feed1
              .getSubtitle(), feed1.getIcon(), feed1.getLogo(),
          feed1.getEntries());
      fail("this should not happen.");
    } catch (Exception e) {
      e.printStackTrace();
      assertTrue(e instanceof AtomSpecException);
      assertEquals(
          e.getMessage(),
          "the following extension prefix(es) ( whats ) are not bound to a namespace declaration. See http://www.w3.org/TR/1999/REC-xml-names-19990114/#ns-decl.");
    }

    try {
      feed1 = feedDoc.readFeedToBean(basicFeed4);
      List<Author> auths = feed1.getAuthors();
      Author author = auths.remove(0);
      List<Extension> extns = new LinkedList<Extension>();
      extns.add(feedDoc.buildExtension("whats:up", null,
          "nothing special"));
      List<Attribute> attrs = feed1.getAttributes();
      attrs.add(feedDoc.buildAttribute("xmlns:whats",
          "http://www.yyy.zzz"));
      auths.add(feedDoc.buildAuthor(author.getName(), author.getUri(),
          author.getEmail(), author.getAttributes(), extns));
      feed1 = feedDoc.buildFeed(feed1.getId(), feed1.getTitle(), feed1
          .getUpdated(), feed1.getRights(), auths, feed1
          .getCategories(), feed1.getContributors(),
          feed1.getLinks(), attrs, feed1.getExtensions(), feed1
              .getGenerator(), feed1.getSubtitle(), feed1
View Full Code Here

    } catch (AtomSpecException r) {
      assertEquals(r.getMessage(), "The person name SHOULD NOT be blank.");
    }

    try {
      Author author = feedDoc.buildAuthor(feedDoc.buildName("someone"),
          feedDoc.buildURI(null), feedDoc.buildEmail(null), null,
          null);
      assertNotNull(author);
    } catch (AtomSpecException r) {
      fail("should not get here.");
View Full Code Here

        if (ent
            .getId()
            .getAtomUri()
            .equals(
                "http://colorfulsoftware.localhost/colorfulsoftware/projects/atomsphere/atom.xml#About")) {
          Author auth = ent.getAuthor("Bill Brown");
          assertNotNull(ent.getAttribute("xmlns"));
          assertNotNull(auth);
          assertNotNull(auth.getAttribute("local:testAttr"));
          Attribute attr1 = auth.getAttribute("local:testAttr");
          assertFalse(attr1.equals(auth.getAttribute("local:blank")));
          assertNull(auth.getAttribute("local:blank"));
          assertNotNull(auth.getExtension("test:test"));
          assertNull(auth.getExtension("local:bunky"));
          assertNull(ent.getAuthor("some other dude"));
          assertNotNull(ent.getContributor("Bill Brown"));
          assertNull(ent.getContributor("some other dude"));
          assertNotNull(ent.getCategory("science"));
          assertNull(ent.getCategory("nothing"));
          assertNotNull(ent.getLink("alternate"));
          assertNull(ent.getLink("http://www.fakeness.net"));
          assertNotNull(ent.getExtension("local:element"));
          assertNull(ent.getExtension("local:notthere"));
          assertNotNull(ent.getPublished().getAttribute("xmlns"));
          assertNotNull(ent.getPublished().getDateTime());
          assertNull(ent.getSummary().getAttribute("sayWhat"));

          Contributor cont = ent.getContributor("Bill Brown");
          assertNotNull(cont);
          assertNotNull(cont.getExtension("test:test"));
          assertNotNull(cont.getAttribute("local:testAttr"));
          attr1 = cont.getAttribute("local:testAttr");
          assertFalse(attr1.equals(auth.getAttribute("local:blank")));
          assertNull(auth.getAttribute("local:blank"));
          assertNotNull(auth.getExtension("test:test"));
          assertNull(auth.getExtension("local:bunky"));
          assertNull(ent.getAuthor("some other dude"));
          assertNotNull(ent.getContributor("Bill Brown"));
          assertNull(ent.getContributor("some other dude"));
          assertNotNull(ent.getCategory("science"));
          assertNull(ent.getCategory("nothing"));
View Full Code Here

    // test extension namespaces
    try {
      feed1 = feedDoc.readFeedToBean(basicFeed4);
      List<Author> auths = feed1.getAuthors();
      Author author = auths.remove(0);
      List<Extension> extns = new LinkedList<Extension>();
      extns.add(feedDoc.buildExtension("whats:up", null,
          "nothing special"));
      auths.add(feedDoc.buildAuthor(author.getName(), author.getUri(),
          author.getEmail(), author.getAttributes(), extns));
      feedDoc.buildFeed(feed1.getId(), feed1.getTitle(), feed1
          .getUpdated(), feed1.getRights(), auths, feed1
          .getCategories(), feed1.getContributors(),
          feed1.getLinks(), feed1.getAttributes(), feed1
              .getExtensions(), feed1.getGenerator(), feed1
              .getSubtitle(), feed1.getIcon(), feed1.getLogo(),
          feed1.getEntries());
      fail("this should not happen.");
    } catch (Exception e) {
      e.printStackTrace();
      assertTrue(e instanceof AtomSpecException);
      assertEquals(
          e.getMessage(),
          "the following extension prefix(es) ( whats ) are not bound to a namespace declaration. See http://www.w3.org/TR/1999/REC-xml-names-19990114/#ns-decl.");
    }

    try {
      feed1 = feedDoc.readFeedToBean(basicFeed4);
      List<Author> auths = feed1.getAuthors();
      Author author = auths.remove(0);
      List<Extension> extns = new LinkedList<Extension>();
      extns.add(feedDoc.buildExtension("whats:up", null,
          "nothing special"));
      List<Attribute> attrs = feed1.getAttributes();
      attrs.add(feedDoc.buildAttribute("xmlns:whats",
          "http://www.yyy.zzz"));
      auths.add(feedDoc.buildAuthor(author.getName(), author.getUri(),
          author.getEmail(), author.getAttributes(), extns));
      feed1 = feedDoc.buildFeed(feed1.getId(), feed1.getTitle(), feed1
          .getUpdated(), feed1.getRights(), auths, feed1
          .getCategories(), feed1.getContributors(),
          feed1.getLinks(), attrs, feed1.getExtensions(), feed1
              .getGenerator(), feed1.getSubtitle(), feed1
View Full Code Here

TOP

Related Classes of com.colorfulsoftware.atom.Author

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.