Package com.google.gxp.compiler.fs

Examples of com.google.gxp.compiler.fs.FileRef


    assertAlert(new ParamDefaultMismatchError(pos(3,1), "<gxp:param>", "x"));
    assertNoUnexpectedAlerts();
  }

  public void testParamMissingConstructor() throws Exception {
    FileRef iface = createInterfaceFile(
        "testInterface",
        "<gxp:param name='x' type='String' has-constructor='true' />");

    FileRef implementation = createFile("testImplementation",
                                        "<gxp:implements interface='testInterface' />",
                                        "<gxp:param name='x' type='String' />");

    compileFiles(iface, implementation);
    assertAlert(new ParamConstructorMismatchError(pos(3,1), "<gxp:param>", "x"));
View Full Code Here


    assertAlert(new ParamConstructorMismatchError(pos(3,1), "<gxp:param>", "x"));
    assertNoUnexpectedAlerts();
  }

  public void testNoThisParamSupplied() throws Exception {
    FileRef iface = createInterfaceFile("testInterface");
    FileRef implementation = createFile("testImplementation",
                                        "<call:testInterface />");

    compileFiles(iface, implementation);
    assertAlert(new MissingAttributeError(pos(2,1), "<call:testInterface>", "this"));
    assertNoUnexpectedAlerts();
View Full Code Here

        "<gxp:param type='String' name='x'/><my:" + getTemplateBaseName()
        + " expr:x='", "'/>", 2, 36);
  }

  public void testCall_invalidRegex() throws Exception {
    FileRef callee = createFile(
        "callee", "<gxp:param name='s' type='String' regex='foo' />");
    FileRef caller = createFile("caller", "<my:callee s='bar' />");
    compileFiles(caller, callee);

    assertAlert(new InvalidParameterFailedRegexError(
                    pos(2, 1), "callee", "s", "foo", "bar"));
    assertNoUnexpectedAlerts();
View Full Code Here

                                          "inside " + startCall));
    assertNoUnexpectedAlerts();
  }

  public void testCall_paramHasMultipleValues() throws Exception {
    FileRef callee = createFile("callee", "<gxp:param type='int' name='y'/>");
    FileRef caller = createFile("caller",
                                "<gxp:param type='int' name='x'/>",
                                "<call:callee y='1'>",
                                "  <gxp:attr name='y'>",
                                "    5",
                                "  </gxp:attr>",
View Full Code Here

    assertAlert(new MultiValueAttributeError(pos(10, 3), "<call:callee>", "'y' attribute"));
    assertNoUnexpectedAlerts();
  }

  public void testCall_paramIsContentButNotContainer() throws Exception {
    FileRef callee = createFile(
        "callee", "<gxp:param content-type='text/html' name='x'/>");
    FileRef caller = createFile("caller",
                                "<call:callee>foo</call:callee>",
                                "<my:callee>foo</my:callee>");
    compileFiles(callee, caller);
    assertAlert(new BadNodePlacementError(pos(2, 14), "text",
                                          "inside <call:callee>"));
View Full Code Here

    assertAlert(new IllegalScalaPrimitiveError(pos(5, 1), "bad", "boolean"));
    assertNoUnexpectedAlerts();
  }

  public void testCall_badContentType() throws Exception {
    FileRef callee = createFileNoHeader(
        "callee",
        "<!DOCTYPE gxp:template SYSTEM \"http://gxp.googlecode.com/svn/trunk/resources/xhtml.ent\">",
        "<gxp:template name='com.google.gxp.compiler.errortests.callee'",
        "              xmlns:gxp='http://google.com/2001/gxp'",
        "              content-type='text/javascript'>",
        "</gxp:template>");

    // bad call (not on javascript context)
    FileRef caller = createFile("caller", "<call:callee />");
    compileFiles(callee, caller);
    assertAlert(new TypeError(pos(2,1), "<call:callee>", "text/javascript", "text/html"));
    assertNoUnexpectedAlerts();

    // bad call (in an attribute that isn't javascript)
View Full Code Here

    compileFiles(callee, caller);
    assertNoUnexpectedAlerts();
  }

  public void testCall_badContentTypeForCallInParam() throws Exception {
    FileRef innerCallee = createFileNoHeader(
        "innerCallee",
        "<!DOCTYPE gxp:template SYSTEM \"http://gxp.googlecode.com/svn/trunk/resources/xhtml.ent\">",
        "<gxp:template name='com.google.gxp.compiler.errortests.innerCallee'",
        "              xmlns:gxp='http://google.com/2001/gxp'",
        "              content-type='text/javascript'>",
        "</gxp:template>");

    FileRef outerCallee = createFile("outerCallee",
                                     "<gxp:param name='x' content-type='text/html'/>");

    FileRef caller = createFile("caller",
                                "<call:outerCallee>",
                                "  <gxp:attr name='x'>",
                                "    <call:innerCallee/>",
                                "  </gxp:attr>",
                                "</call:outerCallee>");
View Full Code Here

    assertAlert(new TypeError(pos(4,5), "<call:innerCallee>", "text/javascript", "text/html"));
    assertNoUnexpectedAlerts();
  }

  public void testCall_badContentTypeForParam() throws Exception {
    FileRef callee = createFile("callee", "<gxp:param name='x' content-type='text/plain' />");
    FileRef caller = createFile("caller",
                                "<call:callee>",
                                "  <gxp:attr name='x'>",
                                "    <b>foo</b>",
                                "  </gxp:attr>",
                                "</call:callee>");
View Full Code Here

    assertAlert(new TypeError(pos(4,5), "<b>", "text/html", "text/plain"));
    assertNoUnexpectedAlerts();
  }

  public void testCall_multipleBodyAttributes() throws Exception {
    FileRef callee = createFile("callee", "<gxp:param name='body' content='*' />");
    FileRef caller = createFile("caller",
                                "<call:callee expr:body='HtmlClosures.EMPTY' />");
    compileFiles(callee, caller);
    assertNoUnexpectedAlerts();

    caller = createFile("caller",
View Full Code Here

  }

  private static final String PATH_PREFIX = "/com/google/gxp/compiler/schema/";

  private void add(FileSystem fs, String fnam, String nsUri, String... contentTypeNames) {
    FileRef ref = fs.parseFilename(PATH_PREFIX).join(fnam);
    addSchemaPromise(ref, nsUri, contentTypeNames);
  }
View Full Code Here

TOP

Related Classes of com.google.gxp.compiler.fs.FileRef

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.