@Override public void close() throws IOException { Resource content = new Resource(toByteArray(), null); long lastModified = fs.updateResource(file, content); JavaFileObjectImpl.this.content = new Timestamped<Resource>(lastModified, content); JavaFileObjectImpl.this.writing = false; } };
@Override public void close() throws IOException { Resource content = new Resource(getBuffer()); long lastModified = fs.updateResource(file, content); JavaFileObjectImpl.this.content = new Timestamped<Resource>(lastModified, content); JavaFileObjectImpl.this.writing = false; } };
@Override public void close() throws IOException { Resource content = new Resource(toByteArray(), null); long lastModified = fs.updateResource(file, content); JavaFileObjectImpl.this.content = new Timestamped<Resource>(lastModified, content); JavaFileObjectImpl.this.writing = false; } };
@Override public void close() throws IOException { Resource content = new Resource(getBuffer()); long lastModified = fs.updateResource(file, content); JavaFileObjectImpl.this.content = new Timestamped<Resource>(lastModified, content); JavaFileObjectImpl.this.writing = false; } };
public void assertSave(String content) { try { sourcePath.updateResource(path, new Resource(content)); } catch (Exception e) { throw AbstractTestCase.failure(e); } }
public void assertSave(String content) { try { sourcePath.updateResource(path, new Resource(content)); } catch (Exception e) { throw AbstractTestCase.failure(e); } }
public void assertTouch() { try { Resource content = sourcePath.getResource(path).getObject(); sourcePath.updateResource(path, content); } catch (Exception e) { throw AbstractTestCase.failure(e); } }
public void assertTouch() { try { Resource content = sourcePath.getResource(path).getObject(); sourcePath.updateResource(path, content); } catch (Exception e) { throw AbstractTestCase.failure(e); } }
case 0: { if (filter.acceptFile(srcPath, srcName)) { dst.updateResource(dstPath, getResource(srcPath).getObject());
case 0: { if (filter.acceptFile(srcPath, srcName)) { dst.updateResource(dstPath, getResource(srcPath).getObject());
output.updateResource(foo, new Resource("foo_value"));
output.updateResource(foo, new Resource("foo_value"));
@Test public void testLifeCycle() throws Exception { ReadWriteFileSystem<P> fs = create(); // The root exist P foo = fs.makePath(Collections.singleton("foo")); P bar = fs.makePath(foo, "bar"); assertEquals(1, fs.size(ReadFileSystem.PATH)); // Now create fs.updateResource(bar, new Resource("FOO")); // assertEquals(3, fs.size(ReadFileSystem.PATH)); assertEquals(2, fs.size(ReadFileSystem.DIR)); assertEquals(1, fs.size(ReadFileSystem.FILE)); } }
@Test public void testLifeCycle() throws Exception { ReadWriteFileSystem<P> fs = create(); // The root exist P foo = fs.makePath(Collections.singleton("foo")); P bar = fs.makePath(foo, "bar"); assertEquals(1, fs.size(ReadFileSystem.PATH)); // Now create fs.updateResource(bar, new Resource("FOO")); // assertEquals(3, fs.size(ReadFileSystem.PATH)); assertEquals(2, fs.size(ReadFileSystem.DIR)); assertEquals(1, fs.size(ReadFileSystem.FILE)); } }
public FileResource<I> assertAddSource(String name, String ext, String content) { try { ReadWriteFileSystem<I> fs = strategy.sourcePath; String[] atoms = Tools.split(name, '.'); I path; if (atoms.length > 1) { path = fs.makePath(Tools.iterable(atoms, 0, atoms.length - 1)); fs.createDir(path); } else { path = fs.getRoot(); } path = fs.makePath(path, atoms[atoms.length - 1] + "." + ext); fs.updateResource(path, new Resource(content)); return new FileResource<I>(fs, path); } catch (IOException e) { throw AbstractTestCase.failure(e); } }
public FileResource<I> assertAddSource(String name, String ext, String content) { try { ReadWriteFileSystem<I> fs = strategy.sourcePath; String[] atoms = Tools.split(name, '.'); I path; if (atoms.length > 1) { path = fs.makePath(Tools.iterable(atoms, 0, atoms.length - 1)); fs.createDir(path); } else { path = fs.getRoot(); } path = fs.makePath(path, atoms[atoms.length - 1] + "." + ext); fs.updateResource(path, new Resource(content)); return new FileResource<I>(fs, path); } catch (IOException e) { throw AbstractTestCase.failure(e); } }
@Test public void testIncremental() throws IOException, CompilationException { CompilerAssert<File, File> compiler = compiler(true, Name.parse("compiler.incremental"), ""). with(compilerProvider). with((Provider<? extends Processor>)null); compiler.assertCompile(); // ReadWriteFileSystem<File> classOutput = compiler.getClassOutput(); assertEquals(1, classOutput.size(ReadFileSystem.FILE)); // ReadWriteFileSystem<File> sourcePath = (ReadWriteFileSystem<File>)compiler.getSourcePath(); File b = sourcePath.makePath(sourcePath.getPath("compiler", "incremental"), "B.java"); sourcePath.updateResource(b, new Resource("package compiler.incremental; public class B extends A {}")); compiler.assertCompile(); assertEquals(2, classOutput.size(ReadFileSystem.FILE)); }
@Test public void testIncremental() throws IOException, CompilationException { CompilerAssert<File, File> compiler = compiler(true, Name.parse("compiler.incremental"), ""). with(compilerProvider). with((Provider<? extends Processor>)null); compiler.assertCompile(); // ReadWriteFileSystem<File> classOutput = compiler.getClassOutput(); assertEquals(1, classOutput.size(ReadFileSystem.FILE)); // ReadWriteFileSystem<File> sourcePath = (ReadWriteFileSystem<File>)compiler.getSourcePath(); File b = sourcePath.makePath(sourcePath.getPath("compiler", "incremental"), "B.java"); sourcePath.updateResource(b, new Resource("package compiler.incremental; public class B extends A {}")); compiler.assertCompile(); assertEquals(2, classOutput.size(ReadFileSystem.FILE)); }