Package org.apache.shindig.social.core.util.xstream

Examples of org.apache.shindig.social.core.util.xstream.XStream081Configuration$DefaultedEnumMap


    ContainerConfig containerConfig = EasyMock.createMock(ContainerConfig.class);
    EasyMock.expect(containerConfig.<String>getList(null, "gadgets.parentOrigins")).andReturn(Collections.<String>singletonList("*")).anyTimes();
    EasyMock.replay(containerConfig);
    servlet.setContainerConfig(containerConfig);
    servlet.setBeanConverters(new BeanJsonConverter(injector),
        new BeanXStreamConverter(new XStream081Configuration(injector)),
        new BeanXStreamAtomConverter(new XStream081Configuration(injector)));

    res = EasyMock.createMock(HttpServletResponse.class);
    NamespaceContext ns = new SimpleNamespaceContext(ImmutableMap.of("", "http://ns.opensocial.org/2008/opensocial"));
    XMLUnit.setXpathNamespaceContext(ns);
    xp = XMLUnit.newXpathEngine();
View Full Code Here


    servlet = new DataServiceServlet();

    servlet.setHandlerDispatcher(injector.getInstance(HandlerDispatcher.class));
    servlet.setBeanConverters(new BeanJsonConverter(injector),
        new BeanXStreamConverter(new XStream081Configuration(injector)),
        new BeanXStreamAtomConverter(new XStream081Configuration(injector)));

    req = EasyMock.createMock(HttpServletRequest.class);
    res = EasyMock.createMock(HttpServletResponse.class);
  }
View Full Code Here

  public void testGetConverterForRequest() throws Exception {

    Injector injector = Guice.createInjector(new SocialApiTestsGuiceModule());
    BeanJsonConverter json = new BeanJsonConverter(injector);
    BeanXStreamConverter xml = new BeanXStreamConverter(new XStream081Configuration(injector));
    BeanXStreamAtomConverter atom = new BeanXStreamAtomConverter(new XStream081Configuration(injector));
    servlet.setBeanConverters(json, xml, atom);

    assertConverter(atom, "atom");
    assertConverter(xml, "xml");
    assertConverter(json, "");
View Full Code Here

  }

  public void testGetConverterForRequestContentType() throws Exception {
    Injector injector = Guice.createInjector(new SocialApiTestsGuiceModule());
    BeanJsonConverter json = new BeanJsonConverter(injector);
    BeanXStreamConverter xml = new BeanXStreamConverter(new XStream081Configuration(injector));
    BeanXStreamAtomConverter atom = new BeanXStreamAtomConverter(new XStream081Configuration(injector));
    servlet.setBeanConverters(json, xml, atom);

    assertConverterForContentType(atom, "application/atom+xml");
    assertConverterForContentType(xml, "application/xml");
    assertConverterForContentType(json, "");
View Full Code Here

    activity.setMediaItems(Lists.<MediaItem> newArrayList(new MediaItemImpl(
        "image/jpg", MediaItem.Type.IMAGE, "http://foo.bar")));
   

    beanXmlConverter = new BeanXStreamConverter(new XStream081Configuration(injector));
  }
View Full Code Here

    activity.setMediaItems(Lists.<MediaItem> newArrayList(new MediaItemImpl(
        "image/jpg", MediaItem.Type.IMAGE, "http://foo.bar")));

    beanXmlConverter = new BeanXStreamAtomConverter(
        new XStream081Configuration(injector));
  }
View Full Code Here

    activity.setMediaItems(Lists.<MediaItem> newArrayList(new MediaItemImpl(
        "image/jpg", MediaItem.Type.IMAGE, "http://foo.bar")));


    beanXmlConverter = new BeanXStreamConverter(new XStream081Configuration(injector));
  }
View Full Code Here

    activity.setMediaItems(Lists.<MediaItem> newArrayList(mediaItem));
    activity.setUrl("http://foo.com");

    beanXmlConverter = new BeanXStreamAtomConverter(
        new XStream081Configuration(injector));
  }
View Full Code Here

    EasyMock.expect(containerConfig.<String>getList(null, "gadgets.parentOrigins")).andReturn(Collections.<String>singletonList("*")).anyTimes();
    EasyMock.replay(containerConfig);
    servlet.setContainerConfig(containerConfig);
    servlet.setJSONPAllowed(true);
    servlet.setBeanConverters(new BeanJsonConverter(injector),
        new BeanXStreamConverter(new XStream081Configuration(injector)),
        new BeanXStreamAtomConverter(new XStream081Configuration(injector)));

    res = EasyMock.createMock(HttpServletResponse.class);
    NamespaceContext ns = new SimpleNamespaceContext(ImmutableMap.of("", "http://ns.opensocial.org/2008/opensocial"));
    XMLUnit.setXpathNamespaceContext(ns);
    xp = XMLUnit.newXpathEngine();
View Full Code Here

    HandlerRegistry dispatcher = injector.getInstance(HandlerRegistry.class);
    dispatcher.addHandlers(injector.getInstance(Key.get(new TypeLiteral<Set<Object>>(){},
        Names.named("org.apache.shindig.social.handlers"))));
    servlet.setHandlerRegistry(dispatcher);
    servlet.setBeanConverters(new BeanJsonConverter(injector),
        new BeanXStreamConverter(new XStream081Configuration(injector)),
        new BeanXStreamAtomConverter(new XStream081Configuration(injector)));

    res = EasyMock.createMock(HttpServletResponse.class);
    NamespaceContext ns = new SimpleNamespaceContext(ImmutableMap.of("", "http://ns.opensocial.org/2008/opensocial"));
    XMLUnit.setXpathNamespaceContext(ns);
    xp = XMLUnit.newXpathEngine();
View Full Code Here

TOP

Related Classes of org.apache.shindig.social.core.util.xstream.XStream081Configuration$DefaultedEnumMap

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.