org.assertj.core.api.AbstractFileAssert.isEqualTo()方法的使用及代码示例

x33g5p2x  于11个月前 转载在 其他  
字(9.5k)|赞(0)|评价(0)|浏览(34)

本文整理了Java中org.assertj.core.api.AbstractFileAssert.isEqualTo()方法的一些代码示例,展示了AbstractFileAssert.isEqualTo()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。AbstractFileAssert.isEqualTo()方法的具体详情如下:
包路径:org.assertj.core.api.AbstractFileAssert
类名称:AbstractFileAssert
方法名:isEqualTo

AbstractFileAssert.isEqualTo介绍

暂无

代码示例

代码示例来源:origin: eclipse-vertx/vert.x

@Test
public void testCWD() throws CLIException {
 CLI cli = CLIConfigurator.define(command.getClass());
 CommandLine evaluatedCLI = parse(cli, "--name=vert.x");
 CLIConfigurator.inject(evaluatedCLI, command);
 assertThat(command.getCwd()).isEqualTo(new File("."));
 evaluatedCLI = parse(cli, "--cwd=target", "--name=vert.x");
 CLIConfigurator.inject(evaluatedCLI, command);
 assertThat(command.getCwd()).isEqualTo(new File("target"));
}

代码示例来源:origin: SonarSource/sonarqube

@Test
public void relative_path_from_not_normalized_dirs() throws IOException {
 PathResolver resolver = new PathResolver();
 File rootDir = new File(temp.newFolder(), "foo/..");
 File org = new File(rootDir, "org");
 File hello = new File(org, "hello");
 File world = new File(hello, "World.java");
 PathResolver.RelativePath relativePath = resolver.relativePath(Arrays.asList(rootDir), world);
 assertThat(relativePath).isNotNull();
 assertThat(relativePath.dir()).isEqualTo(rootDir);
 assertThat(relativePath.path()).isEqualTo("org/hello/World.java");
}

代码示例来源:origin: SonarSource/sonarqube

@Test
public void shouldInitRootWorkDir() {
 ProjectReactorBuilder builder = new ProjectReactorBuilder(new ScannerProperties(Maps.<String, String>newHashMap()), mock(AnalysisWarnings.class));
 File baseDir = new File("target/tmp/baseDir");
 File workDir = builder.initRootProjectWorkDir(baseDir, Maps.<String, String>newHashMap());
 assertThat(workDir).isEqualTo(new File(baseDir, ".sonar"));
}

代码示例来源:origin: SonarSource/sonarqube

@Test
public void test_file_system_information() throws IOException {
 File home = temp.newFolder();
 when(fs.getHomeDir()).thenReturn(home);
 assertThat(underTest.getRootDir()).isEqualTo(home);
}

代码示例来源:origin: SonarSource/sonarqube

@Test
public void shouldGetRelativeFile() {
 assertThat(ProjectReactorBuilder.resolvePath(getResource(this.getClass(), "/"), "shouldGetFile/foo.properties"))
  .isEqualTo(getResource(this.getClass(), "shouldGetFile/foo.properties"));
}

代码示例来源:origin: SonarSource/sonarqube

@Test
public void get_file() {
 BatchIndex batchIndex = new BatchIndex(fs);
 batchIndex.start();
 File file = batchIndex.getFile("sonar-batch.jar");
 assertThat(file).isEqualTo(jar);
}

代码示例来源:origin: SonarSource/sonarqube

@Test
 public void contextProperties_file() throws Exception {
  File dir = temp.newFolder();
  File file = new File(dir, "context-props.pb");
  FileUtils.write(file, "content");

  FileStructure structure = new FileStructure(dir);
  assertThat(structure.contextProperties()).exists().isFile().isEqualTo(file);
 }
}

代码示例来源:origin: SonarSource/sonarqube

@Test
public void working_directory() {
 Command command = Command.create("java");
 assertThat(command.getDirectory()).isNull();
 File working = new File("working");
 command = Command.create("java").setDirectory(working);
 assertThat(command.getDirectory()).isEqualTo(working);
}

代码示例来源:origin: SonarSource/sonarqube

@Test
public void createTempFolderWithName() throws Exception {
 File rootTempFolder = temp.newFolder();
 DefaultTempFolder underTest = new DefaultTempFolder(rootTempFolder);
 File dir = underTest.newDir("sample");
 assertThat(dir).exists().isDirectory();
 assertThat(new File(rootTempFolder, "sample")).isEqualTo(dir);
 new TempFolderCleaner(underTest).stop();
 assertThat(rootTempFolder).doesNotExist();
}

代码示例来源:origin: SonarSource/sonarqube

@Test
public void checkAndComplete_sets_driver_path_for_oracle() throws Exception {
 File driverFile = new File(homeDir, "extensions/jdbc-driver/oracle/ojdbc6.jar");
 FileUtils.touch(driverFile);
 Props props = newProps(JDBC_URL.getKey(), "jdbc:oracle:thin:@localhost/XE");
 underTest.accept(props);
 assertThat(props.nonNullValueAsFile(JDBC_DRIVER_PATH.getKey())).isEqualTo(driverFile);
}

代码示例来源:origin: SonarSource/sonarqube

@Test
public void getElasticsearchYml_is_in_es_conf_directory() throws IOException {
 File tempDir = temp.newFolder();
 Props props = new Props(new Properties());
 props.set(PATH_DATA.getKey(), temp.newFolder().getAbsolutePath());
 props.set(PATH_HOME.getKey(), temp.newFolder().getAbsolutePath());
 props.set(PATH_TEMP.getKey(), tempDir.getAbsolutePath());
 props.set(PATH_LOGS.getKey(), temp.newFolder().getAbsolutePath());
 EsInstallation underTest = new EsInstallation(props);
 assertThat(underTest.getElasticsearchYml()).isEqualTo(new File(tempDir, "conf/es/elasticsearch.yml"));
}

代码示例来源:origin: SonarSource/sonarqube

@Test
public void filesWithDefaultPredicate() {
 DefaultInputFile file1 = new TestInputFileBuilder("foo", "src/Foo.php").setLanguage("php").build();
 fs.add(file1);
 fs.add(new TestInputFileBuilder("foo", "src/Bar.java").setLanguage("java").build());
 fs.add(new TestInputFileBuilder("foo", "src/Baz.java").setLanguage("java").build());
 fs.setDefaultPredicate(p -> f -> f.relativePath().endsWith("Foo.php"));
 Iterator<File> iterator = fs.files(fs.predicates().all()).iterator();
 assertThat(iterator.hasNext()).isTrue();
 assertThat(iterator.next()).isEqualTo(file1.file());
 assertThat(iterator.hasNext()).isFalse();
}

代码示例来源:origin: SonarSource/sonarqube

@Test
public void sets_driver_path_for_h2() throws Exception {
 File driverFile = new File(homeDir, "lib/jdbc/h2/h2.jar");
 FileUtils.touch(driverFile);
 Props props = newProps(JDBC_URL.getKey(), "jdbc:h2:tcp://localhost:9092/sonar");
 underTest.accept(props);
 assertThat(props.nonNullValueAsFile(JDBC_DRIVER_PATH.getKey())).isEqualTo(driverFile);
}

代码示例来源:origin: SonarSource/sonarqube

@Test
public void checkAndComplete_sets_driver_path_for_postgresql() throws Exception {
 File driverFile = new File(homeDir, "lib/jdbc/postgresql/pg.jar");
 FileUtils.touch(driverFile);
 Props props = newProps(JDBC_URL.getKey(), "jdbc:postgresql://localhost/sonar");
 underTest.accept(props);
 assertThat(props.nonNullValueAsFile(JDBC_DRIVER_PATH.getKey())).isEqualTo(driverFile);
}

代码示例来源:origin: SonarSource/sonarqube

@Test
public void getLog4j2Properties_is_in_es_conf_directory() throws IOException {
 File tempDir = temp.newFolder();
 Props props = new Props(new Properties());
 props.set(PATH_DATA.getKey(), temp.newFolder().getAbsolutePath());
 props.set(PATH_HOME.getKey(), temp.newFolder().getAbsolutePath());
 props.set(PATH_TEMP.getKey(), tempDir.getAbsolutePath());
 props.set(PATH_LOGS.getKey(), temp.newFolder().getAbsolutePath());
 EsInstallation underTest = new EsInstallation(props);
 assertThat(underTest.getLog4j2PropertiesLocation()).isEqualTo(new File(tempDir, "conf/es/log4j2.properties"));
}

代码示例来源:origin: SonarSource/sonarqube

@Test
 public void getJvmOptions_is_in_es_conf_directory() throws IOException {
  File tempDir = temp.newFolder();
  Props props = new Props(new Properties());
  props.set(PATH_DATA.getKey(), temp.newFolder().getAbsolutePath());
  props.set(PATH_HOME.getKey(), temp.newFolder().getAbsolutePath());
  props.set(PATH_TEMP.getKey(), tempDir.getAbsolutePath());
  props.set(PATH_LOGS.getKey(), temp.newFolder().getAbsolutePath());

  EsInstallation underTest = new EsInstallation(props);

  assertThat(underTest.getJvmOptions()).isEqualTo(new File(tempDir, "conf/es/jvm.options"));
 }
}

代码示例来源:origin: SonarSource/sonarqube

@Test
public void checkAndComplete_sets_driver_path_for_mssql() throws Exception {
 File driverFile = new File(homeDir, "lib/jdbc/mssql/sqljdbc4.jar");
 FileUtils.touch(driverFile);
 Props props = newProps(JDBC_URL.getKey(), "jdbc:sqlserver://localhost/sonar;SelectMethod=Cursor");
 underTest.accept(props);
 assertThat(props.nonNullValueAsFile(JDBC_DRIVER_PATH.getKey())).isEqualTo(driverFile);
}

代码示例来源:origin: SonarSource/sonarqube

@Test
public void getHomeDirectory_is_elasticsearch_subdirectory_of_sq_home_directory() throws IOException {
 File sqHomeDir = temp.newFolder();
 Props props = new Props(new Properties());
 props.set(PATH_DATA.getKey(), temp.newFolder().getAbsolutePath());
 props.set(PATH_HOME.getKey(), sqHomeDir.getAbsolutePath());
 props.set(PATH_TEMP.getKey(), temp.newFolder().getAbsolutePath());
 props.set(PATH_LOGS.getKey(), temp.newFolder().getAbsolutePath());
 EsInstallation underTest = new EsInstallation(props);
 assertThat(underTest.getHomeDirectory()).isEqualTo(new File(sqHomeDir, "elasticsearch"));
}

代码示例来源:origin: SonarSource/sonarqube

@Test
public void conf_directory_is_conf_es_subdirectory_of_sq_temp_directory() throws IOException {
 File tempDir = temp.newFolder();
 Props props = new Props(new Properties());
 props.set(PATH_DATA.getKey(), temp.newFolder().getAbsolutePath());
 props.set(PATH_HOME.getKey(), temp.newFolder().getAbsolutePath());
 props.set(PATH_TEMP.getKey(), tempDir.getAbsolutePath());
 props.set(PATH_LOGS.getKey(), temp.newFolder().getAbsolutePath());
 EsInstallation underTest = new EsInstallation(props);
 assertThat(underTest.getConfDirectory()).isEqualTo(new File(tempDir, "conf/es"));
}

代码示例来源:origin: SonarSource/sonarqube

@Test
public void getLogDirectory_is_configured_with_non_nullable_PATH_LOG_variable() throws IOException {
 File sqHomeDir = temp.newFolder();
 File logDir = temp.newFolder();
 Props props = new Props(new Properties());
 props.set(PATH_DATA.getKey(), temp.newFolder().getAbsolutePath());
 props.set(PATH_HOME.getKey(), sqHomeDir.getAbsolutePath());
 props.set(PATH_TEMP.getKey(), temp.newFolder().getAbsolutePath());
 props.set(PATH_LOGS.getKey(), logDir.getAbsolutePath());
 EsInstallation underTest = new EsInstallation(props);
 assertThat(underTest.getLogDirectory()).isEqualTo(logDir);
}

相关文章