META-INF.jqassistant-rules.junit-common.xml Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of junit Show documentation
Show all versions of junit Show documentation
Plugin for jQAssistant to be able to scan and to
analyze JUnit related artifacts.
The newest version!
<jqassistant-rules xmlns="http://schema.jqassistant.org/rule/v1.10"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://schema.jqassistant.org/rule/v1.10 http://schema.jqassistant.org/rule/jqassistant-rule-v1.10.xsd">
<group id="junit:Default">
<includeConstraint refId="junit:IgnoreWithoutMessage"/>
</group>
<concept id="junit:TestCaseDefinedByClass">
<description>Creates a relation DEFINED_BY between all test cases from test reports and the class which defined it.</description>
<cypher><![CDATA[
MATCH
(testcase:TestCase)
WITH
testcase
MATCH
(testclass:Type)
WHERE
testclass.fqn = testcase.className
MERGE
(testcase)-[:DEFINED_BY]->(testclass)
RETURN
testcase.name AS TestCase, testclass AS TestClass
]]></cypher>
</concept>
<concept id="junit:TestCaseImplementedByMethod">
<requiresConcept refId="junit:TestCaseDefinedByClass" />
<description>Creates a relation IMPLEMENTED_BY between all test cases from test reports and their implementing
methods.
</description>
<cypher><![CDATA[
MATCH
(testcase:TestCase)-[:DEFINED_BY]->(testclass:Type),
(testclass)-[:EXTENDS*0..]->(:Type)-[:DECLARES]->(testmethod:Method)
WHERE
testmethod.name = testcase.name
MERGE
(testcase)-[:IMPLEMENTED_BY]->(testmethod)
RETURN
testcase.name AS TestCase, testmethod as TestMethod
]]></cypher>
</concept>
<constraint id="junit:IgnoreWithoutMessage">
<description>All @Ignore and @Disabled annotations must provide a message.</description>
<cypher><![CDATA[
MATCH
(e)-[:ANNOTATED_BY]->(ignore:Annotation)-[:OF_TYPE]->(ignoreType:Type)
WHERE
ignoreType.fqn= "org.junit.Ignore"
AND NOT (ignore)-[:HAS]->(:Value{name:"value"})
RETURN
e AS IgnoreWithoutMessage
UNION
MATCH
(e)-[:ANNOTATED_BY]->(disabled:Annotation)-[:OF_TYPE]->(disabledType:Type)
WHERE
disabledType.fqn = "org.junit.jupiter.api.Disabled"
AND NOT (disabled)-[:HAS]->(:Value{name:"value"})
RETURN
e AS IgnoreWithoutMessage
]]></cypher>
</constraint>
</jqassistant-rules>
© 2015 - 2025 Weber Informatics LLC | Privacy Policy