Search in sources :

Example 31 with ClazzChangeData

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

the class TestClassComparison method test7.

@Test
public void test7() throws ParseException, IOException {
    final File file1 = new File(FOLDER, "Test1_1_Equal.java");
    final File file2 = new File(FOLDER, "Test7_MethodAdded.java");
    final ClazzChangeData changedMethods = new ClazzChangeData(new ChangedEntity("Test1_1_Equal", ""));
    FileComparisonUtil.getChangedMethods(file1, file2, changedMethods);
    Assert.assertTrue(changedMethods.isChange());
    Assert.assertFalse(changedMethods.isOnlyMethodChange());
}
Also used : ClazzChangeData(de.dagere.peass.dependency.changesreading.ClazzChangeData) ChangedEntity(de.dagere.peass.dependency.analysis.data.ChangedEntity) File(java.io.File) Test(org.junit.jupiter.api.Test)

Example 32 with ClazzChangeData

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

the class TestClassComparison method testStaticFieldChanged.

@Test
public void testStaticFieldChanged() throws ParseException, IOException {
    final File file1 = new File(FOLDER, "Test10_StaticFieldAdded.java");
    final File file2 = new File(FOLDER, "Test10_StaticFieldChanged.java");
    final ClazzChangeData changedMethods = new ClazzChangeData(new ChangedEntity("Test1_1_Equal", ""));
    FileComparisonUtil.getChangedMethods(file1, file2, changedMethods);
    Assert.assertTrue(changedMethods.isChange());
}
Also used : ClazzChangeData(de.dagere.peass.dependency.changesreading.ClazzChangeData) ChangedEntity(de.dagere.peass.dependency.analysis.data.ChangedEntity) File(java.io.File) Test(org.junit.jupiter.api.Test)

Example 33 with ClazzChangeData

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

the class TestClassComparison method test5.

@Test
public void test5() throws ParseException, IOException {
    final File file1 = new File(FOLDER, "Test1_1_Equal.java");
    final File file2 = new File(FOLDER, "Test5_2_Imports.java");
    final ClazzChangeData changedMethods = new ClazzChangeData(new ChangedEntity("Test1_1_Equal", ""));
    FileComparisonUtil.getChangedMethods(file1, file2, changedMethods);
    Assert.assertTrue(changedMethods.isChange());
}
Also used : ClazzChangeData(de.dagere.peass.dependency.changesreading.ClazzChangeData) ChangedEntity(de.dagere.peass.dependency.analysis.data.ChangedEntity) File(java.io.File) Test(org.junit.jupiter.api.Test)

Example 34 with ClazzChangeData

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

the class TestClassComparison method test8.

@Test
public void test8() throws ParseException, IOException {
    final File file1 = new File(FOLDER, "Test1_1_Equal.java");
    final File file2 = new File(FOLDER, "Test8_2_LineComments.java");
    final ClazzChangeData changedMethods = new ClazzChangeData(new ChangedEntity("Test1_1_Equal", ""));
    FileComparisonUtil.getChangedMethods(file1, file2, changedMethods);
    Assert.assertFalse(changedMethods.isChange());
}
Also used : ClazzChangeData(de.dagere.peass.dependency.changesreading.ClazzChangeData) ChangedEntity(de.dagere.peass.dependency.analysis.data.ChangedEntity) File(java.io.File) Test(org.junit.jupiter.api.Test)

Example 35 with ClazzChangeData

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

the class TestClassComparison method test9.

@Test
public void test9() throws ParseException, IOException {
    final File file1 = new File(FOLDER, "Test1_1_Equal.java");
    final File file2 = new File(FOLDER, "Test9_FieldAdded.java");
    final ClazzChangeData changedMethods = new ClazzChangeData(new ChangedEntity("Test1_1_Equal", ""));
    FileComparisonUtil.getChangedMethods(file1, file2, changedMethods);
    Assert.assertTrue(changedMethods.isChange());
}
Also used : ClazzChangeData(de.dagere.peass.dependency.changesreading.ClazzChangeData) ChangedEntity(de.dagere.peass.dependency.analysis.data.ChangedEntity) File(java.io.File) 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