Examples of FeatureResource


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

  @Test
  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),
View Full Code Here

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

  private void setupForVersionAndProxy(boolean proxyCacheable, UriStatus uriStatus) {
    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),
View Full Code Here

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

    expect(result.getBundles()).andReturn(bundles);
    return result;
  }

  private FeatureResource mockResource(boolean proxyCacheable) {
    FeatureResource result = control.createMock(FeatureResource.class);
    expect(result.isProxyCacheable()).andReturn(proxyCacheable).anyTimes();
    return result;
  }
View Full Code Here

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

      }
    };

    Gadget gadget = makeGadgetWithSpec(gadgetXml).setContext(context);

    FeatureResource fooResource = inline("foo-content", "foo-debug");
    expectFeatureCalls(gadget,
        ImmutableList.of(fooResource),
        libs,
        ImmutableList.of(fooResource, inline("bar-c", "bar-d"), inline("baz-c", "baz-d")));
View Full Code Here

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

        return null;
      }
    };

    Gadget gadget = makeGadgetWithSpec(gadgetXml).setContext(context);
    FeatureResource fooResource = inline("foo-content", "foo-debug");
    expectFeatureCalls(gadget,
        ImmutableList.of(fooResource),
        libs,
        ImmutableList.of(fooResource, inline("bar-c", "bar-d"), inline("baz-c", "baz-d")));
    String rewritten = rewrite(gadget, BODY_CONTENT);
View Full Code Here

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

    expect(denied.getName()).andReturn("hello");
    expect(gadgetAdminStore.checkFeatureAdminInfo(isA(Gadget.class))).andReturn(true);
    expect(gadgetAdminStore.isAllowedFeature(eq(denied), isA(Gadget.class))).andReturn(false);
    replay();

    FeatureResource fooResource = inline("foo-content", "foo-debug");
    expectFeatureCalls(gadget,
        ImmutableList.of(fooResource),
        libs,
        ImmutableList.of(fooResource, inline("bar-c", "bar-d"), inline("baz-c", "baz-d")));
View Full Code Here

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

  @Before
  public void setUp() throws Exception {
    GadgetContext ctx = new GadgetContext();
    Provider<GadgetContext> contextProviderMock = Providers.of(ctx);
    FeatureResource resource = mockResource(EXPORT_JS_DEB);
    FeatureRegistry.FeatureBundle bundle = mockExportJsBundle(resource);
    LookupResult lookupMock = mockLookupResult(bundle);
    final FeatureRegistry featureRegistryMock = mockRegistry(lookupMock);
    FeatureRegistryProvider registryProvider = new FeatureRegistryProvider() {
      public FeatureRegistry get(String repository) {
View Full Code Here

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

    replay(result);
    return result;
  }

  private FeatureResource mockResource(String debContent) {
    FeatureResource result = createMock(FeatureResource.class);
    expect(result.getDebugContent()).andReturn(debContent).anyTimes();
    expect(result.getName()).andReturn("js").anyTimes();
    replay(result);
    return result;
  }
View Full Code Here

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

  @Test
  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),
View Full Code Here

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

  private void setupForVersionAndProxy(boolean proxyCacheable, UriStatus uriStatus) {
    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),
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.