eu.stamp.project.assertfixer.Configuration Maven / Gradle / Ivy
package eu.stamp.project.assertfixer;
import java.io.File;
import java.io.FileNotFoundException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* Created by Benjamin DANGLOT
* [email protected]
* on 20/03/18
*/
public class Configuration {
private String classpath;
private String fullQualifiedFailingTestClass;
private List failingTestMethods;
private List pathToSourceFolder;
private List pathToTestFolder;
private boolean verbose;
private String output;
private Map> multipleTestCases;
private boolean genTryCatch;
public String getSourceOutputDirectory() {
return this.output + "/spooned";
}
public String getBinaryOutputDirectory() {
return this.output + "/spooned-classes/";
}
public String getClasspath() {
return classpath;
}
public void setClasspath(String classpath) {
this.classpath = classpath;
}
public String getFullQualifiedFailingTestClass() {
return fullQualifiedFailingTestClass;
}
public void setFullQualifiedFailingTestClass(String fullQualifiedFailingTestClass) {
this.fullQualifiedFailingTestClass = fullQualifiedFailingTestClass;
}
public List getFailingTestMethods() {
return failingTestMethods;
}
public void setFailingTestMethods(List failingTestMethods) {
this.failingTestMethods = failingTestMethods;
}
public List getPathToSourceFolder() {
return pathToSourceFolder;
}
public void setPathToSourceFolder(List pathToSourceFolder) {
for (String path : pathToSourceFolder) {
if (!new File(path).exists()) {
throw new RuntimeException("All paths to source folder must be existing", new FileNotFoundException(path+" does not exist."));
}
}
this.pathToSourceFolder = new ArrayList<>(pathToSourceFolder);
}
public List getPathToTestFolder() {
return pathToTestFolder;
}
public void setPathToTestFolder(List pathToTestFolder) {
for (String path : pathToTestFolder) {
if (!new File(path).exists()) {
throw new RuntimeException("All paths to test folder must be existing", new FileNotFoundException(path+" does not exist."));
}
}
this.pathToTestFolder = new ArrayList<>(pathToTestFolder);
}
public boolean isVerbose() {
return verbose;
}
public void setVerbose(boolean verbose) {
this.verbose = verbose;
}
public String getOutput() {
return output;
}
public void setOutput(String output) {
this.output = output;
}
public Map> getMultipleTestCases() {
return multipleTestCases;
}
public void setMultipleTestCases(Map> multipleTestCases) {
this.multipleTestCases = new HashMap<>(multipleTestCases);
}
public boolean isGenTryCatch() {
return genTryCatch;
}
public void setGenTryCatch(boolean genTryCatch) {
this.genTryCatch = genTryCatch;
}
@Override
public String toString() {
return "Configuration{" +
"classpath='" + classpath + '\'' +
", fullQualifiedFailingTestClass='" + fullQualifiedFailingTestClass + '\'' +
", failingTestMethods=" + failingTestMethods +
", pathToSourceFolder='" + pathToSourceFolder + '\'' +
", pathToTestFolder='" + pathToTestFolder + '\'' +
", verbose=" + verbose +
", output='" + output + '\'' +
'}';
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy