Package org.joda.beans.test
Class JodaBeanTests
- java.lang.Object
-
- org.joda.beans.test.JodaBeanTests
-
public final class JodaBeanTests extends Object
A utility class to assist with testing beans.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.
-
-
Field Summary
Fields Modifier and Type Field 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 Summary
Constructors Constructor Description JodaBeanTests()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method 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.
-
-
-
Field Detail
-
TEST_COVERAGE_PROPERTY
public static final String TEST_COVERAGE_PROPERTY
This constant can be used to pass to increase test coverage. This is used by someMetaBean
methods in generated classes.- See Also:
- Constant Field Values
-
TEST_COVERAGE_STRING
public static final String TEST_COVERAGE_STRING
This constant can be used to pass to increase test coverage. This is used by someBeanBuilder
set methods in generated classes.- See Also:
- Constant Field Values
-
-
Method Detail
-
coverMutableBean
public static void coverMutableBean(Bean bean)
Test a mutable bean for the primary purpose of increasing test coverage.- Parameters:
bean
- the bean to test
-
coverImmutableBean
public static void coverImmutableBean(ImmutableBean bean)
Test an immutable bean for the primary purpose of increasing test coverage.- Parameters:
bean
- the bean to test
-
coverBeanEquals
public static void coverBeanEquals(Bean bean1, Bean bean2)
Test a bean equals method for the primary purpose of increasing test coverage.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.
- Parameters:
bean1
- the first bean to testbean2
- the second bean to test
-
-