@Theory public void theoryExtantHaveDate(String path) throws Exception { Resource res = getResource(path); assumeThat(res, defined()); long result = res.lastmodified(); assertThat(result, notNullValue()); }
@Theory public void theoryAddingFileToDirectoryAddsResource(String path) throws Exception { Resource res = getResource(path); assumeThat(res, is(directory())); File dir = res.dir(); File file = new File(dir, "newFileCreatedDirectly"); assumeTrue(file.createNewFile()); Resource child = getResource(Paths.path(res.path(), "newFileCreatedDirectly")); Collection<Resource> children = res.list(); assertThat(child, is(defined())); assertThat(children, hasItem(child)); }
@Theory public void theoryRenamedAreUndefined(String path) throws Exception { Resource res = getResource(path); assumeThat(res, defined()); Resource target = getUndefined(); assertThat(res.renameTo(target), is(true)); assertThat(res, undefined()); }
@Theory public void theoryExtantHaveDate(String path) throws Exception { Resource res = getResource(path); assumeThat(res, defined()); long result = res.lastmodified(); assertThat(result, notNullValue()); }
@Theory public void theoryAddingFileToDirectoryAddsResource(String path) throws Exception { Resource res = getResource(path); assumeThat(res, is(directory())); File dir = res.dir(); File file = new File(dir, "newFileCreatedDirectly"); assumeTrue(file.createNewFile()); Resource child = getResource(Paths.path(res.path(), "newFileCreatedDirectly")); Collection<Resource> children = res.list(); assertThat(child, is(defined())); assertThat(children, hasItem(child)); }
@Theory public void theoryRenamedAreUndefined(String path) throws Exception { Resource res = getResource(path); assumeThat(res, defined()); Resource target = getUndefined(); assertThat(res.renameTo(target), is(true)); assertThat(res, undefined()); }