Skip to content

Commit

Permalink
[sinttest] Add optional version to specification reference
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
guusdk committed Apr 30, 2024
1 parent 1bba38d commit e799349
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
Expand All @@ -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 "";
}

0 comments on commit e799349

Please sign in to comment.