Search in sources :

Example 6 with VersionIterator

use of de.dagere.peass.vcs.VersionIterator in project peass by DaGeRe.

the class DependencyDetectorITGradle method testNormalChangeAndroid.

@Test
public void testNormalChangeAndroid() throws IOException, InterruptedException, XmlPullParserException, ParseException, ViewNotFoundException {
    init(BASIC_STATE_ANDROID);
    final ChangeManager changeManager = DependencyDetectorTestUtil.defaultChangeManager();
    final VersionIterator fakeIterator = new FakeFileIterator(DependencyTestConstants.CURRENT, Arrays.asList(CHANGE_ANDROID));
    final DependencyReader reader = DependencyDetectorTestUtil.readTwoVersions(changeManager, fakeIterator);
    DependencyDetectorTestUtil.checkTestMeAlsoTestChange(reader, "defaultpackage.NormalDependency#executeThing", "defaultpackage.TestMe", DependencyTestConstants.VERSION_1);
}
Also used : ChangeManager(de.dagere.peass.dependency.ChangeManager) FakeFileIterator(de.dagere.peass.dependencytests.helper.FakeFileIterator) DependencyReader(de.dagere.peass.dependency.reader.DependencyReader) VersionIterator(de.dagere.peass.vcs.VersionIterator) Test(org.junit.jupiter.api.Test)

Example 7 with VersionIterator

use of de.dagere.peass.vcs.VersionIterator in project peass by DaGeRe.

the class DependencyDetectorIncludesTest method executeWithInclude.

private DependencyReader executeWithInclude(final String includeName, final File secondVersion, final ChangeManager changeManager) throws IOException, InterruptedException, XmlPullParserException, ParseException, ViewNotFoundException {
    final VersionIterator fakeIterator = new FakeFileIterator(DependencyTestConstants.CURRENT, Arrays.asList(secondVersion));
    ExecutionConfig config = new ExecutionConfig(5);
    config.getIncludes().add(includeName);
    final DependencyReader reader = DependencyDetectorTestUtil.readTwoVersions(changeManager, fakeIterator, config, DependencyTestConstants.DEFAULT_CONFIG_NO_VIEWS, DependencyTestConstants.NULL_RESULTS_FOLDERS);
    return reader;
}
Also used : FakeFileIterator(de.dagere.peass.dependencytests.helper.FakeFileIterator) DependencyReader(de.dagere.peass.dependency.reader.DependencyReader) VersionIterator(de.dagere.peass.vcs.VersionIterator) ExecutionConfig(de.dagere.peass.config.ExecutionConfig)

Example 8 with VersionIterator

use of de.dagere.peass.vcs.VersionIterator 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);
}
Also used : ChangeManager(de.dagere.peass.dependency.ChangeManager) FakeFileIterator(de.dagere.peass.dependencytests.helper.FakeFileIterator) DependencyReader(de.dagere.peass.dependency.reader.DependencyReader) VersionIterator(de.dagere.peass.vcs.VersionIterator) Test(org.junit.jupiter.api.Test)

Example 9 with VersionIterator

use of de.dagere.peass.vcs.VersionIterator 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);
}
Also used : ChangeManager(de.dagere.peass.dependency.ChangeManager) FakeFileIterator(de.dagere.peass.dependencytests.helper.FakeFileIterator) EnvironmentVariables(de.dagere.peass.execution.utils.EnvironmentVariables) DependencyReader(de.dagere.peass.dependency.reader.DependencyReader) VersionIterator(de.dagere.peass.vcs.VersionIterator) ExecutionConfig(de.dagere.peass.config.ExecutionConfig) File(java.io.File) KiekerConfig(de.dagere.peass.config.KiekerConfig) PeassFolders(de.dagere.peass.folders.PeassFolders) StaticTestSelection(de.dagere.peass.dependency.persistence.StaticTestSelection) Test(org.junit.jupiter.api.Test)

Example 10 with VersionIterator

use of de.dagere.peass.vcs.VersionIterator 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);
}
Also used : ChangeManager(de.dagere.peass.dependency.ChangeManager) FakeFileIterator(de.dagere.peass.dependencytests.helper.FakeFileIterator) DependencyReader(de.dagere.peass.dependency.reader.DependencyReader) VersionIterator(de.dagere.peass.vcs.VersionIterator) File(java.io.File) Test(org.junit.jupiter.api.Test)

Aggregations

VersionIterator (de.dagere.peass.vcs.VersionIterator)27 DependencyReader (de.dagere.peass.dependency.reader.DependencyReader)24 ChangeManager (de.dagere.peass.dependency.ChangeManager)23 FakeFileIterator (de.dagere.peass.dependencytests.helper.FakeFileIterator)23 Test (org.junit.jupiter.api.Test)22 File (java.io.File)15 ChangedEntity (de.dagere.peass.dependency.analysis.data.ChangedEntity)10 ClazzChangeData (de.dagere.peass.dependency.changesreading.ClazzChangeData)9 ExecutionConfig (de.dagere.peass.config.ExecutionConfig)7 TreeMap (java.util.TreeMap)7 TestSet (de.dagere.peass.dependency.analysis.data.TestSet)5 EnvironmentVariables (de.dagere.peass.execution.utils.EnvironmentVariables)5 PeassFolders (de.dagere.peass.folders.PeassFolders)5 KiekerConfig (de.dagere.peass.config.KiekerConfig)4 TestCase (de.dagere.peass.dependency.analysis.data.TestCase)4 StaticTestSelection (de.dagere.peass.dependency.persistence.StaticTestSelection)4 OneReader (de.dagere.peass.dependency.parallel.OneReader)2 VersionIteratorGit (de.dagere.peass.vcs.VersionIteratorGit)2 VersionStaticSelection (de.dagere.peass.dependency.persistence.VersionStaticSelection)1 FirstRunningVersionFinder (de.dagere.peass.dependency.reader.FirstRunningVersionFinder)1