From a62ba1d05053e3853403029fd25183181971e018 Mon Sep 17 00:00:00 2001 From: Stefan Bodewig Date: Wed, 1 Feb 2006 05:45:08 +0000 Subject: [PATCH] tests for 38370 git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@373999 13f79535-47bb-0310-9956-ffa450edef68 --- .../taskdefs/javadoc/java/ClassToJavadoc.java | 38 ++++++ .../testcases/taskdefs/javadoc/javadoc.xml | 111 ++++++++++++++++ .../tools/ant/taskdefs/JavadocTest.java | 121 ++++++++++++++++++ 3 files changed, 270 insertions(+) create mode 100755 src/etc/testcases/taskdefs/javadoc/java/ClassToJavadoc.java create mode 100755 src/etc/testcases/taskdefs/javadoc/javadoc.xml create mode 100755 src/testcases/org/apache/tools/ant/taskdefs/JavadocTest.java diff --git a/src/etc/testcases/taskdefs/javadoc/java/ClassToJavadoc.java b/src/etc/testcases/taskdefs/javadoc/java/ClassToJavadoc.java new file mode 100755 index 000000000..b66274836 --- /dev/null +++ b/src/etc/testcases/taskdefs/javadoc/java/ClassToJavadoc.java @@ -0,0 +1,38 @@ +/* + * Copyright 2006 The Apache Software Foundation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ +package etc.testcases.taskdefs.javadoc.java; + +/** + * This is a simple class to provide grist for the javadoc mill + * while testing it. + */ +public class ClassToJavadoc { + /** + * @param anArgument A String that is ignored + */ + public void methodToJavadoc(String anArgument) { } + + /** + * @see java.lang.Object#toString() + */ + public String toString() { return this.getClass().getName(); } + + /** + * @return An arbitrary string. + */ + public String anotherString() {return "An arbitrary string.";} +} diff --git a/src/etc/testcases/taskdefs/javadoc/javadoc.xml b/src/etc/testcases/taskdefs/javadoc/javadoc.xml new file mode 100755 index 000000000..47fa80c4e --- /dev/null +++ b/src/etc/testcases/taskdefs/javadoc/javadoc.xml @@ -0,0 +1,111 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/testcases/org/apache/tools/ant/taskdefs/JavadocTest.java b/src/testcases/org/apache/tools/ant/taskdefs/JavadocTest.java new file mode 100755 index 000000000..3b003dacd --- /dev/null +++ b/src/testcases/org/apache/tools/ant/taskdefs/JavadocTest.java @@ -0,0 +1,121 @@ +/* + * Copyright 2006 The Apache Software Foundation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +package org.apache.tools.ant.taskdefs; + +import org.apache.tools.ant.BuildException; +import org.apache.tools.ant.BuildFileTest; + +public class JavadocTest extends BuildFileTest { + + public JavadocTest(String name) { + super(name); + } + + private static final String BUILD_PATH = "src/etc/testcases/taskdefs/javadoc/"; + private static final String BUILD_FILENAME = "javadoc.xml"; + private static final String BUILD_FILE = BUILD_PATH + BUILD_FILENAME; + + protected void setUp() throws Exception { + super.setUp(); + configureProject(BUILD_FILE); + } + + // PR 38370 + public void testDirsetPath() throws Exception { + executeTarget("dirsetPath"); + } + + // PR 38370 + public void XtestDirsetPathWithoutPackagenames() throws Exception { + try { + executeTarget("dirsetPathWithoutPackagenames"); + } catch (BuildException e) { + fail("Contents of path should be picked up without specifying package names: " + e); + } + } + + // PR 38370 + public void testNestedDirsetPath() throws Exception { + executeTarget("nestedDirsetPath"); + } + + // PR 38370 + public void testFilesetPath() throws Exception { + try { + executeTarget("filesetPath"); + } catch (BuildException e) { + fail("A path can contain filesets: " + e); + } + } + + // PR 38370 + public void testNestedFilesetPath() throws Exception { + try { + executeTarget("nestedFilesetPath"); + } catch (BuildException e) { + fail("A path can contain nested filesets: " + e); + } + } + + // PR 38370 + public void testFilelistPath() throws Exception { + try { + executeTarget("filelistPath"); + } catch (BuildException e) { + fail("A path can contain filelists: " + e); + } + } + + // PR 38370 + public void testNestedFilelistPath() throws Exception { + try { + executeTarget("nestedFilelistPath"); + } catch (BuildException e) { + fail("A path can contain nested filelists: " + e); + } + } + + // PR 38370 + public void testPathelementPath() throws Exception { + executeTarget("pathelementPath"); + } + + // PR 38370 + public void testPathelementLocationPath() throws Exception { + try { + executeTarget("pathelementLocationPath"); + } catch (BuildException e) { + fail("A path can contain pathelements pointing to a file: " + e); + } + } + + // PR 38370 + public void testNestedSource() throws Exception { + executeTarget("nestedSource"); + } + + // PR 38370 + public void testNestedFilesetRef() throws Exception { + executeTarget("nestedFilesetRef"); + } + + // PR 38370 + public void testNestedFilesetRefInPath() throws Exception { + executeTarget("nestedFilesetRefInPath"); + } +}