Examples of GadgetSpec


Examples of org.apache.shindig.gadgets.spec.GadgetSpec

  /**
   * Verify that social preloads where the request doesn't contain a token
   * serve up 403s for the preloaded data, instead of failing the whole request.
   */
  public void testSocialPreloadWithoutToken() throws Exception {
    GadgetSpec spec = new GadgetSpec(GADGET_URL, XML);
   
    RecordingRequestPipeline pipeline = new RecordingRequestPipeline("");
    PipelinedDataPreloader preloader = new PipelinedDataPreloader(pipeline, containerConfig);
    view = "profile";
    // But don't set the security token

    Gadget gadget = new Gadget()
        .setContext(context)
        .setSpec(spec)
        .setCurrentView(spec.getView("profile"));
    PipelinedData.Batch batch = getBatch(gadget);
    Collection<Callable<PreloadedData>> tasks = preloader.createPreloadTasks(
        context, batch);
    PreloadedData data = tasks.iterator().next().call();
    JSONObject resultWithKeyA = new JSONObject(
View Full Code Here

Examples of org.opensocial.explorer.specserver.api.GadgetSpec

  @Test
  public void testGetDefaultSpec() throws Exception {
    expectRequestAndResponse("/default");
    niceControl.replay();

    GadgetSpec mockSpec = createMock(GadgetSpec.class);
    JSONObject defaultGadgetJson = new JSONObject("{'foo':'bar'}");
    expect(mockSpec.toJSON()).andReturn(defaultGadgetJson);

    expect(registry.getDefaultGadget()).andReturn(mockSpec);
    replay(registry, mockSpec);

    servlet.doGet(request, response);
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.