Package com.google.gxp.compiler.fs

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


   */
  protected final FileRef createSchemaFile(String name, String contents)
      throws Exception {
    // create in memory file
    String pkgDir = getPackage().replace('.', '/');
    InMemoryFileSystem schemaFs = new InMemoryFileSystem();
    String sourceName = "/" + pkgDir + "/" + name + ".xml";
    source = schemaFs.parseFilename(sourceName);

    // write GXP
    Writer writer = source.openWriter(Charsets.US_ASCII);
    writer.write(contents);
    writer.close();
View Full Code Here


  private FileSystem sourcePathFs;

  @Override
  public void setUp() throws Exception {
    super.setUp();
    sourcePathFs = new InMemoryFileSystem();
    addFileToSourceFs("/foo", "[file /foo]");
    addFileToSourceFs("/bar", "[file /bar]");
  }
View Full Code Here

    assertEquals(Severity.INFO, alertPolicy.getSeverity(INFO_ALERT));
    assertEquals(Severity.ERROR, alertPolicy.getSeverity(I18N_ALERT));
  }

  public void testParameterFile() throws Exception {
    InMemoryFileSystem inMemory = new InMemoryFileSystem();
    FileRef parameterFile = inMemory.parseFilename("/here/params");
    Writer out = parameterFile.openWriter();
    out.write("--help");
    out.close();
    GxpcFlags flags = new GxpcFlags(inMemory, inMemory.parseFilename("/here"), "@params");
    assertTrue(flags.showHelp());
  }
View Full Code Here

    GxpcFlags flags = new GxpcFlags(inMemory, inMemory.parseFilename("/here"), "@params");
    assertTrue(flags.showHelp());
  }

  public void testParameterFileIsUtf8() throws Exception {
    InMemoryFileSystem inMemory = new InMemoryFileSystem();
    FileRef parameterFile = inMemory.parseFilename("/here/params");
    Writer out = parameterFile.openWriter(Charsets.UTF_8);
    out.write("--output /here/\u00F6"); // An oe umlaut.
    out.close();
    GxpcFlags flags = new GxpcFlags(inMemory, inMemory.parseFilename("/here"), "@params");
    assertEquals("/here/\u00F6", flags.getAllowedOutputFiles().iterator().next().toFilename());
  }
View Full Code Here

   */
  protected final FileRef createSchemaFile(String name, String contents)
      throws Exception {
    // create in memory file
    String pkgDir = getPackage().replace('.', '/');
    InMemoryFileSystem schemaFs = new InMemoryFileSystem();
    String sourceName = "/" + pkgDir + "/" + name + ".xml";
    source = schemaFs.parseFilename(sourceName);

    // write GXP
    Writer writer = source.openWriter(Charsets.US_ASCII);
    writer.write(contents);
    writer.close();
View Full Code Here

TOP

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

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.