Sounds interesting Charles.

I guess it should require more dependence on Hamcrest, which may be some
extra cost for building and footprint? So would you please describe what the
advantages are, and share your experience? Or share us some examples?

2009/8/6 Charles Lee <littlee1...@gmail.com>

> Hi guys,
>
> These days I am writing some testcase to the harmony using Hamcrest. I'd
> like to introduce harmcrest to the community :-)
>
> Hamcrest provides a library of matcher objects (also known as constraints
> or
> predicates) allowing 'match' rules to be defined declaratively, to be used
> in other frameworks. It maybe the only third-party plugin which junit
> supports. Check out these beautiful asserts:
> 1. assertThat(object1, equalTo(object2))
> 2. assertThat(object1, is(anything()))
> 3. assertThat(boolean, allOf(boolean1, boolean2))   (like and)
> 4. assertThat(boolean, anyOf(boolean1, boolean2)) (like or)
> 5. assertThat(obj1, instanceOf(CLASS))
> 6. assertThat(obj1, compatibleTo(CLASS))
> .............
>
> Hamcrest makes unit tests more readable. Besides it speed my unit coding
> :-)
>
> More detail, please visit Hamcrest <http://code.google.com/p/hamcrest/>.
>
> --
> Yours sincerely,
> Charles Lee
>



-- 

Best Regards!

Jimmy, Jing Lv
China Software Development Lab, IBM

Reply via email to