Examples of PipelinedData


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

    NodeList dataTags = doc.getElementsByTagName(GadgetHtmlParser.OSML_DATA_TAG);
    Map<PipelinedData, Node> pipelineNodes = Maps.newHashMap();
    for (int i = 0; i < dataTags.getLength(); i++) {
      Node n = dataTags.item(i);
      try {
        PipelinedData pipelineData = new PipelinedData((Element) n, gadget.getSpec().getUrl());
        pipelineNodes.put(pipelineData, n);
      } catch (SpecParserException e) {
        // Leave the element to the client
        logger.log(Level.INFO, "Failed to parse preload in " + gadget.getSpec().getUrl(), e);
      }
View Full Code Here

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

    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

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("{data: {foo: 'bar'}}");
View Full Code Here

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

    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

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

    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

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

    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

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

    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

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

    setupGadget(getGadgetXml(contentWithDataRequest));
    Map<PipelinedData, ? extends Object> pipelines =
        rewriter.parsePipelinedData(gadget, content.getDocument());
    assertEquals(1, pipelines.size());
    PipelinedData pipeline = pipelines.keySet().iterator().next();
    PipelinedData.Batch batch = pipeline.getBatch(Expressions.forTesting(), new RootELResolver());
    Map<String, PipelinedData.BatchItem> preloads = batch.getPreloads();
    assertTrue(preloads.containsKey("me"));
    assertEquals(PipelinedData.BatchType.SOCIAL, preloads.get("me").getType());
       
    JsonAssert.assertObjectEquals(
View Full Code Here

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

    setupGadget(getGadgetXml(contentWithDataRequest));
    Map<PipelinedData, ? extends Object> pipelines =
        rewriter.parsePipelinedData(gadget, content.getDocument());
    assertEquals(1, pipelines.size());
    PipelinedData pipeline = pipelines.keySet().iterator().next();
    PipelinedData.Batch batch = pipeline.getBatch(Expressions.forTesting(), new RootELResolver());
    Map<String, PipelinedData.BatchItem> preloads = batch.getPreloads();
    assertTrue(preloads.containsKey("me"));
    assertEquals(PipelinedData.BatchType.SOCIAL, preloads.get("me").getType());
       
    JsonAssert.assertObjectEquals(
View Full Code Here

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

    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
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.