Examples of Gadget


Examples of org.apache.shindig.gadgets.Gadget

    parser = injector.getInstance(GadgetHtmlParser.class);
  }

  private Gadget makeGadgetWithSpec(String gadgetXml) throws GadgetException {
    GadgetSpec spec = new GadgetSpec(SPEC_URL, gadgetXml);
    Gadget gadget = new Gadget()
        .setContext(context)
        .setPreloads(ImmutableList.<PreloadedData>of())
        .setSpec(spec)
        .setCurrentView(spec.getView(GadgetSpec.DEFAULT_VIEW))
        .setGadgetFeatureRegistry(featureRegistry);
View Full Code Here

Examples of org.apache.shindig.gadgets.Gadget

    return mc.getContent();
  }

  @Test
  public void defaultOutput() throws Exception {
    Gadget gadget = makeDefaultGadget();

    String rewritten = rewrite(gadget, BODY_CONTENT);

    Matcher matcher = DOCUMENT_SPLIT_PATTERN.matcher(rewritten);
    assertTrue("Output is not valid HTML.", matcher.matches());
View Full Code Here

Examples of org.apache.shindig.gadgets.Gadget

        matcher.group(BODY_GROUP).contains("gadgets.util.runOnLoadHandlers();"));
  }

  @Test
  public void overrideDefaultDoctype() throws Exception{
    Gadget gadget = makeDefaultOpenSocial2Gadget(false);
    String body = "hello, world.";
    String doc = new StringBuilder()
        .append("<html><head>")
        .append("</head><body>")
        .append(body)
View Full Code Here

Examples of org.apache.shindig.gadgets.Gadget

  }

  @Test
  public void quirksmodeInOS2() throws Exception{
    Gadget gadget = makeDefaultOpenSocial2Gadget(true);
    String body = "hello, world.";
    String doc = new StringBuilder()
        .append("<html><head>")
        .append("</head><body>")
        .append(body)
View Full Code Here

Examples of org.apache.shindig.gadgets.Gadget

        }
        return null;
      }
    };

    Gadget gadget = makeDefaultGadget()
        .setContext(context);

    expectFeatureCalls(gadget,
        ImmutableList.<FeatureResource>of(),
        ImmutableSet.of("foo"),
View Full Code Here

Examples of org.apache.shindig.gadgets.Gadget

        }
        return null;
      }
    };

    Gadget gadget = makeDefaultOpenSocial2Gadget(false)
        .setContext(context);
    expectFeatureCalls(gadget,
        ImmutableList.<FeatureResource>of(),
        ImmutableSet.of("foo"),
        ImmutableList.of(inline("blah", "n/a")));
View Full Code Here

Examples of org.apache.shindig.gadgets.Gadget

      "  <Locale language_direction='rtl'/>" +
      "</ModulePrefs>" +
      "<Content type='html'/>" +
      "</Module>";

    Gadget gadget = makeGadgetWithSpec(gadgetXml);

    String rewritten = rewrite(gadget, "");

    assertTrue("Bi-directional locale settings not preserved.",
        rewritten.contains("<body dir=\"rtl\">"));
View Full Code Here

Examples of org.apache.shindig.gadgets.Gadget

        }
        return null;
      }
    };

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

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

Examples of org.apache.shindig.gadgets.Gadget

      "  <Require feature='foo'/>" +
      "</ModulePrefs>" +
      "<Content type='html'/>" +
      "</Module>";

    Gadget gadget = makeGadgetWithSpec(gadgetXml);

    expectFeatureCalls(gadget,
        ImmutableList.of(inline("foo_content();", "foo_content_debug();")),
        ImmutableSet.<String>of(),
        ImmutableList.<FeatureResource>of());
View Full Code Here

Examples of org.apache.shindig.gadgets.Gadget

      "  <Require feature='foo'/>" +
      "</ModulePrefs>" +
      "<Content type='html'/>" +
      "</Module>";

    Gadget gadget = makeGadgetWithSpec(gadgetXml);
    gadget.removeFeature("foo");

    expectFeatureCalls(gadget,
        ImmutableList.<FeatureResource>of(),
        ImmutableSet.<String>of(),
        ImmutableList.<FeatureResource>of());
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.