public final class JodaBeanTests extends Object
Test coverage statistics can be heavily skewed by getters, setters and generated code. This class provides a solution, allowing bean test coverage to be artificially increased. Always remember that the goal of artificially increasing coverage is so that you can see what you really need to test, not to avoid writing tests altogether.
| Modifier and Type | Field and Description |
|---|---|
static String |
TEST_COVERAGE_PROPERTY
This constant can be used to pass to increase test coverage.
|
static String |
TEST_COVERAGE_STRING
This constant can be used to pass to increase test coverage.
|
| Constructor and Description |
|---|
JodaBeanTests() |
| Modifier and Type | Method and Description |
|---|---|
static void |
coverBeanEquals(Bean bean1,
Bean bean2)
Test a bean equals method for the primary purpose of increasing test coverage.
|
static void |
coverImmutableBean(ImmutableBean bean)
Test an immutable bean for the primary purpose of increasing test coverage.
|
static void |
coverMutableBean(Bean bean)
Test a mutable bean for the primary purpose of increasing test coverage.
|
public static final String TEST_COVERAGE_PROPERTY
MetaBean methods in generated classes.public static final String TEST_COVERAGE_STRING
BeanBuilder set methods in generated classes.public static void coverMutableBean(Bean bean)
bean - the bean to testpublic static void coverImmutableBean(ImmutableBean bean)
bean - the bean to testpublic static void coverBeanEquals(Bean bean1, Bean bean2)
The two beans passed in should contain a different value for each property. The method creates a cross-product to ensure test coverage of equals.
bean1 - the first bean to testbean2 - the second bean to testCopyright © 2007–2017 Joda.org. All rights reserved.