Package com.google.caja.parser.js

Examples of com.google.caja.parser.js.CajoledModule


    gzipper.finish();
    return stream.toByteArray();
  }

  public CajoledModule es53(Block plain) {
    CajoledModule result = null;
    PluginMeta meta = new PluginMeta();
    MessageQueue mq = TestUtil.createTestMessageQueue(this.mc);
    PluginCompiler pc = new PluginCompiler(
        TestBuildInfo.getInstance(), meta, mq);
    pc.addInput(plain, null);
View Full Code Here


      "window.canary1 = (window.canary1 || 0) + 1;";

  // TODO(felix8a): fails when running in eclipse
  public final void testJunitPretty() throws Exception {
    PrecajoleMap pm = StaticPrecajoleMap.getInstance();
    CajoledModule cm = pm.lookupUri(CANARY1, false);
    assertNotNull(cm);
    String result = render(cm);
    assertContains(result, "cajolerVersion");
    assertContains(result, "canary1");
    assertContains(result, "    ");
View Full Code Here

  }

  // TODO(felix8a): fails when running in eclipse
  public final void testJunitMinified() throws Exception {
    PrecajoleMap pm = StaticPrecajoleMap.getInstance();
    CajoledModule cm = pm.lookupUri(CANARY1, true);
    assertNotNull(cm);
    String result = render(cm);
    assertContains(result, "canary1");
    assertNotContains(result, "  ");
  }
View Full Code Here

    assertNotContains(result, "  ");
  }

  public final void testUnknownUri() throws Exception {
    PrecajoleMap pm = StaticPrecajoleMap.getInstance();
    CajoledModule cm = pm.lookupUri("http://unknown/", false);
    assertNull(cm);
  }
View Full Code Here

    assertNull(cm);
  }

  public final void testInvalidUri() throws Exception {
    PrecajoleMap pm = StaticPrecajoleMap.getInstance();
    CajoledModule cm = pm.lookupUri(":", false);
    assertNull(cm);
  }
View Full Code Here

    assertNull(cm);
  }

  public final void testSource1() {
    PrecajoleMap pm = StaticPrecajoleMap.getInstance();
    CajoledModule cm = pm.lookupSource(CANARY1_TEXT, false);
    assertNotNull(cm);
    String result = render(cm);
    assertContains(result, "precajole:");
    assertContains(result, "canary1");
  }
View Full Code Here

    assertContains(result, "canary1");
  }

  public final void testSource2() {
    PrecajoleMap pm = StaticPrecajoleMap.getInstance();
    CajoledModule cm = pm.lookupSource(" " + CANARY1_TEXT + "\n", false);
    assertNotNull(cm);
    String result = render(cm);
    assertContains(result, "precajole:");
    assertContains(result, "canary1");
  }
View Full Code Here

    private CajoledModule makeModule(String s, boolean minify) {
      try {
        Expression js = jsExpr(fromString(
            "{ precajoled: '" + s + " " + minify + "' }"));
        return new CajoledModule((ObjectConstructor) js);
      } catch (Exception e) {
        throw new RuntimeException(e);
      }
    }
View Full Code Here

TOP

Related Classes of com.google.caja.parser.js.CajoledModule

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.