use of de.dagere.peass.dependency.analysis.data.ChangedEntity 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.ChangedEntity in project peass by DaGeRe.
the class TestTestDependencies method testParameterChange.
private void testParameterChange(final TestDependencies dependencies, final String parameterizedMethod) {
HashMap<ChangedEntity, ClazzChangeData> changeTestMap = new HashMap<ChangedEntity, ClazzChangeData>();
ClazzChangeData classChangeData = new ClazzChangeData(new ChangedEntity("package.ClazzB", "moduleA"), true);
classChangeData.addChange("ClazzB", parameterizedMethod);
changeTestMap.put(new ChangedEntity("package.ClazzB", "moduleA"), classChangeData);
ChangeTestMapping changes = dependencies.getChangeTestMap(changeTestMap);
Assert.assertEquals(1, changes.getChanges().size());
}
use of de.dagere.peass.dependency.analysis.data.ChangedEntity 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.ChangedEntity in project peass by DaGeRe.
the class TestVersionDiff method testTestContainigPath.
@Test
public void testTestContainigPath() throws IOException {
createFile(TOMCAT_EXAMPLE);
createFile(NO_SOURCE_FOLDER);
VersionDiff diff = createVersionDiff();
ExecutionConfig config = new ExecutionConfig();
config.getClazzFolders().clear();
config.getClazzFolders().add("java");
config.getTestClazzFolders().clear();
config.getTestClazzFolders().add("test");
diff.addChange(TOMCAT_EXAMPLE, config);
diff.addChange(NO_SOURCE_FOLDER, config);
MatcherAssert.assertThat(diff.getChangedClasses(), IsIterableContaining.hasItem(new ChangedEntity("de.dagere.peass.CoyoteAdapter")));
MatcherAssert.assertThat(diff.getChangedClasses(), Matchers.not(IsIterableContaining.hasItem(new ChangedEntity("de.dagere.peass.Example2"))));
}
use of de.dagere.peass.dependency.analysis.data.ChangedEntity in project peass by DaGeRe.
the class TestMethodChangeLongMethodName method writeLongMethod.
public static ChangedEntity writeLongMethod(final File sourceFolder, final File methodSourceFolder) throws FileNotFoundException, IOException {
ChangedEntity longMethodEntity = new ChangedEntity("de.dagere.peass.analysis.properties.TestMethodChangeLongMethodName", "", "method");
longMethodEntity.createParameters("java.lang.String,java.lang.String,java.lang.String,java.lang.String,java.lang.String,java.lang.String," + "java.lang.String,java.lang.String,java.lang.String,java.lang.String");
MethodChangeReader reader = new MethodChangeReader(methodSourceFolder, sourceFolder, new File("."), longMethodEntity, VERSION, TEST_CONFIG);
reader.readMethodChangeData();
return longMethodEntity;
}
Aggregations