Skip to content

Commit

Permalink
Add test for commit
Browse files Browse the repository at this point in the history
  • Loading branch information
tsantalis committed Sep 25, 2024
1 parent 08fbf91 commit a363c50
Show file tree
Hide file tree
Showing 18 changed files with 10,750 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -1007,7 +1007,8 @@ public void testRestructuredStatementMappings19() throws Exception {
"https://github.com/eclipse/jetty.project.git, c285d6f8bbd839906e8c39d23db2f343be22c6ca, send, true, jetty.project-c285d6f8bbd839906e8c39d23db2f343be22c6ca.txt", // TODO L115-116 should be matched with R127-128
"https://github.com/spring-framework.git, b204437cef0976f5af0e1c5290e77e266b306a51, writeWithMessageConverters, true, spring-framework-b204437cef0976f5af0e1c5290e77e266b306a51.txt",
"https://github.com/spring-framework.git, 0a42c80c1151380f7f492ec75de5648cfe62d250, processConfigBeanDefinitions, true, spring-framework-0a42c80c1151380f7f492ec75de5648cfe62d250.txt",
"https://github.com/javaparser/javaparser.git, de5c17c37f15a1c134f518ed2754974cc4b9aa15, apply, true, javaparser-de5c17c37f15a1c134f518ed2754974cc4b9aa15.txt"
"https://github.com/javaparser/javaparser.git, de5c17c37f15a1c134f518ed2754974cc4b9aa15, apply, true, javaparser-de5c17c37f15a1c134f518ed2754974cc4b9aa15.txt",
"https://github.com/hibernate/hibernate-orm.git, 8577a68e69d30d9e671024bf3330616000a3ec54, processElementAnnotations, true, hibernate-orm-8577a68e69d30d9e671024bf3330616000a3ec54.txt"
})
public void testRestructuredStatementMappings(String url, String commitId, String containerName, boolean breakOnFirstMatch, String testResultFileName) throws Exception {
GitHistoryRefactoringMinerImpl miner = new GitHistoryRefactoringMinerImpl();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2188,6 +2188,24 @@ public void testRestructuredStatementMappings19() throws Exception {
Assert.assertTrue(expected.size() == actual.size() && expected.containsAll(actual) && actual.containsAll(expected));
}

@Test
public void testRestructuredStatementMappings20() throws Exception {
GitHistoryRefactoringMinerImpl miner = new GitHistoryRefactoringMinerImpl();
final List<String> actual = new ArrayList<>();
UMLModelDiff modelDiff = miner.detectAtCommitWithGitHubAPI("https://github.com/hibernate/hibernate-orm.git", "8577a68e69d30d9e671024bf3330616000a3ec54", new File(REPOS));
List<UMLClassDiff> commonClassDiff = modelDiff.getCommonClassDiffList();
for(UMLClassDiff classDiff : commonClassDiff) {
for(UMLOperationBodyMapper mapper : classDiff.getOperationBodyMapperList()) {
if(mapper.getContainer1().getName().equals("processElementAnnotations") && mapper.getContainer2().getName().equals("processElementAnnotations")) {
mapperInfo(mapper, actual);
break;
}
}
}
List<String> expected = IOUtils.readLines(new FileReader(EXPECTED_PATH + "hibernate-orm-8577a68e69d30d9e671024bf3330616000a3ec54.txt"));
Assert.assertTrue(expected.size() == actual.size() && expected.containsAll(actual) && actual.containsAll(expected));
}

@Test
public void testInlinedMethodMovedToExtractedMethod() throws Exception {
GitHistoryRefactoringMinerImpl miner = new GitHistoryRefactoringMinerImpl();
Expand Down

Large diffs are not rendered by default.

Loading

0 comments on commit a363c50

Please sign in to comment.