Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change issue 1945 test to paramaterized #3739

Merged
merged 3 commits into from Nov 4, 2022
Merged

Change issue 1945 test to paramaterized #3739

merged 3 commits into from Nov 4, 2022

Conversation

ghost
Copy link

@ghost ghost commented Oct 30, 2022

Hello, I have worked with @TheJosephCCox to address the code smell concern raised in #3668. Please let us know what you think of this change. Thank you.

assertEquals(resultsQualifiedName.get(expr.toString()), qName);
assertEquals(resultsResolvedType.get(expr.toString()), resolvedType);
}
private static List<MethodCallExpr> parsedCodeMethodCalls() {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are you declaring this method static?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is our understanding that the factory method that provides inputs to a test must be declared static as per the JUnit documentation.

}

@ParameterizedTest
@MethodSource("parsedCodeMethodCalls")
void test(MethodCallExpr expr) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indeed this test method is a little less complex in this case.

@codecov
Copy link

codecov bot commented Nov 3, 2022

Codecov Report

Merging #3739 (0204c96) into master (f45b449) will decrease coverage by 0.027%.
The diff coverage is n/a.

❗ Current head 0204c96 differs from pull request most recent head 9977899. Consider uploading reports for the commit 9977899 to get more accurate results

Impacted file tree graph

@@               Coverage Diff               @@
##              master     #3739       +/-   ##
===============================================
- Coverage     57.326%   57.299%   -0.028%     
- Complexity      2680      5435     +2755     
===============================================
  Files            635       635               
  Lines          33576     33557       -19     
  Branches        5791      5785        -6     
===============================================
- Hits           19248     19228       -20     
- Misses         12274     12276        +2     
+ Partials        2054      2053        -1     
Flag Coverage Δ
AlsoSlowTests 57.299% <ø> (-0.028%) ⬇️
javaparser-core 52.446% <ø> (-0.014%) ⬇️
javaparser-symbol-solver 36.752% <ø> (+0.002%) ⬆️
jdk-10 57.295% <ø> (-0.025%) ⬇️
jdk-11 57.295% <ø> (-0.025%) ⬇️
jdk-12 57.292% <ø> (-0.031%) ⬇️
jdk-13 57.295% <ø> (-0.025%) ⬇️
jdk-14 57.295% <ø> (-0.028%) ⬇️
jdk-15 57.289% <ø> (-0.034%) ⬇️
jdk-16 57.295% <ø> (-0.028%) ⬇️
jdk-8 57.296% <ø> (-0.028%) ⬇️
jdk-9 57.295% <ø> (-0.028%) ⬇️
macos-latest 57.287% <ø> (-0.028%) ⬇️
ubuntu-latest 57.284% <ø> (-0.028%) ⬇️
windows-latest 57.278% <ø> (-0.028%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
.../src/main/java/com/github/javaparser/Position.java 64.814% <0.000%> (-15.620%) ⬇️
...om/github/javaparser/ast/body/TypeDeclaration.java 60.240% <0.000%> (-2.410%) ⬇️
...om/github/javaparser/ast/body/BodyDeclaration.java 23.863% <0.000%> (-1.137%) ⬇️
...declarations/ResolvedReferenceTypeDeclaration.java 63.793% <0.000%> (-0.614%) ⬇️
...vaparser/symbolsolver/resolution/SymbolSolver.java 45.945% <0.000%> (ø)
...symbolsolver/javaparsermodel/JavaParserFacade.java 75.155% <0.000%> (ø)
...symbolsolver/resolution/MethodResolutionLogic.java 76.528% <0.000%> (ø)
...olsolver/resolution/typesolvers/JarTypeSolver.java 90.000% <0.000%> (ø)
...olver/javassistmodel/JavassistEnumDeclaration.java 55.172% <0.000%> (ø)
...lver/javassistmodel/JavassistClassDeclaration.java 75.581% <0.000%> (ø)
... and 19 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f45b449...9977899. Read the comment docs.

@jlerbsc jlerbsc enabled auto-merge (rebase) November 3, 2022 07:23
@jlerbsc jlerbsc merged commit d7a8361 into javaparser:master Nov 4, 2022
@jlerbsc jlerbsc added this to the next release milestone Nov 4, 2022
@jlerbsc jlerbsc added the PR - TESTCASE Pull requests with this label are test cases only - may later be merged when it passes. label Nov 4, 2022
@jlerbsc
Copy link
Collaborator

jlerbsc commented Nov 4, 2022

Thank you for this contribution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PR - TESTCASE Pull requests with this label are test cases only - may later be merged when it passes.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants