<commit_before>package common;

import org.junit.Test;

public class VersionTest {

	@Test
	public void compareReleaseVersionTest() {
		String olderVersion = "0.0.1";
		String newerVersion = "0.0.3";
		assert new Version(olderVersion).compareTo(new Version(newerVersion)) == -1;
	}

	@Test
	public void compareSnapshotVersionTest() {
		String olderVersion = "0.0.1-SNAPSHOT";
		String newerVersion = "0.0.1";
		assert new Version(olderVersion).compareTo(new Version(newerVersion)) == -1;
	}
	
	@Test
	public void compareSnapshotVersionWithBuildNumberTest() {
		String olderVersion = "0.0.1-SNAPSHOT";
		String oldBuildNumber = "10";
		String newerVersion = "0.0.1-SNAPSHOT";
		String newBuildNumber = "11";
		Version old = new Version(olderVersion, oldBuildNumber);
		Version n = new Version(newerVersion, newBuildNumber);
		assert old.compareTo(n) == -1;
	}

	@Test
	public void compareEqualReleaseVersionTest() {
		String olderVersion = "0.0.1";
		String newerVersion = "0.0.1";
		assert new Version(olderVersion).compareTo(new Version(newerVersion)) == 0;
		assert new Version(olderVersion).equals(new Version(newerVersion));
	}

	@Test
	public void compareEqualSnapshotVersionTest() {
		String olderVersion = "0.0.1-SNAPSHOT";
		String newerVersion = "0.0.1-SNAPSHOT";
		assert new Version(olderVersion).compareTo(new Version(newerVersion)) == 0;
		assert new Version(olderVersion).equals(new Version(newerVersion));
	}

	@Test
	public void illegalVersionFormatTest() {
		String olderVersion = "lkjzughvihkgv";
		try {
			// this is an illegal version format so an exception should be
			// thrown
			new Version(olderVersion);

			// No exception occurred
			assert false;
		} catch (Exception e) {
			if (e instanceof IllegalArgumentException) {
				assert true;
			}else {
				// Any other exception was thrown
				e.printStackTrace();
			}
		}
	}
	
	@Test
	public void versionNullTest(){
		String olderVersion = null;
		try {<commit_msg>Added compareToNullTest<commit_after>package common;

import org.junit.Test;

public class VersionTest {

	@Test
	public void compareReleaseVersionTest() {
		String olderVersion = "0.0.1";
		String newerVersion = "0.0.3";
		assert new Version(olderVersion).compareTo(new Version(newerVersion)) == -1;
	}

	@Test
	public void compareSnapshotVersionTest() {
		String olderVersion = "0.0.1-SNAPSHOT";
		String newerVersion = "0.0.1";
		assert new Version(olderVersion).compareTo(new Version(newerVersion)) == -1;
	}
	
	@Test
	public void compareSnapshotVersionWithBuildNumberTest() {
		String olderVersion = "0.0.1-SNAPSHOT";
		String oldBuildNumber = "10";
		String newerVersion = "0.0.1-SNAPSHOT";
		String newBuildNumber = "11";
		Version old = new Version(olderVersion, oldBuildNumber);
		Version n = new Version(newerVersion, newBuildNumber);
		assert old.compareTo(n) == -1;
	}

	@Test
	public void compareEqualReleaseVersionTest() {
		String olderVersion = "0.0.1";
		String newerVersion = "0.0.1";
		assert new Version(olderVersion).compareTo(new Version(newerVersion)) == 0;
		assert new Version(olderVersion).equals(new Version(newerVersion));
	}

	@Test
	public void compareEqualSnapshotVersionTest() {
		String olderVersion = "0.0.1-SNAPSHOT";
		String newerVersion = "0.0.1-SNAPSHOT";
		assert new Version(olderVersion).compareTo(new Version(newerVersion)) == 0;
		assert new Version(olderVersion).equals(new Version(newerVersion));
	}
	
	@Test
	public void compareToNullTest(){
		String olderVersion = "0.0.1-SNAPSHOT";
		assert new Version(olderVersion).compareTo(null) == 1;
	}

	@Test
	public void illegalVersionFormatTest() {
		String olderVersion = "lkjzughvihkgv";
		try {
			// this is an illegal version format so an exception should be
			// thrown
			new Version(olderVersion);

			// No exception occurred
			assert false;
		} catch (Exception e) {
			if (e instanceof IllegalArgumentException) {
				assert true;
			}else {
				// Any other exception was thrown
				e.printStackTrace();
			}
		}
	}
	
	@Test
	public void versionNullTest(){
		String olderVersion = null;
		try {
{'fraction_non_alphanumeric': 0.11668726823238566, 'fraction_numerical': 0.020271940667490728, 'mean_word_length': 4.288888888888889, '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': '7573465', 'n_tokens_mistral': 1415, 'n_tokens_neox': 1286, 'n_words': 322}