Search in sources :

Example 41 with ClazzChangeData

use of de.dagere.peass.dependency.changesreading.ClazzChangeData in project peass by DaGeRe.

the class TestTestDependencies method testNonParameterChange.

private void testNonParameterChange(final TestDependencies dependencies) {
    HashMap<ChangedEntity, ClazzChangeData> changeTestMap = new HashMap<ChangedEntity, ClazzChangeData>();
    ClazzChangeData classChangeData = new ClazzChangeData(new ChangedEntity("package.ClazzB", "moduleA"), true);
    classChangeData.addChange("ClazzB", "methodB");
    changeTestMap.put(new ChangedEntity("package.ClazzB", "moduleA"), classChangeData);
    ChangeTestMapping changes = dependencies.getChangeTestMap(changeTestMap);
    Assert.assertEquals(1, changes.getChanges().size());
}
Also used : ClazzChangeData(de.dagere.peass.dependency.changesreading.ClazzChangeData) HashMap(java.util.HashMap) ChangeTestMapping(de.dagere.peass.dependency.analysis.data.ChangeTestMapping) ChangedEntity(de.dagere.peass.dependency.analysis.data.ChangedEntity)

Example 42 with ClazzChangeData

use of de.dagere.peass.dependency.changesreading.ClazzChangeData in project peass by DaGeRe.

the class TestTestDependencies method testClassLevelChange.

@Test
public void testClassLevelChange() {
    TestDependencies dependencies = buildTestDependencies();
    HashMap<ChangedEntity, ClazzChangeData> changes = new HashMap<ChangedEntity, ClazzChangeData>();
    ClazzChangeData clazzChangeData = new ClazzChangeData(new ChangedEntity("package.ClazzA", "moduleA"), false);
    clazzChangeData.addChange("ClazzA", "methodB");
    changes.put(new ChangedEntity("package.ClazzA", "moduleA"), clazzChangeData);
    ChangeTestMapping changeTestMap = dependencies.getChangeTestMap(changes);
    Set<ChangedEntity> changedClazzes = changeTestMap.getChanges().keySet();
    MatcherAssert.assertThat(changedClazzes, IsIterableContaining.hasItem(new ChangedEntity("package.ClazzA", "moduleA", "methodB")));
    MatcherAssert.assertThat(changeTestMap.getChanges().get(new ChangedEntity("package.ClazzA", "moduleA", "methodB")), IsIterableContaining.hasItem(testEntity));
    MatcherAssert.assertThat(changeTestMap.getChanges().get(new ChangedEntity("package.ClazzA", "moduleA")), IsIterableContaining.hasItem(testEntity));
}
Also used : ClazzChangeData(de.dagere.peass.dependency.changesreading.ClazzChangeData) HashMap(java.util.HashMap) ChangeTestMapping(de.dagere.peass.dependency.analysis.data.ChangeTestMapping) ChangedEntity(de.dagere.peass.dependency.analysis.data.ChangedEntity) TestDependencies(de.dagere.peass.dependency.analysis.data.TestDependencies) Test(org.junit.jupiter.api.Test)

Aggregations

ClazzChangeData (de.dagere.peass.dependency.changesreading.ClazzChangeData)42 ChangedEntity (de.dagere.peass.dependency.analysis.data.ChangedEntity)41 Test (org.junit.jupiter.api.Test)26 File (java.io.File)25 ChangeManager (de.dagere.peass.dependency.ChangeManager)17 DependencyReader (de.dagere.peass.dependency.reader.DependencyReader)10 FakeFileIterator (de.dagere.peass.dependencytests.helper.FakeFileIterator)10 VersionIterator (de.dagere.peass.vcs.VersionIterator)9 TreeMap (java.util.TreeMap)9 HashMap (java.util.HashMap)7 PeassFolders (de.dagere.peass.folders.PeassFolders)5 ExecutionConfig (de.dagere.peass.config.ExecutionConfig)4 KiekerConfig (de.dagere.peass.config.KiekerConfig)4 EnvironmentVariables (de.dagere.peass.execution.utils.EnvironmentVariables)4 ChangeTestMapping (de.dagere.peass.dependency.analysis.data.ChangeTestMapping)3 StaticTestSelection (de.dagere.peass.dependency.persistence.StaticTestSelection)3 Map (java.util.Map)3 Set (java.util.Set)3 TestCase (de.dagere.peass.dependency.analysis.data.TestCase)2 TestSet (de.dagere.peass.dependency.analysis.data.TestSet)2