use of de.dagere.peass.dependency.changesreading.ClazzChangeData in project peass by DaGeRe.
the class TestClassComparison method testImport.
@Test
public void testImport() throws ParseException, IOException, URISyntaxException {
final File file1 = new File(FOLDER, "TestImport_New.java");
final File file2 = new File(FOLDER, "TestImport_Old.java");
final ClazzChangeData changedMethods = new ClazzChangeData(new ChangedEntity("de.TestImport_new", ""));
FileComparisonUtil.getChangedMethods(file1, file2, changedMethods);
Assert.assertTrue(changedMethods.isChange());
MatcherAssert.assertThat(changedMethods.getChanges(), Matchers.hasItem(new ChangedEntity("de.Test", "")));
MatcherAssert.assertThat(changedMethods.getChanges(), Matchers.hasItem(new ChangedEntity("de.Test$InnerTest", "")));
}
use of de.dagere.peass.dependency.changesreading.ClazzChangeData in project peass by DaGeRe.
the class TestClassComparison method testChangeAndAddition2.
@Test
public void testChangeAndAddition2() throws ParseException, IOException {
final File file1 = new File(FOLDER, "Test1_1_Equal.java");
final File file2 = new File(FOLDER, "Test12_ChangeAndAddition2.java");
final ClazzChangeData changedMethods = new ClazzChangeData(new ChangedEntity("Test1_1_Equal", ""));
FileComparisonUtil.getChangedMethods(file1, file2, changedMethods);
Assert.assertTrue(changedMethods.isChange());
Assert.assertFalse(changedMethods.isOnlyMethodChange());
System.out.println(changedMethods.getChangedMethods());
MatcherAssert.assertThat(changedMethods.getChangedMethods().values().iterator().next(), Matchers.containsInAnyOrder("<init>", "doNonStaticThing"));
}
use of de.dagere.peass.dependency.changesreading.ClazzChangeData in project peass by DaGeRe.
the class TestClassComparison method test2.
@Test
public void test2() throws ParseException, IOException {
final File file1 = new File(FOLDER, "Test1_1_Equal.java");
final File file2 = new File(FOLDER, "Test2_2_Comments.java");
final ClazzChangeData changedMethods = new ClazzChangeData(new ChangedEntity("Test1_1_Equal", ""));
FileComparisonUtil.getChangedMethods(file1, file2, changedMethods);
Assert.assertFalse(changedMethods.isChange());
}
use of de.dagere.peass.dependency.changesreading.ClazzChangeData in project peass by DaGeRe.
the class TestClassComparison method test1.
@Test
public void test1() throws ParseException, IOException, URISyntaxException {
final File file1 = new File(FOLDER, "Test1_1_Equal.java");
final File file2 = new File(FOLDER, "Test1_2_Equal.java");
final ClazzChangeData changedMethods = new ClazzChangeData(new ChangedEntity("Test1_1_Equal", ""));
FileComparisonUtil.getChangedMethods(file1, file2, changedMethods);
Assert.assertFalse(changedMethods.isChange());
}
use of de.dagere.peass.dependency.changesreading.ClazzChangeData in project peass by DaGeRe.
the class TestClassComparison method testChangeAndAddition1.
@Test
public void testChangeAndAddition1() throws ParseException, IOException {
final File file1 = new File(FOLDER, "Test1_1_Equal.java");
final File file2 = new File(FOLDER, "Test11_ChangeAndAddition.java");
final ClazzChangeData changedMethods = new ClazzChangeData(new ChangedEntity("Test1_1_Equal", ""));
FileComparisonUtil.getChangedMethods(file1, file2, changedMethods);
Assert.assertTrue(changedMethods.isChange());
Assert.assertFalse(changedMethods.isOnlyMethodChange());
Map<String, Set<String>> changedMethods2 = changedMethods.getChangedMethods();
MatcherAssert.assertThat(changedMethods2.values().iterator().next(), Matchers.contains("<init>"));
}
Aggregations