Package com.google.gxp.compiler.fs

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


    assertAlert(new MultiValueAttributeError(pos(2,1), "<call:callee>", "'java:s' attribute"));
    assertNoUnexpectedAlerts();
  }

  public void testCall_JavaAndCppAttribute() throws Exception {
    FileRef callee = createFile("callee", "<gxp:param name='s' type='String' />");
    FileRef caller = createFile("caller", "<call:callee cpp:s='foo' java:s='bar' />");
    compileFiles(callee, caller);
    assertAlert(new MissingExpressionError(pos(2,1), "'s' attribute", "JavaScript"));
    assertAlert(new MissingExpressionError(pos(2,1), "'s' attribute", "Scala"));
    assertNoUnexpectedAlerts();
  }
View Full Code Here


        "com.google.gxp.compiler.errortests.TestTemplate_filenameMismatch"));
    assertNoUnexpectedAlerts();
  }

  public void testTemplate_invalidName() throws Exception {
    FileRef gxp = createFile("Holy!Cow!", "Hello");
    compileFiles(gxp);
    assertAlert(new InvalidNameError(
             pos(1, 700), "com.google.gxp.compiler.errortests.Holy!Cow!"));
    assertNoUnexpectedAlerts();
  }
View Full Code Here

                                          "inside <html>"));
    assertNoUnexpectedAlerts();
  }

  public void testMoreParamsInInterfaceThanTemplate() throws Exception {
    FileRef iface = createInterfaceFile("testInterface",
                                        "<gxp:param name='foo' type='String' />");

    FileRef implementation = createFile("testImplementation",
                                        "<gxp:implements interface='testInterface' />");

    compileFiles(iface, implementation);
    assertAlert(new NumParamsMismatchError(pos(2,1), 1, 0));
    assertNoUnexpectedAlerts();
View Full Code Here

    assertAlert(new NumParamsMismatchError(pos(2,1), 1, 0));
    assertNoUnexpectedAlerts();
  }

  public void testMoreParamsInTemplateThanInterface() throws Exception {
    FileRef iface = createInterfaceFile("testInterface",
                                        "<gxp:param name='foo' type='String' />");

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

    compileFiles(iface, implementation);
View Full Code Here

    assertAlert(new NumParamsMismatchError(pos(2,1), 1, 2));
    assertNoUnexpectedAlerts();
  }

  public void testCannotImplementTemplate() throws Exception {
    FileRef refTemplate = createFile("template1",
                                     "<gxp:param name='foo' type='String' />");
    FileRef implementation = createFile("template2",
                                        "<gxp:implements interface='template1' />",
                                        "<gxp:param name='foo' type='String' />");
    compileFiles(refTemplate, implementation);
    assertAlert(new ImplementableNotFoundError(pos(2,1), TemplateName.create(null, "template1")));
    assertNoUnexpectedAlerts();
View Full Code Here

    assertAlert(new ImplementableNotFoundError(pos(2,1), TemplateName.create(null, "template1")));
    assertNoUnexpectedAlerts();
  }

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


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

    compileFiles(refInterface, implementation);
    assertAlert(new SchemaMismatchError(
View Full Code Here

        pos(2,1), "com.google.gxp.compiler.errortests.testImplementation"));
    assertNoUnexpectedAlerts();
  }

  public void testParamNameMismatch() throws Exception {
    FileRef iface = createInterfaceFile("testInterface",
                                        "<gxp:param name='foo' type='String' />");

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

    compileFiles(iface, implementation);
    assertAlert(new ParamNameMismatchError(pos(2,1), "foo", "bar"));
View Full Code Here

    assertAlert(new ParamNameMismatchError(pos(2,1), "foo", "bar"));
    assertNoUnexpectedAlerts();
  }

  public void testParamTypeMismatch() throws Exception {
    FileRef iface = createInterfaceFile("testInterface",
                                        "<gxp:param name='foo' gxp:type='boolean' />");

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

    compileFiles(iface, implementation);
    assertAlert(new ParamTypeMismatchError(pos(2,1), "foo", "BooleanType", "NativeType"));
View Full Code Here

    assertAlert(new ParamTypeMismatchError(pos(2,1), "foo", "BooleanType", "NativeType"));
    assertNoUnexpectedAlerts();
  }

  public void testParamContentTypeMismatch() throws Exception {
    FileRef iface = createInterfaceFile("testInterface",
                                        "<gxp:param name='foo' content-type='text/html' />");

    FileRef implementation = createFile("testImplementation",
                                        "<gxp:implements interface='testInterface' />",
                                        "<gxp:param name='foo' content-type='text/plain' />");

    compileFiles(iface, implementation);
    assertAlert(new ParamTypeMismatchError(pos(2,1), "foo", "text/html", "text/plain"));
View Full Code Here

    assertAlert(new ParamTypeMismatchError(pos(2,1), "foo", "text/html", "text/plain"));
    assertNoUnexpectedAlerts();
  }

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

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

    compileFiles(iface, implementation);
    assertAlert(new ParamDefaultMismatchError(pos(3,1), "<gxp:param>", "x"));
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.