use of de.dagere.peass.dependency.analysis.data.TestDependencies in project peass by DaGeRe.
the class TestTestDependencies method buildTestDependencies.
private TestDependencies buildTestDependencies() {
TestDependencies dependencies = new TestDependencies();
HashMap<ChangedEntity, Set<String>> calledClasses = new HashMap<>();
Set<String> methods = new HashSet<>();
methods.add("testA");
calledClasses.put(new ChangedEntity("package.ClazzA", "moduleA"), methods);
Set<String> methodsB = new HashSet<>();
methodsB.add("methodB");
methodsB.add("methodC(int)");
calledClasses.put(new ChangedEntity("package.ClazzB", "moduleA"), methodsB);
dependencies.addDependencies(testEntity, calledClasses);
return dependencies;
}
use of de.dagere.peass.dependency.analysis.data.TestDependencies in project peass by DaGeRe.
the class TestTestDependencies method testAddingFQNParameter.
@Test
public void testAddingFQNParameter() {
TestDependencies dependencies = buildTestDependenciesFQN();
Set<String> calledMethods = dependencies.getDependencyMap().get(testEntity).getCalledMethods().get(new ChangedEntity("package.ClazzB", "moduleA"));
MatcherAssert.assertThat(calledMethods, IsIterableContaining.hasItem("methodC(java.lang.Integer)"));
MatcherAssert.assertThat(calledMethods, IsIterableContaining.hasItem("methodB"));
testNonParameterChange(dependencies);
testParameterChange(dependencies, "methodC(java.lang.Integer)");
}
use of de.dagere.peass.dependency.analysis.data.TestDependencies in project peass by DaGeRe.
the class TestTestDependencies method testBasicAdding.
@Test
public void testBasicAdding() {
TestDependencies dependencies = buildTestDependencies();
Set<String> calledMethods = dependencies.getDependencyMap().get(testEntity).getCalledMethods().get(new ChangedEntity("package.ClazzB", "moduleA"));
MatcherAssert.assertThat(calledMethods, IsIterableContaining.hasItem("methodC(int)"));
MatcherAssert.assertThat(calledMethods, IsIterableContaining.hasItem("methodB"));
testNonParameterChange(dependencies);
testParameterChange(dependencies, "methodC(int)");
}
use of de.dagere.peass.dependency.analysis.data.TestDependencies in project peass by DaGeRe.
the class TestTestDependencies method buildTestDependenciesFQN.
private TestDependencies buildTestDependenciesFQN() {
TestDependencies dependencies = new TestDependencies();
HashMap<ChangedEntity, Set<String>> calledClasses = new HashMap<>();
Set<String> methods = new HashSet<>();
methods.add("testA");
calledClasses.put(new ChangedEntity("package.ClazzA", "moduleA"), methods);
Set<String> methodsB = new HashSet<>();
methodsB.add("methodB");
methodsB.add("methodC(java.lang.Integer)");
calledClasses.put(new ChangedEntity("package.ClazzB", "moduleA"), methodsB);
dependencies.addDependencies(testEntity, calledClasses);
return dependencies;
}
use of de.dagere.peass.dependency.analysis.data.TestDependencies in project peass by DaGeRe.
the class TestTestDependencies method testClassLevelChange.
@Test
public void testClassLevelChange() {
TestDependencies dependencies = buildTestDependencies();
HashMap<ChangedEntity, ClazzChangeData> changes = new HashMap<ChangedEntity, ClazzChangeData>();
ClazzChangeData clazzChangeData = new ClazzChangeData(new ChangedEntity("package.ClazzA", "moduleA"), false);
clazzChangeData.addChange("ClazzA", "methodB");
changes.put(new ChangedEntity("package.ClazzA", "moduleA"), clazzChangeData);
ChangeTestMapping changeTestMap = dependencies.getChangeTestMap(changes);
Set<ChangedEntity> changedClazzes = changeTestMap.getChanges().keySet();
MatcherAssert.assertThat(changedClazzes, IsIterableContaining.hasItem(new ChangedEntity("package.ClazzA", "moduleA", "methodB")));
MatcherAssert.assertThat(changeTestMap.getChanges().get(new ChangedEntity("package.ClazzA", "moduleA", "methodB")), IsIterableContaining.hasItem(testEntity));
MatcherAssert.assertThat(changeTestMap.getChanges().get(new ChangedEntity("package.ClazzA", "moduleA")), IsIterableContaining.hasItem(testEntity));
}
Aggregations