Package org.apache.shindig.gadgets.spec

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


    return new PipelinedData(element, GADGET_URI);
  }
 
  @Test
  public void execute() throws Exception {
    PipelinedData pipeline = getPipelinedData(CONTENT);

    Capture<PipelinedData.Batch> batchCapture =
      new Capture<PipelinedData.Batch>();
   
    JSONObject expectedData = new JSONObject("{result: {foo: 'bar'}}");
View Full Code Here


    control.verify();
  }

  @Test
  public void executeWithTwoBatches() throws Exception {
    PipelinedData pipeline = getPipelinedData(TWO_BATCH_CONTENT);

    context = new GadgetContext() {
      @Override
      public String getParameter(String property) {
        // Provide the filename to be requested in the first batch
View Full Code Here

    assertEquals("canonical", personRequest.getJSONObject("params").getJSONArray("userId").get(0));
  }

  @Test
  public void executeWithBlockedBatch() throws Exception {
    PipelinedData pipeline = getPipelinedData(BLOCKED_FIRST_BATCH_CONTENT);

    // Expect a batch with no content
    expect(
        preloader.createPreloadTasks(same(context), eqBatch(0, 0)))
            .andReturn(ImmutableList.<Callable<PreloadedData>>of());
View Full Code Here

    control.verify();
  }
 
  @Test
  public void executeError() throws Exception {
    PipelinedData pipeline = getPipelinedData(CONTENT);

    Capture<PipelinedData.Batch> batchCapture =
      new Capture<PipelinedData.Batch>();
   
    JSONObject expectedData = new JSONObject("{error: {message: 'NO!', code: 500}}");
View Full Code Here

    control.verify();
  }

  @Test
  public void executePreloadException() throws Exception {
    PipelinedData pipeline = getPipelinedData(CONTENT);
    final PreloadedData willThrow = control.createMock(PreloadedData.class);
   
    Callable<PreloadedData> callable = new Callable<PreloadedData>() {
      public PreloadedData call() throws Exception {
        return willThrow;
View Full Code Here

    context = new GadgetContext(){};
  }

  private PipelinedData getPipelinedData(String pipelineXml) throws SpecParserException {
    Element element = XmlUtil.parseSilent(pipelineXml);
    return new PipelinedData(element, GADGET_URI);
  }
View Full Code Here

    return new PipelinedData(element, GADGET_URI);
  }

  @Test
  public void execute() throws Exception {
    PipelinedData pipeline = getPipelinedData(CONTENT);

    Capture<PipelinedData.Batch> batchCapture =
      new Capture<PipelinedData.Batch>();

    JSONObject expectedData = new JSONObject("{result: {foo: 'bar'}}");
View Full Code Here

    control.verify();
  }

  @Test
  public void executeWithTwoBatches() throws Exception {
    PipelinedData pipeline = getPipelinedData(TWO_BATCH_CONTENT);

    context = new GadgetContext() {
      @Override
      public String getParameter(String property) {
        // Provide the filename to be requested in the first batch
View Full Code Here

    assertEquals("canonical", personRequest.getJSONObject("params").getJSONArray("userId").get(0));
  }

  @Test
  public void executeWithBlockedBatch() throws Exception {
    PipelinedData pipeline = getPipelinedData(BLOCKED_FIRST_BATCH_CONTENT);

    // Expect a batch with no content
    expect(
        preloader.createPreloadTasks(same(context), eqBatch(0, 0)))
            .andReturn(ImmutableList.<Callable<PreloadedData>>of());
View Full Code Here

    control.verify();
  }

  @Test
  public void executeError() throws Exception {
    PipelinedData pipeline = getPipelinedData(CONTENT);

    Capture<PipelinedData.Batch> batchCapture =
      new Capture<PipelinedData.Batch>();

    JSONObject expectedData = new JSONObject("{error: {message: 'NO!', code: 500}}");
View Full Code Here

TOP

Related Classes of org.apache.shindig.gadgets.spec.PipelinedData

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.