@@ -4,7 +4,7 @@ Here you can compare pojo-tester to existing java libraries that test `pojo-meth
4
4
## Other libraries {#other-libs}
5
5
Here is the list of libraries that were found on the Internet. If you find another one, feel free to write a comparison and include it into your pull request.
6
6
7
- * pojo-tester 0.4 .0
7
+ * pojo-tester 0.5 .0
8
8
* [ openpojo] ( http://openpojo.com ) 0.8.4
9
9
* [ SmartUnit] ( https://github.com/rlogiacco/SmartUnit ) 0.10.2
10
10
* [ testUtils] ( http://outsidemybox.github.io/testUtils/index.html ) 0.1.3
@@ -40,26 +40,27 @@ Each library provides different testing features. Here is the comparison.
40
40
41
41
Basic ` pojo-methods ` test support:
42
42
43
- | Kind of tests | pojo-tester | OpenPojo | SmartUnit | testUtils | testUtil | Mean Bean |
44
- | --- | :---: | :---: | :---: | :---: | :---: | :---: |
45
- | getters | ✓ | ✓ | ✓ ^ | ✓ | ✓ ^ | ✓ |
46
- | setters | ✓ | ✓ | ✓ ^ | ✓ | ✓ ^ | ✓ |
47
- | equals | ✓ | ✓ * ^ | ✕ | ✓ | ✕ | ✓ ^ |
48
- | hashCode | ✓ | ✓ * ^ | ✕ | ✓ | ✕ | ✓ ^ |
49
- | toString | ✓ | ✓ * ^ | ✕ | ✓ | ✕ | ✕ |
50
- |||||||||
51
- | Additional features ||
43
+ | Kind of tests | pojo-tester | OpenPojo | SmartUnit | testUtils | testUtil | Mean Bean |
44
+ | --- | :---: | :---: | :---: | :---: | :---: | :---: |
45
+ | getters | ✓ | ✓ | ✓ ^ | ✓ | ✓ ^ | ✓ |
46
+ | setters | ✓ | ✓ | ✓ ^ | ✓ | ✓ ^ | ✓ |
47
+ | equals | ✓ | ✓ * ^ | ✕ | ✓ | ✕ | ✓ ^ |
48
+ | hashCode | ✓ | ✓ * ^ | ✕ | ✓ | ✕ | ✓ ^ |
49
+ | toString | ✓ | ✓ * ^ | ✕ | ✓ | ✕ | ✕ |
50
+ | constructors | ✓ | ✕ | ✕ | ✕ | ✕ | ✕ |
51
+ ||||||||
52
+ | Additional features |
52
53
| field selection | ✓ | ✓ | ✓ | ✓ | ✕ | ✓ |
53
54
| method selection | ✓ | ✓ | ✕ | ✕ | ✕ | ✓ |
54
55
| supports nonpublic classes | ✓ | ✓ | ✕ | ✓ | ✕ | ✕ |
55
56
| supports non-default constructors | ✓ | ✓ | ✕ | ✓ | ✕ | ✕ |
56
57
| recurrence support | ✓ | ✕ | ✕ | ✕ | ✕ | ✕ |
57
58
| creating object by user defined constructor | ✓ | ✕ | ✕ | ✕ | ✕ | ✕ |
58
59
| custom changing fields values | ✓ | ✕ | ✕ | ✕ | ✕ | ✕ |
59
- | package-testing | ✕ | ✓ | ✕ | ✕ | ✕ | ✕ |
60
+ | package-testing | ✓ | ✓ | ✕ | ✕ | ✕ | ✕ |
60
61
61
62
\* limited support for changing fields recursively and otherwise having problems with fields other than primitives.
62
- Libraries throw exceptions from java core, which does mean nothing.
63
+
63
64
^ requires additional changes in your production code
64
65
65
66
### Tests
@@ -280,9 +281,6 @@ And there is one more thing. Tests (internal, in library implementation) using M
280
281
` POJO-TESTER ` does the job. It provides stable coverage with the highest percentage. See numbers below.
281
282
![ ] ( coverage-comparison.png )
282
283
283
- Next thing that ` POJO-TESTER ` can do, but other libraries cannot, is recursively testing fields.
284
- This means your tests are more sure.
285
-
286
284
We have done one more code coverage report using changing nested fields.
287
285
From those tests we excluded three libraries - Mean Bean, Smart Unit and TestUtil.
288
286
They simply could not perform such tests and threw undefined exceptions.
@@ -316,4 +314,11 @@ Disadvantages are:
316
314
* it has variable coverage report, which can cause unwanted CI reports
317
315
* it does not support recurrence which can be a deal breaker, especially if you use enums or VOs (Value Objects)
318
316
317
+ Next thing that ` POJO-TESTER ` can do, but other libraries cannot, is recursively testing fields.
318
+ This means your tests are more sure.
319
+
320
+ And last but not least which makes ` POJO-TESTER ` awesome is that it can test constructors!
321
+ Now you can forget about getting constructors via reflection, invoking them... What a nightmare. And who is doing this?
322
+ No more reflection in your tests!
323
+
319
324
To sum up, ` POJO-TESTER ` has the highest consistent coverage and its features make your tests more bulletproof.
0 commit comments