<commit_before>package de.terrestris.shogun2.util.converter;

import org.junit.Test;
import static org.junit.Assert.*;

/**
 * @author <NAME>
 *
 */
public class PropertyValueConverterTest {

	/**
	 * The converter class to test.
	 */
	private final PropertyValueConverter converter = new PropertyValueConverter();

	/**
	 * Tests whether a string will remain a string.
	 */
	@Test
	public void convertToEntityAttribute_convertsToString() {

		String testValue = "test";
		Object convertedValue = converter.convertToEntityAttribute(testValue);

		assertTrue(testValue.equals(convertedValue));
	}

	/**
	 * Tests whether an integer "string" will be converted to a Long value.
	 */
	@Test
	public void convertToEntityAttribute_convertsToLong() {

		String testValue = "42";
		Object convertedValue = converter.convertToEntityAttribute(testValue);

		assertTrue(convertedValue instanceof Long);
		assertTrue(((Long)convertedValue) == 42);
	}

	/**
	 * Tests whether an float/double "string" will be converted to a Double value.
	 */
	@Test
	public void convertToEntityAttribute_convertsToDouble() {

		String testValue = "17.42";
		Object convertedValue = converter.convertToEntityAttribute(testValue);

		assertTrue(convertedValue instanceof Double);
		assertTrue(((Double)convertedValue) == 17.42);
	}

	/**
	 * Tests whether an boolean "string" will be converted to a Boolean value.
	 */
	@Test
	public void convertToEntityAttribute_convertsToBoolean() {

		String testValue = "true";
		String testValueCaseInsensitive = "faLSe";

		Object convertedValue = converter.convertToEntityAttribute(testValue);
		Object convertedValueCaseInsensitive = converter.convertToEntityAttribute(testValueCaseInsensitive);

		assertTrue(convertedValue instanceof Boolean);
		assertTrue(((Boolean)convertedValue) == true);

		assertTrue(convertedValueCaseInsensitive instanceof Boolean);
		assertTrue(((Boolean)convertedValueCaseInsensitive) == false);
	}

	/**
	 * Tests whether a string will be converted to the correct string.
	 */
	@Test
	public void convertToDatabaseColumn_convertsStringToString() {

		String testValue = "test";
		String convertedValue = converter.convertToDatabaseColumn(testValue);

		assertTrue(testValue.equals(convertedValue));
	}

	/**
	 * Tests whether an integer will be converted to the correct string.
	 */
	@Test
	public void convertToDatabaseColumn_convertsIntegerToString() {

		int testValue = 42;
		String convertedValue = converter.convertToDatabaseColumn(testValue);

		assertTrue("42".equals(convertedValue));
	}

	/**
	 * Tests whether a double will be converted to the correct string.
	 */
	@Test
	public void convertToDatabaseColumn_convertsDoubleToString() {

		double testValue = 17.42;
		String convertedValue = converter.convertToDatabaseColumn(testValue);

		assertTrue("17.42".equals(convertedValue));
	}

	/**
	 * Tests whether a boolean will be converted to the correct string.
	 */
	@Test
	public void convertToDatabaseColumn_convertsBooleanToString() {

		boolean testValue = true;
		String convertedValue = converter.convertToDatabaseColumn(testValue);

		assertTrue("true".equals(convertedValue));
	}

}<commit_msg>Extend converter test to check negative values<commit_after>package de.terrestris.shogun2.util.converter;

import org.junit.Test;
import static org.junit.Assert.*;

/**
 * @author <NAME>
 *
 */
public class PropertyValueConverterTest {

	/**
	 * The converter class to test.
	 */
	private final PropertyValueConverter converter = new PropertyValueConverter();

	/**
	 * Tests whether a string will remain a string.
	 */
	@Test
	public void convertToEntityAttribute_convertsToString() {

		String testValue = "test";
		Object convertedValue = converter.convertToEntityAttribute(testValue);

		assertTrue(convertedValue instanceof String);
		assertTrue(testValue.equals(convertedValue));
	}

	/**
	 * Tests whether an integer "string" will be converted to a Long value.
	 */
	@Test
	public void convertToEntityAttribute_convertsToLong() {

		String testValue = "42";
		String negativeTestValue = "-42";

		Object convertedValue = converter.convertToEntityAttribute(testValue);
		Object convertedNegativeValue = converter.convertToEntityAttribute(negativeTestValue);

		assertTrue(convertedValue instanceof Long);
		assertTrue(((Long)convertedValue) == 42);

		assertTrue(convertedNegativeValue instanceof Long);
		assertTrue(((Long)convertedNegativeValue) == -42);
	}

	/**
	 * Tests whether an float/double "string" will be converted to a Double value.
	 */
	@Test
	public void convertToEntityAttribute_convertsToDouble() {

		String testValue = "17.42";
		String negativeTestValue = "-17.42";

		Object convertedValue = converter.convertToEntityAttribute(testValue);
		Object convertedNegativeValue = converter.convertToEntityAttribute(negativeTestValue);

		assertTrue(convertedValue instanceof Double);
		assertTrue(((Double)convertedValue) == 17.42);

		assertTrue(convertedNegativeValue instanceof Double);
		assertTrue(((Double)convertedNegativeValue) == -17.42);
	}

	/**
	 * Tests whether an boolean "string" will be converted to a Boolean value.
	 */
	@Test
	public void convertToEntityAttribute_convertsToBoolean() {

		String testValue = "true";
		String testValueCaseInsensitive = "faLSe";

		Object convertedValue = converter.convertToEntityAttribute(testValue);
		Object convertedValueCaseInsensitive = converter.convertToEntityAttribute(testValueCaseInsensitive);

		assertTrue(convertedValue instanceof Boolean);
		assertTrue(((Boolean)convertedValue) == true);

		assertTrue(convertedValueCaseInsensitive instanceof Boolean);
		assertTrue(((Boolean)convertedValueCaseInsensitive) == false);
	}

	/**
	 * Tests whether a string will be converted to the correct string.
	 */
	@Test
	public void convertToDatabaseColumn_convertsStringToString() {

		String testValue = "test";
		String convertedValue = converter.convertToDatabaseColumn(testValue);

		assertTrue(testValue.equals(convertedValue));
	}

	/**
	 * Tests whether an integer will be converted to the correct string.
	 */
	@Test
	public void convertToDatabaseColumn_convertsIntegerToString() {

		int testValue = 42;
		int negativeTestValue = -42;

		String convertedValue = converter.convertToDatabaseColumn(testValue);
		String convertedNegativeValue = converter.convertToDatabaseColumn(negativeTestValue);

		assertTrue("42".equals(convertedValue));
		assertTrue("-42".equals(convertedNegativeValue));
	}

	/**
	 * Tests whether a double will be converted to the correct string.
	 */
	@Test
	public void convertToDatabaseColumn_convertsDoubleToString() {

		double testValue = 17.42;
		double negativeTestValue = -17.42;

		String convertedValue = converter.convertToDatabaseColumn(testValue);
		String convertedNegativeValue = converter.convertToDatabaseColumn(negativeTestValue);

		assertTrue("17.42".equals(convertedValue));
		assertTrue("-17.42".equals(convertedNegativeValue));
	}

	/**
	 * Tests whether a boolean will be converted to the correct string.
	 */
	@Test
	public void convertToDatabaseColumn_convertsBooleanToString() {

		boolean testValue = true;
		String convertedValue = converter.convertToDatabaseColumn(testValue);

		assertTrue("true".equals(convertedValue));
	}

}
{'fraction_non_alphanumeric': 0.09651066186651897, 'fraction_numerical': 0.010246469122126834, 'mean_word_length': 5.335964912280701, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '5017548', 'n_tokens_mistral': 2134, 'n_tokens_neox': 1911, 'n_words': 489}