From e79934938c4ca4ddc50c68f311f2fe0bf0e74a8b Mon Sep 17 00:00:00 2001 From: Guus der Kinderen Date: Tue, 30 Apr 2024 22:00:51 +0200 Subject: [PATCH] [sinttest] Add optional version to specification reference Some specifications are versioned. XEPs, for example, typically are. It is useful to annotate an implementation with the specific version of the specification that is being tested. --- .../smack/inttest/SmackIntegrationTestFramework.java | 3 +++ .../inttest/annotations/SpecificationReference.java | 9 ++++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/smack-integration-test/src/main/java/org/igniterealtime/smack/inttest/SmackIntegrationTestFramework.java b/smack-integration-test/src/main/java/org/igniterealtime/smack/inttest/SmackIntegrationTestFramework.java index 0c9b56d3f2..3db80163f9 100644 --- a/smack-integration-test/src/main/java/org/igniterealtime/smack/inttest/SmackIntegrationTestFramework.java +++ b/smack-integration-test/src/main/java/org/igniterealtime/smack/inttest/SmackIntegrationTestFramework.java @@ -179,6 +179,9 @@ private static String getSpecificationReference(Method method) { return null; } String line = spec.document().trim(); + if (!spec.version().isBlank()) { + line += " (version " + spec.version() + ")"; + } final SmackIntegrationTest test = method.getAnnotation(SmackIntegrationTest.class); if (!test.section().isBlank()) { diff --git a/smack-integration-test/src/main/java/org/igniterealtime/smack/inttest/annotations/SpecificationReference.java b/smack-integration-test/src/main/java/org/igniterealtime/smack/inttest/annotations/SpecificationReference.java index 947dc3b901..beadb7782d 100644 --- a/smack-integration-test/src/main/java/org/igniterealtime/smack/inttest/annotations/SpecificationReference.java +++ b/smack-integration-test/src/main/java/org/igniterealtime/smack/inttest/annotations/SpecificationReference.java @@ -23,7 +23,7 @@ import java.lang.annotation.Target; /** - * Reference to a specific part of a specification. + * Reference to a specification document. * * @author Guus der Kinderen, guus@goodbytes.nl */ @@ -38,4 +38,11 @@ * @return a document identifier */ String document(); + + /** + * An optional version number, such as '1.2.0'. + * + * @return a version number + */ + String version() default ""; }