<commit_before>package fitnesse;

import java.io.File;
import java.util.Properties;

import org.junit.Test;

import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.is;
import static org.hamcrest.Matchers.notNullValue;

public class ConfigurationParameterTest {

  @Test
  public void shouldMakePropertiesWithConfigurationParametersAndValues() {
    Properties properties = ConfigurationParameter.makeProperties(ConfigurationParameter.PORT, 8001,
            ConfigurationParameter.ROOT_PATH, ".",
            ConfigurationParameter.ROOT_DIRECTORY, "FitNesseRoot");

    assertThat(properties.getProperty(ConfigurationParameter.PORT.getKey()), is("8001"));
    assertThat(properties.getProperty(ConfigurationParameter.ROOT_PATH.getKey()), is("."));
    assertThat(properties.getProperty(ConfigurationParameter.ROOT_DIRECTORY.getKey()), is("FitNesseRoot"));
  }

  @Test(expected = IllegalArgumentException.class)
  public void shouldFailOnOddNumberOfArguments() {
    Properties properties = ConfigurationParameter.makeProperties(ConfigurationParameter.PORT, 8001,
            ConfigurationParameter.ROOT_PATH);
  }

  @Test
  public void shouldAcceptStringArgumentsInsteadOfConfigurationParameters() {
    Properties properties = ConfigurationParameter.makeProperties("Port", 8001);

    assertThat(properties.getProperty("Port"), is("8001"));
  }

  @Test
  public void shouldAcceptNuArguments() {
    Properties properties = ConfigurationParameter.makeProperties();

    assertThat(properties, is(notNullValue()));
  }

  @Test
  public void canLoadPropertiesFromFile() {
    Properties properties = ConfigurationParameter.loadProperties(new File("configuration-parameter-test.properties"));<commit_msg>Doesn't assign to unused variabel<commit_after>package fitnesse;

import java.io.File;
import java.util.Properties;

import org.junit.Test;

import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.is;
import static org.hamcrest.Matchers.notNullValue;

public class ConfigurationParameterTest {

  @Test
  public void shouldMakePropertiesWithConfigurationParametersAndValues() {
    Properties properties = ConfigurationParameter.makeProperties(ConfigurationParameter.PORT, 8001,
            ConfigurationParameter.ROOT_PATH, ".",
            ConfigurationParameter.ROOT_DIRECTORY, "FitNesseRoot");

    assertThat(properties.getProperty(ConfigurationParameter.PORT.getKey()), is("8001"));
    assertThat(properties.getProperty(ConfigurationParameter.ROOT_PATH.getKey()), is("."));
    assertThat(properties.getProperty(ConfigurationParameter.ROOT_DIRECTORY.getKey()), is("FitNesseRoot"));
  }

  @Test(expected = IllegalArgumentException.class)
  public void shouldFailOnOddNumberOfArguments() {
    ConfigurationParameter.makeProperties(ConfigurationParameter.PORT, 8001,
            ConfigurationParameter.ROOT_PATH);
  }

  @Test
  public void shouldAcceptStringArgumentsInsteadOfConfigurationParameters() {
    Properties properties = ConfigurationParameter.makeProperties("Port", 8001);

    assertThat(properties.getProperty("Port"), is("8001"));
  }

  @Test
  public void shouldAcceptNuArguments() {
    Properties properties = ConfigurationParameter.makeProperties();

    assertThat(properties, is(notNullValue()));
  }

  @Test
  public void canLoadPropertiesFromFile() {
    Properties properties = ConfigurationParameter.loadProperties(new File("configuration-parameter-test.properties"));
{'fraction_non_alphanumeric': 0.09959700633275763, 'fraction_numerical': 0.011514104778353483, 'mean_word_length': 6.006048387096774, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7050322', 'n_tokens_mistral': 880, 'n_tokens_neox': 852, 'n_words': 149}