コード例 #1
0
  @Test
  public void testLinux() {
    objectBuilderFactory.newObjectBuilder(FileConfigurationTest.class).injectTo(this);
    System.setProperty("os.name", "Linux");

    File user = config.user();
    Assert.assertThat(
        "OS is correct", config.os(), CoreMatchers.equalTo(FileConfiguration.OS.unix));
    Assert.assertThat(
        "configuration is correct",
        config.configurationDirectory(),
        CoreMatchers.equalTo(new File(user, "/.StreamFlowServer-test/etc")));
  }
コード例 #2
0
  @Test
  public void testMac() {
    objectBuilderFactory.newObjectBuilder(FileConfigurationTest.class).injectTo(this);

    System.setProperty("os.name", "Mac OS X");

    File user = config.user();
    Assert.assertThat("OS is correct", config.os(), CoreMatchers.equalTo(FileConfiguration.OS.mac));
    Assert.assertThat(
        "configuration is correct",
        config.configurationDirectory(),
        CoreMatchers.equalTo(new File(user, "/Library/Preferences/StreamFlowServer-test")));
  }