Package org.apache.shindig.gadgets

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


        }
        return null;
      }
    };

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

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

        }
        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

      "  <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

        }
        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

      "  <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

      "  <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

      "<Module><ModulePrefs title=''>" +
      "</ModulePrefs>" +
      "<Content type='html'/>" +
      "</Module>";

    Gadget gadget = makeGadgetWithSpec(gadgetXml);
    gadget.addFeature("foo");
    // add non existing feature,
    gadget.addFeature("do-not-exists");

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

        }
        return null;
      }
    };

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

    expectFeatureCalls(gadget,
        ImmutableList.of(inline("foo_content();", "foo_content_debug();")),
        libs,
        ImmutableList.of(inline("bar-c", "bar-d"), inline("baz-c", "baz-d")));
View Full Code Here

    assertTrue("Requested scripts not inlined.", rewritten.contains("foo_content();"));
  }

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

    String rewritten = rewrite(gadget,
        "<html><head><script src=\"foo.js\"></script></head><body>hello</body></html>");

    Matcher matcher = DOCUMENT_SPLIT_PATTERN.matcher(rewritten);
View Full Code Here

TOP

Related Classes of org.apache.shindig.gadgets.Gadget

Copyright © 2018 www.massapicom. 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.