<commit_before>package BlueTurtle.parsers;

import java.util.HashMap;

import static org.junit.Assert.assertSame;
import static org.junit.Assert.assertTrue;

import org.junit.Test;

/**
 * Test class for GDCParser.
 * 
 * @author BlueTurtle.
 *
 */
public class GDCParserTest {

	private static String testSet = "./resources/htmlExample.html";
	private static String testSet2 = "./resources/asat-gdc-mapping.html";


	/**
	 * Test that the parser can parse a valid GDC html file.
	 */
	@Test
	public void testParseCorrectBehaviour() {
		GDCParser parser = new GDCParser();

		HashMap<String, String> categoryInfo = parser.parseFile(testSet);

		assertTrue(categoryInfo.containsValue("Naming Conventions"));
	}
	
	/**
	 * Test that the parser created the right amount of warnings.
	 */
	@Test
	public void testCreateRightAmountOfWarnings() {
		GDCParser parser = new GDCParser();

		HashMap<String, String> categoryInfo = parser.parseFile(testSet);

		assertSame(2, categoryInfo.size());
	}	

//	/**
//	 * Test that the parser parse the wrong file.
//	 */
//	@Test
//	public void testParseTheWrongFile() {
//		FindBugsXMLParser parser = new FindBugsXMLParser();
//		
//		String testSet3 = "./resources/ex.xml";
//
//		List<Warning> warnings = parser.parseFile(testSet3);
//		
//		assertNotSame(6, warnings.toString());
//	}

}<commit_msg>test edge case for GDC Parser<commit_after>package BlueTurtle.parsers;

import java.util.HashMap;

import static org.junit.Assert.assertNotSame;
import static org.junit.Assert.assertSame;
import static org.junit.Assert.assertTrue;

import org.junit.Test;

/**
 * Test class for GDCParser.
 * 
 * @author BlueTurtle.
 *
 */
public class GDCParserTest {

	private static String testSet = "./resources/htmlExample.html";
	private static String testSet2 = "./resources/asat-gdc-mapping.html";


	/**
	 * Test that the parser can parse a valid GDC html file.
	 */
	@Test
	public void testParseCorrectBehaviour() {
		GDCParser parser = new GDCParser();

		HashMap<String, String> categoryInfo = parser.parseFile(testSet);

		assertTrue(categoryInfo.containsValue("Naming Conventions"));
	}
	
	/**
	 * Test that the parser created the right amount of warnings.
	 */
	@Test
	public void testCreateRightAmountOfWarnings() {
		GDCParser parser = new GDCParser();

		HashMap<String, String> categoryInfo = parser.parseFile(testSet);

		assertSame(2, categoryInfo.size());
	}	

	/**
	 * Test that the parser parse the wrong file.
	 */
	@Test
	public void testParseTheWrongFile() {
		GDCParser parser = new GDCParser();
		
		String testSet3 = "./resources/ex.xml";

		HashMap<String, String> warnings = parser.parseFile(testSet3);
		
		assertNotSame(6, warnings.size());
	}

}
{'fraction_non_alphanumeric': 0.12407407407407407, 'fraction_numerical': 0.003703703703703704, 'mean_word_length': 3.9378427787934185, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, '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': '4934337', 'n_tokens_mistral': 892, 'n_tokens_neox': 839, 'n_words': 217}