Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test matchers location #169

Closed
akryvtsun opened this issue Jun 16, 2017 · 11 comments
Closed

Test matchers location #169

akryvtsun opened this issue Jun 16, 2017 · 11 comments

Comments

@akryvtsun
Copy link
Contributor

akryvtsun commented Jun 16, 2017

At this moment some successors of org.hamcrest.TypeSafeMatcher are located at root org.cactoos package among important high level interfaces. I think the new matchers should be removed from this place somewhere.

  1. The best options is to put them into a new library e.g. cactoos-test is dependent from cactoos. In this case these classes will not be located in client prod code if it's used prod cactoos lib. The client has to use cactoos-test only for it's tests via test scope dependency (<scope>test</scope> in Maven). This idea is used e.g. Spring Framework: it has 'spring-core' and 'spring-test'.

  2. The easiest option is to move them at least into specialized org.cactoos.match package don't to pollute the root package.

WDYT?

@0crat
Copy link
Collaborator

0crat commented Jun 16, 2017

@Englishman I'm not managing this repo, remove the webhook or contact me in Slack //cc @yegor256

@fabriciofx
Copy link
Contributor

@Englishman At the moment, we have only two matchers, right? So, I think we can follow the 2nd option, move them to a org.cactoos.math for a while. When the classes number grow up, we can think in move them to another library. WDYT?

@akryvtsun
Copy link
Contributor Author

@fabriciofx 3 of them. But there is another problem: dependencies. Marchers use some entities from prod cactoos code but tests for prod lib code need matchers. So...

@fabriciofx
Copy link
Contributor

@Englishman Well, so the simplest solution is just create a new package and put the matchers there. WDYT?

@yegor256
Copy link
Owner

@Englishman looks like cactoos-test is the best option. Maybe we can create our own alternative to Hamcrest there?

@akryvtsun
Copy link
Contributor Author

@yegor256 let me think about cactoos-test more... As I wrote earlier the main problem here is cyclic dependency. BTW why do we use Hamcrest but not AssertJ?

@yegor256
Copy link
Owner

@Englishman didn't know about AssertJ :( Will take a look now.

@yegor256
Copy link
Owner

@Englishman AssertJ syntax looks nicer that Hamcrest, but it's less object-oriented :) We need something that will be more declarations and less about procedures/instructions/commands.

@llorllale
Copy link
Contributor

@Englishman we're going to separate the matchers into their own project as discussed in #751

Please close this issue

@llorllale
Copy link
Contributor

@Englishman closing

@0crat
Copy link
Collaborator

0crat commented Apr 25, 2018

The job is not in WBS, won't close the order

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants