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

Added Unit tests for StringUtil class #2913

Merged
merged 1 commit into from
Mar 26, 2020

Conversation

LeoNerdoG
Copy link
Contributor

@LeoNerdoG LeoNerdoG commented Mar 24, 2020

I have added unit tests for StringUtil class whichc has not yet been covered with the tests, so the coverage of this file
went from 0% to 85% (line coverage). I still have to add additional tests for "splitValues" method, which has not et been tested
because I do not want to exceed 1k LOC.

Signed-off-by: Leonardo Gaube leonardo.gaube@comtrade.com

Related Issue
This PR fixes/closes #2912

Description of the solution adopted
The tests are written in pure JUnit style, although we have some written in cucumber - if necessary I will rewrite them, but for the time being we are just trying to increase the code coverage and to find some hidden bugs if there are any.

Screenshots
/

Any side note on the changes made
/

@codecov
Copy link

codecov bot commented Mar 24, 2020

Codecov Report

Merging #2913 into develop will increase coverage by 0.54%.
The diff coverage is n/a.

Impacted file tree graph

@@              Coverage Diff              @@
##             develop    #2913      +/-   ##
=============================================
+ Coverage      55.64%   56.19%   +0.54%     
- Complexity      2531     2535       +4     
=============================================
  Files           1040     1040              
  Lines          22568    22568              
  Branches        2036     2036              
=============================================
+ Hits           12557    12681     +124     
+ Misses          9067     8959     -108     
+ Partials         944      928      -16     
Impacted Files Coverage Δ Complexity Δ
...atch/persistence/jpa/JpaExecutionInstanceData.java 90.24% <0.00%> (+2.43%) 23.00% <0.00%> (+1.00%)
...ages/job/DevicePackageDownloadTargetProcessor.java 100.00% <0.00%> (+5.00%) 9.00% <0.00%> (+1.00%)
...obDeviceManagementOperationManagerServiceImpl.java 79.26% <0.00%> (+6.09%) 14.00% <0.00%> (+1.00%)
...ua/commons/configuration/metatype/TscalarImpl.java 100.00% <0.00%> (+10.52%) 0.00% <0.00%> (ø%)
...rtz/persistence/KapuaQuartzConnectionProvider.java 100.00% <0.00%> (+12.50%) 5.00% <0.00%> (+1.00%)
...ava/org/eclipse/kapua/commons/util/StringUtil.java 77.22% <0.00%> (+62.22%) 0.00% <0.00%> (ø%)
...pse/kapua/commons/util/KapuaCommonsErrorCodes.java 100.00% <0.00%> (+100.00%) 0.00% <0.00%> (ø%)

@LeoNerdoG
Copy link
Contributor Author

Hey @Coduz,
can you please merge this PR? All the tests have passed, code coverage is positive.
These are only Unit tests for StringUtil class.

Thanks!

@LeoNerdoG LeoNerdoG force-pushed the commonsUnitTests branch 2 times, most recently from 9b60cda to fccf965 Compare March 25, 2020 10:28
I have added unit tests for StringUtil class whichc has not yet been covered with the tests, so the coverage of this file
went from 0% to 85% (line coverage). I still have to add additional tests for "splitValues" method, which has not et been tested
because I do not want to exceed 1k LOC.

Signed-off-by: Leonardo Gaube <leonardo.gaube@comtrade.com>
@Coduz Coduz merged commit f743efd into eclipse-kapua:develop Mar 26, 2020
@LeoNerdoG LeoNerdoG deleted the commonsUnitTests branch April 22, 2020 05:23
@Coduz Coduz added the Test Test related stuff. It's a dirty job, but someone needs to do that! label May 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Test Test related stuff. It's a dirty job, but someone needs to do that!
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Create Unit Tests for StringUtil Class in Commons Package
2 participants