-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Further improved callable matching by name in Java.
- Loading branch information
1 parent
c5db407
commit 4ce7842
Showing
3 changed files
with
81 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
48 changes: 48 additions & 0 deletions
48
.../quality-analyzer/src/test/java/eu/fasten/analyzer/qualityanalyzer/MetadataUtilsTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
package eu.fasten.analyzer.qualityanalyzer; | ||
|
||
import org.junit.jupiter.api.Test; | ||
|
||
import static eu.fasten.analyzer.qualityanalyzer.MetadataUtils.normalizeCallableName; | ||
import static org.junit.jupiter.api.Assertions.*; | ||
|
||
class MetadataUtilsTest { | ||
|
||
@Test | ||
void normalizeCallableNameJavaTest() { | ||
assertEquals("", | ||
normalizeCallableName("")); | ||
|
||
assertEquals("NDC.clear", | ||
normalizeCallableName("NDC::clear")); | ||
|
||
assertEquals("SMTPAppender.%3Cinit%3E", | ||
normalizeCallableName("SMTPAppender::SMTPAppender")); | ||
|
||
assertEquals("LoggingReceiver$Slurper.run", | ||
normalizeCallableName("LoggingReceiver::Slurper::run")); | ||
|
||
assertEquals("LoggingReceiver$Slurper.%3Cinit%3E", | ||
normalizeCallableName("LoggingReceiver::Slurper::Slurper")); | ||
|
||
assertEquals("PatternParser$NamedPatternConverter.%3Cinit%3E", | ||
normalizeCallableName("PatternParser::NamedPatternConverter::NamedPatternConverter")); | ||
} | ||
|
||
@Test | ||
void normalizeCallableNamePythonTest() { | ||
assertEquals("get_filing_list", | ||
normalizeCallableName("get_filing_list")); | ||
|
||
assertEquals("_get_daily_listing_url", | ||
normalizeCallableName("_get_daily_listing_url")); | ||
} | ||
|
||
@Test | ||
void normalizeCallableNameCTest() { | ||
assertEquals("drop_excludes", | ||
normalizeCallableName("drop_excludes")); | ||
|
||
assertEquals("gda_xslt_getxmlvalue_function", | ||
normalizeCallableName("gda_xslt_getxmlvalue_function")); | ||
} | ||
} |