Package org.jboss.resteasy.plugins.providers.atom

Examples of org.jboss.resteasy.plugins.providers.atom.Feed


    }

    @Test
    public void getEmptyFeed() {
        when(ec.listMostRecent(eq(1000))).thenReturn(new ArrayList<Event>());
        Feed f = afr.getFeed();
        assertNotNull(f);
        assertTrue(f.getEntries().isEmpty());
    }
View Full Code Here


    @Path("/{consumer_uuid}/atom")
    public Feed getConsumerAtomFeed(
        @PathParam("consumer_uuid") @Verify(Consumer.class) String consumerUuid) {
        String path = String.format("/consumers/%s/atom", consumerUuid);
        Consumer consumer = consumerCurator.verifyAndLookupConsumer(consumerUuid);
        Feed feed = this.eventAdapter.toFeed(
            this.eventCurator.listMostRecent(FEED_LIMIT, consumer), path);
        feed.setTitle("Event feed for consumer " + consumer.getUuid());
        return feed;
    }
View Full Code Here


   @Test
   public void testIt() throws Exception
   {
      Feed feed = new Feed();
      feed.setId(new URI("http://example.com/42"));
      feed.setTitle("Yo");
      feed.setUpdated(new Date());
      Link link = new Link();
      link.setHref(new URI("http://localhost"));
      link.setRel("edit");
      feed.getLinks().add(link);
      feed.getAuthors().add(new Person("Bill Burke"));

      JAXBContext ctx = JAXBContext.newInstance(Feed.class);


      Marshaller marshaller = ctx.createMarshaller();
View Full Code Here

   @Test
   public void testRFC() throws Exception
   {
      JAXBContext ctx = JAXBContext.newInstance(Feed.class);
      Feed feed = (Feed) ctx.createUnmarshaller().unmarshal(new StringReader(RFC_COMPLEX_XML));
      Marshaller marshaller = ctx.createMarshaller();

      NamespacePrefixMapper mapper = new NamespacePrefixMapper()
      {
         public String getPreferredPrefix(String namespace, String s1, boolean b)
View Full Code Here

      ClientResponse<String> response = request.get(String.class);
      Assert.assertEquals(200, response.getStatus());
      System.out.println(response.getEntity());
     
      AtomServerInterface intf = createProxy(AtomServerInterface.class);
      Feed feed = intf.postFeed(RFC_COMPLEX_XML);
      assertFeed(feed);

      // Thread.sleep(1000000);

   }
View Full Code Here

      @GET
      @Path("feed")
      @Produces("application/atom+xml")
      public Feed getFeed()
      {
         Feed feed = new Feed();
         feed.getEntries().add(getEntry());
         return feed;
      }
View Full Code Here

      @GET
      @Path("text/feed")
      @Produces("application/atom+xml")
      public Feed getTextFeed()
      {
         Feed feed = new Feed();
         feed.getEntries().add(getTextEntry());
         return feed;
      }
View Full Code Here

    @Path("{owner_key}/atom")
    public Feed getOwnerAtomFeed(@PathParam("owner_key")
            @Verify(Owner.class) String ownerKey) {
        Owner o = findOwner(ownerKey);
        String path = String.format("/owners/%s/atom", ownerKey);
        Feed feed = this.eventAdapter.toFeed(
            this.eventCurator.listMostRecent(FEED_LIMIT, o), path);
        feed.setTitle("Event feed for owner " + o.getDisplayName());
        return feed;
    }
View Full Code Here

     */
    @GET
    @Produces({"application/atom+xml", MediaType.APPLICATION_JSON})
    public Feed getFeed() {
        List<Event> events = eventCurator.listMostRecent(ATOM_FEED_LIMIT);
        Feed feed = this.adapter.toFeed(events, "/atom");
        feed.setTitle("Event Feed");
        return feed;
    }
View Full Code Here

TOP

Related Classes of org.jboss.resteasy.plugins.providers.atom.Feed

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.