Examples of FeatureBundle


Examples of org.apache.shindig.gadgets.features.FeatureRegistry.FeatureBundle

  public void testPopulateWithLoadedFeatures() throws Exception {
    List<String> reqLibs = ImmutableList.of("feature1", "feature2");
    List<String> loadLibs = ImmutableList.of("feature2");

    FeatureResource resource1 = mockResource(true);
    FeatureBundle bundle1 = mockBundle("feature1", null, null, Lists.newArrayList(resource1));
    FeatureBundle bundle2 = mockBundle("feature2", "export2", "extern2", null);

    setupJsUriAndRegistry(UriStatus.VALID_UNVERSIONED,
        reqLibs, ImmutableList.of(bundle1, bundle2),
        loadLibs, ImmutableList.of(bundle2));
View Full Code Here

Examples of org.apache.shindig.gadgets.features.FeatureRegistry.FeatureBundle

    List<String> reqLibs = ImmutableList.of("feature");
    List<String> loadLibs = EMPTY_STRING_LIST;

    FeatureResource resource1 = mockResource(proxyCacheable);
    FeatureResource resource2 = mockResource(proxyCacheable);
    FeatureBundle bundle = mockBundle("feature", null, null,
        Lists.newArrayList(resource1, resource2));

    setupJsUriAndRegistry(uriStatus,
        reqLibs, Lists.newArrayList(bundle),
        loadLibs, EMPTY_BUNDLE_LIST);
View Full Code Here

Examples of org.apache.shindig.gadgets.features.FeatureRegistry.FeatureBundle

    expect(result.isProxyCacheable()).andReturn(proxyCacheable).anyTimes();
    return result;
  }

  private FeatureBundle mockBundle(String name, String export, String extern, List<FeatureResource> resources) {
    FeatureBundle result = control.createMock(FeatureBundle.class);
    expect(result.getName()).andReturn(name).anyTimes();
    if (export != null) {
      expect(result.getApis(ApiDirective.Type.JS, true)).andReturn(ImmutableList.of(export));
    }
    if (extern != null) {
      expect(result.getApis(ApiDirective.Type.JS, false)).andReturn(ImmutableList.of(extern));
    }
    if (resources != null) {
      expect(result.getResources()).andReturn(resources);
    }
    return result;
  }
View Full Code Here

Examples of org.apache.shindig.gadgets.features.FeatureRegistry.FeatureBundle

        actualResponse.toJsString());
  }

  @Test
  public void testNeighboringSameFeatures() throws Exception {
    FeatureBundle bundle = mockBundle("bundle");
    JsContent js1 = JsContent.fromFeature("content1", "source1", bundle, null);
    JsContent js2 = JsContent.fromFeature("content2", "source2", bundle, null);
    JsResponseBuilder builder = newBuilder(js1, js2);

    control.replay();
View Full Code Here

Examples of org.apache.shindig.gadgets.features.FeatureRegistry.FeatureBundle

        -1, -1, false, ERRORS, null);
    return new JsResponseBuilder(response);
  }

  private FeatureBundle mockBundle(String name) {
    FeatureBundle result = control.createMock(FeatureBundle.class);
    expect(result.getName()).andReturn(name).anyTimes();
    return result;
  }
View Full Code Here

Examples of org.apache.shindig.gadgets.features.FeatureRegistry.FeatureBundle

  }

  private FeatureBundle mockBundle(List<String> exports, boolean isDefer) {
    List<ApiDirective> apis = Lists.newArrayList();
    for (String e : exports) apis.add(mockApiDirective(true, e));
    FeatureBundle result = createMock(FeatureBundle.class);
    expect(result.getApis(ApiDirective.Type.JS, true)).andReturn(exports).anyTimes();
    expect(result.isSupportDefer()).andReturn(isDefer).anyTimes();
    replay(result);
    return result;
  }
View Full Code Here

Examples of org.apache.shindig.gadgets.features.FeatureRegistry.FeatureBundle

    assertEquals(200, compResult.getStatusCode());
    assertEquals(789, compResult.getCacheTtlSecs());
  }

  private FeatureBundle mockBundle(String... externs) {
    FeatureBundle result = createMock(FeatureBundle.class);
    expect(result.getApis(ApiDirective.Type.JS, true)).andReturn(
        Lists.newArrayList(externs)).anyTimes();
    replay(result);
    return result;
  }
View Full Code Here

Examples of org.apache.shindig.gadgets.features.FeatureRegistry.FeatureBundle

  @SuppressWarnings("unchecked")
  private void setupMockRegistry(List<String> features) {
    EasyMock.expect(mockRegistry.getFeatures(EasyMock.isA(List.class)))
            .andReturn(Lists.newArrayList(features)).anyTimes();
    FeatureBundle featureBundle = createMockFeatureBundle();
    FeatureRegistry.LookupResult lr = createMockLookupResult(ImmutableList.of(featureBundle));
    EasyMock.expect(
            mockRegistry.getFeatureResources(isA(GadgetContext.class),
                    eq(Lists.newArrayList(features)), EasyMock.<List<String>> isNull()))
            .andReturn(lr).anyTimes();
View Full Code Here

Examples of org.apache.shindig.gadgets.features.FeatureRegistry.FeatureBundle

    EasyMock.expect(gadgetAdminStore.getAdditionalRpcServiceIds(isA(Gadget.class)))
    .andReturn((Sets.newHashSet(RPC_SERVICE_3))).anyTimes();
  }

  private FeatureBundle createMockFeatureBundle() {
    FeatureBundle result = createMock(FeatureBundle.class);
    expect(result.getApis(ApiDirective.Type.RPC, false)).andReturn(
            Lists.newArrayList(RPC_SERVICE_1, RPC_SERVICE_2)).anyTimes();
    replay(result);
    return result;
  }
View Full Code Here

Examples of org.apache.shindig.gadgets.features.FeatureRegistry.FeatureBundle

   * @throws JsException
   */
  public boolean process(JsRequest request, JsResponseBuilder builder) throws JsException {
    Iterable<JsContent> jsContents = builder.build().getAllJsContent();
    for (JsContent jsc : jsContents) {
      FeatureBundle bundle = jsc.getFeatureBundle();
      if (bundle != null) {
        builder.appendExterns(bundle.getApis(ApiDirective.Type.JS, true));
      }
    }

    JsResponse result = compiler.compile(request.getJsUri(), jsContents,
        builder.build().getExterns());
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.