-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Code Coverage Enhancement for 'javaparser-core/src/main/java/com/github/javaparser/ast/body' package #4181
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
base: master
Are you sure you want to change the base?
Conversation
@@ -0,0 +1,127 @@ | |||
/* | |||
* Copyright (C) 2007-2010 Júlio Vilmar Gesser. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For the creation of new classes this copywright is not useful.
@Test | ||
void testReplaceThrownException() { | ||
CompactConstructorDeclaration decl = new CompactConstructorDeclaration(); | ||
ReferenceType oldRt = new ReferenceType() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To simulate behaviors why don't you use Mockito or at least share this code.
|
||
@Test | ||
void testRemoveThrownException() { | ||
CompactConstructorDeclaration decl = new CompactConstructorDeclaration(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To simulate behaviors why don't you use Mockito or at least share this code.
class CallableDeclarationTest { | ||
|
||
// A concrete subclass of CallableDeclaration for testing | ||
private static class ConcreteCallableDeclaration extends CallableDeclaration<ConcreteCallableDeclaration> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why don't you use Mockito here?
class BodyDeclarationTest { | ||
|
||
// A concrete subclass of BodyDeclaration for testing | ||
private static class ConcreteBodyDeclaration extends BodyDeclaration<ConcreteBodyDeclaration> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why don't you use Mockito
@@ -165,5 +165,4 @@ public void testTypeCastingMethods() { | |||
assertEquals(Optional.empty(), decl.toRecordDeclaration()); | |||
assertEquals(Optional.empty(), decl.toCompactConstructorDeclaration()); | |||
} | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are you making changes without added value?
@@ -154,15 +154,13 @@ public ResolvedType resolve() { | |||
assertTrue(removed); | |||
} | |||
|
|||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are you making changes without added value?
@@ -139,6 +139,4 @@ public void testTypeCastingMethods() { | |||
|
|||
assertTrue(enumConstant.toEnumConstantDeclaration().isPresent()); | |||
} | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are you making changes without added value?
@@ -122,6 +122,4 @@ public void testTypeCastingMethods() { | |||
|
|||
assertTrue(enumDeclaration.toEnumDeclaration().isPresent()); | |||
} | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are you making changes without added value?
Thank you for the feedback. I understand the changes that need to be made. However, I have some final exams coming up over the next couple of weeks. Would it be okay if I made these changes after my exams? Thank you for your understanding. |
No problem, I'll wait to validate this PR. Good luck for the exams. |
Thank you so much for your understanding and patience 😀 |
Do you have time to update this PR or should I close it? |
Fixes #820 .
This is a cleaner version of my previous PR aimed at improving the code coverage for the 'body' package.
Key Highlights
Code Coverage Progress
Notes from Previous PRs
I am aware of the concerns raised in the past regarding changes made in the pom.xml files. I noticed that these files' changes are due to my old commits. To address this, I made a new branch and ensured this PR strictly focuses on improving code coverage without any unrelated changes.
I value the feedback from the maintainers and apologise for any inconvenience caused by my previous submissions. I appreciate your patience and guidance throughout this process.