Package org.rssowl.ui.internal

Examples of org.rssowl.ui.internal.ApplicationServer


   *
   * @throws Exception
   */
  @Test
  public void testApplicationServer() throws Exception {
    ApplicationServer server = ApplicationServer.getDefault();
    server.startup();

    ILabel label = DynamicDAO.save(fFactory.createLabel(null, "Label"));

    IFeed feed = Owl.getModelFactory().createFeed(null, new URI("feed"));
    INews news1 = Owl.getModelFactory().createNews(null, feed, new Date(0));
    news1.setTitle("A News");
    news1.setDescription("Foo Bar");
    news1.setFlagged(true);
    news1.addLabel(label);

    IPerson author = fFactory.createPerson(null, news1);
    author.setName("Benjamin Pasero");
    author.setEmail(new URI("foo@bar.de"));
    news1.setAuthor(author);

    ICategory category = fFactory.createCategory(null, news1);
    category.setName("category");
    news1.addCategory(category);

    IAttachment attachment = fFactory.createAttachment(null, news1);
    attachment.setLink(new URI("attachment"));
    news1.addAttachment(attachment);

    feed = DynamicDAO.save(feed);

    IFolder root = fFactory.createFolder(null, null, "Root");
    IBookMark bm = fFactory.createBookMark(null, root, new FeedLinkReference(feed.getLink()), "Bookmark");
    DynamicDAO.save(root);

    String newsUrl = server.toUrl("foo", news1);
    assertTrue(URIUtils.looksLikeLink(newsUrl));

    String bmUrl = server.toUrl("foo", bm);
    assertTrue(URIUtils.looksLikeLink(bmUrl));
  }
View Full Code Here


   *
   * @throws Exception
   */
  @Test
  public void testApplicationServer() throws Exception {
    ApplicationServer server = ApplicationServer.getDefault();
    server.startup();

    ILabel label = DynamicDAO.save(fFactory.createLabel(null, "Label"));

    IFeed feed = Owl.getModelFactory().createFeed(null, new URI("feed"));
    INews news1 = Owl.getModelFactory().createNews(null, feed, new Date(0));
    news1.setTitle("A News");
    news1.setDescription("Foo Bar");
    news1.setFlagged(true);
    news1.addLabel(label);

    IPerson author = fFactory.createPerson(null, news1);
    author.setName("Benjamin Pasero");
    author.setEmail(new URI("foo@bar.de"));
    news1.setAuthor(author);

    ICategory category = fFactory.createCategory(null, news1);
    category.setName("category");
    news1.addCategory(category);

    IAttachment attachment = fFactory.createAttachment(null, news1);
    attachment.setLink(new URI("attachment"));
    news1.addAttachment(attachment);

    feed = DynamicDAO.save(feed);

    IFolder root = fFactory.createFolder(null, null, "Root");
    IBookMark bm = fFactory.createBookMark(null, root, new FeedLinkReference(feed.getLink()), "Bookmark");
    DynamicDAO.save(root);

    String newsUrl = server.toUrl("foo", news1);
    assertTrue(URIUtils.looksLikeLink(newsUrl));

    String bmUrl = server.toUrl("foo", bm);
    assertTrue(URIUtils.looksLikeLink(bmUrl));
  }
View Full Code Here

TOP

Related Classes of org.rssowl.ui.internal.ApplicationServer

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.