de.dagere.peass.dependency.analysis.data.TestExistenceChanges Maven / Gradle / Ivy
package de.dagere.peass.dependency.analysis.data;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
import java.util.TreeMap;
import java.util.TreeSet;
/**
* Manages data about test existence changes, i.e. tests that are added or removed
*
* @author reichelt
*
*/
public class TestExistenceChanges {
//Map from dependency (fqn) -> testcase
private final Map> addedTests = new TreeMap<>();
private final Set removedTests = new HashSet<>();
public Map> getAddedTests() {
return addedTests;
}
public Set getRemovedTests() {
return removedTests;
}
public void addRemovedTest(TestCase testcase) {
removedTests.add(testcase);
}
public void addAddedTest(ChangedEntity changedEntity, ChangedEntity testcase) {
Set testcaseSet = addedTests.get(changedEntity);
if (testcaseSet == null) {
testcaseSet = new TreeSet<>();
addedTests.put(changedEntity, testcaseSet);
}
testcaseSet.add(testcase);
}
}