mirror of
https://github.com/github/codeql.git
synced 2026-04-26 09:15:12 +02:00
Java: move original files
This commit is contained in:
@@ -0,0 +1,44 @@
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.junit.jupiter.api.Nested;
|
||||
|
||||
public class AnnotationTest {
|
||||
@Nested
|
||||
public class Test1 { // COMPLIANT: Inner test class has `@Nested`
|
||||
@Test
|
||||
public void test() {
|
||||
}
|
||||
}
|
||||
|
||||
public class Test2 { // NON_COMPLIANT: Inner test class is missing a `@Nested`
|
||||
@Test
|
||||
public void test() {
|
||||
}
|
||||
}
|
||||
|
||||
public class Test3 { // COMPLIANT: Since it is empty, it is not a test class
|
||||
}
|
||||
|
||||
public class Test4 { // COMPLIANT: Since no methods have `@Test`, it is not a test class
|
||||
public void f() {
|
||||
}
|
||||
|
||||
public void g() {
|
||||
}
|
||||
|
||||
public void h() {
|
||||
}
|
||||
}
|
||||
|
||||
public static class Test5 { // COMPLIANT: Static inner test classes don't need `@Nested`
|
||||
@Test
|
||||
public void test() {
|
||||
}
|
||||
}
|
||||
|
||||
@Nested
|
||||
public static class Test6 { // COMPLIANT: Although invalid, this matter is out of the scope (see Implementation Details)
|
||||
@Test
|
||||
public void test() {
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
| AnnotationTest.java:12:16:12:20 | Test2 | This JUnit5 inner test class lacks a @Nested annotation. |
|
||||
@@ -0,0 +1 @@
|
||||
Likely Bugs/Frameworks/JUnit/JUnit5NonStaticInnerClassMissingNestedAnnotation.ql
|
||||
@@ -0,0 +1 @@
|
||||
//semmle-extractor-options: --javac-args -cp ${testdir}/../../../../stubs/junit-jupiter-api-5.2.0
|
||||
4
java/ql/test/stubs/junit-jupiter-api-5.2.0/org/junit/jupiter/api/Nested.java
generated
Normal file
4
java/ql/test/stubs/junit-jupiter-api-5.2.0/org/junit/jupiter/api/Nested.java
generated
Normal file
@@ -0,0 +1,4 @@
|
||||
package org.junit.jupiter.api;
|
||||
|
||||
public @interface Nested {
|
||||
}
|
||||
Reference in New Issue
Block a user