use of de.dagere.peass.dependency.analysis.data.VersionDiff in project peass by DaGeRe.
the class JmhDependencyReaderTest method mockIterator.
private FakeFileIterator mockIterator() {
List<File> versionList = Arrays.asList(JmhTestConstants.BASIC_VERSION, JmhTestConstants.SLOWER_VERSION);
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;
}
use of de.dagere.peass.dependency.analysis.data.VersionDiff in project peass by DaGeRe.
the class ChangeManager method getChangedClasses.
/**
* Returns a set of the full qualified names of all classes that have been changed in the current revision.
*
* @return full qualified names of all classes that have been changed in the current revision.
* @throws XmlPullParserException
* @throws IOException
* @throws FileNotFoundException
*/
private List<ChangedEntity> getChangedClasses(final String lastVersion) throws FileNotFoundException, IOException, XmlPullParserException {
List<File> moduleFiles = testExecutor.getModules().getModules();
final VersionDiff diff = iterator.getChangedClasses(folders.getProjectFolder(), moduleFiles, lastVersion, config);
LOG.info("Changed classes: " + diff.getChangedClasses().size());
return diff.getChangedClasses();
}
use of de.dagere.peass.dependency.analysis.data.VersionDiff in project peass by DaGeRe.
the class DependencyViewGeneratorTest method mockIterator.
private FakeFileIterator mockIterator() {
List<File> versionList = Arrays.asList(TraceGettingIT.BASIC, TraceGettingIT.REPETITION);
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/viewtest/TestMe.java", defaultConfig);
Mockito.doReturn(fakedDiff).when(iteratorspied).getChangedClasses(Mockito.any(), Mockito.any(), Mockito.any(), Mockito.any());
return iteratorspied;
}
use of de.dagere.peass.dependency.analysis.data.VersionDiff in project peass by DaGeRe.
the class TestVersionDiff method testJavaContainigPath.
@Test
public void testJavaContainigPath() throws IOException {
createFile(JAVA_PATH_FILE);
createFile(NO_SOURCE_FOLDER);
VersionDiff diff = createVersionDiff();
ExecutionConfig config = new ExecutionConfig();
config.getClazzFolders().clear();
config.getClazzFolders().add("java");
diff.addChange(JAVA_PATH_FILE, config);
diff.addChange(NO_SOURCE_FOLDER, config);
MatcherAssert.assertThat(diff.getChangedClasses(), IsIterableContaining.hasItem(new ChangedEntity("de.dagere.peass.Example")));
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 testRegularMavenPath.
@Test
public void testRegularMavenPath() throws IOException {
createFile(MAVEN_PATH_FILE);
createFile(NO_SOURCE_FOLDER);
VersionDiff diff = createVersionDiff();
ExecutionConfig config = new ExecutionConfig();
diff.addChange(MAVEN_PATH_FILE, config);
diff.addChange(NO_SOURCE_FOLDER, config);
MatcherAssert.assertThat(diff.getChangedClasses(), IsIterableContaining.hasItem(new ChangedEntity("de.dagere.peass.Example")));
}
Aggregations