From 15fcf171fb0d7b19f2daa9293b1176900a28238e Mon Sep 17 00:00:00 2001 From: Jens Schauder Date: Thu, 20 Jul 2017 13:57:49 +0200 Subject: [PATCH] DATAJDBC-114 - Adding test to prevent dependency circles. Added a test that finds dependency circles. Removed the dependency circles found by that test. --- .gitignore | 3 +- pom.xml | 6 +++ .../data/jdbc/degraph/DependencyTests.java | 38 +++++++++++++++++++ 3 files changed, 46 insertions(+), 1 deletion(-) create mode 100644 src/test/java/org/springframework/data/jdbc/degraph/DependencyTests.java diff --git a/.gitignore b/.gitignore index 6d0b68c76..646c021fa 100644 --- a/.gitignore +++ b/.gitignore @@ -6,4 +6,5 @@ target/ .classpath .springBeans .sonar4clipse -*.sonar4clipseExternals \ No newline at end of file +*.sonar4clipseExternals +*.graphml diff --git a/pom.xml b/pom.xml index ba6948c95..4ffa5540e 100644 --- a/pom.xml +++ b/pom.xml @@ -155,6 +155,12 @@ test + + de.schauderhaft.degraph + degraph-check + 0.1.4 + test + diff --git a/src/test/java/org/springframework/data/jdbc/degraph/DependencyTests.java b/src/test/java/org/springframework/data/jdbc/degraph/DependencyTests.java new file mode 100644 index 000000000..12baf9b99 --- /dev/null +++ b/src/test/java/org/springframework/data/jdbc/degraph/DependencyTests.java @@ -0,0 +1,38 @@ +/* + * Copyright 2017 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.springframework.data.jdbc.degraph; +import static de.schauderhaft.degraph.check.JCheck.classpath; +import static org.junit.Assert.assertThat; + +import org.junit.Test; + +import de.schauderhaft.degraph.check.JCheck; + +/** + * @author Jens Schauder + */ +public class DependencyTests { + + @Test public void test() { + assertThat( classpath() + .noJars() + .including("org.springframework.data.jdbc.**") + .filterClasspath("*target/classes") + .printOnFailure("degraph.graphml"), JCheck.violationFree()); + + } + +}