use of de.dagere.peass.dependency.analysis.data.VersionDiff 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.VersionDiff in project peass by DaGeRe.
the class TestVersionDiff method createVersionDiff.
private VersionDiff createVersionDiff() {
List<File> modules = new LinkedList<>();
modules.add(tempDir);
VersionDiff diff = new VersionDiff(modules, tempDir);
return diff;
}
use of de.dagere.peass.dependency.analysis.data.VersionDiff in project peass by DaGeRe.
the class GitUtils method getDiffFromProcess.
private static VersionDiff getDiffFromProcess(final Process p, final List<File> modules, final File projectFolder, final ExecutionConfig config) {
final VersionDiff diff = new VersionDiff(modules, projectFolder);
final String output = StreamGobbler.getFullProcess(p, false);
for (final String line : output.split("\n")) {
diff.addChange(line, config);
}
return diff;
}
use of de.dagere.peass.dependency.analysis.data.VersionDiff in project peass by DaGeRe.
the class PropertyReadHelper method identifyAffectedClasses.
private void identifyAffectedClasses(final ChangeProperty property, final Set<String> calls) throws FileNotFoundException, IOException {
List<File> modules = testExecutor.getModules().getModules();
final VersionDiff diff = GitUtils.getChangedFiles(projectFolder, modules, version, config);
removeUncalledClasses(calls, diff);
property.setAffectedClasses(diff.getChangedClasses().size());
final int changedLines = GitUtils.getChangedLines(projectFolder, version, diff.getChangedClasses(), config);
property.setAffectedLines(changedLines);
}
use of de.dagere.peass.dependency.analysis.data.VersionDiff in project peass by DaGeRe.
the class JmhDependencyReaderMultiParamTest method mockIterator.
private FakeFileIterator mockIterator() {
List<File> versionList = Arrays.asList(JmhTestConstants.MULTIPARAM_VERSION, JmhTestConstants.MULTIPARAM_VERSION_CHANGE);
FakeFileIterator fakeIterator = new FakeFileIterator(TestConstants.CURRENT_FOLDER, versionList);
fakeIterator.goToFirstCommit();
FakeFileIterator iteratorspied = Mockito.spy(fakeIterator);
VersionDiff fakedDiff = new VersionDiff(Arrays.asList(TestConstants.CURRENT_FOLDER), TestConstants.CURRENT_FOLDER);
ExecutionConfig defaultConfig = new ExecutionConfig();
fakedDiff.addChange("src/test/java/de/dagere/peass/ExampleBenchmark.java", defaultConfig);
Mockito.doReturn(fakedDiff).when(iteratorspied).getChangedClasses(Mockito.any(), Mockito.any(), Mockito.any(), Mockito.any());
return iteratorspied;
}
Aggregations