degraph icon indicating copy to clipboard operation
degraph copied to clipboard

Documentation error

Open opensource21 opened this issue 8 years ago • 2 comments

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.

opensource21 avatar Feb 07 '17 09:02 opensource21

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

schauder avatar Feb 07 '17 10:02 schauder

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

opensource21 avatar Feb 07 '17 11:02 opensource21