Testing Matchers and AbstractMatcherTest

36 views
Skip to first unread message

Martin Eigenbrodt

unread,
Oct 1, 2016, 10:21:41 AM10/1/16
to Hamcrest Java Users
Hi There,

I noticed AbstractMatcherTest is used to test Matcher and I'd like to use it for my custom matchers. However it seem not to be
part of the maven artefacts.
How do others test there Matchers?

Regards,

Martin

Colin Vipurs

unread,
Oct 1, 2016, 11:31:48 AM10/1/16
to hamcre...@googlegroups.com
Hey Martin,

I would guess it's not part of the artifacts because it's part of the test/ sources so wouldn't be uploaded automatically.

If you're writing a matcher to use as part of an actual test, i.e when doing your business logic - I wouldn't.  Seeing a failing test and checking the diagnostics is how I'd verify the matcher works.   If I was writing a Matcher as part of someone I wanted to redistribute the Matcher would be part of src/main and I'd write tests as normal under src/test.

As Hamcrest is licensed under BSD you could effectively just copy the AbstractMatcherTest into your own project and use it directly, following the license terms of course.

--
You received this message because you are subscribed to the Google Groups "Hamcrest Java Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hamcrest-java+unsubscribe@googlegroups.com.
To post to this group, send email to hamcre...@googlegroups.com.
Visit this group at https://groups.google.com/group/hamcrest-java.
For more options, visit https://groups.google.com/d/optout.



--
Maybe she awoke to see the roommate's boyfriend swinging from the chandelier wearing a boar's head.

Something which you, I, and everyone else would call "Tuesday", of course.

Martin Eigenbrodt

unread,
Oct 1, 2016, 1:04:38 PM10/1/16
to hamcre...@googlegroups.com
Thanks for the reply Colin,

> If you're writing a matcher to use as part of an actual test, i.e when doing your business logic - I wouldn't. Seeing a failing test and checking the diagnostics is how I'd verify the matcher works. If I was writing a Matcher as part of someone I wanted to redistribute the Matcher would be part of src/main and I'd write tests as normal under src/test.

Yes. I am trying to write a "library" of matchers.

> As Hamcrest is licensed under BSD you could effectively just copy the AbstractMatcherTest into your own project and use it directly, following the license terms of course.

Thats what I do right now, just wanted to make sure I didn't miss anything.


>
> On Sat, Oct 1, 2016 at 3:21 PM, Martin Eigenbrodt <martinei...@gmail.com> wrote:
> Hi There,
>
> I noticed AbstractMatcherTest is used to test Matcher and I'd like to use it for my custom matchers. However it seem not to be
> part of the maven artefacts.
> How do others test there Matchers?
>
> Regards,
>
> Martin
>
> --
> You received this message because you are subscribed to the Google Groups "Hamcrest Java Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to hamcrest-jav...@googlegroups.com.
> To post to this group, send email to hamcre...@googlegroups.com.
> Visit this group at https://groups.google.com/group/hamcrest-java.
> For more options, visit https://groups.google.com/d/optout.
>
>
>
> --
> Maybe she awoke to see the roommate's boyfriend swinging from the chandelier wearing a boar's head.
>
> Something which you, I, and everyone else would call "Tuesday", of course.
>
> --
> You received this message because you are subscribed to the Google Groups "Hamcrest Java Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to hamcrest-jav...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages