-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Added JUnit Testcases to the languagetool repo #9648
base: master
Are you sure you want to change the base?
Conversation
Rootcause: Some of the Java files have 0% branch cause their respective JUnit files werent added. Fix: Added some JUnit testcases to increase the branch coverage overall.
@@ -0,0 +1,62 @@ | |||
package org.languagetool; |
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.
Could you add the standard license header we use? (With your name as the copyright holder?)
|
||
public class GlobalConfigTest { | ||
|
||
/* This tests the equals method */ |
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.
The comment isn't really necessary
// When both objects have the same server, their hash codes should be equal again. | ||
assertEquals(config1.hashCode(), config2.hashCode()); | ||
|
||
config1.setBeolingusFile(new File("file1")); |
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.
Could you use a different property? beoLingus isn't used anymore and might soon be removed
|
||
@Test | ||
public void testHashCode() { | ||
// Create a SentenceRange object |
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.
These comments are not needed
dateHelper = new YMDDateHelper(); | ||
} | ||
|
||
/* This checks the "parseData" method */ |
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.
Please remove the comments that don't provide value
Rootcause: Some design and/or implementation smells were not fixed. This was found as part while running the designite tool. Fix: Used refactoring techniques like Pull-up method, Introduce explaining variable, Decompose conditional, Extract method and rename variable to fix a few
Rootcause: Some of the Java files have 0% branch cause their respective JUnit files werent added.
Fix: Added some JUnit testcases to increase the branch coverage overall.