@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)); } }
if (classOutput.size(ReadFileSystem.FILE) > 0) { File root = File.createTempFile("juzu", ""); Assert.assertTrue(root.delete());
if (classOutput.size(ReadFileSystem.FILE) > 0) { File root = File.createTempFile("juzu", ""); Assert.assertTrue(root.delete());
@Test public void testProcessor() throws Exception { ProcessorImpl processor = new ProcessorImpl(); CompilerAssert<File, File> compiler = compiler("compiler.processor").with(compilerProvider).with(processor); compiler.assertCompile(); assertEquals(2, compiler.getClassOutput().size(ReadFileSystem.FILE)); assertEquals(Arrays.asList("compiler.processor.A", "compiler.processor.B"), processor.names); assertEquals(1, compiler.getSourceOutput().size(ReadFileSystem.FILE)); }
@Test public void testProcessor() throws Exception { ProcessorImpl processor = new ProcessorImpl(); CompilerAssert<File, File> compiler = compiler("compiler.processor").with(compilerProvider).with(processor); compiler.assertCompile(); assertEquals(2, compiler.getClassOutput().size(ReadFileSystem.FILE)); assertEquals(Arrays.asList("compiler.processor.A", "compiler.processor.B"), processor.names); assertEquals(1, compiler.getSourceOutput().size(ReadFileSystem.FILE)); }
@Test public void testBar() throws Exception { CompilerAssert<File, File> helper = compiler("compiler.disk").with(compilerProvider); helper.with((Provider<? extends Processor>)null); helper.assertCompile(); assertEquals(1, helper.getClassOutput().size(ReadFileSystem.FILE)); }
@Test public void testBar() throws Exception { CompilerAssert<File, File> helper = compiler("compiler.disk").with(compilerProvider); helper.with((Provider<? extends Processor>)null); helper.assertCompile(); assertEquals(1, helper.getClassOutput().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)); }
@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)); }