This repository has been archived by the owner on Jul 10, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added IT for artifacts and their dependencies created by Maven projects
- Loading branch information
1 parent
82d5ee7
commit fa181e5
Showing
9 changed files
with
171 additions
and
0 deletions.
There are no files selected for viewing
69 changes: 69 additions & 0 deletions
69
src/it/multimodule/singleparent/project-artifacts/jqassistant/default.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
<jqa:jqassistant-rules xmlns:jqa="http://www.buschmais.com/jqassistant/core/rule/schema/v1.3"> | ||
|
||
<group id="default" severity="blocker"> | ||
<includeConcept refId="test:*"/> | ||
</group> | ||
|
||
<!-- These concepts verify the as-is status, there are currently more artifacts created than actually exist in the scanned code --> | ||
|
||
<concept id="test:ArtifactDependencies"> | ||
<description>Verifies expected artifact dependencies.</description> | ||
<cypher><![CDATA[ | ||
MATCH | ||
(:Maven:Project)-[:CREATES]->(a1:Artifact), | ||
(:Maven:Project)-[:CREATES]->(a2:Artifact), | ||
(a1)-[:DEPENDS_ON]->(a2) | ||
RETURN | ||
count(*) as count | ||
]]></cypher> | ||
<verify> | ||
<aggregation column="count" min="5" max="5"/> | ||
</verify> | ||
</concept> | ||
|
||
<concept id="test:ExpectedArtifactDependencies"> | ||
<description>Verifies expected artifact dependencies.</description> | ||
<cypher><![CDATA[ | ||
WITH | ||
[ | ||
{ | ||
from: { name: "test-only", type:"jar"}, | ||
to: [ { name: "main-only", type:"jar"} ] | ||
}, | ||
{ | ||
from: { name: "main-only", type:"test-jar"}, | ||
to: [ { name: "main-only", type:"jar"} ] | ||
}, | ||
{ | ||
from: { name: "test-only", type:"test-jar"}, | ||
to: [ { name: "test-only", type:"jar"} ] | ||
}, | ||
{ | ||
from: { name: "main-and-test", type:"test-jar"}, | ||
to: [ { name: "main-and-test", type:"jar"} ] | ||
}, | ||
{ | ||
from: { name: "project-artifacts", type:"test-jar"}, | ||
to: [ { name: "project-artifacts", type:"pom"} ] | ||
} | ||
] as expectedDependencies | ||
UNWIND | ||
expectedDependencies as expectedDependency | ||
UNWIND | ||
expectedDependency.to as to | ||
MATCH | ||
(:Maven:Project)-[:CREATES]->(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 | ||
]]></cypher> | ||
<verify> | ||
<aggregation column="count" min="5" max="5"/> | ||
</verify> | ||
</concept> | ||
|
||
</jqa:jqassistant-rules> |
10 changes: 10 additions & 0 deletions
10
src/it/multimodule/singleparent/project-artifacts/main-and-test/pom.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
<parent> | ||
<groupId>@project.groupId@</groupId> | ||
<artifactId>@[email protected]</artifactId> | ||
<version>@project.version@</version> | ||
</parent> | ||
<artifactId>@[email protected]</artifactId> | ||
</project> |
7 changes: 7 additions & 0 deletions
7
...rtifacts/main-and-test/src/main/java/com/buschmais/jqassistant/maven/main_and_test/B.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
package com.buschmais.jqassistant.maven.main_and_test; | ||
|
||
/** | ||
* Created by dmahler on 3/6/17. | ||
*/ | ||
public class B { | ||
} |
16 changes: 16 additions & 0 deletions
16
...acts/main-and-test/src/test/java/com/buschmais/jqassistant/maven/main_and_test/BTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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; | ||
} | ||
|
||
} |
10 changes: 10 additions & 0 deletions
10
src/it/multimodule/singleparent/project-artifacts/main-only/pom.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
<parent> | ||
<groupId>@project.groupId@</groupId> | ||
<artifactId>@[email protected]</artifactId> | ||
<version>@project.version@</version> | ||
</parent> | ||
<artifactId>@[email protected]</artifactId> | ||
</project> |
7 changes: 7 additions & 0 deletions
7
...roject-artifacts/main-only/src/main/java/com/buschmais/jqassistant/maven/main_only/A.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
package com.buschmais.jqassistant.maven.main_only; | ||
|
||
/** | ||
* Created by dmahler on 3/6/17. | ||
*/ | ||
public class A { | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
<parent> | ||
<groupId>@project.groupId@</groupId> | ||
<artifactId>@[email protected]</artifactId> | ||
<version>@project.version@</version> | ||
<relativePath>../../../pom.xml</relativePath> | ||
</parent> | ||
<artifactId>@[email protected]</artifactId> | ||
<packaging>pom</packaging> | ||
|
||
<modules> | ||
<module>main-only</module> | ||
<module>test-only</module> | ||
<module>main-and-test</module> | ||
</modules> | ||
</project> |
19 changes: 19 additions & 0 deletions
19
src/it/multimodule/singleparent/project-artifacts/test-only/pom.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
<parent> | ||
<groupId>@project.groupId@</groupId> | ||
<artifactId>@[email protected]</artifactId> | ||
<version>@project.version@</version> | ||
</parent> | ||
<artifactId>@[email protected]</artifactId> | ||
|
||
<dependencies> | ||
<dependency> | ||
<groupId>@project.groupId@</groupId> | ||
<artifactId>@[email protected]</artifactId> | ||
<version>@project.version@</version> | ||
</dependency> | ||
</dependencies> | ||
|
||
</project> |
16 changes: 16 additions & 0 deletions
16
...ct-artifacts/test-only/src/test/java/com/buschmais/jqassistant/maven/test_only/ATest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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; | ||
} | ||
|
||
} |