org.coderu.adapters.junit.CoderuAssertAdapter Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of coderu-junit-adapter Show documentation
Show all versions of coderu-junit-adapter Show documentation
Simplifies integration of CODERU as a junit test
package org.coderu.adapters.junit;
import java.util.Collection;
import java.util.Collections;
import org.coderu.adapters.junit.utils.String2TypeUtils;
import org.coderu.core.api.DependencyOnSameLevelAllowed;
import org.coderu.core.api.Depth;
public final class CoderuAssertAdapter {
private final CoderuAssert junitTester;
public CoderuAssertAdapter(final CoderuAssert junitTester) {
this.junitTester = junitTester;
}
public void assertNoViolations(final Class> unit) { // NO_UCD
assertNoViolations(unit, ROOT, Depth.UNLIMITED);
}
public void assertNoViolations( // NO_UCD
final Class> unit, final String package2test) { // NO_UCD
assertNoViolations(unit, package2test, Depth.UNLIMITED);
}
public void assertNoViolations( // NO_UCD
final Class> unit, final String package2test, final Depth depth) { // NO_UCD
assertNoViolations(Collections.> singletonList(unit),
Collections.singletonList(package2test),
Collections. emptyList(), depth, DependencyOnSameLevelAllowed.YES);
}
public void assertNoViolations(final Collection> units) { // NO_UCD
assertNoViolations(units, Collections.singletonList(ROOT),
Collections. emptyList());
}
public void assertNoViolations( // NO_UCD
final Collection> units, final String package2test) { // NO_UCD
assertNoViolations(units, Collections.singletonList(package2test),
Collections. emptyList());
}
public void assertNoViolations( // NO_UCD
final Class> units, final Collection package2test) { // NO_UCD
assertNoViolations(Collections.> singletonList(units),
package2test, Collections. emptyList());
}
public void assertNoViolations(
// NO_UCD
final Class> unit,
final String package2test,
final String package2excude) { // NO_UCD
assertNoViolations(Collections.> singletonList(unit),
Collections.singletonList(package2test),
Collections.singletonList(package2excude));
}
public void assertNoViolations(
// NO_UCD
final Class> unit,
final String package2test,
final Collection package2excude,
final DependencyOnSameLevelAllowed classDep) { // NO_UCD
assertNoViolations(Collections.> singletonList(unit),
Collections.singletonList(package2test),
package2excude, Depth.UNLIMITED, classDep);
}
public void assertNoViolations(
// NO_UCD
final Class> unit, final String package2test,
final Collection package2excude) { // NO_UCD
assertNoViolations(Collections.> singletonList(unit),
Collections.singletonList(package2test), package2excude);
}
public void assertNoViolations(
// NO_UCD
final Class> unit, final Collection package2test,
final Collection package2excude) { // NO_UCD
assertNoViolations(Collections.> singletonList(unit),
package2test, package2excude);
}
public void assertNoViolations(
// NO_UCD
final Class> unit,
final Collection package2test,
final Collection package2excude,
final Depth depth) { // NO_UCD
assertNoViolations(Collections.> singletonList(unit),
package2test, package2excude, depth, DependencyOnSameLevelAllowed.YES);
}
public void assertNoViolations(
// NO_UCD
final Collection> unit,
final Collection package2test,
final Collection package2excude) {
assertNoViolations(unit, package2test, package2excude, Depth.UNLIMITED, DependencyOnSameLevelAllowed.YES);
}
public void assertNoViolations(
// NO_UCD
final Collection> unit,
final Collection package2test,
final Collection package2excude,
final Depth depth) {
assertNoViolations(unit,package2test, package2excude, depth, DependencyOnSameLevelAllowed.YES);
}
public void assertNoViolations(
// NO_UCD
final Collection> unit,
final Collection package2test,
final Collection package2excude,
final Depth depth,
final DependencyOnSameLevelAllowed classDep) {
junitTester.assertNoViolations(String2TypeUtils.toCompileUnit(unit),
String2TypeUtils.toPackages(package2test),
String2TypeUtils.toPackages(package2excude), depth, classDep);
}
private static final String ROOT = "";
}