testserver/patches/api/0259-Better-AnnotationTest-...

34 lines
1.4 KiB
Diff
Raw Normal View History

2021-06-11 12:02:28 +00:00
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Jake Potrebic <jake.m.potrebic@gmail.com>
Date: Thu, 3 Dec 2020 14:04:57 -0800
Subject: [PATCH] Better AnnotationTest printout
diff --git a/src/test/java/org/bukkit/AnnotationTest.java b/src/test/java/org/bukkit/AnnotationTest.java
2021-06-21 16:55:17 +00:00
index 1c6a41644257cd35ced235af6cc60efc925ebc18..b94d87832a271a76a5c8c0c9bf403c35348b31ed 100644
2021-06-11 12:02:28 +00:00
--- a/src/test/java/org/bukkit/AnnotationTest.java
+++ b/src/test/java/org/bukkit/AnnotationTest.java
2021-06-21 16:55:17 +00:00
@@ -118,13 +118,18 @@ public class AnnotationTest {
2021-06-11 12:02:28 +00:00
Collections.sort(errors);
- System.out.println(errors.size() + " missing annotation(s):");
+ StringBuilder builder = new StringBuilder()
+ .append("There ")
+ .append(errors.size() != 1 ? "are " : "is ")
+ .append(errors.size())
+ .append(" missing annotation")
+ .append(errors.size() != 1 ? "s:\n" : ":\n");
+
for (String message : errors) {
- System.out.print("\t");
- System.out.println(message);
+ builder.append("\t").append(message).append("\n");
}
- Assert.fail("There " + errors.size() + " are missing annotation(s)");
+ Assert.fail(builder.toString());
}
private static void collectClasses(@NotNull File from, @NotNull Map<String, ClassNode> to) throws IOException {