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

Examples of org.apache.shindig.social.core.util.BeanXStreamAtomConverter


    servlet = new JsonRpcServlet();
    req = EasyMock.createMock(HttpServletRequest.class);
    res = EasyMock.createMock(HttpServletResponse.class);
    jsonConverter = EasyMock.createMock(BeanJsonConverter.class);
    xmlConverter = EasyMock.createMock(BeanXStreamConverter.class);
    BeanXStreamAtomConverter atomConverter = EasyMock.createMock(BeanXStreamAtomConverter.class);

    peopleHandler = EasyMock.createMock(PersonHandler.class);
    activityHandler = EasyMock.createMock(ActivityHandler.class);
    appDataHandler = EasyMock.createMock(AppDataHandler.class);
View Full Code Here


    servlet = new DataServiceServlet();
    req = EasyMock.createMock(HttpServletRequest.class);
    res = EasyMock.createMock(HttpServletResponse.class);
    jsonConverter = EasyMock.createMock(BeanJsonConverter.class);
    BeanXStreamConverter xmlConverter = EasyMock.createMock(BeanXStreamConverter.class);
    BeanXStreamAtomConverter atomConverter = EasyMock.createMock(BeanXStreamAtomConverter.class);
    peopleHandler = EasyMock.createMock(PersonHandler.class);
    activityHandler = EasyMock.createMock(ActivityHandler.class);
    appDataHandler = EasyMock.createMock(AppDataHandler.class);

    EasyMock.expect(jsonConverter.getContentType()).andReturn("application/json");
    EasyMock.expect(xmlConverter.getContentType()).andReturn("application/xml");
    EasyMock.expect(atomConverter.getContentType()).andReturn("application/atom+xml");

    HandlerDispatcher dispatcher = new StandardHandlerDispatcher(constant(peopleHandler),
        constant(activityHandler), constant(appDataHandler));
    servlet.setHandlerDispatcher(dispatcher);
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 = new ActivityImpl("activityId", johnDoe.getId());

    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

    mediaItem.setNumViews("10000");

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

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

    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

    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

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

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

            PersonHandler.class, MessageHandler.class));

    servlet.setHandlerRegistry(registry);
    servlet.setBeanConverters(new BeanJsonConverter(injector),
        new BeanXStreamConverter(new XStream081Configuration(injector)),
        new BeanXStreamAtomConverter(new XStream081Configuration(injector)));

    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);
View Full Code Here

TOP

Related Classes of org.apache.shindig.social.core.util.BeanXStreamAtomConverter

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.