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

Documentation error #80

Open
opensource21 opened this issue Feb 7, 2017 · 2 comments
Open

Documentation error #80

opensource21 opened this issue Feb 7, 2017 · 2 comments

Comments

@opensource21
Copy link

Hi in the documentation I found

classpath().withSlicing(
		"mainVsTest",
		"de.schauderhaft.**(Test)",
		new NamedPattern("main", "de.schauderhaft.*.**"))

how ever it seems that the name must be defined at the end. So

classpath().withSlicing(
		"mainVsTest",
		"de.schauderhaft.**(Test)",
		new NamedPattern("de.schauderhaft.*.**", "main"))

should be correct. However even then a test like

       ConstraintBuilder testObject =
                classpath().noJars().
                including(SZE_BASE_PACKAGE + "**").
                excluding("**.package-info").
                withSlicing(
                        "mainVsTest",
                        SZE_BASE_PACKAGE + ".**(Test)",
                        new NamedPattern(SZE_BASE_PACKAGE + ".*.**", "main")).
                allow("main", "Test");
        assertThat(testObject, is(violationFree()));

doesn't fail, even if I only allow the wrong direction. I came to this issue, trying to define a test which disallow references to any class which is in the package **.(impl).**. Again it's hard to track or debug the slice-definition.

@schauder
Copy link
Collaborator

schauder commented Feb 7, 2017

Can you provide a complete example (e.g. a link to a specific commit in your repository)?

@opensource21
Copy link
Author

No problem: Here is the test
I make all step in the branch Degraph so improved version are here.

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

2 participants