Permalink
Browse files

Merge branch 'possibleScalaJavaInteropBug'

  • Loading branch information...
2 parents 38329da + a800b42 commit 035ca8861434e3bc49d17d0e7cf5ffba931266d9 @schauder committed Dec 30, 2013
@@ -54,6 +54,7 @@ case class ConstraintBuilder(
sls.map {
case s: String => UnnamedPattern(s)
case (n: String, p: String) => NamedPattern(n, p)
+ case p: Pattern => p
}))
}
@@ -1,6 +1,12 @@
package de.schauderhaft.degraph.check;
+import de.schauderhaft.degraph.configuration.NamedPattern;
+import de.schauderhaft.degraph.check.Check;
+
import org.junit.Test;
+import static org.hamcrest.core.Is.*;
+
+import static org.junit.Assert.assertThat;
import static de.schauderhaft.degraph.check.Check.classpath;
public class JavaCheckApiTest {
@@ -34,4 +40,22 @@ public void canUseAnyOf() {
public void canUseOneOf() {
JLayer.oneOf("b", "c", "d");
}
+
+ @Test
+ public void degraphHonoursItsConstraintsJavaStyle() {
+ assertThat(
+ classpath()
+ .including("de.schauderhaft.**")
+ .withSlicing("part", "de.schauderhaft.*.(*).**")
+ .withSlicing(
+ "lib",
+ "de.schauderhaft.**(Test)",
+ new NamedPattern("main", "de.schauderhaft.*.**"))
+ .withSlicing(
+ "internalExternal",
+ new NamedPattern("internal",
+ "de.schauderhaft.**"),
+ new NamedPattern("external", "**")),
+ is(Check.violationFree()));
+ }
}

0 comments on commit 035ca88

Please sign in to comment.