Class ClassSanityTester.FactoryMethodReturnValueTester

    • Method Detail

      • testNulls

        @CanIgnoreReturnValue
        public ClassSanityTester.FactoryMethodReturnValueTester testNulls()
                                                                   throws java.lang.Exception
        Tests null checks against the instance methods of the return values, if any.

        Test fails if default value cannot be determined for a constructor or factory method parameter, or if the constructor or factory method throws exception.

        Returns:
        this tester
        Throws:
        java.lang.Exception
      • testEquals

        @CanIgnoreReturnValue
        public ClassSanityTester.FactoryMethodReturnValueTester testEquals()
                                                                    throws java.lang.Exception
        Tests Object.equals(java.lang.Object) and Object.hashCode() against the return values of the static methods, by asserting that when equal parameters are passed to the same static method, the return value should also be equal; and vice versa.

        Test fails if default value cannot be determined for a constructor or factory method parameter, or if the constructor or factory method throws exception.

        Returns:
        this tester
        Throws:
        java.lang.Exception
      • testSerializable

        @CanIgnoreReturnValue
        public ClassSanityTester.FactoryMethodReturnValueTester testSerializable()
                                                                          throws java.lang.Exception
        Runs serialization test on the return values of the static methods.

        Test fails if default value cannot be determined for a constructor or factory method parameter, or if the constructor or factory method throws exception.

        Returns:
        this tester
        Throws:
        java.lang.Exception
      • testEqualsAndSerializable

        @CanIgnoreReturnValue
        public ClassSanityTester.FactoryMethodReturnValueTester testEqualsAndSerializable()
                                                                                   throws java.lang.Exception
        Runs equals and serialization test on the return values.

        Test fails if default value cannot be determined for a constructor or factory method parameter, or if the constructor or factory method throws exception.

        Returns:
        this tester
        Throws:
        java.lang.Exception