Search in sources :

Example 6 with DependencyReader

use of de.dagere.peass.dependency.reader.DependencyReader in project peass by DaGeRe.

the class DependencyDetectorIT method testAddedClass.

@Test
public void testAddedClass() throws Exception {
    final File secondVersion = new File(DependencyTestConstants.VERSIONS_FOLDER, "added_class");
    final ChangeManager changeManager = DependencyDetectorTestUtil.mockAddedChangeManager();
    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.TestMeAlso", "defaultpackage.TestMeAlso", 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)

Example 7 with DependencyReader

use of de.dagere.peass.dependency.reader.DependencyReader in project peass by DaGeRe.

the class DependencyDetectorITGradle method testNormalChange.

// @org.junit.After
// public void cleanAfterwards() throws IOException {
// FileUtils.deleteDirectory(CURRENT);
// // be aware: maven does not compile if a .class-file is still in the resources, since it gets identified as test
// }
@Test
public void testNormalChange() throws IOException, InterruptedException, XmlPullParserException, ParseException, ViewNotFoundException {
    init(BASIC_STATE);
    final ChangeManager changeManager = DependencyDetectorTestUtil.defaultChangeManager();
    final VersionIterator fakeIterator = new FakeFileIterator(DependencyTestConstants.CURRENT, Arrays.asList(CHANGE));
    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 8 with DependencyReader

use of de.dagere.peass.dependency.reader.DependencyReader 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 9 with DependencyReader

use of de.dagere.peass.dependency.reader.DependencyReader 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 10 with DependencyReader

use of de.dagere.peass.dependency.reader.DependencyReader in project peass by DaGeRe.

the class DependencyDetectorIncludesTest method testNormalChangeIncluded.

@Test
public void testNormalChangeIncluded() throws IOException, InterruptedException, XmlPullParserException, ParseException, ViewNotFoundException {
    final ChangeManager changeManager = DependencyDetectorTestUtil.defaultChangeManager();
    final DependencyReader reader = executeWithInclude("defaultpackage.TestMe#testMe", DependencyTestConstants.NORMAL_CHANGE, changeManager);
    checkContainsOnlyTestMe(reader);
}
Also used : ChangeManager(de.dagere.peass.dependency.ChangeManager) DependencyReader(de.dagere.peass.dependency.reader.DependencyReader) Test(org.junit.jupiter.api.Test)

Aggregations

DependencyReader (de.dagere.peass.dependency.reader.DependencyReader)36 Test (org.junit.jupiter.api.Test)28 FakeFileIterator (de.dagere.peass.dependencytests.helper.FakeFileIterator)27 ChangeManager (de.dagere.peass.dependency.ChangeManager)26 VersionIterator (de.dagere.peass.vcs.VersionIterator)24 File (java.io.File)21 ExecutionConfig (de.dagere.peass.config.ExecutionConfig)11 ChangedEntity (de.dagere.peass.dependency.analysis.data.ChangedEntity)11 EnvironmentVariables (de.dagere.peass.execution.utils.EnvironmentVariables)11 PeassFolders (de.dagere.peass.folders.PeassFolders)11 ClazzChangeData (de.dagere.peass.dependency.changesreading.ClazzChangeData)10 KiekerConfig (de.dagere.peass.config.KiekerConfig)9 TreeMap (java.util.TreeMap)7 StaticTestSelection (de.dagere.peass.dependency.persistence.StaticTestSelection)6 TestSet (de.dagere.peass.dependency.analysis.data.TestSet)5 VersionKeeper (de.dagere.peass.dependency.reader.VersionKeeper)5 ResultsFolders (de.dagere.peass.folders.ResultsFolders)5 TestCase (de.dagere.peass.dependency.analysis.data.TestCase)4 GitUtils (de.dagere.peass.vcs.GitUtils)4 TestSelectionConfig (de.dagere.peass.config.TestSelectionConfig)3