|
- <?xml version="1.0"?>
- <!--
- Licensed to the Apache Software Foundation (ASF) under one or more
- contributor license agreements. See the NOTICE file distributed with
- this work for additional information regarding copyright ownership.
- The ASF licenses this file to You 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.
- -->
- <project default="antunit" xmlns:au="antlib:org.apache.ant.antunit">
- <import file="../antunit-base.xml" />
-
- <target name="-makeTestClass">
- <mkdir dir="${input}/test"/>
- <echo file="${input}/test/A.java"><![CDATA[
- package test;
-
- /**
- * This is a test class.
- */
- public class A {
- /**
- * With a test method.
- */
- public void foo(String bar) {}
- }
- ]]></echo>
- </target>
-
- <target name="testBottomWithLineBreaksWithFile" depends="-makeTestClass">
- <javadoc destdir="${output}" useexternalfile="true">
- <fileset dir="${input}"/>
- <bottom><![CDATA[
- <hr/>
- Hello World
- ]]></bottom>
- </javadoc>
- <au:assertFileExists file="${output}/test/A.html"/>
- </target>
-
- <target name="-setUpDocFilesTests" depends="-makeTestClass">
- <mkdir dir="${input}/test/doc-files/a"/>
- <mkdir dir="${input}/test/doc-files/b"/>
- <macrodef name="mkfoo">
- <attribute name="file"/>
- <sequential>
- <echo file="@{file}"><![CDATA[<p>Hello, world!</p>]]></echo>
- </sequential>
- </macrodef>
- <mkfoo file="${input}/test/doc-files/foo.html"/>
- <mkfoo file="${input}/test/doc-files/a/foo.html"/>
- <mkfoo file="${input}/test/doc-files/b/foo.html"/>
- </target>
-
- <target name="XtestNoDocFiles" depends="-setUpDocFilesTests">
- <javadoc destdir="${output}">
- <packageset dir="${input}"/>
- </javadoc>
- <au:assertFileExists file="${output}/test/doc-files/foo.html"/>
- <au:assertFileDoesntExist file="${output}/test/doc-files/a/foo.html"/>
- </target>
-
- <target name="XtestDocFiles" depends="-setUpDocFilesTests">
- <javadoc destdir="${output}" docfilessubdirs="true">
- <packageset dir="${input}"/>
- </javadoc>
- <au:assertFileExists file="${output}/test/doc-files/foo.html"/>
- <au:assertFileExists file="${output}/test/doc-files/a/foo.html"/>
- <au:assertFileExists file="${output}/test/doc-files/b/foo.html"/>
- </target>
-
- <target name="XtestDocFilesWithExclude" depends="-setUpDocFilesTests">
- <javadoc destdir="${output}" docfilessubdirs="true"
- excludedocfilessubdir="a">
- <packageset dir="${input}"/>
- </javadoc>
- <au:assertFileExists file="${output}/test/doc-files/foo.html"/>
- <au:assertFileDoesntExist file="${output}/test/doc-files/a/foo.html"/>
- <au:assertFileExists file="${output}/test/doc-files/b/foo.html"/>
- </target>
-
- </project>
|