diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 8393b60c2c2..925c141ae11 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -70,7 +70,7 @@ Guidelines for feature pull-requests: Other kinds of pull-requests: 1. Pull requests with passing test cases only are welcome, they specify previously unspecified behavior and are prefixed by "test:". -1. Pull requests with failing test cases only are welcome, they reproduce bugs and are very useful for maintainers to fix them. You can prevent failing the CI with adding the annotation `@GitHubIssue(issueNumber = , fixed = false)`. If you fix a test case with such an annotation mark the test case as fixed with `@GitHubIssue(issueNumber = , fixed = true)`. +2. Pull requests with failing test cases only are welcome, they reproduce bugs and are very useful for maintainers to fix them. You can prevent failing the CI with adding the annotation `@GitHubIssue(issueNumber = , fixed = false)`. If you fix a test case with such an annotation mark the test case as fixed with `@GitHubIssue(issueNumber = , fixed = true)`. 1. "Chore" pull-requests modify the CI setup. 1. If there is no activity on an issue or on a pull request for 3 months it's closed. diff --git a/src/test/java/spoon/reflect/factory/PackageFactoryTest.java b/src/test/java/spoon/reflect/factory/PackageFactoryTest.java index 13cb1897fa1..326adc47781 100644 --- a/src/test/java/spoon/reflect/factory/PackageFactoryTest.java +++ b/src/test/java/spoon/reflect/factory/PackageFactoryTest.java @@ -3,13 +3,14 @@ import static org.hamcrest.CoreMatchers.equalTo; import static org.hamcrest.CoreMatchers.sameInstance; import static org.hamcrest.MatcherAssert.assertThat; - +import org.junit.jupiter.api.Test; import spoon.Launcher; import spoon.reflect.declaration.CtPackage; -import spoon.test.GitHubIssue; +import spoon.testing.utils.GitHubIssue; class PackageFactoryTest { + @Test @GitHubIssue(issueNumber = 4764, fixed = true) void getOrCreate_returnsNestedPackageStructure_whenQualifiedNameRepeatsSimpleName() { // contract: A qualified name that is simply repetitions of a single simple name results in the expected diff --git a/src/test/java/spoon/reflect/visitor/DefaultJavaPrettyPrinterTest.java b/src/test/java/spoon/reflect/visitor/DefaultJavaPrettyPrinterTest.java index 039ef7e30b3..d88d4f69ed5 100644 --- a/src/test/java/spoon/reflect/visitor/DefaultJavaPrettyPrinterTest.java +++ b/src/test/java/spoon/reflect/visitor/DefaultJavaPrettyPrinterTest.java @@ -32,8 +32,8 @@ import spoon.reflect.reference.CtTypeReference; import spoon.reflect.visitor.filter.TypeFilter; import spoon.support.reflect.reference.CtArrayTypeReferenceImpl; -import spoon.test.GitHubIssue; import spoon.test.SpoonTestHelpers; +import spoon.testing.utils.GitHubIssue; import spoon.testing.utils.ModelTest; import java.io.FileNotFoundException; @@ -271,6 +271,7 @@ public Stream provideArguments(ExtensionContext extensionCo @Nested class SquareBracketsForArrayInitialization_ArrayIsBuiltUsingFactoryMethods { + @Test @GitHubIssue(issueNumber = 4887, fixed = true) void bracketsShouldBeAttachedToTypeByDefault() { // contract: the square brackets should be attached to type by default when array is built using factory methods @@ -333,6 +334,7 @@ void testKeepGenericType(Factory factory) { assertThat(printed, containsRegexMatch("List<.*List<\\? super T>>")); } + @Test @GitHubIssue(issueNumber = 4881, fixed = true) void bracketsShouldBeMinimallyPrintedForTypeCastOnFieldRead() throws FileNotFoundException { // contract: the brackets should be minimally printed for type cast on field read diff --git a/src/test/java/spoon/support/TypeAdaptorTest.java b/src/test/java/spoon/support/TypeAdaptorTest.java index a8e7f99717e..bab12ea8af5 100644 --- a/src/test/java/spoon/support/TypeAdaptorTest.java +++ b/src/test/java/spoon/support/TypeAdaptorTest.java @@ -15,7 +15,7 @@ import spoon.reflect.reference.CtTypeReference; import spoon.reflect.visitor.filter.TypeFilter; import spoon.support.adaption.TypeAdaptor; -import spoon.test.GitHubIssue; +import spoon.testing.utils.GitHubIssue; import spoon.testing.utils.ModelTest; import java.util.List; @@ -444,6 +444,7 @@ public void overloaded(T t) {} public void overriden(T t) {} } + @Test @GitHubIssue(issueNumber = 5226, fixed = true) void testAdaptingTypeFromEnclosingClass() { Launcher launcher = new Launcher(); diff --git a/src/test/java/spoon/support/visitor/java/JavaReflectionTreeBuilderTest.java b/src/test/java/spoon/support/visitor/java/JavaReflectionTreeBuilderTest.java index c075478f03a..56a6eda71aa 100644 --- a/src/test/java/spoon/support/visitor/java/JavaReflectionTreeBuilderTest.java +++ b/src/test/java/spoon/support/visitor/java/JavaReflectionTreeBuilderTest.java @@ -106,13 +106,13 @@ import spoon.support.util.compilation.JavacFacade; import spoon.support.visitor.equals.EqualsChecker; import spoon.support.visitor.equals.EqualsVisitor; -import spoon.test.GitHubIssue; import spoon.test.generics.testclasses3.ComparableComparatorBug; import spoon.test.innerclasses.InnerClasses; import spoon.test.pkg.PackageTest; import spoon.test.pkg.cyclic.Outside; import spoon.test.pkg.cyclic.direct.Cyclic; import spoon.test.pkg.cyclic.indirect.Indirect; +import spoon.testing.utils.GitHubIssue; public class JavaReflectionTreeBuilderTest { @@ -850,6 +850,7 @@ void testInnerClassesConstructorParameters() { assertThat(asClass.getConstructors().iterator().next().getParameters().size(), equalTo(inners.size())); } + @Test @GitHubIssue(issueNumber = 4972, fixed = true) void parameterNamesAreParsedWhenCompilingWithParametersFlag() throws ClassNotFoundException { ClassLoader loader = JavacFacade.compileFiles( diff --git a/src/test/java/spoon/test/comment/CommentTest.java b/src/test/java/spoon/test/comment/CommentTest.java index 529749ebdcf..0ad77376ec5 100644 --- a/src/test/java/spoon/test/comment/CommentTest.java +++ b/src/test/java/spoon/test/comment/CommentTest.java @@ -74,7 +74,6 @@ import spoon.support.StandardEnvironment; import spoon.support.compiler.jdt.JDTSnippetCompiler; import spoon.support.reflect.code.CtCommentImpl; -import spoon.test.GitHubIssue; import spoon.test.comment.testclasses.BlockComment; import spoon.test.comment.testclasses.Comment1; import spoon.test.comment.testclasses.Comment2; @@ -87,6 +86,7 @@ import spoon.test.comment.testclasses.TestClassWithComments; import spoon.test.comment.testclasses.WildComments; import spoon.test.comment.testclasses.WindowsEOL; +import spoon.testing.utils.GitHubIssue; import spoon.testing.utils.LineSeparatorExtension; import spoon.testing.utils.ModelTest; diff --git a/src/test/java/spoon/test/enums/EnumsTest.java b/src/test/java/spoon/test/enums/EnumsTest.java index 98e59b209f6..25d8dd37459 100644 --- a/src/test/java/spoon/test/enums/EnumsTest.java +++ b/src/test/java/spoon/test/enums/EnumsTest.java @@ -43,13 +43,13 @@ import spoon.reflect.reference.CtExecutableReference; import spoon.reflect.visitor.filter.TypeFilter; import spoon.support.reflect.CtExtendedModifier; -import spoon.test.GitHubIssue; import spoon.test.SpoonTestHelpers; import spoon.test.annotation.AnnotationTest; import spoon.test.enums.testclasses.Burritos; import spoon.test.enums.testclasses.EnumWithMembers; import spoon.test.enums.testclasses.NestedEnums; import spoon.test.enums.testclasses.Regular; +import spoon.testing.utils.GitHubIssue; import spoon.testing.utils.ModelUtils; import java.io.File; @@ -286,6 +286,7 @@ void testLocalEnumExists() { )); } + @Test @GitHubIssue(issueNumber = 4758, fixed = true) @DisplayName("Implicit enum constructors do not contain a super call") void testImplicitEnumConstructorSuperCall() { diff --git a/src/test/java/spoon/test/factory/CodeFactoryTest.java b/src/test/java/spoon/test/factory/CodeFactoryTest.java index 01d507f1f03..8a6f558203e 100644 --- a/src/test/java/spoon/test/factory/CodeFactoryTest.java +++ b/src/test/java/spoon/test/factory/CodeFactoryTest.java @@ -29,8 +29,7 @@ import spoon.reflect.factory.Factory; import spoon.reflect.reference.CtTypeReference; import spoon.support.util.compilation.JavacFacade; -import spoon.test.GitHubIssue; - +import spoon.testing.utils.GitHubIssue; import java.util.List; import java.util.Map; @@ -66,8 +65,9 @@ public void testCreateVariableAssignement() { assertEquals(f.getReference(), ((CtVariableWrite) va.getAssigned()).getVariable()); } + @Test @GitHubIssue(issueNumber= 4956, fixed = true) - void createCtCatcVariablehWithoutModifiers() { + void createCtCatchVariableWithoutModifiers() { // contract: CtCatchVariable without modifiers is created. This a test for the regression of #4940 Factory factory = createFactory(); CtTypeReference exceptionType = factory.Type().createReference(Exception.class); diff --git a/src/test/java/spoon/test/issue3321/AnnotationPositionTest.java b/src/test/java/spoon/test/issue3321/AnnotationPositionTest.java index 1905ced6cf7..d62f9485886 100644 --- a/src/test/java/spoon/test/issue3321/AnnotationPositionTest.java +++ b/src/test/java/spoon/test/issue3321/AnnotationPositionTest.java @@ -1,20 +1,21 @@ package spoon.test.issue3321; -import spoon.test.GitHubIssue; import spoon.reflect.cu.SourcePosition; import spoon.Launcher; import spoon.reflect.factory.Factory; import spoon.test.issue3321.testclasses.AnnoUser; +import spoon.testing.utils.GitHubIssue; import spoon.reflect.declaration.CtParameter; import spoon.reflect.declaration.CtClass; import spoon.reflect.declaration.CtMethod; import static org.junit.jupiter.api.Assertions.assertTrue; +import org.junit.jupiter.api.Test; import static org.junit.jupiter.api.Assertions.assertFalse; public class AnnotationPositionTest { - + @Test @GitHubIssue(issueNumber = 3358, fixed = false) public void testUsageOfTypeAnnotationOnParameterInMethod() { final Launcher launcher = new Launcher(); @@ -68,6 +69,7 @@ public void testUsageOfTypeAnnotationOnParameterInMethod() { } + @Test @GitHubIssue(issueNumber = 3358, fixed = false) public void testSneakyAnnotationsOnParameters() { final Launcher launcher = new Launcher(); diff --git a/src/test/java/spoon/test/literal/LiteralTest.java b/src/test/java/spoon/test/literal/LiteralTest.java index 1047234a16a..2ae4581fc89 100644 --- a/src/test/java/spoon/test/literal/LiteralTest.java +++ b/src/test/java/spoon/test/literal/LiteralTest.java @@ -22,7 +22,6 @@ import spoon.reflect.declaration.CtType; import spoon.reflect.code.CtLiteral; import spoon.reflect.factory.CodeFactory; -import spoon.test.GitHubIssue; import spoon.test.literal.testclasses.Tacos; import spoon.Launcher; import spoon.reflect.code.LiteralBase; @@ -30,6 +29,7 @@ import spoon.reflect.factory.TypeFactory; import spoon.reflect.declaration.CtClass; import org.junit.jupiter.api.Test; +import spoon.testing.utils.GitHubIssue; import spoon.testing.utils.ModelTest; import java.util.List; import java.util.TreeSet; @@ -260,6 +260,7 @@ public void testLiteralBasePrinter(Factory factory) { assertEquals("\"hello\"", ctClass.getField("s1").getDefaultExpression().toString()); } + @Test @GitHubIssue(issueNumber = 5070, fixed = true) void tooStrictEscaping() { // contract: inside a string without a position ' are not escaped. @@ -272,6 +273,7 @@ void tooStrictEscaping() { assertEquals("\"'\"", ctLiteral.toString()); } + @Test @GitHubIssue(issueNumber = 5070, fixed = true) void tooStrictEscapingCharTest() { // contract: inside a string with a position ' are escaped. diff --git a/src/test/java/spoon/test/logging/LogTest.java b/src/test/java/spoon/test/logging/LogTest.java index d795c55ca9d..74fefdac4a7 100644 --- a/src/test/java/spoon/test/logging/LogTest.java +++ b/src/test/java/spoon/test/logging/LogTest.java @@ -31,7 +31,7 @@ import spoon.reflect.visitor.filter.TypeFilter; import spoon.support.JavaOutputProcessor; import spoon.support.Level; -import spoon.test.GitHubIssue; +import spoon.testing.utils.GitHubIssue; import uk.org.lidalia.slf4jtest.TestLogger; import uk.org.lidalia.slf4jtest.TestLoggerFactory; import java.util.List; @@ -112,6 +112,7 @@ public void testLoggingOff() { assertEquals(0, logger.getLoggingEvents().size()); } + @Test @GitHubIssue(issueNumber = 4997, fixed = true) void innerTypesCrashesLogging() { // contract: when a class has inner types, the logging should not crash with a NPE diff --git a/src/test/java/spoon/test/model/SwitchCaseTest.java b/src/test/java/spoon/test/model/SwitchCaseTest.java index a4ed14deff4..5b6dd376372 100644 --- a/src/test/java/spoon/test/model/SwitchCaseTest.java +++ b/src/test/java/spoon/test/model/SwitchCaseTest.java @@ -51,7 +51,7 @@ import spoon.reflect.factory.Factory; import spoon.reflect.visitor.filter.TypeFilter; import spoon.support.compiler.VirtualFile; -import spoon.test.GitHubIssue; +import spoon.testing.utils.GitHubIssue; @DisplayName("Switchcase Tests") public class SwitchCaseTest { @@ -233,6 +233,7 @@ public void testSwitchColons() { ); } + @Test @GitHubIssue(issueNumber = 4696, fixed = true) void testVariableScopeInSwitch() { // contract: different cases do not introduce different scopes in colon-switches diff --git a/src/test/java/spoon/test/prettyprinter/SniperAnnotatedEnumTest.java b/src/test/java/spoon/test/prettyprinter/SniperAnnotatedEnumTest.java index 47a5d048b1f..f1d234878e1 100644 --- a/src/test/java/spoon/test/prettyprinter/SniperAnnotatedEnumTest.java +++ b/src/test/java/spoon/test/prettyprinter/SniperAnnotatedEnumTest.java @@ -10,7 +10,7 @@ import org.apache.commons.io.FileUtils; import org.hamcrest.CoreMatchers; import org.junit.jupiter.api.BeforeAll; - +import org.junit.jupiter.api.Test; import spoon.Launcher; import spoon.compiler.Environment; import spoon.reflect.CtModel; @@ -18,7 +18,7 @@ import spoon.reflect.declaration.CtClass; import spoon.reflect.visitor.filter.TypeFilter; import spoon.support.sniper.SniperJavaPrettyPrinter; -import spoon.test.GitHubIssue; +import spoon.testing.utils.GitHubIssue; public class SniperAnnotatedEnumTest { private static final Path INPUT_PATH = Paths.get("src/test/java/"); @@ -29,6 +29,7 @@ public static void setup() throws IOException { FileUtils.deleteDirectory(OUTPUT_PATH.toFile()); } + @Test @GitHubIssue(issueNumber = 4779, fixed = true) public void annotatedEnumTest() throws IOException { runSniperJavaPrettyPrinter("spoon/test/prettyprinter/testclasses/AnnotatedEnum.java"); diff --git a/src/test/java/spoon/test/prettyprinter/TestSniperPrinter.java b/src/test/java/spoon/test/prettyprinter/TestSniperPrinter.java index 50d9daebebf..ccb7fd072c9 100644 --- a/src/test/java/spoon/test/prettyprinter/TestSniperPrinter.java +++ b/src/test/java/spoon/test/prettyprinter/TestSniperPrinter.java @@ -49,12 +49,11 @@ import spoon.support.modelobs.ChangeCollector; import spoon.support.modelobs.SourceFragmentCreator; import spoon.support.sniper.SniperJavaPrettyPrinter; -import spoon.test.GitHubIssue; import spoon.test.prettyprinter.testclasses.OneLineMultipleVariableDeclaration; import spoon.test.prettyprinter.testclasses.Throw; import spoon.test.prettyprinter.testclasses.InvocationReplacement; import spoon.test.prettyprinter.testclasses.ToBeChanged; - +import spoon.testing.utils.GitHubIssue; import java.io.File; import java.io.FileInputStream; import java.io.IOException; @@ -785,6 +784,7 @@ void testSniperRespectsDeletionInForUpdate() { testSniper("ForLoop", deleteForUpdate, assertNotStaticFindFirstIsEmpty); } + @Test @GitHubIssue(issueNumber = 4021, fixed = true) void testSniperRespectsSuperWithUnaryOperator() { // Combining CtSuperAccess and CtUnaryOperator leads to SpoonException with Sniper @@ -798,6 +798,7 @@ void testSniperRespectsSuperWithUnaryOperator() { testSniper("superCall.SuperCallSniperTestClass", deleteForUpdate, assertContainsSuperWithUnaryOperator); } + @Test @GitHubIssue(issueNumber = 3911, fixed = false) void testRoundBracketPrintingInComplexArithmeticExpression() { Consumer> noOpModifyFieldAssignment = type -> @@ -812,6 +813,7 @@ void testRoundBracketPrintingInComplexArithmeticExpression() { testSniper("ArithmeticExpression", noOpModifyFieldAssignment, assertPrintsRoundBracketsCorrectly); } + @Test @GitHubIssue(issueNumber = 4218, fixed = true) void testSniperDoesNotPrintTheDeletedAnnotation() { Consumer> deleteAnnotation = type -> { @@ -824,6 +826,7 @@ void testSniperDoesNotPrintTheDeletedAnnotation() { testSniper("sniperPrinter.DeleteAnnotation", deleteAnnotation, assertDoesNotContainAnnotation); } + @Test @GitHubIssue(issueNumber = 4220, fixed = true) void testSniperAddsSpaceAfterFinal() { Consumer> modifyField = type -> { @@ -907,6 +910,7 @@ private BiConsumer, String> assertPrintsBracketForArrayInitialisation( assertThat(result, containsString(arrayDeclaration)); } + @Test @GitHubIssue(issueNumber = 4315, fixed = true) void test_bracketShouldBePrintedWhenArrayIsNull() { testSniper( @@ -915,6 +919,7 @@ void test_bracketShouldBePrintedWhenArrayIsNull() { assertPrintsBracketForArrayInitialisation("int array[];")); } + @Test @GitHubIssue(issueNumber = 4315, fixed = true) void test_bracketShouldBePrintedWhenArrayIsInitialisedToIntegers() { testSniper( @@ -923,6 +928,7 @@ void test_bracketShouldBePrintedWhenArrayIsInitialisedToIntegers() { assertPrintsBracketForArrayInitialisation("int array[] = {1, 2, 3, 4, 5};")); } + @Test @GitHubIssue(issueNumber = 4315, fixed = true) void test_bracketShouldBePrintedWhenArrayIsInitialisedToNullElements() { testSniper( @@ -931,6 +937,7 @@ void test_bracketShouldBePrintedWhenArrayIsInitialisedToNullElements() { assertPrintsBracketForArrayInitialisation("String array[] = new String[42];")); } + @Test @GitHubIssue(issueNumber = 4315, fixed = true) void test_bracketsShouldBePrintedForMultiDimensionalArray() { testSniper( @@ -939,6 +946,7 @@ void test_bracketsShouldBePrintedForMultiDimensionalArray() { assertPrintsBracketForArrayInitialisation("String array[][][] = new String[1][2][3];")); } + @Test @GitHubIssue(issueNumber = 4315, fixed = true) void test_bracketsShouldBePrintedForArrayInitialisedInLocalVariable() { Consumer> noOpModifyLocalVariable = type -> { @@ -952,6 +960,7 @@ void test_bracketsShouldBePrintedForArrayInitialisedInLocalVariable() { assertPrintsBracketForArrayInitialisation("int array[] = new int[]{ };")); } + @Test @GitHubIssue(issueNumber = 4421, fixed = true) void test_bracketsShouldBePrintedForGenericTypeOfArray() { testSniper( @@ -1098,32 +1107,38 @@ public void testToStringWithSniperPrinter(String inputSourcePath) throws Excepti public void testToStringWithSniperOnElementScan() throws Exception { testToStringWithSniperPrinter("src/test/java/spoon/test/prettyprinter/testclasses/ElementScan.java"); } + @Test @GitHubIssue(issueNumber = 3811, fixed = true) void noChangeDiffBrackets() throws IOException { testNoChangeDiffFailing( Paths.get("src/test/java/spoon/test/prettyprinter/testclasses/difftest/Brackets").toFile()); } + @Test @GitHubIssue(issueNumber = 3811, fixed = true) void noChangeDiffConditionalComment() throws IOException { testNoChangeDiffFailing( Paths.get("src/test/java/spoon/test/prettyprinter/testclasses/difftest/ConditionalComment").toFile()); } + @Test @GitHubIssue(issueNumber = 3811, fixed = true) void noChangeDiffEnumComment() throws IOException { testNoChangeDiffFailing( Paths.get("src/test/java/spoon/test/prettyprinter/testclasses/difftest/EnumComment").toFile()); } + @Test @GitHubIssue(issueNumber = 3811, fixed = true) void noChangeDiffEnumTest() throws IOException { testNoChangeDiffFailing( Paths.get("src/test/java/spoon/test/prettyprinter/testclasses/difftest/EnumTest").toFile()); } + @Test @GitHubIssue(issueNumber = 3811, fixed = true) void noChangeDiffExceptionTest() throws IOException { testNoChangeDiffFailing( Paths.get("src/test/java/spoon/test/prettyprinter/testclasses/difftest/ExceptionTest").toFile()); } + @Test @GitHubIssue(issueNumber = 3811, fixed = true) void noChangeDiffMethodComment() throws IOException { testNoChangeDiffFailing( diff --git a/src/test/java/spoon/test/role/TestCtRole.java b/src/test/java/spoon/test/role/TestCtRole.java index b74420dab8d..169398c8886 100644 --- a/src/test/java/spoon/test/role/TestCtRole.java +++ b/src/test/java/spoon/test/role/TestCtRole.java @@ -28,8 +28,7 @@ import spoon.support.reflect.declaration.CtConstructorImpl; import spoon.support.reflect.declaration.CtFieldImpl; import spoon.support.reflect.declaration.CtMethodImpl; -import spoon.test.GitHubIssue; - +import spoon.testing.utils.GitHubIssue; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertNotNull; import static org.junit.jupiter.api.Assertions.assertNull; @@ -112,6 +111,7 @@ public void testCtRoleGetSubRoleFailsOnNull() { } } + @Test @GitHubIssue(issueNumber = 4698, fixed = true) void testArrayListRoleInParent() { // contract: Printing an element should not cause getRoleInParent to fail afterwards diff --git a/src/test/java/spoon/test/GitHubIssue.java b/src/test/java/spoon/testing/utils/GitHubIssue.java similarity index 88% rename from src/test/java/spoon/test/GitHubIssue.java rename to src/test/java/spoon/testing/utils/GitHubIssue.java index 0cc3c9e5307..da991e1fe0d 100644 --- a/src/test/java/spoon/test/GitHubIssue.java +++ b/src/test/java/spoon/testing/utils/GitHubIssue.java @@ -5,7 +5,7 @@ * * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. */ -package spoon.test; +package spoon.testing.utils; import static org.junit.jupiter.api.Assertions.fail; import java.lang.annotation.ElementType; @@ -14,7 +14,6 @@ import java.lang.annotation.Target; import java.util.Objects; import org.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.AfterTestExecutionCallback; import org.junit.jupiter.api.extension.ExtendWith; import org.junit.jupiter.api.extension.ExtensionContext; @@ -23,13 +22,21 @@ @Retention(RetentionPolicy.RUNTIME) @Target(ElementType.METHOD) -@Test @ExtendWith(GitHubIssue.UnresolvedBugExtension.class) /** * This meta annotation is used to mark a test method as a test that should fail if {@link #fixed} is false. * The test will be executed and the result will be checked. If the test fails, the test will be marked as success. - * As this is a meta annotation you can simple only add this to a test method and omit the {@link Test} aonntation. - * Mark {@link #fixed} as true if you want to signal that the test should succed and the issue is fixed. + * Mark {@link #fixed} as true if you want to signal that the test should succeed and the issue is fixed. + * + * Example usage: + *
+ * {@literal @}Test
+ * {@literal @}GitHubIssue(issueNumber = 123, fixed = false)
+ * public void testSomething() {
+ *     // Perform some test that should fail if issue #123 is not fixed
+ *     Assertions.fail("This test should fail if issue #123 is not fixed");
+ * }
+ * 
*/ public @interface GitHubIssue {