Java 类org.assertj.core.api.FileAssert 实例源码

项目:smart-testing    文件:DirectoryAssert.java   
public DirectoryAssert hasSameContentAs(Path path) {
    FileAssert fileAssert = new FileAssert(actual.toFile());
    fileAssert.exists().isDirectory();

    Arrays
        .stream(path.toFile().listFiles())
        .map(File::toPath)
        .forEach(expectedFile -> {
            Path actualFile = actual.resolve(expectedFile.getFileName());
            if (expectedFile.toFile().isDirectory()) {
                assertThatDirectory(actualFile).hasSameContentAs(expectedFile);
            } else {
                Assertions.assertThat(actualFile).exists().isRegularFile().hasSameContentAs(expectedFile);
            }
        });

    return this;
}
项目:smart-testing    文件:BuiltProjectAssert.java   
private void containsEffectivePom(String effectivePom) {
    final String smartTestingExtension = "org.arquillian.smart.testing";
    final File targetDirectory = actual.getTargetDirectory();
    Path reportPath = Paths.get(targetDirectory.toString(), SMART_TESTING_TARGET_DIRECTORY_NAME, REPORTING_SUBDIRECTORY);
    if (targetDirectory.exists() && !actual.getModel().getPackaging().equals("pom")) {
        final File pomFile = new File(reportPath.toString(), effectivePom);
        FileAssert fileAssert = new FileAssert(pomFile);
        fileAssert.exists();
        Assertions.assertThat(contentOf(pomFile)).contains(smartTestingExtension);
    }
}
项目:smart-testing    文件:BuiltProjectAssert.java   
private void hasReportFile(String report) {
    final File targetDirectory = actual.getTargetDirectory();
    Path reportPath = Paths.get(targetDirectory.toString(), SMART_TESTING_TARGET_DIRECTORY_NAME, REPORTING_SUBDIRECTORY);
    final FileAssert fileAssert = new FileAssert(new File(reportPath.toString(), report));
    if (isJar(actual)) {
        if (hasCompiledTests(targetDirectory)) {
            fileAssert.exists();
        } else {
            fileAssert.doesNotExist();
        }
    } else {
        fileAssert.doesNotExist();
    }
}
项目:assertj-core    文件:FileAssert_hasParent_Test.java   
@Override
protected FileAssert invoke_api_method() {
  return assertions.hasParent(parent);
}
项目:assertj-core    文件:FileAssert_hasExtension_Test.java   
@Override
protected FileAssert invoke_api_method() {
  return assertions.hasExtension(extension);
}
项目:assertj-core    文件:FileAssert_doesNotExist_Test.java   
@Override
protected FileAssert invoke_api_method() {
  return assertions.doesNotExist();
}
项目:assertj-core    文件:FileAssert_usingCharset_Test.java   
@Override
protected FileAssert invoke_api_method() {
  return assertions.usingCharset(otherCharset);
}
项目:assertj-core    文件:FileAssert_exists_Test.java   
@Override
protected FileAssert invoke_api_method() {
  return assertions.exists();
}
项目:assertj-core    文件:FileAssert_isFile_Test.java   
@Override
protected FileAssert invoke_api_method() {
  return assertions.isFile();
}
项目:assertj-core    文件:FileAssert_isAbsolute_Test.java   
@Override
protected FileAssert invoke_api_method() {
  return assertions.isAbsolute();
}
项目:assertj-core    文件:FileAssert_usingCharset_String_invalid_Test.java   
@Override
protected FileAssert invoke_api_method() {
  // not used here
  return null;
}
项目:assertj-core    文件:FileAssert_hasParentWithStringParameter_Test.java   
@Override
protected FileAssert invoke_api_method() {
  return assertions.hasParent(parent);
}
项目:assertj-core    文件:FileAssert_hasParentWithNullStringParameter_Test.java   
@Override
protected FileAssert invoke_api_method() {
  return assertions.hasParent((String) null);
}
项目:assertj-core    文件:FileAssert_canWrite_Test.java   
@Override
protected FileAssert invoke_api_method() {
  return assertions.canWrite();
}
项目:assertj-core    文件:FileAssert_hasSameContentAs_Test.java   
@Override
protected FileAssert invoke_api_method() {
  return assertions.hasSameContentAs(expected);
}
项目:assertj-core    文件:FileAssert_hasNoParent_Test.java   
@Override
protected FileAssert invoke_api_method() {
  return assertions.hasNoParent();
}
项目:assertj-core    文件:FileAssert_isDirectory_Test.java   
@Override
protected FileAssert invoke_api_method() {
  return assertions.isDirectory();
}
项目:assertj-core    文件:FileAssert_usingCharset_null_Test.java   
@Override
protected FileAssert invoke_api_method() {
  // not used here
  return null;
}
项目:assertj-core    文件:FileAssert_isRelative_Test.java   
@Override
protected FileAssert invoke_api_method() {
  return assertions.isRelative();
}
项目:assertj-core    文件:FileAssert_hasContent_Test.java   
@Override
protected FileAssert invoke_api_method() {
  return assertions.hasContent(expected);
}
项目:assertj-core    文件:FileAssert_usingCharset_default_Test.java   
@Override
protected FileAssert invoke_api_method() {
  // do nothing
  return assertions;
}
项目:assertj-core    文件:FileAssert_usingCharset_String_Test.java   
@Override
protected FileAssert invoke_api_method() {
  return assertions.usingCharset(otherCharset.name());
}
项目:assertj-core    文件:FileAssert_hasName_Test.java   
@Override
protected FileAssert invoke_api_method() {
  return assertions.hasName(expected);
}
项目:assertj-core    文件:FileAssert_hasBinaryContent_Test.java   
@Override
protected FileAssert invoke_api_method() {
  return assertions.hasBinaryContent(content);
}
项目:assertj-core    文件:FileAssert_canRead_Test.java   
@Override
protected FileAssert invoke_api_method() {
  return assertions.canRead();
}