*
* @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));
}