Skip to content

Truth 0.29

Compare
Choose a tag to compare
@cgruber cgruber released this 10 Aug 20:33
· 1217 commits to master since this release

Pushing towards a 1.0 release
Maven Release

New Subjects

  • AtomicLongMapSubject

Changes to existing Subjects and Core classes

  • Preliminary versions of "Fuzzy Equality" for doubles/floats. See DoublesSubject for
    new APIs, and we'll be updating the docs on fuzzy equality soon.
  • Prefer isEqualTo instead of equals since that is a method with a fairly precise
    meaning in Java, and we were hijacking it. .equals() shouldn't be called on Subject
    implementations.
  • Multidimensional Array support in ObjectArraySubject
  • Lots of renames and deprecations.
  • SPI/API cleanup
    • marking a lot of subjects or their methods final, or noting where we can't
    • start making parts of the infrastructure more in line with the Open/Closed Principle
      (final methods, etc.)
    • stop storing "failure message" in the TestVerb, part 1

New Extensions

  • An extension/contrib submodule, for things we want to ship with Truth,
    but which may need to be separate artifacts, mostly due to dependency
    issues or general bloat. Including our first entry: RE2J

    Support for MessageLite protocol buffers is also in extensions, but not released
    in 0.29.

Fixes

  • Some cleanups of generics
  • Message improvements:
    • Trim some stack trace of the obvious truth frames, to make it clearer where the
      locus of error is. (i.e. who needs to see Subject.failComparing() in the stack trace?)
    • ThrowableSubject uses string comparision where reasonable (to take advantage of
      JUnit's ComparisonFailure)
    • fix BooleanSubject's handling of null in failure messaging
    • other message improvements

Miscellaneous

  • Apply @CheckReturnValue across a wide range of methods (on by default).
    • Users are _strongly_ advised to use error-prone in their builds, to ensure
      that this is checked, and the compiler errors out when people fail to call the
      following chained methods.
  • build and continuous test system fixes
  • more recent upstream dependencies
  • full formating of the codebase using google-java-format
  • various improvements from error-prone
  • improvements to the examples
  • more flesh out some holes in the tests

Note: various methods are being deprecated in preparation for 1.0. A penultimate
pre-1.0 release will be cut with those deprecated methods intact. Then a 1.0 will
be released with those methods removed. This should give people a chance to
get the 1.0 features and benefits, but have a nice transition phase.