jdaugherty commented on code in PR #2228: URL: https://github.com/apache/groovy/pull/2228#discussion_r2096097956
########## subprojects/groovy-groovydoc/src/test/groovy/org/codehaus/groovy/tools/groovydoc/GroovyDocTest.java: ########## @@ -84,6 +85,43 @@ public void testCustomClassTemplate() throws Exception { assertTrue("\"This is a custom class template.\" not in: " + lines, lines.contains("This is a custom class template.")); } + @Test + public void testSupportedJavadocVersion() throws Exception { + rule.executeTarget("supportedGroovyDocJava"); + + final File testfilesPackageDir = new File(tmpDir, "org/codehaus/groovy/tools/groovydoc/testfiles/generics"); + final String[] list = testfilesPackageDir.list((file, name) -> name.equals("Java.html")); + + assertNotNull("Dir not found: " + testfilesPackageDir.getAbsolutePath(), list); + assertEquals(1, list.length); + File documentedClass = new File(testfilesPackageDir, list[0]); + assertTrue("Java.html not found: " + documentedClass.getAbsolutePath(), documentedClass.exists()); + + List<String> lines = ResourceGroovyMethods.readLines(documentedClass); + assertTrue("\"<title>Java</title>\" not in: " + lines, lines.contains("<title>Java</title>")); + } + + @Test + public void testUnsupportedJavadocVersion() throws Exception { + rule.executeTarget("unsupportedGroovyDocJava"); + + final File testfilesPackageDir = new File(tmpDir, "org/codehaus/groovy/tools/groovydoc/testfiles/generics"); + final String[] list = testfilesPackageDir.list((file, name) -> name.equals("Java.html")); + + assertNotNull("Dir not found: " + testfilesPackageDir.getAbsolutePath(), list); + assertEquals("Files unexpectedly found when not expecting to parse",0, list.length); + } + + @Test + public void testInvalidJavaVersion() throws Exception { + try { + rule.executeTarget("invalidJavaVersion"); + } + catch(BuildException e) { + assertEquals("java.lang.IllegalArgumentException: Unsupported Java Version: DNE", e.getMessage()); Review Comment: This isn't valid (the test passes) -- 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