Package org.opensocial.explorer.specserver.api

Examples of org.opensocial.explorer.specserver.api.GadgetSpec.toJSON()


    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


    expectRequestAndResponse("/-1");
    niceControl.replay();

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

    expect(registry.getGadgetSpec("-1")).andReturn(mockSpec);
    replay(registry, mockSpec);

    servlet.doGet(request, response);
View Full Code Here

    expectRequestAndResponse("/-1");
    niceControl.replay();
   
    GadgetSpec mockSpec = createMock(GadgetSpec.class);
    JSONObject defaultGadgetJson = new JSONObject("{'foo':'bar'}");
    expect(mockSpec.toJSON()).andReturn(defaultGadgetJson);
    Map<String, GadgetSpec> tempSpecs = Maps.newConcurrentMap();
    tempSpecs.put("-1", mockSpec);
    Whitebox.setInternalState(servlet, "tempSpecs", tempSpecs);
   
    replay(registry, mockSpec);
View Full Code Here

    expectLastCall().once();

    niceControl.replay();

    GadgetSpec mockSpec = createMock(GadgetSpec.class);
    expect(mockSpec.toJSON()).andThrow(new JSONException("This is not JSON"));

    expect(registry.getGadgetSpec("-1")).andReturn(mockSpec);
    replay(registry, mockSpec);

    servlet.doGet(request, response);
View Full Code Here

  }
 
  @Test
  public void testToJSON() throws Exception {
    GadgetSpec spec = new DefaultGadgetSpec("specs/complex/spec.json");
    JSONObject json = spec.toJSON();
    // FIXME: Actually test the results from this
   
    spec = new DefaultGadgetSpec("specs/simple/spec.json");
    json = spec.toJSON();
    // FIXME: Actually test the results from this
View Full Code Here

    GadgetSpec spec = new DefaultGadgetSpec("specs/complex/spec.json");
    JSONObject json = spec.toJSON();
    // FIXME: Actually test the results from this
   
    spec = new DefaultGadgetSpec("specs/simple/spec.json");
    json = spec.toJSON();
    // FIXME: Actually test the results from this
  }
}
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.