| <!-- |
| 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 name="org.apache.easyant.plugins;easyant-plugin-documentation-test" xmlns:au="antlib:org.apache.ant.antunit" |
| xmlns:ivy="antlib:org.apache.ivy.ant" xmlns:ea="antlib:org.apache.easyant"> |
| |
| <!-- Import your plugin --> |
| <property name="target" value="${basedir}/target/test-antunit" /> |
| <!-- configure easyant in current project --> |
| <ea:configure-easyant-ivy-instance /> |
| <!-- import our local plugin --> |
| <ea:import-test-module moduleIvy="../../../module.ivy" sourceDirectory="../../main/resources" /> |
| |
| <!-- Defines a setUp / tearDown (before each test) that cleans the environnement --> |
| <target name="clean" description="remove stale build artifacts before / after each test"> |
| <delete dir="${basedir}" includeemptydirs="true"> |
| <include name="**/target/**" /> |
| <include name="**/lib/**" /> |
| <include name="README.md"/> |
| </delete> |
| </target> |
| |
| <target name="setUp" depends="clean"> |
| <property name="plugindoc.module.ivy" value="${basedir}/sample-module.ivy" /> |
| <property name="plugindoc.source.dir" value="${basedir}/src/main/resources" /> |
| </target> |
| <target name="tearDown" depends="clean" /> |
| |
| <target name="test-easyant-plugin-documentation:init" depends="easyant-plugin-documentation:init"> |
| <au:assertPropertyEquals name="plugindoc.module.ivy" value="${basedir}/sample-module.ivy" /> |
| <au:assertPropertyEquals name="plugindoc.source.dir" value="${basedir}/src/main/resources" /> |
| <au:assertPropertyEquals name="plugindoc.main.confs" value="default" /> |
| <au:assertPropertyEquals name="target.documentation.dir" value="${target}/documentation" /> |
| </target> |
| |
| <target name="test-easyant-plugin-documentation:report" depends="easyant-plugin-documentation:report"> |
| <au:assertFileExists file="${target}/documentation/org.apache.easyant.plugins-tinyplugin-default.html" /> |
| </target> |
| |
| <target name="testeasyant-plugin-documentation:package" depends="easyant-plugin-documentation:package"> |
| <au:assertPropertyEquals name="target.artifacts" value="${target}/artifacts" /> |
| <au:assertFileExists file="${target.artifacts}"/> |
| <au:assertFileExists file="${target.artifacts}/${ivy.module}-documentation.zip"/> |
| </target> |
| |
| <target name="test-easyant-plugin-documentation:generate-readme" depends="easyant-plugin-documentation:generate-readme"> |
| <au:assertFileExists file="${basedir}/README.md" /> |
| </target> |
| |
| |
| <target name="prepare-register-artifact"> |
| <ivy:settings id="easyant.ivy.instance" /> |
| <ivy:resolve file="sample-module.ivy" settingsRef="easyant.ivy.instance" /> |
| </target> |
| |
| <target name="test-easyant-plugin-documentation:register-artifact" depends="prepare-register-artifact,easyant-plugin-documentation:register-artifact"> |
| <au:assertPropertyEquals name="plugindoc.publish.type" value="zip" /> |
| <au:assertPropertyEquals name="plugindoc.publish.confs" value="documentation" /> |
| <au:assertPropertyEquals name="project.ivy.instance" value="project.ivy.instance"/> |
| </target> |
| </project> |