mirror of
https://github.com/github/codeql.git
synced 2026-04-27 17:55:19 +02:00
Java: Add Annotation value convenience predicates
This commit is contained in:
committed by
Chris Smowton
parent
3165babc88
commit
536f5c7f89
@@ -161,15 +161,13 @@ class TestNGTestMethod extends Method {
|
||||
exists(TestNGTestAnnotation testAnnotation |
|
||||
testAnnotation = this.getAnAnnotation() and
|
||||
// The data provider must have the same name as the referenced data provider
|
||||
result.getDataProviderName() =
|
||||
testAnnotation.getValue("dataProvider").(StringLiteral).getValue()
|
||||
result.getDataProviderName() = testAnnotation.getValueString("dataProvider")
|
||||
|
|
||||
// Either the data provider should be on the current class, or a supertype
|
||||
this.getDeclaringType().getAnAncestor() = result.getDeclaringType()
|
||||
or
|
||||
// Or the data provider class should be declared
|
||||
result.getDeclaringType() =
|
||||
testAnnotation.getValue("dataProviderClass").(TypeLiteral).getReferencedType()
|
||||
result.getDeclaringType() = testAnnotation.getValueClass("dataProviderClass")
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user