Search in sources :

Example 36 with DependencyReader

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

the class SuperclassDetectorIT method testSuperclassChange.

@Test
public void testSuperclassChange() throws IOException, InterruptedException, XmlPullParserException, ParseException, ViewNotFoundException, ClassNotFoundException, InstantiationException, IllegalAccessException, IllegalArgumentException, InvocationTargetException, NoSuchMethodException, SecurityException {
    final File secondVersion = new File(VERSIONS_FOLDER, "superclass_changed");
    final Map<ChangedEntity, ClazzChangeData> changes = new TreeMap<>();
    changes.put(new ChangedEntity("defaultpackage.NormalSuperclass", ""), new ClazzChangeData("defaultpackage.NormalSuperclass", false));
    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 = 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());
    reader.readInitialVersion();
    checkInitialDependencies(reader);
    fakeIterator.goToNextCommit();
    reader.analyseVersion(changeManager);
    checkFirstVersionDependencies(reader);
}
Also used : FakeFileIterator(de.dagere.peass.dependencytests.helper.FakeFileIterator) DependencyReader(de.dagere.peass.dependency.reader.DependencyReader) ChangedEntity(de.dagere.peass.dependency.analysis.data.ChangedEntity) ExecutionConfig(de.dagere.peass.config.ExecutionConfig) TreeMap(java.util.TreeMap) PeassFolders(de.dagere.peass.folders.PeassFolders) ChangeManager(de.dagere.peass.dependency.ChangeManager) ClazzChangeData(de.dagere.peass.dependency.changesreading.ClazzChangeData) EnvironmentVariables(de.dagere.peass.execution.utils.EnvironmentVariables) VersionIterator(de.dagere.peass.vcs.VersionIterator) File(java.io.File) KiekerConfig(de.dagere.peass.config.KiekerConfig) 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