Package com.google.gxp.compiler.fs

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


      Predicates.<FileRef>alwaysTrue();
  private final FileRef depsFile = fs.getRoot().join("/deps.gxd");
  DependencyGraph dependencyGraph;

  private FileRef addFile(String name, String... lines) throws Exception {
    FileRef result = createFile(name, lines);
    sourceFiles.add(result);
    return result;
  }
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, 648), "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

   * Runs compiler based on command line arguments. This method is invoked by
   * the JVM when this class is run from the command line.
   */
  public static void main(String[] args) throws IOException {
    FileSystem sysFs = SystemFileSystem.INSTANCE;
    FileRef cwd = sysFs.parseFilename(System.getProperty("user.dir"));
    int result = main(sysFs, System.err, cwd, args);
    System.exit(result);
  }
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.