// Path: src/main/java/BlueTurtle/warnings/FindBugsWarning.java
// public class FindBugsWarning extends Warning {
// 
// 	
// 	@Getter @Setter private String category;
// 	@Getter @Setter private String priority;
// 
// 	
// 	/**
// 	 * Constructor.
// 	 * 
// 	 * @param filePath
// 	 *            the path to the file where the warning is located.
// 	 * @param filename
// 	 *            the name of the file where the warning is located.
// 	 * @param line
// 	 *            the line number where the warning is located.
// 	 * @param message
// 	 *            the message of the warning.
// 	 * @param category
// 	 *            the category of the warning.
// 	 * @param priority
// 	 *            the priority of the warning.            
// 	 * @param ruleName
// 	 *            the rule name of the warning.
// 	 * @param classification
// 	 *            of the violated rule of the warning.
// 	 */
// 	public FindBugsWarning(String filePath, String filename, int line, String message, String category, String priority, String ruleName, String classification) {
// 		super(filePath, filename, line, "FindBugs", ruleName, message, classification);
// 		setCategory(category);
// 		setPriority(priority);
// 	}
// 	
// 
// 	/**
// 	 * Check whether two FindBugs warnings are the same.
// 	 * 
// 	 * @param other
// 	 *            the other warning.
// 	 * @return a boolean
// 	 */
// 	@Override
// 	public boolean equals(Object other) {
// 
// 		if (!(other instanceof FindBugsWarning)) {
// 			return false;
// 		}
// 
// 		FindBugsWarning that = (FindBugsWarning) other;
// 
// 		return (filePath.equals(that.filePath) && fileName.equals(that.fileName) && line == that.line
// 				&& message.equals(that.message) && category.equals(that.category) && classification.equals(that.classification)
// 				&& priority.equals(that.priority) && type.equals(that.type) && ruleName.equals(that.ruleName));
// 	}
// 	
// 	/**
// 	 * HashCode for the FindBugsWarning.
// 	 */
// 	@Override
// 	public int hashCode() {
// 		return java.util.Objects.hash(filePath, fileName, type, line, message, category, priority, ruleName, classification);
// 	}
// 	
// 	/**
// 	 * toString method for FindBugsWarning.
// 	 */
// 	@Override
// 	public String toString() {
// 		return "FindBugsWarning [lineNumber=" + line + ", message=" + message + ", category=" + category
// 				+ ", priority=" + priority + ", classification="
// 				+ classification + ", fileName=" + fileName + ", type=" + type + ", filePath=" + filePath
// 				+ ", ruleName=" + ruleName + "]";
// 	}
// 	
// }


import java.io.File;
import java.io.IOException;
import java.util.List;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertSame;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import BlueTurtle.finders.ProjectInfoFinder;
import BlueTurtle.warnings.FindBugsWarning;
import BlueTurtle.warnings.Warning;
package BlueTurtle.parsers;





/**
 * Test class for FindBugsXMLParser.
 * 
 * @author BlueTurtle.
 *
 */
public class FindBugsXMLParserTest {

	private static String testSet2 = "./src/test/resources/exampleFindbugs1.xml";
	private static String srcDir = System.getProperty("user.dir") + "/src";

	private static String testSet2FileName = "FindBugsWarning.java";
	private static String testSet2RuleName = "HE_EQUALS_USE_HASHCODE";
	private static String testSet2Message = "BlueTurtle.warnings.FindBugsWarning defines equals and uses Object.hashCode()";
	private static String testSet2Category = "BAD_PRACTICE";
	private static String testSet2Priority = "High";
	private static String testSet2Classification = "Interface";
	private static String testSet3FilePath = System.getProperty("user.dir") + File.separatorChar + "src"
			+ File.separatorChar + "main" + File.separatorChar + "java" + File.separatorChar + "BlueTurtle"
			+ File.separatorChar + "warnings" + File.separatorChar + "FindBugsWarning.java";

	/**
	 * Set up the GDP parser, parse the category information.
	 * 
	 * @throws IOException
	 *             throws an exception while reading the files.
	 */
	@Before
	public void setUp() throws IOException {
		new ProjectInfoFinder().findFiles(new File(srcDir));
	}

	/**
	 * Clear the attributes of ProjectInfoFinder.
	 */
	@After
	public void tearDown() {
		ProjectInfoFinder.getClassLocs().clear();
		ProjectInfoFinder.getClassPackage().clear();
		ProjectInfoFinder.getClassPaths().clear();
		ProjectInfoFinder.getPackages().clear();

	}

	/**
	 * Test that the parser can parse a valid FindBugs output file.
	 */
	@Test
// Path: src/main/java/BlueTurtle/warnings/FindBugsWarning.java
// public class FindBugsWarning extends Warning {
// 
// 	
// 	@Getter @Setter private String category;
// 	@Getter @Setter private String priority;
// 
// 	
// 	/**
// 	 * Constructor.
// 	 * 
// 	 * @param filePath
// 	 *            the path to the file where the warning is located.
// 	 * @param filename
// 	 *            the name of the file where the warning is located.
// 	 * @param line
// 	 *            the line number where the warning is located.
// 	 * @param message
// 	 *            the message of the warning.
// 	 * @param category
// 	 *            the category of the warning.
// 	 * @param priority
// 	 *            the priority of the warning.            
// 	 * @param ruleName
// 	 *            the rule name of the warning.
// 	 * @param classification
// 	 *            of the violated rule of the warning.
// 	 */
// 	public FindBugsWarning(String filePath, String filename, int line, String message, String category, String priority, String ruleName, String classification) {
// 		super(filePath, filename, line, "FindBugs", ruleName, message, classification);
// 		setCategory(category);
// 		setPriority(priority);
// 	}
// 	
// 
// 	/**
// 	 * Check whether two FindBugs warnings are the same.
// 	 * 
// 	 * @param other
// 	 *            the other warning.
// 	 * @return a boolean
// 	 */
// 	@Override
// 	public boolean equals(Object other) {
// 
// 		if (!(other instanceof FindBugsWarning)) {
// 			return false;
// 		}
// 
// 		FindBugsWarning that = (FindBugsWarning) other;
// 
// 		return (filePath.equals(that.filePath) && fileName.equals(that.fileName) && line == that.line
// 				&& message.equals(that.message) && category.equals(that.category) && classification.equals(that.classification)
// 				&& priority.equals(that.priority) && type.equals(that.type) && ruleName.equals(that.ruleName));
// 	}
// 	
// 	/**
// 	 * HashCode for the FindBugsWarning.
// 	 */
// 	@Override
// 	public int hashCode() {
// 		return java.util.Objects.hash(filePath, fileName, type, line, message, category, priority, ruleName, classification);
// 	}
// 	
// 	/**
// 	 * toString method for FindBugsWarning.
// 	 */
// 	@Override
// 	public String toString() {
// 		return "FindBugsWarning [lineNumber=" + line + ", message=" + message + ", category=" + category
// 				+ ", priority=" + priority + ", classification="
// 				+ classification + ", fileName=" + fileName + ", type=" + type + ", filePath=" + filePath
// 				+ ", ruleName=" + ruleName + "]";
// 	}
// 	
// }


// Path: src/test/java/BlueTurtle/parsers/FindBugsXMLParserTest.java
import java.io.File;
import java.io.IOException;
import java.util.List;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertSame;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import BlueTurtle.finders.ProjectInfoFinder;
import BlueTurtle.warnings.FindBugsWarning;
import BlueTurtle.warnings.Warning;

package BlueTurtle.parsers;





/**
 * Test class for FindBugsXMLParser.
 * 
 * @author BlueTurtle.
 *
 */
public class FindBugsXMLParserTest {

	private static String testSet2 = "./src/test/resources/exampleFindbugs1.xml";
	private static String srcDir = System.getProperty("user.dir") + "/src";

	private static String testSet2FileName = "FindBugsWarning.java";
	private static String testSet2RuleName = "HE_EQUALS_USE_HASHCODE";
	private static String testSet2Message = "BlueTurtle.warnings.FindBugsWarning defines equals and uses Object.hashCode()";
	private static String testSet2Category = "BAD_PRACTICE";
	private static String testSet2Priority = "High";
	private static String testSet2Classification = "Interface";
	private static String testSet3FilePath = System.getProperty("user.dir") + File.separatorChar + "src"
			+ File.separatorChar + "main" + File.separatorChar + "java" + File.separatorChar + "BlueTurtle"
			+ File.separatorChar + "warnings" + File.separatorChar + "FindBugsWarning.java";

	/**
	 * Set up the GDP parser, parse the category information.
	 * 
	 * @throws IOException
	 *             throws an exception while reading the files.
	 */
	@Before
	public void setUp() throws IOException {
		new ProjectInfoFinder().findFiles(new File(srcDir));
	}

	/**
	 * Clear the attributes of ProjectInfoFinder.
	 */
	@After
	public void tearDown() {
		ProjectInfoFinder.getClassLocs().clear();
		ProjectInfoFinder.getClassPackage().clear();
		ProjectInfoFinder.getClassPaths().clear();
		ProjectInfoFinder.getPackages().clear();

	}

	/**
	 * Test that the parser can parse a valid FindBugs output file.
	 */
	@Test
	public void testParseCorrectBehaviour() {