create account

Truth java assertion framework releases v0.29 by christiangruber

View this thread on: hive.blogpeakd.comecency.com
· @christiangruber · (edited)
Truth java assertion framework releases v0.29
# About Truth
[ ![Main Site](https://img.shields.io/badge/main%20site-google.github.io/truth-aa55ff.png?style=flat)][gh-pages-link][ ![Maven Release](https://img.shields.io/badge/maven-com.google.truth:truth:0.29-6666ff.png?style=flat)][maven-link][ ![Release Page](https://img.shields.io/github%20release/v0.29.png)][github-release][ ![License](https://img.shields.io/github/license/google/truth.png)][Apache 2.0]

Truth is a [Java] test [assertion framework] that provides assertions/propositions to apply to objects-under-test. It is intended to be used with the JUnit test infrastructure, and can be used in the context of unit or integration tests. 

Truth seeks to apply a [fluent interface] to testing, and was inspired by [FEST], and is the [main way that Google writes its android and java tests internally][tott].  Its goal is to allow for tests whose assertions are readable and match a quasi-english style, such as `assertThat(someString).contains("some substring")`.  More readable tests make for less error-prone tests. 

Truth is an [open-source project hosted at Github][truth-github] and is permissively licensed under [Apache 2.0], and its main website [can be found here][truth-website].

# v 0.29 - pushing towards 1.0

## Newly Supported Types

  * AtomicLongMap

## 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. 

[gh-pages-link]: http://google.github.io/truth/
[maven-link]:http://search.maven.org/#search%7Cga%7C1%7Ccom.google.truth%20
[github-release]: https://github.com/google/truth/releases/tag/release_0_29
[Java]: https://en.wikipedia.org/wiki/Java_(programming_language)
[assertion framework]: https://dzone.com/articles/brief-overview-java-assertions
[tott]: http://googletesting.blogspot.com/2014/12/testing-on-toilet-truth-fluent.html
[fluent interface]: https://en.wikipedia.org/wiki/Fluent_interface
[FEST]: https://github.com/alexruiz/fest-assert-2.x
[truth-github]: http://github.com/google/truth
[truth-website]: http://google.github.io/truth
 [Apache 2.0]: https://github.com/google/truth/blob/master/LICENSE
[release link on github]: https://github.com/google/truth/releases/tag/release_0_29
[google-java-format]: http://github.com/google/google-java-format
[error-prone]: http://github.com/google/error-prone
👍  , , ,
properties (23)
authorchristiangruber
permlinktruth-java-assertion-framework-releases-v0-29
categorysoftware
json_metadata{"tags":["software","java","testing","release","truth"],"image":["https://img.shields.io/badge/main%20site-google.github.io/truth-aa55ff.png?style=flat"]}
created2016-08-10 22:44:45
last_update2016-08-10 23:57:54
depth0
children0
last_payout2016-09-10 11:09:00
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length4,708
author_reputation28,846,042,835
root_title"Truth java assertion framework releases v0.29"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id734,851
net_rshares2,808,344,131
author_curate_reward""
vote details (4)