jdaugherty commented on code in PR #2228:
URL: https://github.com/apache/groovy/pull/2228#discussion_r2096098929


##########
subprojects/groovy-groovydoc/src/test/groovy/org/codehaus/groovy/tools/groovydoc/GroovyDocToolTest.java:
##########
@@ -1026,6 +1039,63 @@ public void testClassDeclarationHeader() throws 
Exception {
         assertTrue("The Groovy derived class declaration header should match 
in:\n" + groovyDerivedClass, derivedClass.matcher(groovyDerivedClass).find());
     }
 
+    public void testLanguageLevelNotSupported() throws Exception {
+        htmlTool = makeHtmltool(new ArrayList<LinkArgument>(), 
ParserConfiguration.LanguageLevel.JAVA_1_4.name(), new Properties());
+
+        final String base = 
"org/codehaus/groovy/tools/groovydoc/testfiles/generics";
+
+        PrintStream originalSystemErr = System.err;
+        ByteArrayOutputStream systemErr = new ByteArrayOutputStream();
+        try {
+            System.setErr(new PrintStream(systemErr));
+            htmlTool.add(Arrays.asList(
+                base + "/Java.java"
+            ));
+        }
+        finally {
+            System.setErr(originalSystemErr);
+        }
+        final String errorMessage = systemErr.toString();
+        System.err.println(errorMessage);

Review Comment:
   The groovy doc tool uses System.err when outputting, so this is how to 
capture that output.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscr...@groovy.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to