Skip to content
Browse files

added java api for allow and allowDirect

  • Loading branch information...
1 parent 01638e8 commit 3ccab4e461ae9df050d0a3a225779f60811caadd @schauder committed Dec 29, 2013
View
4 src/main/scala/de/schauderhaft/degraph/check/ConstraintBuilder.scala
@@ -35,7 +35,7 @@ case class ConstraintBuilder(
*
* see also #allowDirect
*/
- def allow(slices: AnyRef*): ConstraintBuilder =
+ @varargs def allow(slices: AnyRef*): ConstraintBuilder =
modifyConfig(slices.toIndexedSeq, LayeringConstraint)
/**
@@ -45,7 +45,7 @@ case class ConstraintBuilder(
*
* see also #allow
*/
- def allowDirect(slices: AnyRef*): ConstraintBuilder =
+ @varargs def allowDirect(slices: AnyRef*): ConstraintBuilder =
modifyConfig(slices.toIndexedSeq, DirectLayeringConstraint)
@varargs def withSlicing(sliceType: String, sls: AnyRef*) = {
View
13 src/test/java/de/schauderhaft/degraph/check/JavaCheckApiTest.java
@@ -1,8 +1,7 @@
package de.schauderhaft.degraph.check;
-import static de.schauderhaft.degraph.check.Check.classpath;
-
import org.junit.Test;
+import static de.schauderhaft.degraph.check.Check.classpath;
public class JavaCheckApiTest {
@@ -15,4 +14,14 @@ public void canAccessClasspathConfigurationBuilder() {
public void canDefineSlices() {
classpath().withSlicing("blah", "whatever");
}
+
+ @Test
+ public void canUseAllow() {
+ classpath().withSlicing("blah", "whatever").allow("a", "b", "c");
+ }
+
+ @Test
+ public void canUseAllowDirect() {
+ classpath().withSlicing("blah", "whatever").allowDirect("a", "b", "c");
+ }
}

0 comments on commit 3ccab4e

Please sign in to comment.
Something went wrong with that request. Please try again.