Examples of TagVO


Examples of org.apache.cxf.jaxrs.resources.TagVO

        MessageBodyReader<TagVO> p = new JSONProvider<TagVO>();
        byte[] bytes = "{\"tagVO\":{\"group\":\"b\",\"name\":\"a\"}}"
            .getBytes();
        Object tagsObject = p.readFrom(TagVO.class, null, null,
                                          null, null, new ByteArrayInputStream(bytes));
        TagVO tag = (TagVO)tagsObject;
        assertEquals("a", tag.getName());
        assertEquals("b", tag.getGroup());
    }
View Full Code Here

Examples of org.apache.cxf.jaxrs.resources.TagVO

    private void readUnwrapped(JSONProvider<TagVO> p) throws Exception {
        byte[] bytes = "{\"group\":\"b\",\"name\":\"a\"}"
            .getBytes();
        Object tagsObject = p.readFrom(TagVO.class, null, null,
                                          null, null, new ByteArrayInputStream(bytes));
        TagVO tag = (TagVO)tagsObject;
        assertEquals("a", tag.getName());
        assertEquals("b", tag.getGroup());
    }
View Full Code Here

Examples of org.apache.cxf.jaxrs.resources.TagVO

    }
   
    @Test
    public void testWriteToSingleTag() throws Exception {
        JSONProvider<TagVO> p = new JSONProvider<TagVO>();
        TagVO tag = createTag("a", "b");
       
        ByteArrayOutputStream os = new ByteArrayOutputStream();
       
        p.writeTo(tag, TagVO.class, TagVO.class, TagVO.class.getAnnotations(),
                  MediaType.APPLICATION_JSON_TYPE, new MetadataMap<String, Object>(), os);
View Full Code Here

Examples of org.apache.cxf.jaxrs.resources.TagVO

        assertTrue(s2.contains("<group>b</group><name>a</name>"));
    }
   
    @Test
    public void testWriteDocumentToWriter() throws Exception {
        TagVO tag = createTag("a", "b");
       
        ByteArrayOutputStream os = new ByteArrayOutputStream();
       
        new JAXBElementProvider<TagVO>().writeTo(tag, TagVO.class, TagVO.class,
                  TagVO.class.getAnnotations(), MediaType.APPLICATION_XML_TYPE,
View Full Code Here

Examples of org.apache.cxf.jaxrs.resources.TagVO

   
    @Test
    public void testWriteToSingleTagBadgerFish() throws Exception {
        JSONProvider<TagVO> p = new JSONProvider<TagVO>();
        p.setConvention("badgerfish");
        TagVO tag = createTag("a", "b");
       
        ByteArrayOutputStream os = new ByteArrayOutputStream();
       
        p.writeTo(tag, TagVO.class, TagVO.class, TagVO.class.getAnnotations(),
                  MediaType.APPLICATION_JSON_TYPE, new MetadataMap<String, Object>(), os);
View Full Code Here

Examples of org.apache.cxf.jaxrs.resources.TagVO

        Object o = provider.readFrom(ManyTags.class, ManyTags.class,
                      new Annotation[0], MediaType.APPLICATION_JSON_TYPE,
                      new MetadataMap<String, String>(), is);
        ManyTags holder = (ManyTags)o;
        assertNotNull(holder);   
        TagVO tag = holder.getTags().getTags().get(0);
        assertEquals("a", tag.getName());
        assertEquals("b", tag.getGroup());
    }
View Full Code Here

Examples of org.apache.cxf.jaxrs.resources.TagVO

        Object o = provider.readFrom(ManyTags.class, ManyTags.class,
                      new Annotation[0], MediaType.APPLICATION_JSON_TYPE,
                      new MetadataMap<String, String>(), is);
        ManyTags holder = (ManyTags)o;
        assertNotNull(holder);   
        TagVO tag = holder.getTags().getTags().get(0);
        assertEquals("a", tag.getName());
        assertEquals("b", tag.getGroup());
    }
View Full Code Here

Examples of org.apache.cxf.jaxrs.resources.TagVO

        provider.setNamespaceMap(nsmap);
        ByteArrayInputStream is = new ByteArrayInputStream(data.getBytes());
        Object o = provider.readFrom(TagVO.class, TagVO.class,
                      new Annotation[0], MediaType.APPLICATION_JSON_TYPE, new MetadataMap<String, String>(),
                      is);
        TagVO tag2 = (TagVO)o;
        assertEquals("A", tag2.getName());
        assertEquals("B", tag2.getGroup());   
    }
View Full Code Here

Examples of org.apache.cxf.jaxrs.resources.TagVO

        list.add("list");
        list.add("tags");
        provider.setOutDropElements(list);
        ManyTags many = new ManyTags();
        Tags tags = new Tags();
        tags.addTag(new TagVO("A", "B"));
        tags.addTag(new TagVO("C", "D"));
        many.setTags(tags);
        ByteArrayOutputStream bos = new ByteArrayOutputStream();
        provider.writeTo(many, ManyTags.class, ManyTags.class,
                       new Annotation[0], MediaType.TEXT_XML_TYPE, new MetadataMap<String, Object>(), bos);
    }
View Full Code Here

Examples of org.apache.cxf.jaxrs.resources.TagVO

        list.add("ManyTags");
        list.add("tags");
        provider.setOutDropElements(list);
        ManyTags many = new ManyTags();
        Tags tags = new Tags();
        tags.addTag(new TagVO("A", "B"));
        tags.addTag(new TagVO("C", "D"));
        many.setTags(tags);
        ByteArrayOutputStream bos = new ByteArrayOutputStream();
        provider.writeTo(many, ManyTags.class, ManyTags.class,
                       new Annotation[0], MediaType.TEXT_XML_TYPE, new MetadataMap<String, Object>(), bos);
        String expected = "{\"list\":[{\"group\":\"B\",\"name\":\"A\"},"
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.