-
Notifications
You must be signed in to change notification settings - Fork 688
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
SONARJAVA-4424 add methods annotated with @test to the list of testNg…
… test methods (#4953)
- Loading branch information
1 parent
889e741
commit 565282b
Showing
5 changed files
with
94 additions
and
4 deletions.
There are no files selected for viewing
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 |
---|---|---|
|
@@ -2,5 +2,5 @@ | |
"ruleKey": "S2187", | ||
"hasTruePositives": true, | ||
"falseNegatives": 13, | ||
"falsePositives": 0 | ||
"falsePositives": 1 | ||
} |
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
38 changes: 38 additions & 0 deletions
38
...cks-test-sources/default/src/test/java/checks/tests/NoTestInTestClassCheckTestNgTest.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,38 @@ | ||
package checks.tests; | ||
|
||
import org.testng.annotations.Test; | ||
|
||
class TestNGTest { | ||
@Test | ||
void foo() { | ||
} | ||
} | ||
|
||
@Test | ||
class TestNgFooTest { | ||
public void test1() { | ||
} | ||
|
||
public void test2() { | ||
} | ||
} | ||
|
||
@Test | ||
class TestNGClassTest { // Noncompliant | ||
public int field; | ||
private void test1() { } | ||
public static void foo() {} | ||
} | ||
|
||
@Test | ||
class TestNGClassTestUseAnnotation { | ||
|
||
@Test | ||
void myMethod(){ | ||
|
||
} | ||
} | ||
|
||
@Test(groups ="integration") | ||
abstract class AbstractIntegrationTest2{ | ||
} |
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
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