Examples of FeatureResource


Examples of org.apache.shindig.gadgets.features.FeatureResource

  }

  @Test
  public void testGetJsContentWithOpt() throws Exception {
    JsUri jsUri = mockJsUri(false); // optimized
    FeatureResource extRes = mockResource(true, RESOURCE_URL_DEB, RESOURCE_URL_OPT);
    FeatureResource intRes = mockResource(false, RESOURCE_CONTENT_DEB, RESOURCE_CONTENT_OPT);
    FeatureBundle bundle = mockBundle(Lists.newArrayList(extRes, intRes));
    Iterable<JsContent> actual = compiler.getJsContent(jsUri, bundle);
    assertEquals(
        "document.write('<script src=\"" + RESOURCE_URL_OPT + "\"></script>');\n" +
        RESOURCE_CONTENT_OPT + ";\n",
View Full Code Here

Examples of org.apache.shindig.gadgets.features.FeatureResource

    replay(result);
    return result;
  }

  private FeatureResource mockResource(boolean external, String debContent, String optContent) {
    FeatureResource result = createMock(FeatureResource.class);
    expect(result.getDebugContent()).andReturn(debContent).anyTimes();
    expect(result.getContent()).andReturn(optContent).anyTimes();
    expect(result.isExternal()).andReturn(external).anyTimes();
    expect(result.getName()).andReturn("source").anyTimes();
    replay(result);
    return result;
  }
View Full Code Here

Examples of org.apache.shindig.gadgets.features.FeatureResource

      digest.update(debugContent.getBytes());
    }

    featureChecksum = HashUtil.bytesToHex(digest.digest());
    FeatureRegistry registry = createMock(FeatureRegistry.class);
    FeatureResource resource = new FeatureResource.Simple(featureContent, debugContent, "js");
    List<FeatureResource> allResources = Lists.newArrayList(resource);
    final FeatureRegistry.LookupResult lr = createMock(FeatureRegistry.LookupResult.class);
    expect(lr.getResources()).andReturn(allResources);
    replay(lr);
    expect(registry.getAllFeatures()).andReturn(lr).once();
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.