Examples of AtomLink

  • org.jboss.resteasy.links.RESTServiceDiscovery.AtomLink

  • Examples of org.apache.wink.common.model.atom.AtomLink

            request.addParameter(RestConstants.REST_PARAM_ABSOLUTE_URLS, "");
            MockHttpServletResponse response = invoke(request);
            assertEquals("status", HttpStatus.OK.getCode(), response.getStatus());
            String contentString = response.getContentAsString();
            AtomFeed feed = AtomFeed.unmarshal(new StringReader(contentString));
            AtomLink link = feed.getLinks().get(0);
            assertTrue("ipv6 URI: " + link, link.getHref().startsWith(https));
        }
    View Full Code Here

    Examples of org.apache.wink.common.model.atom.AtomLink

            AtomFeed feed = resource.accept("application/atom+xml").get(AtomFeed.class);
            assertEquals(BlogService.ID, feed.getId());
            assertEquals(BlogService.ID, feed.getTitle().getValue());
           
            List<AtomLink> expectedLinks = new ArrayList<AtomLink>();
            AtomLink link = new AtomLink();
            link.setHref(BASE_URI+"/blogs/0");
            expectedLinks.add(link);
            link = new AtomLink();
            link.setHref(BASE_URI+"/blogs/1");
            expectedLinks.add(link);
            List<AtomLink> actual = feed.getLinks();
            assertEquals(expectedLinks.size(), actual.size());
            for(int i = 0; i < actual.size(); ++i)
                assertEquals(expectedLinks.get(i).getHref(), actual.get(i).getHref());
    View Full Code Here

    Examples of org.apache.wink.common.model.atom.AtomLink

            AtomFeed feed = resource.accept("application/atom+xml").get(AtomFeed.class);
            assertEquals("0", feed.getId());
            assertEquals("wink-developer-blog", feed.getTitle().getValue());
           
            List<AtomLink> expectedLinks = new ArrayList<AtomLink>();
            AtomLink link = new AtomLink();
            link.setHref(BASE_URI+"/blogs/0/entries/0");
            expectedLinks.add(link);
            link = new AtomLink();
            link.setHref(BASE_URI+"/blogs/0/entries/1");
            expectedLinks.add(link);
            List<AtomLink> actual = feed.getLinks();
            assertEquals(expectedLinks.size(), actual.size());
            for(int i = 0; i < actual.size(); ++i)
                assertEquals(expectedLinks.get(i).getHref(), actual.get(i).getHref());
           
            client = new RestClient();
            resource = client.resource(BASE_URI+"/blogs/1");
            feed = resource.accept("application/atom+xml").get(AtomFeed.class);
            assertEquals("1", feed.getId());
            assertEquals("wink-user-blog", feed.getTitle().getValue());
           
            expectedLinks = new ArrayList<AtomLink>();
            link = new AtomLink();
            link.setHref(BASE_URI+"/blogs/1/entries/2");
            expectedLinks.add(link);
            actual = feed.getLinks();
            assertEquals(expectedLinks.size(), actual.size());
            for(int i = 0; i < actual.size(); ++i)
                assertEquals(expectedLinks.get(i).getHref(), actual.get(i).getHref());
    View Full Code Here

    Examples of org.apache.wink.common.model.atom.AtomLink

            assertEquals(0, entry.getLinks().size());
           
            resource = client.resource(BASE_URI+"/blogs/0");
            AtomFeed feed = resource.accept("application/atom+xml").get(AtomFeed.class);
            List<AtomLink> expectedLinks = new ArrayList<AtomLink>();
            AtomLink link = new AtomLink();
            link.setHref(BASE_URI+"/blogs/0/entries/0");
            expectedLinks.add(link);
            link = new AtomLink();
            link.setHref(BASE_URI+"/blogs/0/entries/1");
            expectedLinks.add(link);
            link = new AtomLink();
            link.setHref(BASE_URI+"/blogs/0/entries/3");
            expectedLinks.add(link);
            List<AtomLink> actual = feed.getLinks();
            assertEquals(expectedLinks.size(), actual.size());
            for(int i = 0; i < actual.size(); ++i)
                assertEquals(expectedLinks.get(i).getHref(), actual.get(i).getHref());
    View Full Code Here

    Examples of org.apache.wink.common.model.atom.AtomLink

            assertEquals("Success", entry.getTitle().getValue());
           
            resource = client.resource(BASE_URI+"/blogs/0/entries/1");
            entry = resource.accept("application/atom+xml").get(AtomEntry.class);
            List<AtomLink> expectedLinks = new ArrayList<AtomLink>();
            AtomLink link = new AtomLink();
            link.setHref(BASE_URI+"/blogs/0/entries/1/comments/0");
            expectedLinks.add(link);
            link = new AtomLink();
            link.setHref(BASE_URI+"/blogs/0/entries/1/comments/1");
            expectedLinks.add(link);
            List<AtomLink> actual = entry.getLinks();
            assertEquals(expectedLinks.size(), actual.size());
            for(int i = 0; i < actual.size(); ++i)
                assertEquals(expectedLinks.get(i).getHref(), actual.get(i).getHref());
    View Full Code Here

    Examples of org.jboss.resteasy.links.RESTServiceDiscovery.AtomLink

        Assert.assertEquals(0, comment.getId());
        RESTServiceDiscovery links = comment.getRest();
        Assert.assertNotNull(links);
        Assert.assertEquals(6, links.size());
        // self
        AtomLink atomLink = links.getLinkForRel("self");
        Assert.assertNotNull(atomLink);
        Assert.assertEquals(url+"/book/foo/comment/0", atomLink.getHref());
        // update
        atomLink = links.getLinkForRel("update");
        Assert.assertNotNull(atomLink);
        Assert.assertEquals(url+"/book/foo/comment/0", atomLink.getHref());
        // remove
        atomLink = links.getLinkForRel("remove");
        Assert.assertNotNull(atomLink);
        Assert.assertEquals(url+"/book/foo/comment/0", atomLink.getHref());
        // list
        atomLink = links.getLinkForRel("list");
        Assert.assertNotNull(atomLink);
        Assert.assertEquals(url+"/book/foo/comments", atomLink.getHref());
        // add
        atomLink = links.getLinkForRel("add");
        Assert.assertNotNull(atomLink);
        Assert.assertEquals(url+"/book/foo/comments", atomLink.getHref());
        // collection
        atomLink = links.getLinkForRel("collection");
        Assert.assertNotNull(atomLink);
        Assert.assertEquals(url+"/book/foo/comment-collection", atomLink.getHref());
      }
    View Full Code Here

    Examples of org.jboss.resteasy.links.RESTServiceDiscovery.AtomLink

        Assert.assertEquals("bar", book.getAuthor());
        RESTServiceDiscovery links = book.getRest();
        Assert.assertNotNull(links);
        Assert.assertEquals(1, links.size());
        // self
        AtomLink atomLink = links.getLinkForRel("self");
        Assert.assertNotNull(atomLink);
        Assert.assertEquals(url+"/book/foo", atomLink.getHref());
      }
    View Full Code Here

    Examples of org.jboss.resteasy.links.RESTServiceDiscovery.AtomLink

      private void checkBook(IdBook book, String relativeUrl) {
        Assert.assertNotNull(book);
        RESTServiceDiscovery links = book.getRest();
        Assert.assertNotNull(links);
        Assert.assertEquals(1, links.size());
        AtomLink link = links.get(0);
        Assert.assertEquals("self", link.getRel());
        Assert.assertEquals(url + relativeUrl, link.getHref());
      }
    View Full Code Here

    Examples of org.jboss.resteasy.links.RESTServiceDiscovery.AtomLink

        Assert.assertEquals("bar", book.getAuthor());
        RESTServiceDiscovery links = book.getRest();
        Assert.assertNotNull(links);
        Assert.assertEquals(7, links.size());
        // self
        AtomLink atomLink = links.getLinkForRel("self");
        Assert.assertNotNull(atomLink);
        Assert.assertEquals(url+"/book/foo", atomLink.getHref());
        // update
        atomLink = links.getLinkForRel("update");
        Assert.assertNotNull(atomLink);
        Assert.assertEquals(url+"/book/foo", atomLink.getHref());
        // remove
        atomLink = links.getLinkForRel("remove");
        Assert.assertNotNull(atomLink);
        Assert.assertEquals(url+"/book/foo", atomLink.getHref());
        // list
        atomLink = links.getLinkForRel("list");
        Assert.assertNotNull(atomLink);
        Assert.assertEquals(url+"/books", atomLink.getHref());
        // add
        atomLink = links.getLinkForRel("add");
        Assert.assertNotNull(atomLink);
        Assert.assertEquals(url+"/books", atomLink.getHref());
        // comments
        atomLink = links.getLinkForRel("comments");
        Assert.assertNotNull(atomLink);
        Assert.assertEquals(url+"/book/foo/comments", atomLink.getHref());
        // comment collection
        atomLink = links.getLinkForRel("comment-collection");
        Assert.assertNotNull(atomLink);
        Assert.assertEquals(url+"/book/foo/comment-collection", atomLink.getHref());
      }
    View Full Code Here

    Examples of org.jboss.resteasy.links.RESTServiceDiscovery.AtomLink

        Assert.assertEquals(0, comment.getId());
        RESTServiceDiscovery links = comment.getRest();
        Assert.assertNotNull(links);
        Assert.assertEquals(6, links.size());
        // self
        AtomLink atomLink = links.getLinkForRel("self");
        Assert.assertNotNull(atomLink);
        Assert.assertEquals(url+"/book/foo/comment/0", atomLink.getHref());
        // update
        atomLink = links.getLinkForRel("update");
        Assert.assertNotNull(atomLink);
        Assert.assertEquals(url+"/book/foo/comment/0", atomLink.getHref());
        // remove
        atomLink = links.getLinkForRel("remove");
        Assert.assertNotNull(atomLink);
        Assert.assertEquals(url+"/book/foo/comment/0", atomLink.getHref());
        // list
        atomLink = links.getLinkForRel("list");
        Assert.assertNotNull(atomLink);
        Assert.assertEquals(url+"/book/foo/comments", atomLink.getHref());
        // add
        atomLink = links.getLinkForRel("add");
        Assert.assertNotNull(atomLink);
        Assert.assertEquals(url+"/book/foo/comments", atomLink.getHref());
        // collection
        atomLink = links.getLinkForRel("collection");
        Assert.assertNotNull(atomLink);
        Assert.assertEquals(url+"/book/foo/comment-collection", atomLink.getHref());
      }
    View Full Code Here
    TOP
    Copyright © 2018 www.massapi.com. 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.