microsoft / microsoft/vscode-java-test
Support TestNG class level annotations
Dieses Issue hat noch niemand übernommen.
- Vorherrschende Sprache
- TypeScript
- Sterne
- 340
- Forks
- 173
- Ø Merge
- 1 T. 19 Std.
- Gemergte PRs (30 T.)
- 18
Beschreibung
Consider adding support for TestNG class level annotations.
https://testng.org/doc/documentation-main.html#class-level
With TestNG the @Test annotation can be placed on a class instead of the method. In this case all public void methods are considered tests even if they are not annotated.
Example:
@Test
public class TestNGTest {
public void test1() {
System.out.println("Test 1");
}
public void test2() {
System.out.println("Test 2");
}
private void privateMethod() {
System.out.println( "Not a test" );
}
}
Currently there does not appear to be any way to run a test unless it is explicitly annotated. Right clicking and selecting Run just pops up an alert with No tests in file: .... No code lens appear at either class or method level. No tests appear under the class in the Test panel.
Beitragsleitfaden
Erste Schritte
- Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
- Forke das Repository und arbeite in einem Branch.
- Öffne einen Pull Request, der die Issue-Nummer nennt.
Rechercherichtung
Beginne mit der im Issue verlinkten Dokumentation zu Klassenebenen-Annotationen von TestNG und reproduziere das gemeldete Verhalten „No tests in file“ anhand des Java-Beispiels. Finde den vorhandenen Einstiegspunkt für die Test-Erkennung von TestNG und füge eine Abdeckung für öffentliche Methoden hinzu, die von einer Klasse mit @Test auf Klassenebene geerbt werden, wobei private Methoden ausgeschlossen werden. Erledigt ist die Aufgabe, wenn die Tests ausgeführt werden und in code lenses und im Test panel erscheinen.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- java
- Bereich
- testing
- Issue-Typ
- Feature
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Aktivitätsstatus
- Veraltet
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 35/100