Skip to content

Prabhjot kaur test branch: added different types of test in 3 differnet test files #1370

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

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

Jyotprabhs
Copy link

Thanks for your contribution to Apache Commons! Your help is appreciated!

Before you push a pull request, review this list:

  • Read the contribution guidelines for this project.
  • Run a successful build using the default Maven goal with mvn; that's mvn on the command line by itself.
  • Write unit tests that match behavioral changes, where the tests fail if the changes to the runtime are not applied. This may not always be possible but is a best-practice.
  • Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
  • Each commit in the pull request should have a meaningful subject line and body. Note that commits might be squashed by a maintainer on merge.

Copy link
Member

@garydgregory garydgregory left a comment

Choose a reason for hiding this comment

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

-1: Duplicates existing tests, build fails.

By just looking at the first few methods, I can see this PR just duplicates existing tests in StringUtilsTest. For example StringUtilsTest.testReverse_String()

We test in:

  • StringUtilsContainsTest
  • StringUtilsEmptyBlankTest
  • StringUtilsEqualsIndexOfTest
  • StringUtilsIsMixedCaseTest
  • StringUtilsIsTest
  • StringUtilsStartsEndsWithTest
  • StringUtilsSubstringTest
  • StringUtilsTest
  • StringUtilsTrimStripTest
  • StringUtilsValueOfTest

Please be considerate and do not create duplicate tests, which wastes maintainers' time in reviews. Please analyze what we already have before asking maintainers to spend their time on your code.

Was this code generated?

Why do the new classes carry a "PK" postfix in their names? If the name is meaningful, you should call it out in a Javadoc comment. Note that by convention in this component, all test classes are postfixed with "Test" only.

The PR does not have a description with your intended goal. Did you examine the JaCoCo code coverage report and find a branch or method not covered?

If you let us know what you’re trying to do, this helps us help you if appropriate for the PR.

You also did follow the instructions by running mvn by itself in order to run all build checks. When I apply the PR locally, the build fails:

[ERROR] src/test/java/org/apache/commons/lang3/math/NumberUtils_TestPK.java:[30] (regexp) RegexpSingleline: Line has trailing spaces.
[ERROR] src/test/java/org/apache/commons/lang3/math/NumberUtils_TestPK.java:[30,36] (whitespace) NoWhitespaceBefore: ',' is preceded with whitespace.
[ERROR] src/test/java/org/apache/commons/lang3/math/NumberUtils_TestPK.java:[31,34] (whitespace) NoWhitespaceBefore: ',' is preceded with whitespace.
[ERROR] src/test/java/org/apache/commons/lang3/math/NumberUtils_TestPK.java:[37] (regexp) RegexpSingleline: Line has trailing spaces.
[ERROR] src/test/java/org/apache/commons/lang3/math/NumberUtils_TestPK.java:[42] (regexp) RegexpSingleline: Line has trailing spaces.
[ERROR] src/test/java/org/apache/commons/lang3/math/NumberUtils_TestPK.java:[42,48] (whitespace) WhitespaceAfter: ',' is not followed by whitespace.
[ERROR] src/test/java/org/apache/commons/lang3/math/NumberUtils_TestPK.java:[42,50] (whitespace) WhitespaceAfter: ',' is not followed by whitespace.
[ERROR] src/test/java/org/apache/commons/lang3/math/NumberUtils_TestPK.java:[42,53] (whitespace) WhitespaceAfter: ',' is not followed by whitespace.
[ERROR] src/test/java/org/apache/commons/lang3/math/NumberUtils_TestPK.java:[42,80] (whitespace) WhitespaceAround: '+' is not followed by whitespace.
[ERROR] src/test/java/org/apache/commons/lang3/math/NumberUtils_TestPK.java:[46] (regexp) RegexpSingleline: Line has trailing spaces.
[ERROR] src/test/java/org/apache/commons/lang3/math/NumberUtils_TestPK.java:[48,30] (whitespace) WhitespaceAround: '{' is not preceded with whitespace.
[ERROR] src/test/java/org/apache/commons/lang3/math/NumberUtils_TestPK.java:[49,42] (whitespace) WhitespaceAfter: ',' is not followed by whitespace.
[ERROR] src/test/java/org/apache/commons/lang3/math/NumberUtils_TestPK.java:[49,44] (whitespace) WhitespaceAfter: ',' is not followed by whitespace.
[ERROR] src/test/java/org/apache/commons/lang3/math/NumberUtils_TestPK.java:[49,46] (whitespace) WhitespaceAfter: ',' is not followed by whitespace.
[ERROR] src/test/java/org/apache/commons/lang3/math/NumberUtils_TestPK.java:[49,48] (whitespace) WhitespaceAfter: ',' is not followed by whitespace.
[ERROR] src/test/java/org/apache/commons/lang3/math/NumberUtils_TestPK.java:[52,31] (whitespace) WhitespaceAround: '{' is not preceded with whitespace.
[ERROR] src/test/java/org/apache/commons/lang3/math/NumberUtils_TestPK.java:[53,42] (whitespace) WhitespaceAfter: ',' is not followed by whitespace.
[ERROR] src/test/java/org/apache/commons/lang3/math/NumberUtils_TestPK.java:[53,44] (whitespace) WhitespaceAfter: ',' is not followed by whitespace.
[ERROR] src/test/java/org/apache/commons/lang3/math/NumberUtils_TestPK.java:[53,46] (whitespace) WhitespaceAfter: ',' is not followed by whitespace.
[ERROR] src/test/java/org/apache/commons/lang3/math/NumberUtils_TestPK.java:[53,48] (whitespace) WhitespaceAfter: ',' is not followed by whitespace.
[ERROR] src/test/java/org/apache/commons/lang3/math/NumberUtils_TestPK.java:[56,29] (whitespace) WhitespaceAround: '{' is not preceded with whitespace.
[ERROR] src/test/java/org/apache/commons/lang3/math/NumberUtils_TestPK.java:[57,42] (whitespace) WhitespaceAfter: ',' is not followed by whitespace.
[ERROR] src/test/java/org/apache/commons/lang3/math/NumberUtils_TestPK.java:[57,44] (whitespace) WhitespaceAfter: ',' is not followed by whitespace.
[ERROR] src/test/java/org/apache/commons/lang3/math/NumberUtils_TestPK.java:[57,46] (whitespace) WhitespaceAfter: ',' is not followed by whitespace.
[ERROR] src/test/java/org/apache/commons/lang3/math/NumberUtils_TestPK.java:[57,48] (whitespace) WhitespaceAfter: ',' is not followed by whitespace.
[ERROR] src/test/java/org/apache/commons/lang3/math/NumberUtils_TestPK.java:[60,41] (whitespace) WhitespaceAround: '{' is not preceded with whitespace.
[ERROR] src/test/java/org/apache/commons/lang3/math/NumberUtils_TestPK.java:[61,44] (whitespace) WhitespaceAfter: ',' is not followed by whitespace.
[ERROR] src/test/java/org/apache/commons/lang3/math/NumberUtils_TestPK.java:[61,47] (whitespace) WhitespaceAfter: ',' is not followed by whitespace.
[ERROR] src/test/java/org/apache/commons/lang3/math/NumberUtils_TestPK.java:[61,50] (whitespace) WhitespaceAfter: ',' is not followed by whitespace.
[ERROR] src/test/java/org/apache/commons/lang3/math/NumberUtils_TestPK.java:[61,53] (whitespace) WhitespaceAfter: ',' is not followed by whitespace.
[ERROR] src/test/java/org/apache/commons/lang3/math/NumberUtils_TestPK.java:[64,38] (whitespace) WhitespaceAround: '{' is not preceded with whitespace.
[ERROR] src/test/java/org/apache/commons/lang3/math/NumberUtils_TestPK.java:[65,44] (whitespace) WhitespaceAfter: ',' is not followed by whitespace.
[ERROR] src/test/java/org/apache/commons/lang3/math/NumberUtils_TestPK.java:[65,46] (whitespace) WhitespaceAfter: ',' is not followed by whitespace.
[ERROR] src/test/java/org/apache/commons/lang3/math/NumberUtils_TestPK.java:[65,49] (whitespace) WhitespaceAfter: ',' is not followed by whitespace.
[ERROR] src/test/java/org/apache/commons/lang3/math/NumberUtils_TestPK.java:[65,51] (whitespace) WhitespaceAfter: ',' is not followed by whitespace.
[ERROR] src/test/java/org/apache/commons/lang3/math/NumberUtils_TestPK.java:[68,41] (whitespace) WhitespaceAround: '{' is not preceded with whitespace.
[ERROR] src/test/java/org/apache/commons/lang3/math/NumberUtils_TestPK.java:[73,28] (whitespace) WhitespaceAround: '{' is not preceded with whitespace.
[ERROR] src/test/java/org/apache/commons/lang3/math/NumberUtils_TestPK.java:[77,29] (whitespace) WhitespaceAround: '{' is not preceded with whitespace.
[ERROR] src/test/java/org/apache/commons/lang3/math/NumberUtils_TestPK.java:[80] (regexp) RegexpSingleline: Line has trailing spaces.
[ERROR] src/test/java/org/apache/commons/lang3/StringUtils_TestPK.java:[22,1] (imports) RedundantImport: Redundant import from the same package - org.apache.commons.lang3.StringUtils.
[ERROR] src/test/java/org/apache/commons/lang3/StringUtils_TestPK.java:[28,35] (whitespace) WhitespaceAround: '{' is not preceded with whitespace.
[ERROR] src/test/java/org/apache/commons/lang3/StringUtils_TestPK.java:[31] (regexp) RegexpSingleline: Line has trailing spaces.
[ERROR] src/test/java/org/apache/commons/lang3/StringUtils_TestPK.java:[32,39] (whitespace) WhitespaceAround: '{' is not preceded with whitespace.
[ERROR] src/test/java/org/apache/commons/lang3/StringUtils_TestPK.java:[33] (regexp) RegexpSingleline: Line has trailing spaces.
[ERROR] src/test/java/org/apache/commons/lang3/StringUtils_TestPK.java:[36] (regexp) RegexpSingleline: Line has trailing spaces.
[ERROR] src/test/java/org/apache/commons/lang3/StringUtils_TestPK.java:[37,38] (whitespace) WhitespaceAround: '{' is not preceded with whitespace.
[ERROR] src/test/java/org/apache/commons/lang3/StringUtils_TestPK.java:[38] (regexp) RegexpSingleline: Line has trailing spaces.
[ERROR] src/test/java/org/apache/commons/lang3/StringUtils_TestPK.java:[41] (regexp) RegexpSingleline: Line has trailing spaces.
[ERROR] src/test/java/org/apache/commons/lang3/StringUtils_TestPK.java:[42,34] (whitespace) WhitespaceAround: '{' is not preceded with whitespace.
[ERROR] src/test/java/org/apache/commons/lang3/StringUtils_TestPK.java:[43] (regexp) RegexpSingleline: Line has trailing spaces.
[ERROR] src/test/java/org/apache/commons/lang3/StringUtils_TestPK.java:[46] (regexp) RegexpSingleline: Line has trailing spaces.
[ERROR] src/test/java/org/apache/commons/lang3/StringUtils_TestPK.java:[47,29] (whitespace) WhitespaceAround: '{' is not preceded with whitespace.
[ERROR] src/test/java/org/apache/commons/lang3/StringUtils_TestPK.java:[48] (regexp) RegexpSingleline: Line has trailing spaces.
[ERROR] src/test/java/org/apache/commons/lang3/StringUtils_TestPK.java:[52,48] (whitespace) WhitespaceAround: '{' is not preceded with whitespace.
[ERROR] src/test/java/org/apache/commons/lang3/StringUtils_TestPK.java:[53] (regexp) RegexpSingleline: Line has trailing spaces.
[ERROR] src/test/java/org/apache/commons/lang3/CharUtils_TestPK.java:[29,24] (whitespace) NoWhitespaceBefore: ',' is preceded with whitespace.
[ERROR] src/test/java/org/apache/commons/lang3/CharUtils_TestPK.java:[30,24] (whitespace) NoWhitespaceBefore: ',' is preceded with whitespace.
[ERROR] src/test/java/org/apache/commons/lang3/CharUtils_TestPK.java:[31,24] (whitespace) NoWhitespaceBefore: ',' is preceded with whitespace.
[ERROR] src/test/java/org/apache/commons/lang3/CharUtils_TestPK.java:[32,24] (whitespace) NoWhitespaceBefore: ',' is preceded with whitespace.
[ERROR] src/test/java/org/apache/commons/lang3/CharUtils_TestPK.java:[34,29] (whitespace) NoWhitespaceBefore: ',' is preceded with whitespace.
[ERROR] src/test/java/org/apache/commons/lang3/CharUtils_TestPK.java:[34,29] (whitespace) WhitespaceAfter: ',' is not followed by whitespace.
[ERROR] src/test/java/org/apache/commons/lang3/CharUtils_TestPK.java:[38,64] (whitespace) WhitespaceAround: '{' is not preceded with whitespace.
[ERROR] src/test/java/org/apache/commons/lang3/CharUtils_TestPK.java:[42] (regexp) RegexpSingleline: Line has trailing spaces.
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  18.030 s
[INFO] Finished at: 2025-04-07T08:12:31-04:00
[INFO] ------------------------------------------------------------------------

TY.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants