From fa181e50619c40f0634a1277438727e3229dd628 Mon Sep 17 00:00:00 2001 From: Dirk Mahler Date: Sun, 23 Jun 2024 18:46:02 +0200 Subject: [PATCH] added IT for artifacts and their dependencies created by Maven projects --- .../project-artifacts/jqassistant/default.xml | 69 +++++++++++++++++++ .../project-artifacts/main-and-test/pom.xml | 10 +++ .../jqassistant/maven/main_and_test/B.java | 7 ++ .../maven/main_and_test/BTest.java | 16 +++++ .../project-artifacts/main-only/pom.xml | 10 +++ .../jqassistant/maven/main_only/A.java | 7 ++ .../singleparent/project-artifacts/pom.xml | 17 +++++ .../project-artifacts/test-only/pom.xml | 19 +++++ .../jqassistant/maven/test_only/ATest.java | 16 +++++ 9 files changed, 171 insertions(+) create mode 100644 src/it/multimodule/singleparent/project-artifacts/jqassistant/default.xml create mode 100644 src/it/multimodule/singleparent/project-artifacts/main-and-test/pom.xml create mode 100644 src/it/multimodule/singleparent/project-artifacts/main-and-test/src/main/java/com/buschmais/jqassistant/maven/main_and_test/B.java create mode 100644 src/it/multimodule/singleparent/project-artifacts/main-and-test/src/test/java/com/buschmais/jqassistant/maven/main_and_test/BTest.java create mode 100644 src/it/multimodule/singleparent/project-artifacts/main-only/pom.xml create mode 100644 src/it/multimodule/singleparent/project-artifacts/main-only/src/main/java/com/buschmais/jqassistant/maven/main_only/A.java create mode 100644 src/it/multimodule/singleparent/project-artifacts/pom.xml create mode 100644 src/it/multimodule/singleparent/project-artifacts/test-only/pom.xml create mode 100644 src/it/multimodule/singleparent/project-artifacts/test-only/src/test/java/com/buschmais/jqassistant/maven/test_only/ATest.java diff --git a/src/it/multimodule/singleparent/project-artifacts/jqassistant/default.xml b/src/it/multimodule/singleparent/project-artifacts/jqassistant/default.xml new file mode 100644 index 0000000..d6dfbb8 --- /dev/null +++ b/src/it/multimodule/singleparent/project-artifacts/jqassistant/default.xml @@ -0,0 +1,69 @@ + + + + + + + + + + Verifies expected artifact dependencies. + (a1:Artifact), + (:Maven:Project)-[:CREATES]->(a2:Artifact), + (a1)-[:DEPENDS_ON]->(a2) + RETURN + count(*) as count + ]]> + + + + + + + Verifies expected artifact dependencies. + (a1:Artifact), + (:Maven:Project)-[:CREATES]->(a2:Artifact), + (a1)-[:DEPENDS_ON]->(a2) + WHERE + a1.name ends with expectedDependency.from.name and a1.type=expectedDependency.from.type + and a2.name ends with to.name and a2.type=to.type + RETURN + count(*) as count + ]]> + + + + + + diff --git a/src/it/multimodule/singleparent/project-artifacts/main-and-test/pom.xml b/src/it/multimodule/singleparent/project-artifacts/main-and-test/pom.xml new file mode 100644 index 0000000..d22773e --- /dev/null +++ b/src/it/multimodule/singleparent/project-artifacts/main-and-test/pom.xml @@ -0,0 +1,10 @@ + + 4.0.0 + + @project.groupId@ + @project.artifactId@.integration.project-artifacts + @project.version@ + + @project.artifactId@.integration.project-artifacts.main-and-test + diff --git a/src/it/multimodule/singleparent/project-artifacts/main-and-test/src/main/java/com/buschmais/jqassistant/maven/main_and_test/B.java b/src/it/multimodule/singleparent/project-artifacts/main-and-test/src/main/java/com/buschmais/jqassistant/maven/main_and_test/B.java new file mode 100644 index 0000000..20ef851 --- /dev/null +++ b/src/it/multimodule/singleparent/project-artifacts/main-and-test/src/main/java/com/buschmais/jqassistant/maven/main_and_test/B.java @@ -0,0 +1,7 @@ +package com.buschmais.jqassistant.maven.main_and_test; + +/** + * Created by dmahler on 3/6/17. + */ +public class B { +} diff --git a/src/it/multimodule/singleparent/project-artifacts/main-and-test/src/test/java/com/buschmais/jqassistant/maven/main_and_test/BTest.java b/src/it/multimodule/singleparent/project-artifacts/main-and-test/src/test/java/com/buschmais/jqassistant/maven/main_and_test/BTest.java new file mode 100644 index 0000000..2008294 --- /dev/null +++ b/src/it/multimodule/singleparent/project-artifacts/main-and-test/src/test/java/com/buschmais/jqassistant/maven/main_and_test/BTest.java @@ -0,0 +1,16 @@ +package com.buschmais.jqassistant.maven.main_and_test; + +import com.buschmais.jqassistant.maven.main_and_test.B; + +/** + * Created by dmahler on 3/6/17. + */ +public class BTest { + + private B b; + + public BTest(B b) { + this.b = b; + } + +} diff --git a/src/it/multimodule/singleparent/project-artifacts/main-only/pom.xml b/src/it/multimodule/singleparent/project-artifacts/main-only/pom.xml new file mode 100644 index 0000000..dcc19ab --- /dev/null +++ b/src/it/multimodule/singleparent/project-artifacts/main-only/pom.xml @@ -0,0 +1,10 @@ + + 4.0.0 + + @project.groupId@ + @project.artifactId@.integration.project-artifacts + @project.version@ + + @project.artifactId@.integration.project-artifacts.main-only + diff --git a/src/it/multimodule/singleparent/project-artifacts/main-only/src/main/java/com/buschmais/jqassistant/maven/main_only/A.java b/src/it/multimodule/singleparent/project-artifacts/main-only/src/main/java/com/buschmais/jqassistant/maven/main_only/A.java new file mode 100644 index 0000000..8fe0b8f --- /dev/null +++ b/src/it/multimodule/singleparent/project-artifacts/main-only/src/main/java/com/buschmais/jqassistant/maven/main_only/A.java @@ -0,0 +1,7 @@ +package com.buschmais.jqassistant.maven.main_only; + +/** + * Created by dmahler on 3/6/17. + */ +public class A { +} diff --git a/src/it/multimodule/singleparent/project-artifacts/pom.xml b/src/it/multimodule/singleparent/project-artifacts/pom.xml new file mode 100644 index 0000000..36a0d93 --- /dev/null +++ b/src/it/multimodule/singleparent/project-artifacts/pom.xml @@ -0,0 +1,17 @@ + + 4.0.0 + + @project.groupId@ + @project.artifactId@.integration + @project.version@ + ../../../pom.xml + + @project.artifactId@.integration.project-artifacts + pom + + + main-only + test-only + main-and-test + + diff --git a/src/it/multimodule/singleparent/project-artifacts/test-only/pom.xml b/src/it/multimodule/singleparent/project-artifacts/test-only/pom.xml new file mode 100644 index 0000000..198a23e --- /dev/null +++ b/src/it/multimodule/singleparent/project-artifacts/test-only/pom.xml @@ -0,0 +1,19 @@ + + 4.0.0 + + @project.groupId@ + @project.artifactId@.integration.project-artifacts + @project.version@ + + @project.artifactId@.integration.project-artifacts.test-only + + + + @project.groupId@ + @project.artifactId@.integration.project-artifacts.main-only + @project.version@ + + + + diff --git a/src/it/multimodule/singleparent/project-artifacts/test-only/src/test/java/com/buschmais/jqassistant/maven/test_only/ATest.java b/src/it/multimodule/singleparent/project-artifacts/test-only/src/test/java/com/buschmais/jqassistant/maven/test_only/ATest.java new file mode 100644 index 0000000..5e27209 --- /dev/null +++ b/src/it/multimodule/singleparent/project-artifacts/test-only/src/test/java/com/buschmais/jqassistant/maven/test_only/ATest.java @@ -0,0 +1,16 @@ +package com.buschmais.jqassistant.maven.test_only; + +import com.buschmais.jqassistant.maven.main_only.A; + +/** + * Created by dmahler on 3/6/17. + */ +public class ATest { + + private A a; + + public ATest(A a) { + this.a = a; + } + +}