From 266eb9fb4eec10c5b54bccdbb8f992e319cf6f78 Mon Sep 17 00:00:00 2001 From: DirkMahler Date: Thu, 12 Dec 2024 15:37:57 +0000 Subject: [PATCH] deploy: 36e9a53aa545f7dc400e4969c890e96e924b3129 --- snapshot/index.html | 264 ++++++++++++++++++++++++++++++++++++-------- 1 file changed, 218 insertions(+), 46 deletions(-) diff --git a/snapshot/index.html b/snapshot/index.html index 569babdf2..b2e0b4524 100644 --- a/snapshot/index.html +++ b/snapshot/index.html @@ -6373,6 +6373,18 @@

Rules provided by the jQ

Concept java:AssertMethod

  • +

    Concept java:AssertAnnotation

    +
  • +
  • +

    Concept java:MethodPerformsAssertion

    +
  • +
  • +

    Concept java:TestMethodPerformsMethodAssertion

    +
  • +
  • +

    Concept java:TestMethodPerformsAnnotationAssertion

    +
  • +
  • Concept java-classpath:ResolveType

  • @@ -7165,27 +7177,64 @@
    Concept java:AssertMethod
    -
    Constraint java:TestMethodWithoutAssertion
    +
    Concept java:AssertAnnotation
    +
    +
    +
    An assert annotation is used to define an expected testing result (e.g. @Test(expected = RuntimeException.class)
    +for a test method.
    +
    +
    +
    +
    +
    MATCH
    +  (type:Java:Type)-[:DECLARES]->(method:Method)-[:ANNOTATED_BY]->(annotation:Annotation:Assert)-[:OF_TYPE]->(annotationType:Java:Type)
    +RETURN
    +  type AS DeclaringType, method AS AnnotatedTestMethod, annotationType AS AnnotationType
    +ORDER BY
    +  type.fqn, method.fqn, annotationType.fqn
    +
    +
    +
    +
    +
    Concept java:MethodPerformsAssertion
    -

    All test methods must perform assertions (within a call hierarchy of max. 3 steps).

    +

    Returns all test methods performing at least one assertion.

    +
    +
    +
    +
    MATCH
    +  (type:Java:Type)-[:DECLARES]->(method:Method)-[:PERFORMS_ASSERTION]->(assertion:Assert)
    +RETURN
    +  type AS DeclaringType, method AS Method
    +ORDER BY
    +  type.fqn, method.signature
    +
    +
    +
    +
    +
    Concept java:TestMethodPerformsMethodAssertion
    +
    +
    +
    A test method performs a method assertion, if it invokes an assert method within a call hierarchy of max. 3 steps.
    +
    MATCH
       (testClass:Java:Type)-[:DECLARES]->(testMethod:Test:Method)
     OPTIONAL MATCH
    -  path=shortestPath((testMethod)-[:INVOKES|VIRTUAL_INVOKES*]->(assert:Method:Assert))
    +  path=shortestPath((testMethod)-[:INVOKES|VIRTUAL_INVOKES*]->(assertMethod:Method:Assert))
     WITH
    -  testClass, testMethod, COLLECT(length(path)) as lengths
    -WITH
    -  testClass, testMethod, REDUCE(minVal = lengths[0], n IN lengths | CASE WHEN n < minVal THEN n ELSE minVal END) AS shortestPathLength
    +  testClass, testMethod, assertMethod, length(path) as callDepth
     WHERE
    -  shortestPathLength is null
    -  or shortestPathLength > $javaTestAssertMaxCallDepth
    +  callDepth is not null
    +  and callDepth <= $javaTestAssertMaxCallDepth
    +MERGE
    +  (testMethod)-[:PERFORMS_ASSERTION]->(assertMethod)
     RETURN
    -  distinct testClass AS TestClass, testMethod AS TestMethod
    +  distinct testClass AS TestClass, testMethod AS TestMethod, assertMethod as AssertMethod
     ORDER BY
    -  testClass.fqn, testMethod.name
    + testClass.fqn, testMethod.name, AssertMethod.name
    @@ -7204,6 +7253,87 @@
    Constraint java:TestMethodWithou
  • +
    +

    Provided concepts:

    +
    + + +
    +
    Concept java:TestMethodPerformsAnnotationAssertion
    +
    +
    +
    A test method performs an annotation assertion, if it is annotated with an assert annotation.
    +
    +
    +
    +
    +
    MATCH
    +  (testClass:Java:Type)-[:DECLARES]->(testMethod:Test:Method)-[:ANNOTATED_BY]->(assertAnnotation:Annotation:Assert)-[:OF_TYPE]->(annotationType:Java:Type)
    +MERGE
    +  (testMethod)-[:PERFORMS_ASSERTION]->(assertAnnotation)
    +RETURN
    +  distinct testClass AS TestClass, testMethod as TestMethod, annotationType AS AssertAnnotationType
    +ORDER BY
    +  testClass.fqn, testMethod.fqn
    +
    +
    +
    +

    Required concepts:

    +
    + +
    +

    Provided concepts:

    +
    + +
    +
    +
    Constraint java:TestMethodWithoutAssertion
    +
    +

    All test methods must perform at least one assertion.

    +
    +
    +
    +
    MATCH
    +  (testClass:Java:Type)-[:DECLARES]->(testMethod:Test:Method)
    +WHERE NOT
    +  (testMethod)-[:PERFORMS_ASSERTION]->(:Assert)
    +RETURN
    +  distinct testClass AS TestClass, testMethod AS TestMethod
    +ORDER BY
    +  testClass.fqn, testMethod.name
    +
    +
    +
    +

    Required concepts:

    +
    +
    Concept java-classpath:ResolveType
    @@ -8635,6 +8765,9 @@

    7.3.2. Rules provided b

    Concept junit4:AssertMethod

  • +

    Concept junit4:AssertAnnotation

    +
  • +
  • Concept junit4:SuiteClass

  • @@ -9046,7 +9179,46 @@
    7.3.2.14. Concept junit4:AssertMethod
  • -
    7.3.2.15. Concept junit4:SuiteClass
    +
    7.3.2.15. Concept junit4:AssertAnnotation
    +
    +

    Labels @Test-Annotations with the parameter "expected" as assert annotations.

    +
    +
    +
    +
    MATCH
    +  (testType:Java:Type)-[:DECLARES]->(annotatedTestMethod:Test:Method)-[:ANNOTATED_BY]->(annotation:Annotation)-[:OF_TYPE]->(:Java:Type {fqn: "org.junit.Test"}),
    +  (annotation)-[:HAS]->(expectation:Java:Value {name: 'expected'})
    +SET
    +  annotation:Junit4:Assert
    +RETURN
    +  testType AS DeclaringType, annotatedTestMethod AS AnnotatedTestMethod
    +ORDER BY
    +  testType.fqn, annotatedTestMethod.name
    +
    +
    +
    +

    Required concepts:

    +
    +
    + +
    +
    +

    Provided concepts:

    +
    + +
    +
    +
    7.3.2.16. Concept junit4:SuiteClass

    Labels all classes annotated by "@org.junit.runners.Suite.SuiteClasses" with "Junit4" and "Suite" and creates a relation "CONTAINS_TESTCLASS" to all referenced classes.

    @@ -9070,7 +9242,7 @@
    7.3.2.15. Concept junit4:SuiteClass
    -
    7.3.2.16. Concept junit4:InnerTestClass
    +
    7.3.2.17. Concept junit4:InnerTestClass

    Labels inner types of types labeled with "Test" with "Test" and "Inner".

    @@ -9096,7 +9268,7 @@
    7.3.2.16. Concept junit4:InnerTestClass
    -
    7.3.2.17. Constraint junit4:AssertionMustProvideMessage
    +
    7.3.2.18. Constraint junit4:AssertionMustProvideMessage

    All assertions must provide a message.

    @@ -9130,7 +9302,7 @@
    7.3.2.17. Constraint junit4:A
    -
    7.3.2.18. Constraint junit4:NonJUnit4TestMethod
    +
    7.3.2.19. Constraint junit4:NonJUnit4TestMethod

    Only the jUnit 4-test annotation must be used to identify test methods in a jUnit 4-based project.

    @@ -9157,7 +9329,7 @@
    7.3.2.18. Constraint junit4:NonJUnit4
    -
    7.3.2.19. Constraint junit4:UsageOfJUnit5TestApi
    +
    7.3.2.20. Constraint junit4:UsageOfJUnit5TestApi

    Only the jUnit 4-test api must be used in a jUnit 4-based project.

    @@ -9186,7 +9358,7 @@
    7.3.2.19. Constraint junit4:UsageOfJ
    -
    7.3.2.20. Group junit5:Default
    +
    7.3.2.21. Group junit5:Default

    Includes constraints:

    @@ -9205,7 +9377,7 @@
    7.3.2.20. Group junit5:Default
    -
    7.3.2.21. Concept junit5:TestMethod
    +
    7.3.2.22. Concept junit5:TestMethod
    Finds all test methods (i.e. annotated with "@org.junit.jupiter.api.Test") and
    @@ -9236,7 +9408,7 @@ 
    7.3.2.21. Concept junit5:TestMethod
    -
    7.3.2.22. Concept junit5:RepeatedTestMethod
    +
    7.3.2.23. Concept junit5:RepeatedTestMethod
    Finds all test methods (i.e. annotated with "@org.junit.jupiter.api.RepeatedTest") and
    @@ -9267,7 +9439,7 @@ 
    7.3.2.22. Concept junit5:RepeatedTestM
    -
    7.3.2.23. Concept junit5:ParameterizedTestMethod
    +
    7.3.2.24. Concept junit5:ParameterizedTestMethod
    Finds all test methods (i.e. annotated with "@org.junit.jupiter.api.ParameterizedTest") and
    @@ -9298,7 +9470,7 @@ 
    7.3.2.23. Concept junit5:Paramete
    -
    7.3.2.24. Concept junit5:DisabledTestClassOrMethod
    +
    7.3.2.25. Concept junit5:DisabledTestClassOrMethod
    Labels all classes or methods annotated with "@org.junit.jupiter.api.Disabled"
    @@ -9319,7 +9491,7 @@ 
    7.3.2.24. Concept junit5:Disabl
    -
    7.3.2.25. Concept junit5:BeforeEach
    +
    7.3.2.26. Concept junit5:BeforeEach
    Labels all methods annotated by "@org.junit.jupiter.api.BeforeEach"
    @@ -9341,7 +9513,7 @@ 
    7.3.2.25. Concept junit5:BeforeEach
    -
    7.3.2.26. Concept junit5:BeforeAll
    +
    7.3.2.27. Concept junit5:BeforeAll
    Labels all methods annotated by "@org.junit.jupiter.api.BeforeAll"
    @@ -9363,7 +9535,7 @@ 
    7.3.2.26. Concept junit5:BeforeAll
    -
    7.3.2.27. Concept junit5:AfterEach
    +
    7.3.2.28. Concept junit5:AfterEach
    Labels all methods annotated by "@org.junit.jupiter.api.AfterEach"
    @@ -9385,7 +9557,7 @@ 
    7.3.2.27. Concept junit5:AfterEach
    -
    7.3.2.28. Concept junit5:AfterAll
    +
    7.3.2.29. Concept junit5:AfterAll
    Labels all methods annotated by "@org.junit.jupiter.api.AfterAll"
    @@ -9407,7 +9579,7 @@ 
    7.3.2.28. Concept junit5:AfterAll
    -
    7.3.2.29. Concept junit5:TestTemplateMethod
    +
    7.3.2.30. Concept junit5:TestTemplateMethod
    Labels all methods annotated by "@org.junit.jupiter.api.TestTemplate"
    @@ -9439,7 +9611,7 @@ 
    7.3.2.29. Concept junit5:TestTemplateM
    -
    7.3.2.30. Concept junit5:TaggedMethodWithMetaAnnotation
    +
    7.3.2.31. Concept junit5:TaggedMethodWithMetaAnnotation
    Labels all methods annotated by an Junit meta annotation
    @@ -9497,7 +9669,7 @@ 
    7.3.2.30. Concept junit5:T
    -
    7.3.2.31. Concept junit5:TaggedClassWithMetaAnnotation
    +
    7.3.2.32. Concept junit5:TaggedClassWithMetaAnnotation
    Labels all classes annotated by an Junit meta annotation
    @@ -9555,7 +9727,7 @@ 
    7.3.2.31. Concept junit5:Ta
    -
    7.3.2.32. Concept junit5:TaggedMethod
    +
    7.3.2.33. Concept junit5:TaggedMethod
    Labels all methods annotated by "@org.junit.jupiter.api.Tag"
    @@ -9608,7 +9780,7 @@ 
    7.3.2.32. Concept junit5:TaggedMethod
    -
    7.3.2.33. Concept junit5:TaggedMethodTags
    +
    7.3.2.34. Concept junit5:TaggedMethodTags

    Collects all tags of methods annotated with "@org.junit.jupiter.api.Tag" and "@org.junit.jupiter.api.Test" @@ -9657,7 +9829,7 @@

    7.3.2.33. Concept junit5:TaggedMethodTag
    -
    7.3.2.34. Concept junit5:TaggedClass
    +
    7.3.2.35. Concept junit5:TaggedClass
    Labels all methods annotated by "@org.junit.jupiter.api.Tag"
    @@ -9705,7 +9877,7 @@ 
    7.3.2.34. Concept junit5:TaggedClass
    -
    7.3.2.35. Concept junit5:TaggedClassTags
    +
    7.3.2.36. Concept junit5:TaggedClassTags
    Collects all tags of classes annotated with
    @@ -9747,7 +9919,7 @@ 
    7.3.2.35. Concept junit5:TaggedClassTags<
    -
    7.3.2.36. Concept junit5:TestClass
    +
    7.3.2.37. Concept junit5:TestClass

    Labels all classes containing test methods with "Test" and "Junit5".

    @@ -9782,7 +9954,7 @@
    7.3.2.36. Concept junit5:TestClass
    -
    7.3.2.37. Concept junit5:NestedTestClass
    +
    7.3.2.38. Concept junit5:NestedTestClass

    Labels all nested test classes annotated with "@org.junit.jupiter.api.Nested", independently from the number of tests contained in the method, with @@ -9802,7 +9974,7 @@

    7.3.2.37. Concept junit5:NestedTestClass<
    -
    7.3.2.38. Concept junit5:AssertMethod
    +
    7.3.2.39. Concept junit5:AssertMethod
    Labels all assertion methods declared by "org.junit.jupiter.api.Assertions" with "Junit5"
    @@ -9837,7 +10009,7 @@ 
    7.3.2.38. Concept junit5:AssertMethod
    -
    7.3.2.39. Constraint junit5:AssertionMustProvideMessage
    +
    7.3.2.40. Constraint junit5:AssertionMustProvideMessage

    All assertions must provide a message.

    @@ -9872,7 +10044,7 @@
    7.3.2.39. Constraint junit5:A
    -
    7.3.2.40. Constraint junit5:NonJUnit5TestMethod
    +
    7.3.2.41. Constraint junit5:NonJUnit5TestMethod

    Only the jUnit 5-test annotation must be used to identify test methods in a jUnit 5-based project.

    @@ -9902,7 +10074,7 @@
    7.3.2.40. Constraint junit5:NonJUnit5
    -
    7.3.2.41. Constraint junit5:UsageOfJUnit4TestApi
    +
    7.3.2.42. Constraint junit5:UsageOfJUnit4TestApi

    Only the jUnit 5-test api must be used in a jUnit 5-based project.

    @@ -9931,7 +10103,7 @@
    7.3.2.41. Constraint junit5:UsageOfJ
    -
    7.3.2.42. Group junit:Default
    +
    7.3.2.43. Group junit:Default

    Includes constraints:

    @@ -9950,7 +10122,7 @@
    7.3.2.42. Group junit:Default
    -
    7.3.2.43. Concept junit:TestCaseDefinedByClass
    +
    7.3.2.44. Concept junit:TestCaseDefinedByClass

    Creates a relation DEFINED_BY between all test cases from test reports and the class which defined it.

    @@ -9972,7 +10144,7 @@
    7.3.2.43. Concept junit:TestCaseDef
    -
    7.3.2.44. Concept junit:TestCaseImplementedByMethod
    +
    7.3.2.45. Concept junit:TestCaseImplementedByMethod

    Creates a relation IMPLEMENTED_BY between all test cases from test reports and their implementing methods.

    @@ -10002,7 +10174,7 @@
    7.3.2.44. Concept junit:TestCa
    -
    7.3.2.45. Constraint junit:IgnoreWithoutMessage
    +
    7.3.2.46. Constraint junit:IgnoreWithoutMessage

    All @Ignore annotations must provide a message.

    @@ -10027,7 +10199,7 @@
    7.3.2.45. Constraint junit:IgnoreWith
    -
    7.3.2.46. Constraint junit:AssertionMustProvideMessage
    +
    7.3.2.47. Constraint junit:AssertionMustProvideMessage

    The rule is deprecated: This constraint has been replaced by "junit4:AssertionMustProvideMessage" and "junit5:AssertionMustProvideMessage".

    @@ -10064,7 +10236,7 @@
    7.3.2.46. Constraint junit:Ass
    -
    7.3.2.47. Constraint junit:TestMethodWithoutAssertion
    +
    7.3.2.48. Constraint junit:TestMethodWithoutAssertion

    The rule is deprecated: This constraint has been replaced by "java:TestMethodWithoutAssertion".

    @@ -10076,7 +10248,7 @@
    7.3.2.47. Constraint junit:Test
    MATCH
       (testType:Type)-[:DECLARES]->(testMethod:Test:Method)
     WHERE
    -  NOT (testMethod)-[:INVOKES|VIRTUAL_INVOKES*..3]->(:Method:Assert)
    +  NOT (testMethod)-[:PERFORMS_ASSERTION]->(:Assert)
     RETURN
       testType AS DeclaringType,
       testMethod AS Method
    @@ -10094,7 +10266,7 @@
    7.3.2.47. Constraint junit:Test

    java:TestMethod

  • -

    java:AssertMethod

    +

    java:MethodPerformsAssertion

  • @@ -11736,7 +11908,7 @@

    7.5.3. Generic scanner for XSD files