Examples of FeatureBundle


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

  @SuppressWarnings("unchecked")
  private void setupMockRegistry(List<String> features) {
    EasyMock.expect(mockRegistry.getFeatures(EasyMock.isA(Collection.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

            .andReturn(lr).anyTimes();
    replay();
  }

  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

  @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

  }

  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

  }

  public void testGetJsContentWithGoogSymbolExports() throws Exception {
    realOptionsMock = mockRealJsCompilerOptions(true); // with
    compiler = newClosureJsCompiler(null, realOptionsMock, compilerMock, cacheMock);
    FeatureBundle bundle = mockBundle(EXPORTS);
    Iterable<JsContent> actual = compiler.getJsContent(mockJsUri(false), bundle);
    assertEquals(EXPORT_COMPILER_STRING +
        "goog.exportSymbol('bar', bar);\n" +
        "goog.exportSymbol('foo', foo);\n",
        getContent(actual));
View Full Code Here

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

  }

  public void testGetJsContentWithoutGoogSymbolExports() throws Exception {
    realOptionsMock = mockRealJsCompilerOptions(false); // without
    compiler = newClosureJsCompiler(null, realOptionsMock, compilerMock, cacheMock);
    FeatureBundle bundle = mockBundle(EXPORTS);
    Iterable<JsContent> actual = compiler.getJsContent(mockJsUri(false), bundle);
    assertEquals(EXPORT_COMPILER_STRING, getContent(actual));
  }
View Full Code Here

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

    replay(result);
    return result;
  }

  private FeatureBundle mockBundle(List<String> exports) {
    FeatureBundle result = createMock(FeatureBundle.class);
    expect(result.getApis(ApiDirective.Type.JS, true)).andReturn(exports).anyTimes();
    expect(result.getName()).andReturn(null).anyTimes();
    replay(result);
    return result;
  }
View Full Code Here

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

  @Test
  public void testGetJsContentWithDeb() throws Exception {
    JsUri jsUri = mockJsUri(true); // debug
    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_DEB + "\"></script>');\n" +
        RESOURCE_CONTENT_DEB + ";\n",
        getContent(actual));
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.