- Refactor tests:
- Upgrade tests to use jUnit4
- Add hamcrest dependency (contribution of by Laszio Hornyak)
- Break big tests in small unit tests
- Replace assertTrue/False with complex conditions by assertThat with
specific matchers
- Remove dead code:
- Private static method never called locally
- Add test for method that validates cidrs
Signed-off-by: Laszlo Hornyak <laszlo.hornyak@gmail.com>
- StringBuffer replaced with StringBuilder
- nullcheck of tokens array removed since String.split does not return null
- unit test added
Signed-off-by: Laszlo Hornyak <laszlo.hornyak@gmail.com>
- new utility method introduced in PropertiesUtil to load properties objects from files
- RegionManagerImpl modified to use the utility method
- Tests added for both
Signed-off-by: Laszlo Hornyak <laszlo.hornyak@gmail.com>
Removed the assertion on the number of fields from ReflectUtil because it did not work with bytecode manipulation like what sonar works with.
Signed-off-by: Laszlo Hornyak <laszlo.hornyak@gmail.com>
- code comment turned to javadoc
- added braces to if and for statements to make it look more like the rest
- tests added
Signed-off-by: Laszlo Hornyak <laszlo.hornyak@gmail.com>
- javadoc changed - the old one was copy-pasted from AgentShell
- start and stop method removed - they did the same as the overridden methods
- _counter removed as it was only written, but never read
- remove from _asleep map was moved to a finally block, to make sure it is removed even in case of the thread gets interrupted
- Tests created for the above scenarios.
Signed-off-by: Laszlo Hornyak <laszlo.hornyak@gmail.com>
- removed methods that were not used
- parseLong, parseInt and parseFloat replaced with the commons-lang NumberUtils call
- Test for the remaining methods
Signed-off-by: Laszlo Hornyak <laszlo.hornyak@gmail.com>
Signed-off-by: Hugo Trippaers <htrippaers@schubergphilis.com>
a unit test for the most frequently used methods in the Script class
Signed-off-by: Laszlo Hornyak <laszlo.hornyak@gmail.com>
Signed-off-by: Prasanna Santhanam <tsp@apache.org>
commons-lang is already a transitive dependency of the utils project, which allows removing some duplicated functionality.
This patch replaces StringUtils.join(String, Object...) with it's commons-lang counterpart.
It also replaces calls to String join(Iterable<? extends Object>, String) in cases where an array is already exist and it is only wrapped into a List.
Signed-off-by: Laszlo Hornyak <laszlo.hornyak@gmail.com>