Search in sources :

Example 6 with FakeFileIterator

use of de.dagere.peass.dependencytests.helper.FakeFileIterator 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 FakeFileIterator

use of de.dagere.peass.dependencytests.helper.FakeFileIterator 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 FakeFileIterator

use of de.dagere.peass.dependencytests.helper.FakeFileIterator 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 FakeFileIterator

use of de.dagere.peass.dependencytests.helper.FakeFileIterator 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 FakeFileIterator

use of de.dagere.peass.dependencytests.helper.FakeFileIterator 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

FakeFileIterator (de.dagere.peass.dependencytests.helper.FakeFileIterator)30 DependencyReader (de.dagere.peass.dependency.reader.DependencyReader)27 Test (org.junit.jupiter.api.Test)25 ChangeManager (de.dagere.peass.dependency.ChangeManager)23 VersionIterator (de.dagere.peass.vcs.VersionIterator)23 File (java.io.File)19 ExecutionConfig (de.dagere.peass.config.ExecutionConfig)13 ChangedEntity (de.dagere.peass.dependency.analysis.data.ChangedEntity)11 ClazzChangeData (de.dagere.peass.dependency.changesreading.ClazzChangeData)10 EnvironmentVariables (de.dagere.peass.execution.utils.EnvironmentVariables)8 PeassFolders (de.dagere.peass.folders.PeassFolders)8 KiekerConfig (de.dagere.peass.config.KiekerConfig)7 TreeMap (java.util.TreeMap)7 TestSet (de.dagere.peass.dependency.analysis.data.TestSet)5 TestCase (de.dagere.peass.dependency.analysis.data.TestCase)4 StaticTestSelection (de.dagere.peass.dependency.persistence.StaticTestSelection)4 ResultsFolders (de.dagere.peass.folders.ResultsFolders)4 GitUtils (de.dagere.peass.vcs.GitUtils)4 TestSelectionConfig (de.dagere.peass.config.TestSelectionConfig)3 VersionDiff (de.dagere.peass.dependency.analysis.data.VersionDiff)3