use of de.dagere.peass.dependency.reader.DependencyReader in project peass by DaGeRe.
the class DependencyDetectorJUnit5IT method testNormalChange.
@Test
public void testNormalChange() throws IOException, InterruptedException, XmlPullParserException, ParseException, ViewNotFoundException {
final ChangeManager changeManager = DependencyDetectorTestUtil.defaultChangeManager();
final VersionIterator fakeIterator = new FakeFileIterator(DependencyTestConstants.CURRENT, Arrays.asList(NORMAL_CHANGE));
final DependencyReader reader = DependencyDetectorTestUtil.readTwoVersions(changeManager, fakeIterator);
System.out.println(Constants.OBJECTMAPPER.writeValueAsString(reader.getDependencies()));
DependencyDetectorTestUtil.checkTestMeAlsoTestChange(reader, "defaultpackage.NormalDependency#executeThing", "defaultpackage.TestMe", DependencyTestConstants.VERSION_1);
}
use of de.dagere.peass.dependency.reader.DependencyReader in project peass by DaGeRe.
the class DependencyDetectorMultimoduleIT method testTwoChanges.
@Test
public void testTwoChanges() throws IOException, XmlPullParserException, InterruptedException, ParseException, ViewNotFoundException {
final File thirdVersion = new File(VERSIONS_FOLDER, "another_change");
final VersionIterator fakeIterator = new FakeFileIterator(DependencyTestConstants.CURRENT, Arrays.asList(thirdVersion));
ChangeManager changeManager = mockChangeManager();
final DependencyReader reader = new DependencyReader(DependencyTestConstants.DEFAULT_CONFIG_NO_VIEWS, new PeassFolders(DependencyTestConstants.CURRENT), DependencyTestConstants.NULL_RESULTS_FOLDERS, null, fakeIterator, changeManager, new ExecutionConfig(5), new KiekerConfig(true), new EnvironmentVariables());
final boolean success = reader.readInitialVersion();
Assert.assertTrue(success);
StaticTestSelection dependencies = reader.getDependencies();
checkInitialVersion(dependencies);
fakeIterator.goToNextCommit();
reader.analyseVersion(changeManager);
testFirstChange(dependencies);
testSecondChange(dependencies);
}
use of de.dagere.peass.dependency.reader.DependencyReader in project peass by DaGeRe.
the class DependencyDetectorNoUpdateIT method testNormalChange.
@Test
public void testNormalChange() throws IOException, InterruptedException, XmlPullParserException, ParseException, ViewNotFoundException {
final File secondVersion = new File(DependencyTestConstants.VERSIONS_FOLDER, "normal_change");
final ChangeManager changeManager = DependencyDetectorTestUtil.defaultChangeManager();
final VersionIterator fakeIterator = new FakeFileIterator(DependencyTestConstants.CURRENT, Arrays.asList(secondVersion));
final DependencyReader reader = DependencyDetectorTestUtil.readTwoVersions(changeManager, fakeIterator);
System.out.println(reader.getDependencies());
DependencyDetectorTestUtil.checkTestMeAlsoTestChange(reader, "defaultpackage.NormalDependency#executeThing", "defaultpackage.TestMe", DependencyTestConstants.VERSION_1);
}
use of de.dagere.peass.dependency.reader.DependencyReader in project peass by DaGeRe.
the class DependencyDetectorNoUpdateIT method testTestChange.
@Test
public void testTestChange() throws IOException, InterruptedException, XmlPullParserException, ParseException, ViewNotFoundException {
final File secondVersion = new File(DependencyTestConstants.VERSIONS_FOLDER, "changed_test");
final Map<ChangedEntity, ClazzChangeData> changes = new TreeMap<>();
DependencyDetectorTestUtil.addChange(changes, "", "defaultpackage.TestMe", "testMe");
final ChangeManager changeManager = Mockito.mock(ChangeManager.class);
Mockito.when(changeManager.getChanges(Mockito.any())).thenReturn(changes);
final VersionIterator fakeIterator = new FakeFileIterator(DependencyTestConstants.CURRENT, Arrays.asList(secondVersion));
final DependencyReader reader = DependencyDetectorTestUtil.readTwoVersions(changeManager, fakeIterator);
System.out.println(reader.getDependencies().getVersions().get(DependencyTestConstants.VERSION_1));
DependencyDetectorTestUtil.checkTestMeAlsoTestChange(reader, "defaultpackage.TestMe#testMe", "defaultpackage.TestMe", DependencyTestConstants.VERSION_1);
}
use of de.dagere.peass.dependency.reader.DependencyReader in project peass by DaGeRe.
the class DependencyDetectorOneCallWriterIT method testNormalChange.
@Test
public void testNormalChange() throws Exception {
final ChangeManager changeManager = DependencyDetectorTestUtil.defaultChangeManager();
final VersionIterator fakeIterator = new FakeFileIterator(DependencyTestConstants.CURRENT, Arrays.asList(DependencyTestConstants.NORMAL_CHANGE));
final DependencyReader reader = readTwoVersions(changeManager, fakeIterator);
System.out.println(reader.getDependencies());
DependencyDetectorTestUtil.checkTestMeAlsoTestChange(reader, "defaultpackage.NormalDependency#executeThing", "defaultpackage.TestMe", DependencyTestConstants.VERSION_1);
}
Aggregations