diff --git a/src/test/java/org/refactoringminer/test/TestRelatedStatementMappingsTest.java b/src/test/java/org/refactoringminer/test/TestRelatedStatementMappingsTest.java new file mode 100644 index 0000000000..7e925423d1 --- /dev/null +++ b/src/test/java/org/refactoringminer/test/TestRelatedStatementMappingsTest.java @@ -0,0 +1,106 @@ +package org.refactoringminer.test; + +import gr.uom.java.xmi.VariableDeclarationContainer; +import gr.uom.java.xmi.decomposition.AbstractCodeMapping; +import gr.uom.java.xmi.decomposition.LeafExpression; +import gr.uom.java.xmi.diff.AssertThrowsRefactoring; +import gr.uom.java.xmi.diff.ModifyClassAnnotationRefactoring; +import gr.uom.java.xmi.diff.ModifyMethodAnnotationRefactoring; +import org.apache.commons.io.IOUtils; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.CsvSource; +import org.refactoringminer.api.Refactoring; +import org.refactoringminer.api.RefactoringHandler; +import org.refactoringminer.rm1.GitHistoryRefactoringMinerImpl; + +import java.io.File; +import java.io.FileReader; +import java.util.ArrayList; +import java.util.List; +import java.util.Set; +import java.util.function.Consumer; +import java.util.function.Supplier; +import java.util.stream.Collectors; + +import static org.junit.jupiter.api.Assertions.fail; + +public class TestRelatedStatementMappingsTest { + public static final String REPOS = System.getProperty("user.dir") + "/src/test/resources/oracle/commits"; + private static final String EXPECTED_PATH = System.getProperty("user.dir") + "/src/test/resources/mappings/"; + private GitHistoryRefactoringMinerImpl miner; + private List actual; + private List expected; + + + @ParameterizedTest + @CsvSource({ + //Migrate Expected Exception + "https://github.com/apache/camel.git, c30deabcaed4726bce4371d76257db63f2eba87c, camel-c30deabcaed4726bce4371d76257db63f2eba87c.txt", + "https://github.com/apache/commons-csv.git, e2f0a4d8a83a41eaa984086636a3712c682307ea, commons-csv-e2f0a4d8a83a41eaa984086636a3712c682307ea.txt", + "https://github.com/apache/jmeter.git, d5b5b2f38c3341cbb934693c17d0574a241ad4f9, jmeter-d5b5b2f38c3341cbb934693c17d0574a241ad4f9.txt", + "https://github.com/apache/plc4x.git, 4312eb178b6cb000ea8a3c78df70567182341331, plc4x-4312eb178b6cb000ea8a3c78df70567182341331.txt", + "https://github.com/eclipse/eclipse-collections.git, f26addbce8e843f208805aa22f45dcfb6f8177f7, eclipse-collections-f26addbce8e843f208805aa22f45dcfb6f8177f7.txt", + "https://github.com/EnMasseProject/enmasse.git, 5e0e683531b756ac62a497cca15ddb7211a34e24, enmasse-5e0e683531b756ac62a497cca15ddb7211a34e24.txt", + "https://github.com/apache/clerezza.git, d77dbe2085ffa89b2a933637c5432d113b7432b8, clerezza-d77dbe2085ffa89b2a933637c5432d113b7432b8.txt", + "https://github.com/iluwatar/java-design-patterns.git, 6694d742a370e0f181530734481284de8d5dd8ef, java-design-patterns-6694d742a370e0f181530734481284de8d5dd8ef.txt", + "https://github.com/LMAX-Exchange/disruptor.git, 340f23ef88a32ceb8341820c15bfd9537303219c, disruptor-340f23ef88a32ceb8341820c15bfd9537303219c.txt", + "https://github.com/neo4j/neo4j.git, b44c62bcdd6f7218bc97dae183ea0f6587bacd29, neo4j-b44c62bcdd6f7218bc97dae183ea0f6587bacd29.txt", + "https://github.com/RohanNagar/thunder.git, 48776d511a0152f7b9cbe4460c8967bdd5ec3dc4, thunder-48776d511a0152f7b9cbe4460c8967bdd5ec3dc4.txt", + "https://github.com/SAP/olingo-jpa-processor-v4.git, 5e77141293d32b015a92e48d099195840f2b2e87, olingo-jpa-processor-v4-5e77141293d32b015a92e48d099195840f2b2e87.txt", + "https://github.com/zalando/problem.git, 1b987b88ecb5cc2c8df58ac8eda188fb2d6f5998, problem-1b987b88ecb5cc2c8df58ac8eda188fb2d6f5998.txt", + //"https://github.com/apache/plc4x.git, 86da20c173ad291e5f3d5fe4c56f37d7f3c2c538, plc4x-86da20c173ad291e5f3d5fe4c56f37d7f3c2c538.txt", // FIXME: JUnit 5 to AssertJ expected exception not supported + //"https://github.com/assertj/assertj-swing.git, 033bdd7832ca9a9647c8f7b7ecaa985d3115b206, assertj-swing-033bdd7832ca9a9647c8f7b7ecaa985d3115b206.txt", // FIXME: TestNG to JUnit 4 expected exception not supported + //"https://github.com/alexruiz/fest-swing-1.x.git, 033bdd7832ca9a9647c8f7b7ecaa985d3115b206, fest-swing-1.x-033bdd7832ca9a9647c8f7b7ecaa985d3115b206.txt", // FIXME: TestNG to JUnit 4 expected exception not supported + //"https://github.com/apache/flink.git, 2c5bc580e6c10fb3a2724a945847b5cc6b28df27, flink-2c5bc580e6c10fb3a2724a945847b5cc6b28df27.txt", // FIXME: JUnit 4 to AssertJ expected exception not supported + //"https://github.com/apache/flink.git, 95c3499ea80d07c448c297e36fa5a1b5b4caea2b, flink-95c3499ea80d07c448c297e36fa5a1b5b4caea2b.txt", // FIXME: JUnit 4 to AssertJ expected exception not supported + //"https://github.com/apache/cassandra-java-driver.git, 7d962af9291f69f0da6115375efd5bd5224a2353, cassandra-java-driver-7d962af9291f69f0da6115375efd5bd5224a2353.txt", // FIXME: TestNG to JUnit 4 expected exception not supported + //"https://github.com/OpenGamma/Strata.git, e007f826c49075500def8638de8367960c054c19, Strata-e007f826c49075500def8638de8367960c054c19.txt", // FIXME: TestNG to AssertJ expected exception not supported + //"https://github.com/rapidoid/rapidoid.git, 8596c1d82e9f0a36f40cd7ec393c6829e697836d, rapidoid-8596c1d82e9f0a36f40cd7ec393c6829e697836d.txt", // FIXME: TestNG to JUnit 4 expected exception not supported + //"https://github.com/zanata/zanata-platform.git, 0297e0513ac1f487f1570b1cc38979a73ac97da8, zanata-platform-0297e0513ac1f487f1570b1cc38979a73ac97da8.txt", // FIXME: TestNG to JUnit 4 expected exception not supported + }) + public void testAssertThrowsMappings(String url, String commit, String testResultFileName) throws Exception { + testRefactoringMappings(url, commit, testResultFileName, ref -> { + if (ref instanceof AssertThrowsRefactoring) { + AssertThrowsRefactoring assertThrowsRefactoring = (AssertThrowsRefactoring) ref; + Set mapper = assertThrowsRefactoring.getAssertThrowsMappings(); + mapperInfo(mapper, assertThrowsRefactoring.getOperationBefore(), assertThrowsRefactoring.getOperationAfter()); + } + }); + } + + @BeforeEach + void setUp() { + miner = new GitHistoryRefactoringMinerImpl(); + actual = new ArrayList<>(); + expected = new ArrayList<>(); + } + + private void testRefactoringMappings(String url, String commit, String testResultFileName, final Consumer consumer) { + miner.detectAtCommitWithGitHubAPI(url, commit, new File(REPOS), new RefactoringHandler() { + @Override + public void handle(String commitId, List refactorings) { + for (Refactoring ref : refactorings) { + consumer.accept(ref); + } + } + }); + Supplier lazyErrorMessage = () -> actual.stream().collect(Collectors.joining(System.lineSeparator())); + Assertions.assertDoesNotThrow(() -> { + expected.addAll(IOUtils.readLines(new FileReader(EXPECTED_PATH + testResultFileName))); + }, lazyErrorMessage); + Assertions.assertIterableEquals(expected, actual, lazyErrorMessage); + } + + private void mapperInfo(Set mappings, T operationBefore, T operationAfter) { + actual.add(operationBefore + " -> " + operationAfter); + for(AbstractCodeMapping mapping : mappings) { + if(mapping.getFragment1() instanceof LeafExpression && mapping.getFragment2() instanceof LeafExpression) + continue; + String line = mapping.getFragment1().getLocationInfo() + "==" + mapping.getFragment2().getLocationInfo(); + actual.add(line); + } + } +} diff --git a/src/test/resources/mappings/camel-c30deabcaed4726bce4371d76257db63f2eba87c.txt b/src/test/resources/mappings/camel-c30deabcaed4726bce4371d76257db63f2eba87c.txt new file mode 100644 index 0000000000..63508cf528 --- /dev/null +++ b/src/test/resources/mappings/camel-c30deabcaed4726bce4371d76257db63f2eba87c.txt @@ -0,0 +1,28 @@ +public testBodyOgnlExpression() : void -> public testBodyOgnlExpression() : void +line range:187-187==line range:187-187 +public testBodyOgnlExpression() : void -> public testBodyOgnlExpression() : void +line range:195-195==line range:190-190 +public httpDisableStreamCache() : void -> public httpDisableStreamCache() : void +line range:79-79==line range:78-78 +public testTransferExeption() : void -> public testTransferException() : void +line range:62-62==line range:62-62 +public testBadConfiguration() : void -> public testBadConfiguration() : void +line range:110-110==line range:113-113 +public testNoResponseDisconnectOnNoReplyFalse() : void -> public testNoResponseDisconnectOnNoReplyFalse() : void +line range:45-45==line range:45-45 +public testNoResponse() : void -> public testNoResponse() : void +line range:50-50==line range:51-51 +public testBadConfiguration() : void -> public testBadConfiguration() : void +line range:81-81==line range:82-82 +public testWriteByteArraySliceWithNegativeLength() : void -> public testWriteByteArraySliceWithNegativeLength() : void +line range:258-258==line range:258-258 +public testWriteByteArraySliceWithLengthGreaterThanAvailable() : void -> public testWriteByteArraySliceWithLengthGreaterThanAvailable() : void +line range:275-275==line range:273-273 +public testWriteByteArraySliceWithLengthGreaterThanAvailable() : void -> public testWriteByteArraySliceWithLengthGreaterThanAvailable() : void +line range:283-283==line range:280-280 +public testWriteByteArraySliceWithLengthGreaterThanAvailable() : void -> public testWriteByteArraySliceWithLengthGreaterThanAvailable() : void +line range:292-292==line range:287-287 +public testKeepingTimeoutHeader() : void -> public testKeepingTimeoutHeader() : void +line range:60-60==line range:61-61 +public testFail() : void -> public testFail() : void +line range:41-48==line range:51-51 \ No newline at end of file diff --git a/src/test/resources/mappings/clerezza-d77dbe2085ffa89b2a933637c5432d113b7432b8.txt b/src/test/resources/mappings/clerezza-d77dbe2085ffa89b2a933637c5432d113b7432b8.txt new file mode 100644 index 0000000000..2bb0347dbd --- /dev/null +++ b/src/test/resources/mappings/clerezza-d77dbe2085ffa89b2a933637c5432d113b7432b8.txt @@ -0,0 +1,38 @@ +public unavailableConvertor() : void -> public unavailableConvertor() : void +line range:42-42==line range:49-49 +public testAcessGraph() : void -> public testAcessGraph() : void +line range:115-115==line range:127-127 +public testNoWildCard() : void -> public testNoWildCard() : void +line range:120-120==line range:133-133 +public testAllowedArea() : void -> public testAllowedArea() : void +line range:125-125==line range:139-139 +public testAcessForbiddenGraph() : void -> public testAcessForbiddenGraph() : void +line range:130-130==line range:145-145 +public testCustomPermissions() : void -> public testCustomPermissions() : void +line range:141-141==line range:158-158 +public testCustomPermissionsIncorrect() : void -> public testCustomPermissionsIncorrect() : void +line range:152-152==line range:171-171 +public testCreateMGraph() : void -> public testCreateMGraph() : void +line range:168-168==line range:189-189 +public testCreateMGraphWithoutWritePermission() : void -> public testCreateMGraphWithoutWritePermission() : void +line range:172-172==line range:195-195 +public testAddTripleToMGraph() : void -> public testAddTripleToMGraph() : void +line range:178-178==line range:202-202 +public executeSparqlQueryNoEngineWithString() : void -> public executeSparqlQueryNoEngineWithString() : void +line range:145-145==line range:153-153 +public executeSparqlQueryNoEngineWithQuery() : void -> public executeSparqlQueryNoEngineWithQuery() : void +line range:154-154==line range:163-163 +public executeSparqlQueryNoEngineWithSelectQuery() : void -> public executeSparqlQueryNoEngineWithSelectQuery() : void +line range:163-163==line range:173-173 +public executeSparqlQueryNoEngineWithAskQuery() : void -> public executeSparqlQueryNoEngineWithAskQuery() : void +line range:172-172==line range:183-183 +public executeSparqlQueryNoEngineWithDescribeQuery() : void -> public executeSparqlQueryNoEngineWithDescribeQuery() : void +line range:181-182==line range:193-193 +public executeSparqlQueryNoEngineWithConstructQuery() : void -> public executeSparqlQueryNoEngineWithConstructQuery() : void +line range:191-192==line range:203-203 +public testInvalidQuery() : void -> public testInvalidQuery() : void +line range:98-98==line range:107-107 +public removeIncompleteSubGraph() : void -> public removeIncompleteSubGraph() : void +line range:85-85==line range:92-92 +public removeInvalidSubGraph() : void -> public removeInvalidSubGraph() : void +line range:101-101==line range:109-109 \ No newline at end of file diff --git a/src/test/resources/mappings/commons-csv-e2f0a4d8a83a41eaa984086636a3712c682307ea.txt b/src/test/resources/mappings/commons-csv-e2f0a4d8a83a41eaa984086636a3712c682307ea.txt new file mode 100644 index 0000000000..ceff346d60 --- /dev/null +++ b/src/test/resources/mappings/commons-csv-e2f0a4d8a83a41eaa984086636a3712c682307ea.txt @@ -0,0 +1,76 @@ +public testNotNullNull() : void -> public testNotNullNull() : void +line range:33-33==line range:35-35 +public testDelimiterSameAsCommentStartThrowsException() : void -> public testDelimiterSameAsCommentStartThrowsException() : void +line range:77-77==line range:78-78 +public testDelimiterSameAsEscapeThrowsException() : void -> public testDelimiterSameAsEscapeThrowsException() : void +line range:82-82==line range:83-83 +public testDuplicateHeaderElementsFalse() : void -> public testDuplicateHeaderElementsFalse() : void +line range:95-95==line range:98-98 +public testEscapeSameAsCommentStartThrowsException() : void -> public testEscapeSameAsCommentStartThrowsException() : void +line range:525-525==line range:528-528 +public testEscapeSameAsCommentStartThrowsExceptionForWrapperType() : void -> public testEscapeSameAsCommentStartThrowsExceptionForWrapperType() : void +line range:531-531==line range:536-536 +public testQuoteCharSameAsCommentStartThrowsException() : void -> public testQuoteCharSameAsCommentStartThrowsException() : void +line range:664-664==line range:669-669 +public testQuoteCharSameAsCommentStartThrowsExceptionForWrapperType() : void -> public testQuoteCharSameAsCommentStartThrowsExceptionForWrapperType() : void +line range:670-670==line range:677-677 +public testQuoteCharSameAsDelimiterThrowsException() : void -> public testQuoteCharSameAsDelimiterThrowsException() : void +line range:675-675==line range:682-682 +public testQuotePolicyNoneWithoutEscapeThrowsException() : void -> public testQuotePolicyNoneWithoutEscapeThrowsException() : void +line range:680-680==line range:687-687 +public testWithCommentStartCRThrowsException() : void -> public testWithCommentStartCRThrowsException() : void +line range:896-896==line range:903-903 +public testWithDelimiterLFThrowsException() : void -> public testWithDelimiterLFThrowsException() : void +line range:907-907==line range:914-914 +public testWithEscapeCRThrowsExceptions() : void -> public testWithEscapeCRThrowsExceptions() : void +line range:924-924==line range:931-931 +public testWithQuoteLFThrowsException() : void -> public testWithQuoteLFThrowsException() : void +line range:1143-1143==line range:1150-1150 +public testClose() : void -> public testClose() : void +line range:255-255==line range:255-255 +public testDuplicateHeadersNotAllowed() : void -> public testDuplicateHeadersNotAllowed() : void +line range:297-298==line range:299-300 +public testHeadersMissingException() : void -> public testHeadersMissingException() : void +line range:722-722==line range:724-724 +public testInvalidFormat() : void -> public testInvalidFormat() : void +line range:749-749==line range:751-751 +public testNewCSVParserNullReaderFormat() : void -> public testNewCSVParserNullReaderFormat() : void +line range:926-926==line range:925-925 +public testNewCSVParserReaderNullFormat() : void -> public testNewCSVParserReaderNullFormat() : void +line range:933-933==line range:930-930 +public testParseFileNullFormat() : void -> public testParseFileNullFormat() : void +line range:980-980==line range:977-977 +public testParseNullFileFormat() : void -> public testParseNullFileFormat() : void +line range:987-987==line range:984-984 +public testParseNullPathFormat() : void -> public testParseNullPathFormat() : void +line range:994-994==line range:991-991 +public testParseNullStringFormat() : void -> public testParseNullStringFormat() : void +line range:1001-1001==line range:996-996 +public testParseNullUrlCharsetFormat() : void -> public testParseNullUrlCharsetFormat() : void +line range:1008-1008==line range:1003-1003 +public testParserUrlNullCharsetFormat() : void -> public testParserUrlNullCharsetFormat() : void +line range:1015-1015==line range:1010-1010 +public testParseStringNullFormat() : void -> public testParseStringNullFormat() : void +line range:1022-1022==line range:1015-1015 +public testParseUrlCharsetNullFormat() : void -> public testParseUrlCharsetNullFormat() : void +line range:1029-1029==line range:1022-1022 +public testInvalidFormat() : void -> public testInvalidFormat() : void +line range:583-583==line range:583-583 +public testNewCsvPrinterAppendableNullFormat() : void -> public testNewCsvPrinterAppendableNullFormat() : void +line range:884-884==line range:881-881 +public testNewCsvPrinterNullAppendableFormat() : void -> public testNewCsvPrinterNullAppendableFormat() : void +line range:891-891==line range:886-886 +public testGetStringInconsistentRecord() : void -> public testGetStringInconsistentRecord() : void +line range:79-79==line range:79-79 +public testGetStringNoHeader() : void -> public testGetStringNoHeader() : void +line range:84-84==line range:84-84 +public testGetUnmappedEnum() : void -> public testGetUnmappedEnum() : void +line range:89-89==line range:89-89 +public testGetUnmappedName() : void -> public testGetUnmappedName() : void +line range:94-94==line range:94-94 +public testGetUnmappedNegativeInt() : void -> public testGetUnmappedNegativeInt() : void +line range:99-99==line range:99-99 +public testGetUnmappedPositiveInt() : void -> public testGetUnmappedPositiveInt() : void +line range:104-104==line range:104-104 +public testEscapingAtEOF() : void -> public testEscapingAtEOF() : void +line range:388-388==line range:389-389 \ No newline at end of file diff --git a/src/test/resources/mappings/disruptor-340f23ef88a32ceb8341820c15bfd9537303219c.txt b/src/test/resources/mappings/disruptor-340f23ef88a32ceb8341820c15bfd9537303219c.txt new file mode 100644 index 0000000000..0ca4ef49f7 --- /dev/null +++ b/src/test/resources/mappings/disruptor-340f23ef88a32ceb8341820c15bfd9537303219c.txt @@ -0,0 +1,11 @@ +public shouldTimeoutWaitFor() : void -> public shouldTimeoutWaitFor() : void +line range:27-27==line range:24-24 +public shouldThrowExceptionIfBufferIsFull() : void -> public shouldThrowExceptionIfBufferIsFull() : void +line range:154-154==line range:144-144 +public shouldInterruptDuringBusySpin() : void -> public shouldInterruptDuringBusySpin() : void +line range:112-112==line range:109-109 +line range:107-122==line range:108-109 +public shouldTryNext(sequencer Sequencer) : void -> public shouldTryNext(sequencer Sequencer) : void +line range:250-250==line range:247-247 +public shouldTimeoutWaitFor() : void -> public shouldTimeoutWaitFor() : void +line range:28-28==line range:25-25 \ No newline at end of file diff --git a/src/test/resources/mappings/eclipse-collections-f26addbce8e843f208805aa22f45dcfb6f8177f7.txt b/src/test/resources/mappings/eclipse-collections-f26addbce8e843f208805aa22f45dcfb6f8177f7.txt new file mode 100644 index 0000000000..becec260c4 --- /dev/null +++ b/src/test/resources/mappings/eclipse-collections-f26addbce8e843f208805aa22f45dcfb6f8177f7.txt @@ -0,0 +1,41 @@ +public Iterable_next_throws_on_empty() : void -> public Iterable_next_throws_on_empty() : void +line range:240-240==line range:240-240 +public OrderedIterable_getFirstOptional_null_element() : void -> public OrderedIterable_getFirstOptional_null_element() : void +line range:98-98==line range:99-99 +public MutableBagIterable_addOccurrences_throws() : void -> public MutableBagIterable_addOccurrences_throws() : void +line range:46-46==line range:47-47 +public MutableBagIterable_removeOccurrences_throws() : void -> public MutableBagIterable_removeOccurrences_throws() : void +line range:72-72==line range:74-74 +line range:73-73==line range:75-75 +public Iterable_iterator_throws() : void -> public Iterable_iterator_throws() : void +line range:24-24==line range:26-26 +public List_get_negative() : void -> public List_get_negative() : void +line range:64-64==line range:64-64 +public List_get_out_of_bounds() : void -> public List_get_out_of_bounds() : void +line range:70-70==line range:70-70 +public MutableList_sortThis() : void -> public MutableList_sortThis() : void +line range:27-27==line range:28-28 +public MutableList_shuffleThis() : void -> public MutableList_shuffleThis() : void +line range:34-34==line range:35-35 +public MutableList_shuffleThis() : void -> public MutableList_shuffleThis() : void +line range:35-35==line range:36-36 +public MutableList_sortThis_comparator() : void -> public MutableList_sortThis_comparator() : void +line range:49-49==line range:51-51 +public Collection_add() : void -> public Collection_add() : void +line range:46-46==line range:48-48 +public Collection_add() : void -> public Collection_add() : void +line range:50-50==line range:51-51 +public RichIterable_getFirst_empty_null() : void -> public RichIterable_getFirst_empty_null() : void +line range:72-72==line range:72-72 +public RichIterable_getLast_empty_null() : void -> public RichIterable_getLast_empty_null() : void +line range:79-79==line range:79-79 +public OrderedIterable_getLastOptional() : void -> public OrderedIterable_getLastOptional() : void +line range:123-123==line range:124-124 +public OrderedIterable_getLastOptional_null_element() : void -> public OrderedIterable_getLastOptional_null_element() : void +line range:130-130==line range:132-132 +public StackIterable_peek_throws() : void -> public StackIterable_peek_throws() : void +line range:142-142==line range:144-144 +public MutableStack_pop() : void -> public MutableStack_pop() : void +line range:31-31==line range:33-33 +public MutableStack_pop_throws() : void -> public MutableStack_pop_throws() : void +line range:39-39==line range:41-41 \ No newline at end of file diff --git a/src/test/resources/mappings/enmasse-5e0e683531b756ac62a497cca15ddb7211a34e24.txt b/src/test/resources/mappings/enmasse-5e0e683531b756ac62a497cca15ddb7211a34e24.txt new file mode 100644 index 0000000000..ebf2742e0d --- /dev/null +++ b/src/test/resources/mappings/enmasse-5e0e683531b756ac62a497cca15ddb7211a34e24.txt @@ -0,0 +1,50 @@ +public testValidateBadKey() : void -> public testValidateBadKey() : void +line range:83-89==line range:84-90 +public testValidateBadCert() : void -> public testValidateBadCert() : void +line range:94-100==line range:95-101 +public testUnknownWildcardSecret() : void -> public testUnknownWildcardSecret() : void +line range:46-46==line range:50-50 +public testInvalidToken() : void -> public testInvalidToken() : void +line range:90-90==line range:89-89 +public testSerializeAddressSpaceWithIllegalName() : void -> public testSerializeAddressSpaceWithIllegalName() : void +line range:114-114==line range:115-115 +public testDeserializeAddressSpaceMissingDefaults() : void -> public testDeserializeAddressSpaceMissingDefaults() : void +line range:213-213==line range:214-214 +public testDeserializeAddressMissingDefaults() : void -> public testDeserializeAddressMissingDefaults() : void +line range:219-219==line range:220-220 +public testDeserializeAddressSpaceWithMissingAuthServiceValues() : void -> public testDeserializeAddressSpaceWithMissingAuthServiceValues() : void +line range:408-408==line range:409-409 +public testDeserializeAddressSpaceWithExtraAuthServiceValues() : void -> public testDeserializeAddressSpaceWithExtraAuthServiceValues() : void +line range:430-430==line range:431-431 +public testBadInitialResponse() : void -> public testBadInitialResponse() : void +line range:135-135==line range:126-126 +public testBadInitialResponse() : void -> public testBadInitialResponse() : void +line range:114-114==line range:113-113 +public testSyncProvisioningRequest() : void -> public testSyncProvisioningRequest() : void +line range:43-43==line range:45-45 +public testBindOnNonexistentService() : void -> public testBindOnNonexistentService() : void +line range:68-68==line range:71-71 +public testBindWithoutServiceId() : void -> public testBindWithoutServiceId() : void +line range:74-74==line range:78-78 +public testBindWithoutPlanId() : void -> public testBindWithoutPlanId() : void +line range:79-79==line range:85-85 +public testWrongServiceId() : void -> public testWrongServiceId() : void +line range:85-85==line range:92-92 +public testWrongPlanId() : void -> public testWrongPlanId() : void +line range:91-91==line range:99-99 +public testUnbindNonexistingBinding() : void -> public testUnbindNonexistingBinding() : void +line range:126-126==line range:135-135 +public testSyncProvisioningRequest() : void -> public testSyncProvisioningRequest() : void +line range:43-43==line range:45-45 +public testInvalidServiceUuid() : void -> public testInvalidServiceUuid() : void +line range:48-48==line range:51-51 +public testInvalidPlan() : void -> public testInvalidPlan() : void +line range:53-53==line range:57-57 +public testInvalidServiceInstandeUuid() : void -> public testInvalidServiceInstandeUuid() : void +line range:58-58==line range:63-63 +public testDeprovisionNonexistingServiceInstance() : void -> public testDeprovisionNonexistingServiceInstance() : void +line range:131-131==line range:137-137 +public testDeprovisionWithoutServiceId() : void -> public testDeprovisionWithoutServiceId() : void +line range:136-136==line range:143-143 +public testDeprovisionWithoutPlanId() : void -> public testDeprovisionWithoutPlanId() : void +line range:141-141==line range:149-149 \ No newline at end of file diff --git a/src/test/resources/mappings/java-design-patterns-6694d742a370e0f181530734481284de8d5dd8ef.txt b/src/test/resources/mappings/java-design-patterns-6694d742a370e0f181530734481284de8d5dd8ef.txt new file mode 100644 index 0000000000..a1589fe956 --- /dev/null +++ b/src/test/resources/mappings/java-design-patterns-6694d742a370e0f181530734481284de8d5dd8ef.txt @@ -0,0 +1,75 @@ +public testMissingProfession() : void -> public testMissingProfession() : void +line range:42-42==line range:43-43 +public testMissingName() : void -> public testMissingName() : void +line range:50-50==line range:51-51 +public addingACustomerFailsWithExceptionAsFeedbackToClient() : void -> public addingACustomerFailsWithExceptionAsFeedbackToClient() : void +line range:214-214==line range:213-213 +public deletingACustomerFailsWithExceptionAsFeedbackToTheClient() : void -> public deletingACustomerFailsWithExceptionAsFeedbackToTheClient() : void +line range:219-219==line range:220-220 +public updatingACustomerFailsWithFeedbackToTheClient() : void -> public updatingACustomerFailsWithFeedbackToTheClient() : void +line range:227-227==line range:229-229 +public retrievingACustomerByIdFailsWithExceptionAsFeedbackToClient() : void -> public retrievingACustomerByIdFailsWithExceptionAsFeedbackToClient() : void +line range:232-232==line range:236-236 +public retrievingAllCustomersFailsWithExceptionAsFeedbackToClient() : void -> public retrievingAllCustomersFailsWithExceptionAsFeedbackToClient() : void +line range:237-237==line range:243-243 +public testUnsuccessfulSynchronousEvent() : void -> public testUnsuccessfulSynchronousEvent() : void +line range:76-76==line range:78-78 +line range:78-78==line range:80-80 +line range:79-79==line range:81-81 +line range:80-80==line range:82-82 +line range:81-81==line range:83-83 +line range:83-83==line range:85-85 +line range:77-84==line range:79-86 +line range:82-84==line range:84-86 +public testIoException() : void -> public testIoException() : void +line range:90-90==line range:94-94 +line range:91-93==line range:95-97 +line range:92-92==line range:96-96 +line range:91-93==line range:95-97 +public testNullPropertiesPassed() : void -> public testNullPropertiesPassed() : void +line range:42-42==line range:45-45 +public testNonBooleanProperty() : void -> public testNonBooleanProperty() : void +line range:47-47==line range:52-52 +line range:48-48==line range:53-53 +line range:49-49==line range:54-54 +public testAddUserToPaidWhenOnFree() : void -> public testAddUserToPaidWhenOnFree() : void +line range:53-53==line range:55-55 +public testAddUserToFreeWhenOnPaid() : void -> public testAddUserToFreeWhenOnPaid() : void +line range:60-60==line range:64-64 +public testNumbersCantBeModified() : void -> public testNumbersCantBeModified() : void +line range:56-56==line range:58-58 +public testBakeCakeMissingTopping() : void -> public testBakeCakeMissingTopping() : void +line range:136-136==line range:138-138 +public testBakeCakeMissingLayer() : void -> public testBakeCakeMissingLayer() : void +line range:154-154==line range:158-158 +public testBakeCakesUsedLayer() : void -> public testBakeCakesUsedLayer() : void +line range:177-177==line range:182-182 +public testForInvalidName() : void -> public testForInvalidName() : void +line range:45-45==line range:41-41 +line range:45-45==line range:41-41 +line range:45-45==line range:41-41 +public testForInvalidAge() : void -> public testForInvalidAge() : void +line range:52-54==line range:49-51 +line range:53-53==line range:50-50 +line range:52-52==line range:49-49 +line range:52-52==line range:49-49 +line range:53-53==line range:50-50 +public muteShouldRethrowUnexpectedExceptionAsAssertionError() : void -> public muteShouldRethrowUnexpectedExceptionAsAssertionError() : void +line range:59-59==line range:54-54 +line range:59-59==line range:54-54 +public testAddHeader() : void -> public testAddHeader() : void +line range:39-39==line range:41-41 +public testGetHeader() : void -> public testGetHeader() : void +line range:44-44==line range:48-48 +public testGetHeaders() : void -> public testGetHeaders() : void +line range:49-49==line range:55-55 +public testSetBody() : void -> public testSetBody() : void +line range:54-54==line range:62-62 +public testGetBody() : void -> public testGetBody() : void +line range:59-59==line range:69-69 +public testUnModifiableHeaders() : void -> public testUnModifiableHeaders() : void +line range:58-58==line range:60-60 +public oneException() : void -> public oneException() : void +line range:55-55==line range:58-58 +public constructorTest() : void -> public constructorTest() : void +line range:38-38==line range:39-39 \ No newline at end of file diff --git a/src/test/resources/mappings/jmeter-d5b5b2f38c3341cbb934693c17d0574a241ad4f9.txt b/src/test/resources/mappings/jmeter-d5b5b2f38c3341cbb934693c17d0574a241ad4f9.txt new file mode 100644 index 0000000000..9641d2129c --- /dev/null +++ b/src/test/resources/mappings/jmeter-d5b5b2f38c3341cbb934693c17d0574a241ad4f9.txt @@ -0,0 +1,2 @@ +public test4() : void -> public test4() : void +line range:54-54==line range:54-54 \ No newline at end of file diff --git a/src/test/resources/mappings/neo4j-b44c62bcdd6f7218bc97dae183ea0f6587bacd29.txt b/src/test/resources/mappings/neo4j-b44c62bcdd6f7218bc97dae183ea0f6587bacd29.txt new file mode 100644 index 0000000000..912afa116b --- /dev/null +++ b/src/test/resources/mappings/neo4j-b44c62bcdd6f7218bc97dae183ea0f6587bacd29.txt @@ -0,0 +1,14 @@ +private assertNoMoreItems(iterator PrimitiveIntIterator) : void -> private assertNoMoreItems(iterator PrimitiveIntIterator) : void +line range:216-216==line range:207-207 +public iteratorAsSet() : void -> package iteratorAsSet() : void +line range:149-149==line range:147-147 +public failToRemoveElementFromNewEmptyQueue() : void -> package failToRemoveElementFromNewEmptyQueue() : void +line range:76-76==line range:77-77 +public failToGetNextOnEmptyQueueIterator() : void -> package failToGetNextOnEmptyQueueIterator() : void +line range:182-182==line range:183-183 +public doNotAllowCreationOfQueueWithRandomCapacity() : void -> package doNotAllowCreationOfQueueWithRandomCapacity() : void +line range:209-209==line range:210-210 +private assertNoMoreItems(iterator PrimitiveLongIterator) : void -> private assertNoMoreItems(iterator PrimitiveLongIterator) : void +line range:267-267==line range:265-265 +public throwExceptionOnAccessingNonExistentElement() : void -> package throwExceptionOnAccessingNonExistentElement() : void +line range:81-81==line range:82-82 \ No newline at end of file diff --git a/src/test/resources/mappings/olingo-jpa-processor-v4-5e77141293d32b015a92e48d099195840f2b2e87.txt b/src/test/resources/mappings/olingo-jpa-processor-v4-5e77141293d32b015a92e48d099195840f2b2e87.txt new file mode 100644 index 0000000000..f0a50beab0 --- /dev/null +++ b/src/test/resources/mappings/olingo-jpa-processor-v4-5e77141293d32b015a92e48d099195840f2b2e87.txt @@ -0,0 +1,46 @@ +public TestThrowsExceptionOnUnknownPath() : void -> public TestThrowsExceptionOnUnknownPath() : void +line range:76-76==line range:77-77 +public TestThrowsExceptionOnEmptyXML() : void -> public TestThrowsExceptionOnEmptyXML() : void +line range:82-82==line range:85-85 +public checkThrowsErrorOnIsFlagTrueAndNegativeValue() : void -> public checkThrowsErrorOnIsFlagTrueAndNegativeValue() : void +line range:120-120==line range:122-122 +public checkThrowsErrorOnNotSupportedUnderlyingType() : void -> public checkThrowsErrorOnNotSupportedUnderlyingType() : void +line range:126-126==line range:130-130 +public checkThrowsExcpetionForNonPrimitiveParameter() : void -> public checkThrowsExcpetionForNonPrimitiveParameter() : void +line range:294-294==line range:296-296 +public checkThrowsExceptionIfCollectionAndReturnTypeEmpty() : void -> public checkThrowsExceptionIfCollectionAndReturnTypeEmpty() : void +line range:300-300==line range:304-304 +public checkThrowsExcpetionOnPrivateConstructor() : void -> public checkThrowsExcpetionOnPrivateConstructor() : void +line range:305-305==line range:311-311 +public checkThrowsExcpetionOnNoConstructorAsSpecified() : void -> public checkThrowsExcpetionOnNoConstructorAsSpecified() : void +line range:311-311==line range:318-318 +public checkThrowsExcpetionOnIsBoundWithoutEntityTypeParameter() : void -> public checkThrowsExcpetionOnIsBoundWithoutEntityTypeParameter() : void +line range:318-318==line range:326-326 +public checkThrowsExcpetionOnIsBoundWithoutParameter() : void -> public checkThrowsExcpetionOnIsBoundWithoutParameter() : void +line range:324-324==line range:334-334 +public checkThrowsExcpetionOnIsBoundBindingParameterNotFirst() : void -> public checkThrowsExcpetionOnIsBoundBindingParameterNotFirst() : void +line range:330-330==line range:342-342 +public checkThrowsExcpetionOnEntitySetGivenUnbound() : void -> public checkThrowsExcpetionOnEntitySetGivenUnbound() : void +line range:336-336==line range:350-350 +public checkThrowsExcpetionOnEntitySetGivenNoEntityReturnType() : void -> public checkThrowsExcpetionOnEntitySetGivenNoEntityReturnType() : void +line range:342-342==line range:358-358 +public checkThrowsExcpetionForNonPrimitiveParameter() : void -> public checkThrowsExcpetionForNonPrimitiveParameter() : void +line range:71-71==line range:76-76 +public checkThrowsExceptionIfAnnotatedReturnTypeNEDeclairedType() : void -> public checkThrowsExceptionIfAnnotatedReturnTypeNEDeclairedType() : void +line range:135-135==line range:142-142 +public checkThrowsExceptionIfCollectionAndReturnTypeEmpty() : void -> public checkThrowsExceptionIfCollectionAndReturnTypeEmpty() : void +line range:165-165==line range:175-175 +public checkThrowsExcpetionOnNotSupportedReturnType() : void -> public checkThrowsExcpetionOnNotSupportedReturnType() : void +line range:207-207==line range:219-219 +public checkThrowsExcpetionOnPrivateConstructor() : void -> public checkThrowsExcpetionOnPrivateConstructor() : void +line range:224-224==line range:238-238 +public checkThrowsExcpetionOnNoConstructorAsSpecified() : void -> public checkThrowsExcpetionOnNoConstructorAsSpecified() : void +line range:230-230==line range:245-245 +public checkThrowsAnExceptionTimestampWithoutPrecision() : void -> public checkThrowsAnExceptionTimestampWithoutPrecision() : void +line range:423-423==line range:426-426 +public testThrowsExceptionIfBeforeIfManaged() : void -> public testThrowsExceptionIfBeforeIfManaged() : void +line range:59-59==line range:61-61 +public testSetForeignKeyTrhowsExceptionOnMissingGetter() : void -> public testSetForeignKeyTrhowsExceptionOnMissingGetter() : void +line range:340-340==line range:341-341 +public testSetForeignKeyTrhowsExceptionOnMissingSetter() : void -> public testSetForeignKeyTrhowsExceptionOnMissingSetter() : void +line range:351-351==line range:354-354 \ No newline at end of file diff --git a/src/test/resources/mappings/plc4x-4312eb178b6cb000ea8a3c78df70567182341331.txt b/src/test/resources/mappings/plc4x-4312eb178b6cb000ea8a3c78df70567182341331.txt new file mode 100644 index 0000000000..2a85bea1e1 --- /dev/null +++ b/src/test/resources/mappings/plc4x-4312eb178b6cb000ea8a3c78df70567182341331.txt @@ -0,0 +1,10 @@ +public getNotExistingDriverTest() : void -> package getNotExistingDriverTest() : void +line range:61-61==line range:66-66 +public getInvalidUriTest() : void -> package getInvalidUriTest() : void +line range:69-69==line range:76-76 +public getDuplicateDriver() : void -> package getDuplicateDriver() : void +line range:85-85==line range:95-95 +public getConnectionInvalidUrlTest() : void -> package getConnectionInvalidUrlTest() : void +line range:57-57==line range:61-61 +public getConnectionWithAuthenticationTest() : void -> package getConnectionWithAuthenticationTest() : void +line range:68-69==line range:74-75 \ No newline at end of file diff --git a/src/test/resources/mappings/problem-1b987b88ecb5cc2c8df58ac8eda188fb2d6f5998.txt b/src/test/resources/mappings/problem-1b987b88ecb5cc2c8df58ac8eda188fb2d6f5998.txt new file mode 100644 index 0000000000..a1d1e324a1 --- /dev/null +++ b/src/test/resources/mappings/problem-1b987b88ecb5cc2c8df58ac8eda188fb2d6f5998.txt @@ -0,0 +1,20 @@ +public shouldUseMixinConstructor() : void -> package shouldUseMixinConstructor() : void +line range:17-24==line range:19-27 +public shouldThrowForDuplicateStatusCode() : void -> package shouldThrowForDuplicateStatusCode() : void +line range:16-16==line range:18-18 +public shouldCoverUnreachableThrowStatement() : void -> package shouldCoverUnreachableThrowStatement() : void +line range:18-18==line range:20-20 +public shouldNotBeInstantiable() : void -> package shouldNotBeInstantiable() : void +line range:9-9==line range:11-11 +public shouldThrowOnCustomType() : void -> package shouldThrowOnCustomType() : void +line range:105-105==line range:106-106 +public shouldThrowOnCustomTitle() : void -> package shouldThrowOnCustomTitle() : void +line range:110-110==line range:111-111 +public shouldThrowOnCustomStatus() : void -> package shouldThrowOnCustomStatus() : void +line range:115-115==line range:116-116 +public shouldThrowOnCustomDetail() : void -> package shouldThrowOnCustomDetail() : void +line range:120-120==line range:121-121 +public shouldThrowOnCustomInstance() : void -> package shouldThrowOnCustomInstance() : void +line range:125-125==line range:126-126 +public shouldThrowOnCustomCause() : void -> package shouldThrowOnCustomCause() : void +line range:130-130==line range:131-131 \ No newline at end of file diff --git a/src/test/resources/mappings/thunder-48776d511a0152f7b9cbe4460c8967bdd5ec3dc4.txt b/src/test/resources/mappings/thunder-48776d511a0152f7b9cbe4460c8967bdd5ec3dc4.txt new file mode 100644 index 0000000000..1f486b9050 --- /dev/null +++ b/src/test/resources/mappings/thunder-48776d511a0152f7b9cbe4460c8967bdd5ec3dc4.txt @@ -0,0 +1,6 @@ +public testJsonProcessingException() : void -> public testJsonProcessingException() : void +line range:28-28==line range:30-30 +public testIoException() : void -> public testIoException() : void +line range:35-35==line range:39-39 +public testNullDynamoObject() : void -> public testNullDynamoObject() : void +line range:34-34==line range:34-34 \ No newline at end of file