diff options
Diffstat (limited to 'framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs')
151 files changed, 13480 insertions, 0 deletions
diff --git a/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/ant-test.xml b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/ant-test.xml new file mode 100644 index 00000000..c3ee56b7 --- /dev/null +++ b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/ant-test.xml @@ -0,0 +1,55 @@ +<?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="testLastPropertyWins"> + <ant antfile="antcall-test.xml" target="checkB"> + <property name="b" value="1"/> + <property name="b" value="2"/> + <property name="expected" value="2"/> + </ant> + </target> + + <target name="makePropertiesFile"> + <ant antfile="antcall-test.xml" target="makePropertiesFile"/> + </target> + + <target name="testPropertiesLoadedFromFile" depends="makePropertiesFile"> + <ant antfile="antcall-test.xml" target="checkB"> + <property name="expected" value="2"/> + <property file="${input}/ant.properties"/> + </ant> + </target> + + <target name="testFileSeesExternalProperty" depends="makePropertiesFile"> + <property name="a" value="x"/> + <ant antfile="antcall-test.xml" target="checkB"> + <property name="expected" value="x"/> + <property file="${input}/ant.properties"/> + </ant> + </target> + + <target name="testFileSeesInternalProperty" depends="makePropertiesFile"> + <ant antfile="antcall-test.xml" target="checkB"> + <property name="a" value="y"/> + <property name="expected" value="y"/> + <property file="${input}/ant.properties"/> + </ant> + </target> +</project> diff --git a/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/antcall-test.xml b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/antcall-test.xml new file mode 100644 index 00000000..9767185d --- /dev/null +++ b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/antcall-test.xml @@ -0,0 +1,63 @@ +<?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="checkB"> + <au:assertPropertyEquals name="b" value="${expected}"/> + </target> + + <target name="testLastParamWins"> + <antcall target="checkB"> + <param name="b" value="1"/> + <param name="b" value="2"/> + <param name="expected" value="2"/> + </antcall> + </target> + + <target name="makePropertiesFile"> + <mkdir dir="${input}"/> + <echo file="${input}/ant.properties"><![CDATA[ +a=2 +b=$${a} +]]></echo> + </target> + + <target name="testPropertiesLoadedFromFile" depends="makePropertiesFile"> + <antcall target="checkB"> + <param name="expected" value="2"/> + <param file="${input}/ant.properties"/> + </antcall> + </target> + + <target name="testFileSeesExternalProperty" depends="makePropertiesFile"> + <property name="a" value="x"/> + <antcall target="checkB"> + <param name="expected" value="x"/> + <param file="${input}/ant.properties"/> + </antcall> + </target> + + <target name="testFileSeesInternalParam" depends="makePropertiesFile"> + <antcall target="checkB"> + <param name="a" value="y"/> + <param name="expected" value="y"/> + <param file="${input}/ant.properties"/> + </antcall> + </target> +</project> diff --git a/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/apt-test.xml b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/apt-test.xml new file mode 100644 index 00000000..9b240011 --- /dev/null +++ b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/apt-test.xml @@ -0,0 +1,158 @@ +<?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" /> + <!-- apt tests --> + + <property name="build.dir" location="aptbuild" /> + <property name="classes.dir" location="${build.dir}/classes" /> + <property name="classes2.dir" location="${build.dir}/classes2" /> + <property name="preprocess.dir" location="${build.dir}/source" /> + <property name="src" location="apt" /> + + <property name="AptExample.class" location="${classes.dir}/AptExample.class" /> + + <macrodef name="assertCompiled"> + <attribute name="file" /> + <sequential > + <fail message="not found: @{file}"> + <condition> + <not> + <available file="@{file}" /> + </not> + </condition> + </fail> + </sequential> + </macrodef> + + <macrodef name="assertProcessed"> + <sequential> + <au:assertLogContains text="DistributedAnnotationProcessor-is-go"/> + <au:assertLogContains text="[-Abuild.dir="/> + <au:assertLogContains text="visiting DistributedAnnotationFactory"/> + </sequential> + </macrodef> + + <presetdef name="assertAptExampleCompiled"> + <assertCompiled file="${AptExample.class}"/> + </presetdef> + + <target name="tearDown" depends="antunit-base.tearDown"> + <delete dir="${build.dir}"/> + </target> + + <target name="setUp"> + <mkdir dir="${classes.dir}"/> + <mkdir dir="${classes2.dir}"/> + <mkdir dir="${preprocess.dir}"/> + </target> + + <target name="testApt" depends="setUp" unless="jdk1.8+"> + <apt srcdir="${src}" + destdir="${classes.dir}" + debug="on" + compile="true" + preprocessdir="${preprocess.dir}"> + </apt> + <assertAptExampleCompiled /> + </target> + + <target name="testAptFork" depends="setUp" unless="jdk1.8+"> + <apt srcdir="${src}" + destdir="${classes.dir}" + debug="on" + compile="true" + fork="true" + preprocessdir="${preprocess.dir}"> + </apt> + <assertAptExampleCompiled /> + </target> + + <target name="testAptForkFalse" depends="setUp" unless="jdk1.8+"> + <apt srcdir="${src}" + destdir="${classes.dir}" + debug="on" + compile="true" + fork="false" + preprocessdir="${preprocess.dir}"> + </apt> + <assertAptExampleCompiled /> + <au:assertLogContains text="Apt only runs in its own JVM; fork=false option ignored"/> + + </target> + + <target name="testListAnnotationTypes" depends="setUp" unless="jdk1.8+"> + <apt srcdir="${src}" + destdir="${classes.dir}" + debug="on" + compile="true" + preprocessdir="${preprocess.dir}"> + <compilerarg value="-XListAnnotationTypes" /> + <compilerarg value="-Xlint:deprecation" /> + </apt> + + <assertAptExampleCompiled /> + <au:assertLogContains text="Set of annotations found:"/> + <au:assertLogContains text="Distributed"/> + </target> + + + <!-- use the factory we compiled. To avoid trouble + we deliver into a version in a new classpath, otherwise + the dependency logic will not run Apt--> + <target name="testAptNewFactory" depends="testApt" unless="jdk1.8+"> + <apt srcdir="${src}" + destdir="${classes2.dir}" + debug="on" + compile="true" + factory="DistributedAnnotationFactory" + preprocessdir="${preprocess.dir}"> + <factorypath path="${classes.dir}" /> + <option name="build.dir" value="${build.dir}" /> + </apt> + <assertAptExampleCompiled /> + <assertProcessed /> + </target> + + <target name="testAptNewFactoryFork" depends="testApt" unless="jdk1.8+"> + <apt srcdir="${src}" + destdir="${classes2.dir}" + debug="on" + compile="true" + fork="true" + factory="DistributedAnnotationFactory" + preprocessdir="${preprocess.dir}"> + <factorypath path="${classes.dir}" /> + <option name="build.dir" value="${build.dir}" /> + </apt> + <assertAptExampleCompiled /> + <assertProcessed /> + </target> + + <target name="testAptUnderJDK18" if="jdk1.8+"> + <au:expectfailure expectedMessage="apt does not exist under Java 1.8 and higher"> + <apt srcdir="${src}" + destdir="${classes.dir}" + debug="on" + compile="true" + fork="true" + preprocessdir="${preprocess.dir}"> + </apt> + </au:expectfailure> + </target> +</project>
\ No newline at end of file diff --git a/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/apt/AptExample.java b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/apt/AptExample.java new file mode 100644 index 00000000..9d6fcba8 --- /dev/null +++ b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/apt/AptExample.java @@ -0,0 +1,25 @@ +/* + * 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. + * + */ +/** + */ +@Distributed( + protocol="CORBA", + distribution=Distributed.DistributionTypes.FEDERATED + ) +public class AptExample { +} diff --git a/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/apt/Distributed.java b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/apt/Distributed.java new file mode 100644 index 00000000..ebc3467a --- /dev/null +++ b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/apt/Distributed.java @@ -0,0 +1,39 @@ +/* + * 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. + * + */ +import java.lang.annotation.Annotation; +import java.lang.annotation.Target; +import java.lang.annotation.Retention; +import java.lang.annotation.Documented; +import java.lang.annotation.ElementType; +import java.lang.annotation.RetentionPolicy; + +/** + */ +@Documented +@Retention(value = RetentionPolicy.RUNTIME) +@Target(value = ElementType.TYPE) +public @interface Distributed { + + public DistributionTypes distribution() default DistributionTypes.LOCAL; + + public String protocol() default "RMI"; + + public enum DistributionTypes { SINGLETON, LOCAL, FAULT_TOLERANT, FEDERATED, MOBILE}; + + +} diff --git a/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/apt/DistributedAnnotationFactory.java b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/apt/DistributedAnnotationFactory.java new file mode 100644 index 00000000..a8fb6331 --- /dev/null +++ b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/apt/DistributedAnnotationFactory.java @@ -0,0 +1,50 @@ +/* + * 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. + * + */ +import com.sun.mirror.apt.AnnotationProcessorFactory; +import com.sun.mirror.apt.AnnotationProcessor; +import com.sun.mirror.apt.AnnotationProcessorEnvironment; + +import java.util.Collection; +import java.util.Set; +import java.util.Arrays; +import java.util.Collections; + + +/** + * This was the first piece of Java1.5 code in the source tree. + * @since 20050-03-09T21:29:25Z + */ +public class DistributedAnnotationFactory implements AnnotationProcessorFactory { + + private static final Collection<String> supportedAnnotations + = Collections.unmodifiableCollection(Arrays.asList("*")); + + public Collection<String> supportedOptions() { + return Collections.emptySet(); + } + + public Collection<String> supportedAnnotationTypes() { + return supportedAnnotations; + } + + public AnnotationProcessor getProcessorFor( + Set<com.sun.mirror.declaration.AnnotationTypeDeclaration> annotationTypeDeclarations, + AnnotationProcessorEnvironment env) { + return new DistributedAnnotationProcessor(env); + } +} diff --git a/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/apt/DistributedAnnotationProcessor.java b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/apt/DistributedAnnotationProcessor.java new file mode 100644 index 00000000..f94ff7f7 --- /dev/null +++ b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/apt/DistributedAnnotationProcessor.java @@ -0,0 +1,65 @@ +/* + * 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. + * + */ + +//found in tools.jar, not the JRE runtime. +import com.sun.mirror.apt.AnnotationProcessor; +import com.sun.mirror.apt.AnnotationProcessorEnvironment; +import com.sun.mirror.declaration.TypeDeclaration; +import com.sun.mirror.declaration.ClassDeclaration; +import com.sun.mirror.util.SimpleDeclarationVisitor; +import static com.sun.mirror.util.DeclarationVisitors.*; + +import java.util.Map; + +/** + * Annotation processor outputs stuff + */ + +public class DistributedAnnotationProcessor implements AnnotationProcessor { + + public AnnotationProcessorEnvironment env; + + public DistributedAnnotationProcessor(AnnotationProcessorEnvironment env) { + this.env = env; + } + + public void echo(String text) { + env.getMessager().printNotice(text); + } + + public void process() { + echo("DistributedAnnotationProcessor-is-go"); + + Map<String, String> options=env.getOptions(); + for(String key:options.keySet()) { + echo("Option ["+key+"] = "+options.get(key)); + } + + //work time + for (TypeDeclaration typeDecl : env.getSpecifiedTypeDeclarations()) { + typeDecl.accept(getDeclarationScanner(new ClassVisitor(), + NO_OP)); + } + } + + private class ClassVisitor extends SimpleDeclarationVisitor { + public void visitClassDeclaration(ClassDeclaration d) { + echo("visiting "+ d.getQualifiedName()); + } + } +} diff --git a/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/augment-test.xml b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/augment-test.xml new file mode 100644 index 00000000..2e6f3354 --- /dev/null +++ b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/augment-test.xml @@ -0,0 +1,74 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- + 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="augment-test" default="antunit" xmlns:au="antlib:org.apache.ant.antunit"> + <import file="../antunit-base.xml"/> + + <target name="setUp"> + <mkdir dir="${input}" /> + <touch> + <filelist id="filelist" dir="${input}" files="foo,bar,baz" /> + </touch> + <fileset id="input-fs" dir="${input}" /> + <au:assertTrue> + <resourcecount refid="input-fs" count="3" /> + </au:assertTrue> + </target> + + <target name="test-augment-attribute" depends="setUp"> + <augment id="input-fs" excludes="foo" /> + <au:assertTrue> + <resourcecount refid="input-fs" count="2" /> + </au:assertTrue> + </target> + + <target name="test-augment-element" depends="setUp"> + <augment id="input-fs"> + <filename name="bar" /> + </augment> + <au:assertTrue> + <resourcecount refid="input-fs" count="1" /> + </au:assertTrue> + </target> + + <target name="test-noref"> + <au:expectfailure expectedMessage="Unknown reference "nosuchreference""> + <augment id="nosuchreference" /> + </au:expectfailure> + </target> + + <target name="test-id-not-set"> + <au:expectfailure expectedMessage="augment attribute 'id' unset"> + <augment foo="bar" /> + </au:expectfailure> + </target> + + <target name="test-illegal-attribute" depends="setUp"> + <au:expectfailure expectedMessage="augmented reference "input-fs" doesn't support the "filesetwillmostlikelyneversupportthisattribute" attribute"> + <augment id="input-fs" filesetwillmostlikelyneversupportthisattribute="blah" /> + </au:expectfailure> + </target> + + <target name="test-illegal-element" depends="setUp"> + <au:expectfailure expectedMessage="augmented reference "input-fs" doesn't support the nested "filesetwillmostlikelyneversupportthiselement" element"> + <augment id="input-fs"> + <filesetwillmostlikelyneversupportthiselement /> + </augment> + </au:expectfailure> + </target> + +</project> diff --git a/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/broken_cd.zip b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/broken_cd.zip Binary files differnew file mode 100644 index 00000000..721fb450 --- /dev/null +++ b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/broken_cd.zip diff --git a/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/bunzip2-test.xml b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/bunzip2-test.xml new file mode 100644 index 00000000..a9ca4237 --- /dev/null +++ b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/bunzip2-test.xml @@ -0,0 +1,28 @@ +<?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="testExpandArchiveWithMultipleStreams"> + <mkdir dir="${output}"/> + <bunzip2 src="bzip2/multiple.bz2" dest="${output}"/> + <au:assertFilesMatch expected="bzip2/expected" + actual="${output}/multiple"/> + </target> + +</project>
\ No newline at end of file diff --git a/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/bzip2/expected b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/bzip2/expected new file mode 100644 index 00000000..9ae9e86b --- /dev/null +++ b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/bzip2/expected @@ -0,0 +1 @@ +ab
\ No newline at end of file diff --git a/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/bzip2/multiple.bz2 b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/bzip2/multiple.bz2 Binary files differnew file mode 100644 index 00000000..26dc3a75 --- /dev/null +++ b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/bzip2/multiple.bz2 diff --git a/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/checksum-test.xml b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/checksum-test.xml new file mode 100644 index 00000000..8341f425 --- /dev/null +++ b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/checksum-test.xml @@ -0,0 +1,83 @@ +<?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="testChecksumConditionWithFileSet"> + <mkdir dir="${output}"/> + <checksum todir="${output}"> + <fileset dir="."/> + </checksum> + <condition property="checksumsMatch"> + <checksum todir="${output}"> + <fileset dir="."/> + </checksum> + </condition> + <au:assertPropertySet name="checksumsMatch"/> + </target> + + <target name="testTotalPropertyAcrossPlatforms" + description="testcase for + https://issues.apache.org/bugzilla/show_bug.cgi?id=36748"> + <mkdir dir="${input}"/> + <echo file="${input}/a.txt">abc</echo> + <echo file="${input}/subdir/A.txt">def</echo> + <echo file="${input}/B.txt">xyz</echo> + <checksum totalproperty="total"> + <fileset dir="${input}"/> + </checksum> + <au:assertPropertyEquals name="total" + value="f4d688789d32e6ca6bc93c504dbc6b46"/> + </target> + + <target name="testChecksumPattern2"> + <mkdir dir="${output}"/> + <mkdir dir="${input}"/> + <echo file="${input}/a.txt">abc</echo> + <checksum todir="${output}" pattern="{2}"> + <fileset dir="${input}"/> + </checksum> + <au:assertResourceContains + resource="${output}/a.txt.MD5" + value="../testinput/a.txt"/> + </target> + + <target name="testChecksumPattern3"> + <mkdir dir="${output}"/> + <checksum todir="${output}" pattern="{3}"> + <fileset dir=".." includes="types/fileset-test.xml"/> + </checksum> + <au:assertResourceContains + resource="${output}/types/fileset-test.xml.MD5" + value="../types/fileset-test.xml"/> + </target> + + <target name="testChecksumPattern4"> + <mkdir dir="${output}"/> + <mkdir dir="${input}"/> + <property name="a" location="${input}/a.txt"/> + <echo file="${a}">abc</echo> + <checksum todir="${output}" pattern="{4}"> + <fileset dir="${input}"/> + </checksum> + <au:assertResourceContains + resource="${output}/a.txt.MD5" + value="${a}"/> + </target> + +</project> diff --git a/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/commandlauncher/commandlauncher-test.xml b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/commandlauncher/commandlauncher-test.xml new file mode 100644 index 00000000..49519bd8 --- /dev/null +++ b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/commandlauncher/commandlauncher-test.xml @@ -0,0 +1,87 @@ +<?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 xmlns:au="antlib:org.apache.ant.antunit" default="antunit"> + <import file="../../antunit-base.xml" /> + + <target name="testCommandLauncherTask"> + <echo message="${input}"/> + <mkdir dir="${input}"/> + <mkdir dir="${output}"/> + <echo file="${input}/MyCommandLauncher.java"> +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; + +import org.apache.tools.ant.Project; +import org.apache.tools.ant.taskdefs.Execute; +import org.apache.tools.ant.taskdefs.launcher.Java13CommandLauncher; + +public class MyCommandLauncher extends Java13CommandLauncher { + public MyCommandLauncher() throws NoSuchMethodException { + super(); + } + + + + @Override + public Process exec(Project project, String[] cmd, String[] env, File workingDir) throws IOException { + Process p = super.exec(project, cmd, env, workingDir); + System.out.println("Hello World From CommandLauncher"); + return p; + } + +} + + </echo> + <echo file="${input}/MyJavaExecutable.java"> +public class MyJavaExecutable { + public static void main(String[] args) { + + } +} + + </echo> + <javac destdir="${output}" + srcdir="${input}"/> + <typedef + name="my-command-launcher" + classname="MyCommandLauncher" classpath="${output}"/> + + <commandlauncher vmlauncher="true"> + <my-command-launcher/> + </commandlauncher> + + <condition property="java" + value="${java.home}/bin/java.exe" + else="${java.home}/bin/java"> + <os family="dos"/> + </condition> + + <exec executable="${java}" failonerror="true"> + <arg value="-cp"/> + <arg value="${output}"/> + <arg value="MyJavaExecutable"/> + </exec> + + + <au:assertLogContains text="Hello World From CommandLauncher"/> + </target> + + +</project> diff --git a/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/concat-test.xml b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/concat-test.xml new file mode 100644 index 00000000..4b285e38 --- /dev/null +++ b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/concat-test.xml @@ -0,0 +1,202 @@ +<?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="tearDown" depends="antunit-base.tearDown"> + <delete file="concat.resources" /> + </target> + + <property name="encodeStringDest" location="${output}/encodeStringDest" /> + + <target name="testBinaryAppend"> + <property name="binaryAppendDest" location="${output}/binaryAppendDest" /> + <mkdir dir="${output}" /> + <au:assertTrue message="prerequisite conditions unmet"> + <length length="0"> + <!-- allow for nonexistent OR zero-length: --> + <fileset file="${binaryAppendDest}" /> + </length> + </au:assertTrue> + <echo file="${binaryAppendDest}">x</echo> + <au:assertTrue message="destfile setup failed"> + <length length="1" file="${binaryAppendDest}" /> + </au:assertTrue> + <concat append="true" destfile="${binaryAppendDest}" binary="true"> + <string value="x" /> + </concat> + <au:assertTrue message="expected length 2"> + <length file="${binaryAppendDest}" length="2" /> + </au:assertTrue> + </target> + + <target name="testStringEncoding" if="os.unix"> + <property name="br" value="${line.separator}" /> + <concat destfile="${encodeStringDest}" outputEncoding="utf-16">foo${br}bar${br}baz${br}</concat> + <au:assertTrue> + <resourcesmatch astext="true"> + <file file="utf-16.expected" /> + <file file="${encodeStringDest}" /> + </resourcesmatch> + </au:assertTrue> + </target> + + <target name="testStringEncodingWindows" if="os.windows"> + <property name="br" value="${line.separator}" /> + <concat destfile="${encodeStringDest}" outputEncoding="utf-16">foo${br}bar${br}baz${br}</concat> + <au:assertTrue> + <resourcesmatch astext="true"> + <file file="utf-16.expected.windows" /> + <file file="${encodeStringDest}" /> + </resourcesmatch> + </au:assertTrue> + </target> + + <target name="testDoNotFixNestedText" description="Bugzilla 42369"> + <au:assertTrue> + <resourcesmatch> + <string>foo</string> + <concat fixlastline="true">foo</concat> + </resourcesmatch> + </au:assertTrue> + </target> + + <target name="-fixlastline-setup"> + <mkdir dir="${input}"/> + <mkdir dir="${output}"/> + <echo file="${input}/1">1</echo> + <echo file="${input}/2">2</echo> + </target> + + <target name="testFixLastLineActuallyFixes" depends="-fixlastline-setup"> + <au:assertTrue> + <resourcesmatch> + <string>1${line.separator}2${line.separator}</string> + <concat fixlastline="true"> + <filelist dir="${input}"> + <file name="1"/> + <file name="2"/> + </filelist> + </concat> + </resourcesmatch> + </au:assertTrue> + </target> + + <target name="testFixLastLineActuallyFixesWithFilterChain" + depends="-fixlastline-setup" + description="https://issues.apache.org/bugzilla/show_bug.cgi?id=54672"> + <au:assertTrue> + <resourcesmatch> + <string>1${line.separator}2${line.separator}</string> + <concat fixlastline="true"> + <filelist dir="${input}"> + <file name="1"/> + <file name="2"/> + </filelist> + <filterchain> + <tokenfilter> + <ignoreblank/> + </tokenfilter> + </filterchain> + </concat> + </resourcesmatch> + </au:assertTrue> + </target> + + <target name="testIgnoreEmptyFalseFileIsCreated"> + <mkdir dir="${input}" /> + <mkdir dir="${output}" /> + <concat destfile="${output}/TESTDEST" append="true" ignoreEmpty="false"> + <filelist dir="${input}" files="thisfiledoesnotexist" /> + </concat> + <au:assertFileExists file="${output}/TESTDEST" /> + </target> + + <target name="testIgnoreEmptyTrueFileIsNotCreated"> + <mkdir dir="${input}" /> + <mkdir dir="${output}" /> + <concat destfile="${output}/TESTDEST" append="true" ignoreEmpty="true"> + <filelist dir="${input}" files="thisfiledoesnotexist" /> + </concat> + <au:assertFileDoesntExist file="${output}/TESTDEST" /> + </target> + + <target name="testIgnoreEmptyFalseFileIsCreatedIncludesHeader"> + <mkdir dir="${input}" /> + <mkdir dir="${output}" /> + <concat destfile="${output}/TESTDEST" ignoreEmpty="false"> + <filelist dir="${input}" files="thisfiledoesnotexist" /> + <header filtering="false" trim="yes"> + header + </header> + </concat> + <au:assertFileExists file="${output}/TESTDEST" /> + <au:assertResourceContains resource="${output}/TESTDEST" value="header" /> + </target> + + <target name="testIgnoreEmptyFalseFileIsCreatedIncludesFooter"> + <mkdir dir="${input}" /> + <mkdir dir="${output}" /> + <concat destfile="${output}/TESTDEST" ignoreEmpty="false"> + <filelist dir="${input}" files="thisfiledoesnotexist" /> + <footer filtering="no">footer</footer> + </concat> + <au:assertFileExists file="${output}/TESTDEST" /> + <au:assertResourceContains resource="${output}/TESTDEST" value="footer" /> + </target> + + <target name="testResources"> + <string id="s1">The Quick Brown Fox</string> + <string id="s2">Jumped Over The Lazy Dog.</string> + + <concat destfile="concat.resources" binary="true"> + <resource refid="s1" /> + <resource refid="s2" /> + </concat> + <length property="expected"> + <resources> + <resource refid="s1" /> + <resource refid="s2" /> + </resources> + </length> + <length property="actual"> + <file file="concat.resources" /> + </length> + <fail> + <condition> + <or> + <equals arg1="${actual}" arg2="0" /> + <not> + <equals arg1="${actual}" arg2="${expected}" /> + </not> + </or> + </condition> + </fail> + </target> + + <target name="testBug48816"> + <concat> + <resources id="48816" /> + <string value="x" /> + </concat> + <au:assertTrue> + <resourcecount refid="48816" count="0" /> + </au:assertTrue> + </target> + +</project> diff --git a/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/condition/antversion-test.xml b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/condition/antversion-test.xml new file mode 100644 index 00000000..89c2d7eb --- /dev/null +++ b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/condition/antversion-test.xml @@ -0,0 +1,70 @@ +<?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 name="antversion-test" default="all" basedir="." xmlns:au="antlib:org.apache.ant.antunit"> + + <target name="test-atleast"> + <au:assertTrue message="Expected antversion of ${ant.version} to be at least 1.7.0"> + <!-- AntVersion was introduced like AntUnit in 1.7 - so this must be true --> + <antversion atleast="1.7.0" /> + </au:assertTrue> + </target> + + <target name="test-exactly"> + <antversion property="ant.actual.version" /> + <au:assertTrue message="Expected antversion of ${ant.actual.version}"> + <antversion exactly="${ant.actual.version}" /> + </au:assertTrue> + </target> + + <target name="test-atleast-fail"> + <property name="version" value="1.8.9" /> + <au:assertFalse> + <antversion atleast="1.1000.0" /> + </au:assertFalse> + </target> + + <target name="test-task"> + <antversion property="antversion" /> + <au:assertPropertySet name="antversion" message="Property 'antversion' should be set." /> + <echo>AntVersion=${antversion}</echo> + </target> + + <target name="test-property-conditional1"> + <antversion property="antversion" atleast="2.0.0" /> + <au:assertTrue message="Property 'antversion' should not be set because this is not Ant 2.0.0+."> + <not> + <isset property="antversion" /> + </not> + </au:assertTrue> + </target> + + <target name="test-property-conditional2"> + <antversion property="antversion" atleast="1.7.0" /> + <au:assertTrue message="Property 'antversion' should be set because we should have Ant 1.7.0+ (${ant.version})."> + <isset property="antversion" /> + </au:assertTrue> + </target> + + <target name="all"> + <au:antunit> + <fileset file="${ant.file}" /> + <au:plainlistener /> + </au:antunit> + </target> + +</project> diff --git a/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/condition/equals-test.xml b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/condition/equals-test.xml new file mode 100644 index 00000000..8888d396 --- /dev/null +++ b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/condition/equals-test.xml @@ -0,0 +1,80 @@ +<?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 name="equals-test" xmlns:au="antlib:org.apache.ant.antunit" + default="antunit"> + + <import file="../../antunit-base.xml" /> + + <target name="test-noforcestring"> + <string id="s" value="foo" /> + <au:assertFalse> + <equals arg1="foo" arg2="${ant.refid:s}" /> + </au:assertFalse> + </target> + + <target name="test-forcestring"> + <string id="s" value="foo" /> + <au:assertTrue> + <equals arg1="foo" arg2="${ant.refid:s}" forcestring="true" /> + </au:assertTrue> + </target> + + <target name="test-forcestring-notrim"> + <string id="s" value=" foo " /> + <au:assertFalse> + <equals arg1="foo" arg2="${ant.refid:s}" forcestring="true" /> + </au:assertFalse> + </target> + + <target name="test-forcestring-trim"> + <string id="s" value=" foo " /> + <au:assertTrue> + <equals arg1="foo" arg2="${ant.refid:s}" forcestring="true" trim="true" /> + </au:assertTrue> + </target> + + <target name="test-forcestring-cs"> + <string id="s" value="Foo" /> + <au:assertFalse> + <equals arg1="foo" arg2="${ant.refid:s}" forcestring="true" /> + </au:assertFalse> + </target> + + <target name="test-forcestring-nocs"> + <string id="s" value="Foo" /> + <au:assertTrue> + <equals arg1="foo" arg2="${ant.refid:s}" forcestring="true" casesensitive="false" /> + </au:assertTrue> + </target> + + <target name="test-forcestring-trim-cs"> + <string id="s" value=" Foo " /> + <au:assertFalse> + <equals arg1="foo" arg2="${ant.refid:s}" forcestring="true" trim="true" /> + </au:assertFalse> + </target> + + <target name="test-forcestring-trim-nocs"> + <string id="s" value=" Foo " /> + <au:assertTrue> + <equals arg1="foo" arg2="${ant.refid:s}" forcestring="true" + trim="true" casesensitive="false" /> + </au:assertTrue> + </target> + +</project> diff --git a/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/condition/filesmatch-test.xml b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/condition/filesmatch-test.xml new file mode 100644 index 00000000..67e7c00f --- /dev/null +++ b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/condition/filesmatch-test.xml @@ -0,0 +1,57 @@ +<?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="setUp"> + <mkdir dir="${input}"/> + </target> + + <target name="testMatchWithSmallerFile2" + description="https://issues.apache.org/bugzilla/show_bug.cgi?id=48715" + depends="setUp"> + <property name="file1" location="${input}/LS.properties"/> + <property name="file2" location="${input}/LS.properties.old"/> + <echo file="${file1}"><![CDATA[foo=foo +bar=bar + +]]></echo> + <echo file="${file2}"><![CDATA[foo=foo +]]></echo> + <au:assertFalse> + <filesmatch file1="${file1}" file2="${file2}" textfile="true"/> + </au:assertFalse> + </target> + + <target name="testBinaryMatchWithSmallerFile2" + description="https://issues.apache.org/bugzilla/show_bug.cgi?id=48715" + depends="setUp"> + <property name="file1" location="${input}/LS.properties"/> + <property name="file2" location="${input}/LS.properties.old"/> + <echo file="${file1}"><![CDATA[foo=foo +bar=bar + +]]></echo> + <echo file="${file2}"><![CDATA[foo=foo +]]></echo> + <au:assertFalse> + <filesmatch file1="${file1}" file2="${file2}" textfile="false"/> + </au:assertFalse> + </target> + +</project> diff --git a/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/condition/hasfreespace-test.xml b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/condition/hasfreespace-test.xml new file mode 100644 index 00000000..01f18098 --- /dev/null +++ b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/condition/hasfreespace-test.xml @@ -0,0 +1,57 @@ +<?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 name="hasfreespace-test" default="all" basedir="." xmlns:au="antlib:org.apache.ant.antunit"> + + <available property="jdk6.available" classname="java.util.ServiceLoader" /> + + <property name="partition" value="${user.home}" /> + + + <target name="test-not-enough-space-human" if="jdk6.available"> + <au:assertFalse> + <hasfreespace partition="${partition}" needed="1P" /> + </au:assertFalse> + </target> + + <target name="test-enough-space-human" if="jdk6.available"> + <au:assertTrue> + <hasfreespace partition="${partition}" needed="1K" /> + </au:assertTrue> + </target> + + <target name="test-not-enough-space" if="jdk6.available"> + <property name="long.max-value" value="9223372036854775807" /> + <au:assertFalse> + <hasfreespace partition="${partition}" needed="${long.max-value}" /> + </au:assertFalse> + </target> + + <target name="test-enough-space" if="jdk6.available"> + <au:assertTrue> + <hasfreespace partition="${partition}" needed="1" /> + </au:assertTrue> + </target> + + <target name="all"> + <au:antunit> + <fileset file="${ant.file}" /> + <au:plainlistener /> + </au:antunit> + </target> + +</project>
\ No newline at end of file diff --git a/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/condition/hasmethod-text.xml b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/condition/hasmethod-text.xml new file mode 100644 index 00000000..9ae9b323 --- /dev/null +++ b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/condition/hasmethod-text.xml @@ -0,0 +1,63 @@ +<?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 name="equals-test" xmlns:au="antlib:org.apache.ant.antunit" + default="antunit"> + + <import file="../../antunit-base.xml" /> + + <target name="test-missingclass"> + <au:expectfailure + expectedMessage='class "org.example.somepackage.Foo" was not found'> + <condition property="foo"> + <hasmethod classname="org.example.somepackage.Foo" + method="bar"/> + </condition> + </au:expectfailure> + </target> + + <target name="test-missingclass-no-sysclasspath"> + <au:expectfailure + expectedMessage='class "org.example.somepackage.Foo" was not found'> + <condition property="foo"> + <hasmethod classname="org.example.somepackage.Foo" + ignoreSystemClasses="true" + method="bar"/> + </condition> + </au:expectfailure> + </target> + + <target name="test-restricted-class"> + <au:assertFalse> + <hasmethod classname="java.lang.String" + method="bar"/> + </au:assertFalse> + </target> + + <target name="test-restricted-class-no-sysclasspath"> + <au:expectfailure + expectedMessage='class "java.lang.String" was found but a SecurityException has been raised while loading it'> + <condition property="foo"> + <hasmethod classname="java.lang.String" + classpath="${java.home}/lib/rt.jar" + ignoreSystemClasses="true" + method="bar"/> + </condition> + </au:expectfailure> + </target> + +</project> diff --git a/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/condition/islastmodified-test.xml b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/condition/islastmodified-test.xml new file mode 100644 index 00000000..429e3f81 --- /dev/null +++ b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/condition/islastmodified-test.xml @@ -0,0 +1,118 @@ +<?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 xmlns:au="antlib:org.apache.ant.antunit" default="antunit" + xmlns:cond="antlib:org.apache.tools.ant.types.conditions"> + + <import file="../../antunit-base.xml"/> + + <target name="setUp"> + <mkdir dir="${output}"/> + <property name="file" location="${output}/test.txt"/> + <touch file="${file}" dateTime="08/18/2009 04:41:20 AM"/> + </target> + + <target name="testEquals" depends="setUp"> + <au:assertFalse> + <cond:islastmodified dateTime="08/18/2009 04:41:19 AM"> + <file file="${file}"/> + </cond:islastmodified> + </au:assertFalse> + <au:assertTrue> + <cond:islastmodified dateTime="08/18/2009 04:41:20 AM"> + <file file="${file}"/> + </cond:islastmodified> + </au:assertTrue> + <au:assertFalse> + <cond:islastmodified dateTime="08/18/2009 04:41:21 AM"> + <file file="${file}"/> + </cond:islastmodified> + </au:assertFalse> + </target> + + <target name="testBefore" depends="setUp"> + <au:assertFalse> + <cond:islastmodified dateTime="08/18/2009 04:41:19 AM" mode="before"> + <file file="${file}"/> + </cond:islastmodified> + </au:assertFalse> + <au:assertFalse> + <cond:islastmodified dateTime="08/18/2009 04:41:20 AM" mode="before"> + <file file="${file}"/> + </cond:islastmodified> + </au:assertFalse> + <au:assertTrue> + <cond:islastmodified dateTime="08/18/2009 04:41:21 AM" mode="before"> + <file file="${file}"/> + </cond:islastmodified> + </au:assertTrue> + </target> + + <target name="testAfter" depends="setUp"> + <au:assertTrue> + <cond:islastmodified dateTime="08/18/2009 04:41:19 AM" mode="after"> + <file file="${file}"/> + </cond:islastmodified> + </au:assertTrue> + <au:assertFalse> + <cond:islastmodified dateTime="08/18/2009 04:41:20 AM" mode="after"> + <file file="${file}"/> + </cond:islastmodified> + </au:assertFalse> + <au:assertFalse> + <cond:islastmodified dateTime="08/18/2009 04:41:21 AM" mode="after"> + <file file="${file}"/> + </cond:islastmodified> + </au:assertFalse> + </target> + + <target name="testNotBefore" depends="setUp"> + <au:assertTrue> + <cond:islastmodified dateTime="08/18/2009 04:41:19 AM" mode="not-before"> + <file file="${file}"/> + </cond:islastmodified> + </au:assertTrue> + <au:assertTrue> + <cond:islastmodified dateTime="08/18/2009 04:41:20 AM" mode="not-before"> + <file file="${file}"/> + </cond:islastmodified> + </au:assertTrue> + <au:assertFalse> + <cond:islastmodified dateTime="08/18/2009 04:41:21 AM" mode="not-before"> + <file file="${file}"/> + </cond:islastmodified> + </au:assertFalse> + </target> + + <target name="testNotAfter" depends="setUp"> + <au:assertFalse> + <cond:islastmodified dateTime="08/18/2009 04:41:19 AM" mode="not-after"> + <file file="${file}"/> + </cond:islastmodified> + </au:assertFalse> + <au:assertTrue> + <cond:islastmodified dateTime="08/18/2009 04:41:20 AM" mode="not-after"> + <file file="${file}"/> + </cond:islastmodified> + </au:assertTrue> + <au:assertTrue> + <cond:islastmodified dateTime="08/18/2009 04:41:21 AM" mode="not-after"> + <file file="${file}"/> + </cond:islastmodified> + </au:assertTrue> + </target> +</project> diff --git a/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/condition/resourcecontains-test.xml b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/condition/resourcecontains-test.xml new file mode 100644 index 00000000..11c6a9ed --- /dev/null +++ b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/condition/resourcecontains-test.xml @@ -0,0 +1,139 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- + 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="resourcecontains-test" default="antunit" xmlns:au="antlib:org.apache.ant.antunit"> + + <import file="../../antunit-base.xml"/> + + <target name="setUp"> + <mkdir dir="${output}"/> + <property name="file" location="${output}/test-resource.txt"/> + <echo file="${file}" message="loads of text!"/> + </target> + + <target name="testcontains"> + <au:assertTrue message="Should have found the text in the resource"> + <resourcecontains resource="${file}" substring="text"/> + </au:assertTrue> + </target> + + <target name="testContainsLowerNonCS"> + <echo file="${file}" message="LOADS OF TEXT!"/> + <au:assertTrue message="Should have found the text in the resource"> + <resourcecontains resource="${file}" substring="text" + casesensitive="false"/> + </au:assertTrue> + </target> + + <target name="testContainsUpperNonCS"> + <au:assertTrue message="Should have found the text in the resource"> + <resourcecontains resource="${file}" substring="TEXT" + casesensitive="false"/> + </au:assertTrue> + </target> + + <target name="testContainsEmptyString"> + <au:assertTrue message="Should have found the text in the resource"> + <resourcecontains resource="${file}" substring="" /> + </au:assertTrue> + </target> + + <target name="testContainsEmptyProperty"> + <property name="testContainsEmptyProperty" value="" /> + <au:assertTrue message="Should have found the text in the resource"> + <resourcecontains resource="${file}" + substring="${testContainsEmptyProperty}" /> + </au:assertTrue> + </target> + + <target name="testwithemptyfile"> + <truncate file="${file}"/> + <au:assertFalse message="Should have found nothing as file is empty"> + <resourcecontains resource="${file}" substring="text"/> + </au:assertFalse> + </target> + + <target name="testWithEmptyFileAndSubstring"> + <truncate file="${file}"/> + <au:assertTrue message="Empty resource should contain empty string"> + <resourcecontains resource="${file}" substring=""/> + </au:assertTrue> + </target> + + <target name="testdoesntcontain"> + <au:assertFalse message="Should have found nothing as file is empty"> + <resourcecontains resource="${file}" substring="futurama"/> + </au:assertFalse> + </target> + + <target name="testFileRefContains"> + <file id="file" file="${file}" /> + <au:assertTrue message="Should have found the text in the resource"> + <resourcecontains refid="file" substring="text"/> + </au:assertTrue> + </target> + + <target name="testStringRefContains"> + <string id="string">loads of text!</string> + <au:assertTrue message="Should have found the text in the resource"> + <resourcecontains refid="string" substring="text"/> + </au:assertTrue> + </target> + + <target name="testTextConcatRefContains"> + <resources id="concat"> + <concat>loads of text!</concat> + </resources> + <au:assertTrue message="Should have found the text in the resource"> + <resourcecontains refid="concat" substring="text"/> + </au:assertTrue> + </target> + + <target name="testFileConcatRefContains"> + <resources id="concat"> + <concat><file file="${file}" /></concat> + </resources> + <au:assertTrue message="Should have found the text in the resource"> + <resourcecontains refid="concat" substring="text"/> + </au:assertTrue> + </target> + + <target name="testMultiConcatRefContains"> + <resources id="concat"> + <concat> + <header>HEADER</header> + <footer>FOOTER</footer> + <string>foo</string> + <file file="${file}" /> + <string>bar</string> + </concat> + </resources> + <au:assertTrue message="Should have found the text in the resource"> + <resourcecontains refid="concat" substring="text"/> + </au:assertTrue> + </target> + + <target name="testFirstRefContains"> + <first id="first"> + <fileset dir="${basedir}" includes="*-test.xml" /> + </first> + <au:assertTrue message="Should have found the text in the resource"> + <resourcecontains refid="first" substring="project"/> + </au:assertTrue> + </target> + +</project> diff --git a/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/condition/resourceexists-test.xml b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/condition/resourceexists-test.xml new file mode 100644 index 00000000..bdf40c2a --- /dev/null +++ b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/condition/resourceexists-test.xml @@ -0,0 +1,47 @@ +<?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 xmlns:au="antlib:org.apache.ant.antunit" default="antunit" + xmlns:cond="antlib:org.apache.tools.ant.types.conditions"> + + <import file="../../antunit-base.xml"/> + + <target name="test-yes"> + <au:assertTrue> + <cond:resourceexists> + <file file="resourceexists-test.xml"/> + </cond:resourceexists> + </au:assertTrue> + </target> + + <target name="test-no"> + <au:assertFalse> + <cond:resourceexists> + <file file="resourceexists-test-not-there.xml"/> + </cond:resourceexists> + </au:assertFalse> + </target> + + <target name="testURL"> + <au:assertTrue> + <cond:resourceexists> + <url url="http://ant.apache.org/index.html"/> + </cond:resourceexists> + </au:assertTrue> + </target> + +</project> diff --git a/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/copy-test.xml b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/copy-test.xml new file mode 100644 index 00000000..51c6277c --- /dev/null +++ b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/copy-test.xml @@ -0,0 +1,471 @@ +<?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="-fileResourceSetup"> + <mkdir dir="${input}"/> + <mkdir dir="${output}"/> + <touch file="${input}/file.txt"/> + </target> + + <target name="testCopyFileFlatten" depends="-fileResourceSetup"> + <au:assertFileDoesntExist file="${output}/file.txt"/> + <copy todir="${output}" flatten="true"> + <file file="${input}/file.txt"/> + </copy> + <au:assertFileExists file="${output}/file.txt"/> + </target> + + <target name="testCopyFileInResourcesFlatten" depends="-fileResourceSetup"> + <au:assertFileDoesntExist file="${output}/file.txt"/> + <copy todir="${output}" flatten="true"> + <resources> + <file file="${input}/file.txt"/> + </resources> + </copy> + <au:assertFileExists file="${output}/file.txt"/> + </target> + + <target name="-setupNullByteStreamResource"> + <mkdir dir="${input}"/> + <echo file="${input}/NullByteStreamResource.java"><![CDATA[ +import org.apache.tools.ant.types.Resource; +import java.io.*; +public class NullByteStreamResource extends Resource { + private long length = 1024; + + public boolean isExists() { + return true; + } + + public long getLastModified() { + return UNKNOWN_DATETIME; + } + + public void setLength(long length) { + this.length = length; + } + + public InputStream getInputStream() { + return new InputStream() { + int readSoFar = 0; + + public int read() { + return readSoFar++ > length ? -1 : 0; + } + }; + } +} +]]></echo> + <mkdir dir="${output}"/> + <javac srcdir="${input}" destdir="${output}"/> + <typedef name="nullstream" classname="NullByteStreamResource"> + <classpath> + <pathelement location="${output}"/> + </classpath> + </typedef> + </target> + + <target name="testResourceWithoutName" + depends="-setupNullByteStreamResource"> + <au:expectfailure> + <copy todir="${output}"> + <nullstream/> + </copy> + </au:expectfailure> + </target> + + <target name="testResourceWithoutNameWithMergeMapper" + depends="-setupNullByteStreamResource"> + <copy todir="${output}"> + <nullstream/> + <mergemapper to="foo"/> + </copy> + <au:assertFileExists file="${output}/foo"/> + </target> + + <target name="testMappedResources"> + <mkdir dir="${input}"/> + <mkdir dir="${output}"/> + <echo file="${input}/foo.txt">Hello, world!</echo> + <copy todir="${output}"> + <mappedresources> + <fileset dir="${input}"/> + <globmapper from="foo.*" to="bar.*"/> + </mappedresources> + </copy> + <au:assertFileDoesntExist file="${output}/foo.txt"/> + <au:assertFileExists file="${output}/bar.txt"/> + <au:assertFilesMatch expected="${input}/foo.txt" + actual="${output}/bar.txt"/> + </target> + + <target name="testMappedResourcesMultipleTrue"> + <mkdir dir="${input}"/> + <mkdir dir="${output}"/> + <echo file="${input}/foo.txt">Hello, world!</echo> + <copy todir="${output}"> + <mappedresources enableMultipleMappings="true"> + <fileset dir="${input}"/> + <compositemapper> + <globmapper from="foo.*" to="bar.*"/> + <globmapper from="foo.*" to="baz.*"/> + </compositemapper> + </mappedresources> + </copy> + <au:assertFileDoesntExist file="${output}/foo.txt"/> + <au:assertFileExists file="${output}/bar.txt"/> + <au:assertFileExists file="${output}/baz.txt"/> + <au:assertFilesMatch expected="${input}/foo.txt" + actual="${output}/bar.txt"/> + <au:assertFilesMatch expected="${input}/foo.txt" + actual="${output}/baz.txt"/> + </target> + + <target name="testMappedResourcesMultipleFalse"> + <mkdir dir="${input}"/> + <mkdir dir="${output}"/> + <echo file="${input}/foo.txt">Hello, world!</echo> + <copy todir="${output}"> + <mappedresources enableMultipleMappings="false"> + <fileset dir="${input}"/> + <compositemapper> + <globmapper from="foo.*" to="bar.*"/> + <globmapper from="foo.*" to="baz.*"/> + </compositemapper> + </mappedresources> + </copy> + <au:assertFileDoesntExist file="${output}/foo.txt"/> + <au:assertFileExists file="${output}/bar.txt"/> + <au:assertFileDoesntExist file="${output}/baz.txt"/> + <au:assertFilesMatch expected="${input}/foo.txt" + actual="${output}/bar.txt"/> + </target> + + <target name="testIncludeEmptyDirsDefaultsToTrue" + description="https://issues.apache.org/bugzilla/show_bug.cgi?id=47168"> + <mkdir dir="${input}/foo"/> + <mkdir dir="${output}"/> + <copy todir="${output}"> + <fileset dir="${input}"/> + </copy> + <au:assertFileExists file="${output}/foo"/> + </target> + + <target name="XtestIncludeEmptyDirsAndZipfileset" + description="https://issues.apache.org/bugzilla/show_bug.cgi?id=47168"> + <mkdir dir="${input}/foo"/> + <mkdir dir="${output}/final"/> + <zip destfile="${output}/zipfile.zip"> + <fileset dir="${input}"/> + </zip> + <copy todir="${output}/final"> + <zipfileset src="${output}/zipfile.zip"/> + </copy> + <au:assertFileExists file="${output}/final/foo"/> + </target> + + <target name="testFailOnURLConnectionError" + description="https://issues.apache.org/bugzilla/show_bug.cgi?id=47362"> + <mkdir dir="${output}"/> + <au:expectfailure> + <copy todir="${output}" failonerror="true" flatten="true"> + <resources> + <url url="http://i-do-not-exist/"/> + </resources> + </copy> + </au:expectfailure> + </target> + + <target name="testNotModifiedSelector" + description="https://issues.apache.org/bugzilla/show_bug.cgi?id=43574" + > + <mkdir dir="${input}/images"/> + <mkdir dir="${input}/cache"/> + <touch file="${input}/images/foo.jpg"/> + <mkdir dir="${output}"/> + <selector id="cache.selector"> + <not> + <modified update="true" + seldirs="false" + cache="propertyfile" + algorithm="digest" + comparator="equal"> + <param name="cache.cachefile" + value="${input}/cache/cache.properties"/> + <param name="algorithm.algorithm" value="MD5"/> + </modified> + </not> + </selector> + <au:assertFileDoesntExist file="${input}/cache/cache.properties"/> + <copy todir="${output}" overwrite="true"> + <fileset dir="${input}/images"> + <include name="*.jpg" /> + <selector refid="cache.selector" /> + </fileset> + </copy> + <au:assertFileExists file="${input}/cache/cache.properties"/> + <au:assertFileDoesntExist file="${output}/foo.jpg"/> + <copy todir="${output}" overwrite="true"> + <fileset dir="${input}/images"> + <include name="*.jpg" /> + <selector refid="cache.selector" /> + </fileset> + </copy> + <au:assertFileExists file="${output}/foo.jpg"/> + </target> + + <target name="testMissingFileUsingFileAttribute"> + <mkdir dir="${output}"/> + <mkdir dir="${input}"/> + <au:expectfailure expectedMessage="Could not find file"> + <copy file="${input}/not-there.txt" todir="${output}"/> + </au:expectfailure> + <copy file="${input}/not-there.txt" todir="${output}" + failonerror="false"/> + </target> + + <target name="testQuiet"> + <mkdir dir="${output}"/> + <mkdir dir="${input}"/> + <copy file="${input}/not-there.txt" todir="${output}" failonerror="false" quiet="true" /> + <au:assertLogDoesntContain text="Could not find file" /> + </target> + + <target name="testMissingFilesetRoot"> + <mkdir dir="${output}"/> + <au:expectfailure expectedMessage="does not exist"> + <copy todir="${output}"> + <fileset dir="${input}"> + <include name="not-there.txt"/> + </fileset> + </copy> + </au:expectfailure> + <copy todir="${output}" failonerror="false"> + <fileset dir="${input}"> + <include name="not-there.txt"/> + </fileset> + </copy> + </target> + + <target name="testMissingFileUsingFilesetInclude" + description="https://issues.apache.org/bugzilla/show_bug.cgi?id=49070"> + <mkdir dir="${output}"/> + <mkdir dir="${input}"/> + <au:expectfailure + expectedMessage="Cannot perform operation from directory to file."> + <copy tofile="${output}/foo.txt"> + <fileset dir="${input}"> + <include name="not-there.txt"/> + </fileset> + </copy> + </au:expectfailure> + <copy tofile="${output}/foo.txt" failonerror="false"> + <fileset dir="${input}"> + <include name="not-there.txt"/> + </fileset> + </copy> + </target> + + <target name="testMissingFileUsingFilesetFilename" + description="https://issues.apache.org/bugzilla/show_bug.cgi?id=49070"> + <mkdir dir="${output}"/> + <mkdir dir="${input}"/> + <au:expectfailure + expectedMessage="Cannot perform operation from directory to file."> + <copy tofile="${output}/foo.txt"> + <fileset dir="${input}"> + <filename name="not-there.txt"/> + </fileset> + </copy> + </au:expectfailure> + <copy tofile="${output}/foo.txt" failonerror="false"> + <fileset dir="${input}"> + <filename name="not-there.txt"/> + </fileset> + </copy> + </target> + + <!-- stolen from ../types/readwrite-test.xml - create a read-only file --> + <property name="file" value="testfile"/> + <condition property="unix"> + <os family="unix"/> + </condition> + <target name="createTestdir"> + <mkdir dir="${output}"/> + <mkdir dir="${input}"/> + <touch file="${output}/${file}"/> + </target> + <target name="makeFileUnwritable" + depends="createTestdir,makeFileUnwritable-Unix,makeFileUnwritable-Windows"/> + <target name="makeFileUnwritable-Unix" id="unix"> + <chmod file="${output}/${file}" perm="444"/> + </target> + <target name="makeFileUnwritable-Windows" unless="unix"> + <attrib file="${output}/${file}" readonly="true"/> + </target> + + <target name="testCopyOverReadOnlyFile" depends="makeFileUnwritable"> + <sleep seconds="2"/> + <touch file="${input}/${file}"/> + <au:expectfailure + expectedMessage="can't write to read-only destination file "> + <copy toDir="${output}"> + <fileset dir="${input}"/> + </copy> + </au:expectfailure> + </target> + + <target name="testFilteredCopyOverReadOnlyFile" depends="makeFileUnwritable"> + <sleep seconds="2"/> + <touch file="${input}/${file}"/> + <au:expectfailure + expectedMessage="can't write to read-only destination file "> + <copy toDir="${output}"> + <fileset dir="${input}"/> + <filterset> + <filter token="foo" value="bar"/> + </filterset> + </copy> + </au:expectfailure> + </target> + + <target name="testCopyOverReadOnlyFileWithOverwrite" + depends="makeFileUnwritable"> + <touch file="${input}/${file}"/> + <au:expectfailure + expectedMessage="can't write to read-only destination file "> + <copy toDir="${output}" overwrite="true"> + <fileset dir="${input}"/> + </copy> + </au:expectfailure> + </target> + + <target name="testFilteredCopyOverReadOnlyFileWithOverwrite" + depends="makeFileUnwritable"> + <touch file="${input}/${file}"/> + <au:expectfailure + expectedMessage="can't write to read-only destination file "> + <copy toDir="${output}" overwrite="true"> + <fileset dir="${input}"/> + <filterset> + <filter token="foo" value="bar"/> + </filterset> + </copy> + </au:expectfailure> + </target> + + <target name="testForcedCopyOverReadOnlyFile" depends="makeFileUnwritable"> + <sleep seconds="2"/> + <touch file="${input}/${file}"/> + <copy toDir="${output}" force="true"> + <fileset dir="${input}"/> + </copy> + </target> + + <target name="testForcedFilteredCopyOverReadOnlyFile" + depends="makeFileUnwritable"> + <sleep seconds="2"/> + <touch file="${input}/${file}"/> + <copy toDir="${output}" force="true"> + <fileset dir="${input}"/> + <filterset> + <filter token="foo" value="bar"/> + </filterset> + </copy> + </target> + + <target name="testForcedCopyOverReadOnlyFileWithOverwrite" + depends="makeFileUnwritable"> + <touch file="${input}/${file}"/> + <copy toDir="${output}" overwrite="true" force="true"> + <fileset dir="${input}"/> + </copy> + </target> + + <target name="testForcedFilteredCopyOverReadOnlyFileWithOverwrite" + depends="makeFileUnwritable"> + <touch file="${input}/${file}"/> + <copy toDir="${output}" overwrite="true" force="true"> + <fileset dir="${input}"/> + <filterset> + <filter token="foo" value="bar"/> + </filterset> + </copy> + </target> + + <target name="testCopyWithResourceAndFile" + description="https://issues.apache.org/bugzilla/show_bug.cgi?id=49756" + > + <mkdir dir="${input}"/> + <au:assertFileDoesntExist file="${input}/somefile"/> + <copy tofile="${input}/somefile"> + <first> + <union> + <restrict> + <exists/> + <fileset file="${input}/somefile"/> + </restrict> + <string value="default contents"/> + </union> + </first> + </copy> + <au:assertFileExists file="${input}/somefile"/> + <au:assertResourceContains resource="${input}/somefile" + value="default contents"/> + <delete file="${input}/somefile"/> + <touch file="${input}/somefile"/> + <copy tofile="${input}/somefile"> + <first> + <union> + <restrict> + <exists/> + <fileset file="${input}/somefile"/> + </restrict> + <string value="default contents"/> + </union> + </first> + </copy> + <au:assertFileExists file="${input}/somefile"/> + <au:assertResourceDoesntContain resource="${input}/somefile" + value="default contents"/> + </target> + + <target name="testCopyDoesntDeleteReadonlyTargetWhenCopyFails" + description="https://issues.apache.org/bugzilla/show_bug.cgi?id=53095"> + <mkdir dir="${input}"/> + <mkdir dir="${output}"/> + <touch file="${input}/somefile"/> + <touch file="${output}/somefile"/> + <exec executable="chmod" osfamily="unix"> + <arg value="-w"/> + <arg file="${output}/somefile"/> + </exec> + <exec executable="attrib" osfamily="dos"> + <arg value="+r"/> + <arg file="${output}/somefile"/> + </exec> + <au:expectfailure> + <copy todir="${output}" file="${input}/somefile" + overwrite="true"/> + </au:expectfailure> + <au:assertFileExists file="${input}/somefile"/> + <au:assertFileExists file="${output}/somefile"/> + </target> +</project> diff --git a/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/cvs/cvs.xml b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/cvs/cvs.xml new file mode 100644 index 00000000..564e5875 --- /dev/null +++ b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/cvs/cvs.xml @@ -0,0 +1,169 @@ +<?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. +--> + +<!-- this file is not executed by the automated tests since it + requires a working CVS client. --> + +<project default="antunit" xmlns:au="antlib:org.apache.ant.antunit"> + <import file="../../antunit-base.xml" /> + + <property name="cvsrootloc" location="repository"/> + <property name="cvsroot" value=":local:${cvsrootloc}"/> + + <target name="testVersion"> + <cvsversion clientversionproperty="client" cvsroot="${cvsroot}"/> + <au:assertPropertySet name="client"/> + </target> + + <target name="testBug38583"> + <mkdir dir="${output}"/> + <cvs cvsroot="${cvsroot}" package="antmodule1" dest="${output}"/> + <cvschangelog dir="${output}/antmodule1" + destfile="${output}/report.xml"/> + <au:assertFileExists file="${output}/report.xml"/> + </target> + + <target name="testRemoteChangelog"> + <mkdir dir="${output}"/> + <cvschangelog cvsroot="${cvsroot}" package="antmodule3" + remote="true" + destfile="${output}/report.xml"/> + <au:assertFileExists file="${output}/report.xml"/> + <au:assertResourceContains resource="${output}/report.xml" + value="[yet another test.txt]"/> + </target> + + <target name="testRemoteChangelogNestedModule"> + <mkdir dir="${output}"/> + <cvschangelog cvsroot="${cvsroot}" + remote="true" + destfile="${output}/report.xml"> + <module name="antmodule3"/> + </cvschangelog> + <au:assertFileExists file="${output}/report.xml"/> + <au:assertResourceContains resource="${output}/report.xml" + value="[yet another test.txt]"/> + </target> + + <target name="xtestRemoteChangelogStartTag"> + <mkdir dir="${output}"/> + <cvschangelog cvsroot="${cvsroot}" + remote="true" startTag="testtag1" + destfile="${output}/report.xml"> + <module name="antmodule3"/> + </cvschangelog> + <au:assertFileExists file="${output}/report.xml"/> + <au:assertResourceContains resource="${output}/report.xml" + value="[yet another test.txt]"/> + </target> + + <target name="testRemoteChangelogEndTag"> + <mkdir dir="${output}"/> + <cvschangelog cvsroot="${cvsroot}" + remote="true" endTag="testtag2" + destfile="${output}/report.xml"> + <module name="antmodule3"/> + </cvschangelog> + <au:assertFileExists file="${output}/report.xml"/> + <au:assertResourceContains resource="${output}/report.xml" + value="[yet another test.txt]"/> + </target> + + <target name="testRemoteChangelogWithTags"> + <mkdir dir="${output}"/> + <cvschangelog cvsroot="${cvsroot}" + remote="true" endTag="testtag2" startTag="testtag1" + destfile="${output}/report.xml"> + <module name="antmodule3"/> + </cvschangelog> + <au:assertFileExists file="${output}/report.xml"/> + <au:assertResourceContains resource="${output}/report.xml" + value="[yet another test.txt]"/> + </target> + + <target name="xtestLocalChangelogStartTag"> + <mkdir dir="${output}"/> + <cvs cvsroot="${cvsroot}" package="antmodule3" dest="${output}"/> + <cvschangelog dir="${output}/antmodule3" + remote="false" startTag="testtag1" + destfile="${output}/report.xml"/> + <au:assertFileExists file="${output}/report.xml"/> + <au:assertResourceContains resource="${output}/report.xml" + value="[yet another test.txt]"/> + </target> + + <target name="testLocalChangelogEndTag"> + <mkdir dir="${output}"/> + <cvs cvsroot="${cvsroot}" package="antmodule3" dest="${output}"/> + <cvschangelog dir="${output}/antmodule3" + remote="false" endTag="testtag2" + destfile="${output}/report.xml"/> + <au:assertFileExists file="${output}/report.xml"/> + <au:assertResourceContains resource="${output}/report.xml" + value="[yet another test.txt]"/> + </target> + + <target name="testLocalChangelogWithTags"> + <mkdir dir="${output}"/> + <cvs cvsroot="${cvsroot}" package="antmodule3" dest="${output}"/> + <cvschangelog dir="${output}/antmodule3" + remote="false" endTag="testtag2" startTag="testtag1" + destfile="${output}/report.xml"/> + <au:assertFileExists file="${output}/report.xml"/> + <au:assertResourceContains resource="${output}/report.xml" + value="[yet another test.txt]"/> + </target> + + <target name="testCvsWithSpaceInModule"> + <mkdir dir="${output}"/> + <cvs cvsroot="${cvsroot}" dest="${output}"> + <module name="ant module 2"/> + </cvs> + <au:assertFileExists file="${output}/ant module 2/test.txt"/> + <cvschangelog dir="${output}/ant module 2" + destfile="${output}/report.xml"/> + <au:assertFileExists file="${output}/report.xml"/> + </target> + + <target name="testCvsTagDiffWithSpaceInModule"> + <mkdir dir="${output}"/> + <cvstagdiff cvsroot="${cvsroot}" + startDate="2008-01-01" + endDate="2009-01-01" + destfile="${output}/tagdiff.xml"> + <module name="ant module 2"/> + </cvstagdiff> + <au:assertFileExists file="${output}/tagdiff.xml"/> + <au:assertResourceContains resource="${output}/tagdiff.xml" + value="[test.txt]"/> + </target> + + <target name="testCvsTagDiffWithMultipleModules"> + <mkdir dir="${output}"/> + <cvstagdiff cvsroot="${cvsroot}" + startDate="2008-01-01" + endDate="2009-01-01" + destfile="${output}/tagdiff.xml" + package="antmodule1 antmodule3"/> + <au:assertFileExists file="${output}/tagdiff.xml"/> + <au:assertResourceContains resource="${output}/tagdiff.xml" + value="[foo.txt]"/> + <au:assertResourceContains resource="${output}/tagdiff.xml" + value="[yet another test.txt]"/> + </target> +</project> diff --git a/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/cvs/repository/CVSROOT/checkoutlist b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/cvs/repository/CVSROOT/checkoutlist new file mode 100644 index 00000000..2921bffc --- /dev/null +++ b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/cvs/repository/CVSROOT/checkoutlist @@ -0,0 +1,13 @@ +# The "checkoutlist" file is used to support additional version controlled +# administrative files in $CVSROOT/CVSROOT, such as template files. +# +# The first entry on a line is a filename which will be checked out from +# the corresponding RCS file in the $CVSROOT/CVSROOT directory. +# The remainder of the line is an error message to use if the file cannot +# be checked out. +# +# File format: +# +# [<whitespace>]<filename>[<whitespace><error message>]<end-of-line> +# +# comment lines begin with '#' diff --git a/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/cvs/repository/CVSROOT/checkoutlist,v b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/cvs/repository/CVSROOT/checkoutlist,v new file mode 100644 index 00000000..4f0410b6 --- /dev/null +++ b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/cvs/repository/CVSROOT/checkoutlist,v @@ -0,0 +1,37 @@ +head 1.1; +access ; +symbols ; +locks ; strict; +comment @# @; + + +1.1 +date 2008.10.16.12.52.41; author stefan; state Exp; +branches; +next ; +commitid f9748f739194567; + +desc +@@ + + + +1.1 +log +@initial checkin@ +text +@# The "checkoutlist" file is used to support additional version controlled +# administrative files in $CVSROOT/CVSROOT, such as template files. +# +# The first entry on a line is a filename which will be checked out from +# the corresponding RCS file in the $CVSROOT/CVSROOT directory. +# The remainder of the line is an error message to use if the file cannot +# be checked out. +# +# File format: +# +# [<whitespace>]<filename>[<whitespace><error message>]<end-of-line> +# +# comment lines begin with '#' +@ + diff --git a/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/cvs/repository/CVSROOT/commitinfo b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/cvs/repository/CVSROOT/commitinfo new file mode 100644 index 00000000..3903ceec --- /dev/null +++ b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/cvs/repository/CVSROOT/commitinfo @@ -0,0 +1,26 @@ +# The "commitinfo" file is used to control pre-commit checks. +# The filter on the right is invoked with the repository and a list +# of files to check. A non-zero exit of the filter program will +# cause the commit to be aborted. +# +# The first entry on a line is a regular expression which is tested +# against the directory that the change is being committed to, relative +# to the $CVSROOT. For the first match that is found, then the remainder +# of the line is the name of the filter to run. +# +# Format strings present in the filter will be replaced as follows: +# %c = canonical name of the command being executed +# %R = the name of the referrer, if any, otherwise the value NONE +# %p = path relative to repository +# %r = repository (path portion of $CVSROOT) +# %{s} = file name, file name, ... +# +# If no format strings are present in the filter string, a default of +# " %r %s" will be appended to the filter string, but this usage is +# deprecated. +# +# If the repository name does not match any of the regular expressions in this +# file, the "DEFAULT" line is used, if it is specified. +# +# If the name "ALL" appears as a regular expression it is always used +# in addition to the first matching regex or "DEFAULT". diff --git a/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/cvs/repository/CVSROOT/commitinfo,v b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/cvs/repository/CVSROOT/commitinfo,v new file mode 100644 index 00000000..7cc0771c --- /dev/null +++ b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/cvs/repository/CVSROOT/commitinfo,v @@ -0,0 +1,50 @@ +head 1.1; +access ; +symbols ; +locks ; strict; +comment @# @; + + +1.1 +date 2008.10.16.12.52.41; author stefan; state Exp; +branches; +next ; +commitid f9748f739194567; + +desc +@@ + + + +1.1 +log +@initial checkin@ +text +@# The "commitinfo" file is used to control pre-commit checks. +# The filter on the right is invoked with the repository and a list +# of files to check. A non-zero exit of the filter program will +# cause the commit to be aborted. +# +# The first entry on a line is a regular expression which is tested +# against the directory that the change is being committed to, relative +# to the $CVSROOT. For the first match that is found, then the remainder +# of the line is the name of the filter to run. +# +# Format strings present in the filter will be replaced as follows: +# %c = canonical name of the command being executed +# %R = the name of the referrer, if any, otherwise the value NONE +# %p = path relative to repository +# %r = repository (path portion of $CVSROOT) +# %{s} = file name, file name, ... +# +# If no format strings are present in the filter string, a default of +# " %r %s" will be appended to the filter string, but this usage is +# deprecated. +# +# If the repository name does not match any of the regular expressions in this +# file, the "DEFAULT" line is used, if it is specified. +# +# If the name "ALL" appears as a regular expression it is always used +# in addition to the first matching regex or "DEFAULT". +@ + diff --git a/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/cvs/repository/CVSROOT/config b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/cvs/repository/CVSROOT/config new file mode 100644 index 00000000..50d85b5f --- /dev/null +++ b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/cvs/repository/CVSROOT/config @@ -0,0 +1,97 @@ +# Set `SystemAuth' to `no' if pserver shouldn't check system users/passwords. +#SystemAuth=no + +# Set `LocalKeyword' to specify a local alias for a standard keyword. +#LocalKeyword=MYCVS=CVSHeader + +# Set `KeywordExpand' to `i' followed by a list of keywords to expand or +# `e' followed by a list of keywords to not expand. +#KeywordExpand=iMYCVS,Name,Date +#KeywordExpand=eCVSHeader + +# Set `TopLevelAdmin' to `yes' to create a CVS directory at the top +# level of the new working directory when using the `cvs checkout' +# command. +#TopLevelAdmin=no + +# Put CVS lock files in this directory rather than directly in the repository. +#LockDir=/var/lock/cvs + +# Set `LogHistory' to `all' or `TOEFWUPCGMAR' to log all transactions to the +# history file, or a subset as needed (ie `TMAR' logs all write operations) +#LogHistory=TOEFWUPCGMAR + +# Set `RereadLogAfterVerify' to `always' (the default) to allow the verifymsg +# script to change the log message. Set it to `stat' to force CVS to verify +# that the file has changed before reading it (this can take up to an extra +# second per directory being committed, so it is not recommended for large +# repositories. Set it to `never' (the previous CVS behavior) to prevent +# verifymsg scripts from changing the log message. +#RereadLogAfterVerify=always + +# Set `UserAdminOptions' to the list of `cvs admin' commands (options) +# that users not in the `cvsadmin' group are allowed to run. This +# defaults to `k', or only allowing the changing of the default +# keyword expansion mode for files for users not in the `cvsadmin' group. +# This value is ignored if the `cvsadmin' group does not exist. +# +# The following string would enable all `cvs admin' commands for all +# users: +#UserAdminOptions=aAbceIklLmnNostuU + +# Set `UseNewInfoFmtStrings' to `no' if you must support a legacy system by +# enabling the deprecated old style info file command line format strings. +# Be warned that these strings could be disabled in any new version of CVS. +UseNewInfoFmtStrings=yes + +# Set `ImportNewFilesToVendorBranchOnly' to `yes' if you wish to force +# every `cvs import' command to behave as if the `-X' flag was +# specified. +#ImportNewFilesToVendorBranchOnly=no + +# Set `PrimaryServer' to the CVSROOT to the primary, or write, server when +# establishing one or more read-only mirrors which serve as proxies for +# the write server in write mode or redirect the client to the primary for +# write requests. +# +# For example: +# +# PrimaryServer=:fork:localhost/cvsroot + +# Set `MaxProxyBufferSize' to the the maximum allowable secondary +# buffer memory cache size before the buffer begins being stored to disk, in +# bytes. Must be a positive integer but may end in `k', `M', `G', or `T' (for +# kiilo, mega, giga, & tera, respectively). If an otherwise valid number you +# specify is greater than the SIZE_MAX defined by your system's C compiler, +# then it will be resolved to SIZE_MAX without a warning. Defaults to 8M (8 +# megabytes). +# +# High values for MaxProxyBufferSize may speed up a secondary server +# with old hardware and a lot of available memory but can actually slow a +# modern system down slightly. +# +# For example: +# +# MaxProxyBufferSize=1G + +# Set `MaxCommentLeaderLength' to the maximum length permitted for the +# automagically determined comment leader used when expanding the Log +# keyword, in bytes. CVS's behavior when the automagically determined +# comment leader exceeds this length is dependant on the value of +# `UseArchiveCommentLeader' set in this file. `unlimited' is a valid +# setting for this value. Defaults to 20 bytes. +# +# For example: +# +# MaxCommentLeaderLength=20 + +# Set `UseArchiveCommentLeader' to `yes' to cause CVS to fall back on +# the comment leader set in the RCS archive file, if any, when the +# automagically determined comment leader exceeds `MaxCommentLeaderLength' +# bytes. If `UseArchiveCommentLeader' is not set and a comment leader +# greater than `MaxCommentLeaderLength' is calculated, the Log keyword +# being examined will not be expanded. Defaults to `no'. +# +# For example: +# +# UseArchiveCommentLeader=no diff --git a/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/cvs/repository/CVSROOT/config,v b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/cvs/repository/CVSROOT/config,v new file mode 100644 index 00000000..d220b452 --- /dev/null +++ b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/cvs/repository/CVSROOT/config,v @@ -0,0 +1,121 @@ +head 1.1; +access ; +symbols ; +locks ; strict; +comment @# @; + + +1.1 +date 2008.10.16.12.52.41; author stefan; state Exp; +branches; +next ; +commitid f9748f739194567; + +desc +@@ + + + +1.1 +log +@initial checkin@ +text +@# Set `SystemAuth' to `no' if pserver shouldn't check system users/passwords. +#SystemAuth=no + +# Set `LocalKeyword' to specify a local alias for a standard keyword. +#LocalKeyword=MYCVS=CVSHeader + +# Set `KeywordExpand' to `i' followed by a list of keywords to expand or +# `e' followed by a list of keywords to not expand. +#KeywordExpand=iMYCVS,Name,Date +#KeywordExpand=eCVSHeader + +# Set `TopLevelAdmin' to `yes' to create a CVS directory at the top +# level of the new working directory when using the `cvs checkout' +# command. +#TopLevelAdmin=no + +# Put CVS lock files in this directory rather than directly in the repository. +#LockDir=/var/lock/cvs + +# Set `LogHistory' to `all' or `TOEFWUPCGMAR' to log all transactions to the +# history file, or a subset as needed (ie `TMAR' logs all write operations) +#LogHistory=TOEFWUPCGMAR + +# Set `RereadLogAfterVerify' to `always' (the default) to allow the verifymsg +# script to change the log message. Set it to `stat' to force CVS to verify +# that the file has changed before reading it (this can take up to an extra +# second per directory being committed, so it is not recommended for large +# repositories. Set it to `never' (the previous CVS behavior) to prevent +# verifymsg scripts from changing the log message. +#RereadLogAfterVerify=always + +# Set `UserAdminOptions' to the list of `cvs admin' commands (options) +# that users not in the `cvsadmin' group are allowed to run. This +# defaults to `k', or only allowing the changing of the default +# keyword expansion mode for files for users not in the `cvsadmin' group. +# This value is ignored if the `cvsadmin' group does not exist. +# +# The following string would enable all `cvs admin' commands for all +# users: +#UserAdminOptions=aAbceIklLmnNostuU + +# Set `UseNewInfoFmtStrings' to `no' if you must support a legacy system by +# enabling the deprecated old style info file command line format strings. +# Be warned that these strings could be disabled in any new version of CVS. +UseNewInfoFmtStrings=yes + +# Set `ImportNewFilesToVendorBranchOnly' to `yes' if you wish to force +# every `cvs import' command to behave as if the `-X' flag was +# specified. +#ImportNewFilesToVendorBranchOnly=no + +# Set `PrimaryServer' to the CVSROOT to the primary, or write, server when +# establishing one or more read-only mirrors which serve as proxies for +# the write server in write mode or redirect the client to the primary for +# write requests. +# +# For example: +# +# PrimaryServer=:fork:localhost/cvsroot + +# Set `MaxProxyBufferSize' to the the maximum allowable secondary +# buffer memory cache size before the buffer begins being stored to disk, in +# bytes. Must be a positive integer but may end in `k', `M', `G', or `T' (for +# kiilo, mega, giga, & tera, respectively). If an otherwise valid number you +# specify is greater than the SIZE_MAX defined by your system's C compiler, +# then it will be resolved to SIZE_MAX without a warning. Defaults to 8M (8 +# megabytes). +# +# High values for MaxProxyBufferSize may speed up a secondary server +# with old hardware and a lot of available memory but can actually slow a +# modern system down slightly. +# +# For example: +# +# MaxProxyBufferSize=1G + +# Set `MaxCommentLeaderLength' to the maximum length permitted for the +# automagically determined comment leader used when expanding the Log +# keyword, in bytes. CVS's behavior when the automagically determined +# comment leader exceeds this length is dependant on the value of +# `UseArchiveCommentLeader' set in this file. `unlimited' is a valid +# setting for this value. Defaults to 20 bytes. +# +# For example: +# +# MaxCommentLeaderLength=20 + +# Set `UseArchiveCommentLeader' to `yes' to cause CVS to fall back on +# the comment leader set in the RCS archive file, if any, when the +# automagically determined comment leader exceeds `MaxCommentLeaderLength' +# bytes. If `UseArchiveCommentLeader' is not set and a comment leader +# greater than `MaxCommentLeaderLength' is calculated, the Log keyword +# being examined will not be expanded. Defaults to `no'. +# +# For example: +# +# UseArchiveCommentLeader=no +@ + diff --git a/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/cvs/repository/CVSROOT/cvswrappers b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/cvs/repository/CVSROOT/cvswrappers new file mode 100644 index 00000000..e989b754 --- /dev/null +++ b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/cvs/repository/CVSROOT/cvswrappers @@ -0,0 +1,19 @@ +# This file affects handling of files based on their names. +# +# The -m option specifies whether CVS attempts to merge files. +# +# The -k option specifies keyword expansion (e.g. -kb for binary). +# +# Format of wrapper file ($CVSROOT/CVSROOT/cvswrappers or .cvswrappers) +# +# wildcard [option value][option value]... +# +# where option is one of +# -f from cvs filter value: path to filter +# -t to cvs filter value: path to filter +# -m update methodology value: MERGE or COPY +# -k expansion mode value: b, o, kkv, &c +# +# and value is a single-quote delimited value. +# For example: +#*.gif -k 'b' diff --git a/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/cvs/repository/CVSROOT/cvswrappers,v b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/cvs/repository/CVSROOT/cvswrappers,v new file mode 100644 index 00000000..00bd795c --- /dev/null +++ b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/cvs/repository/CVSROOT/cvswrappers,v @@ -0,0 +1,43 @@ +head 1.1; +access ; +symbols ; +locks ; strict; +comment @# @; + + +1.1 +date 2008.10.16.12.52.41; author stefan; state Exp; +branches; +next ; +commitid f9748f739194567; + +desc +@@ + + + +1.1 +log +@initial checkin@ +text +@# This file affects handling of files based on their names. +# +# The -m option specifies whether CVS attempts to merge files. +# +# The -k option specifies keyword expansion (e.g. -kb for binary). +# +# Format of wrapper file ($CVSROOT/CVSROOT/cvswrappers or .cvswrappers) +# +# wildcard [option value][option value]... +# +# where option is one of +# -f from cvs filter value: path to filter +# -t to cvs filter value: path to filter +# -m update methodology value: MERGE or COPY +# -k expansion mode value: b, o, kkv, &c +# +# and value is a single-quote delimited value. +# For example: +#*.gif -k 'b' +@ + diff --git a/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/cvs/repository/CVSROOT/history b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/cvs/repository/CVSROOT/history new file mode 100644 index 00000000..f0ec96fa --- /dev/null +++ b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/cvs/repository/CVSROOT/history @@ -0,0 +1,65 @@ +O48f739fd|stefan|~/ASF/ant/ant-HEAD/src/tests/antunit/taskdefs/cvs/*0|antmodule1||antmodule1 +O48f747b5|stefan|~/ASF/ant/ant-HEAD/src/tests/antunit/taskdefs/cvs/*0|antmodule1||antmodule1 +M48f747fb|stefan|~/ASF/ant/ant-HEAD/src/tests/antunit/taskdefs/cvs/*0|antmodule1|1.2|foo.txt +M48f7480b|stefan|~/ASF/ant/ant-HEAD/src/tests/antunit/taskdefs/cvs/*0|antmodule1|1.3|foo.txt +O48f748cb|stefan|/tmp/testoutput/*0|antmodule1||antmodule1 +O48f74940|stefan|/tmp/testoutput/*0|antmodule1||antmodule1 +O48f749a9|stefan|/tmp/testoutput/*0|antmodule1||antmodule1 +O48f74a02|stefan|/tmp/testoutput/*0|antmodule1||antmodule1 +M48f74a39|stefan|/tmp/testoutput/*0|antmodule1|1.4|foo.txt +O48f74a62|stefan|/tmp/testoutput/*0|antmodule1||antmodule1 +O48f75161|stefan|/tmp/testoutput/*0|ant module 2||ant module 2 +O48f75185|stefan|/tmp/testoutput/*0|ant module 2||ant module 2 +O48f75186|stefan|/tmp/testoutput/*0|antmodule1||antmodule1 +O48f75196|stefan|/tmp/testoutput/*0|ant module 2||ant module 2 +O48f75279|stefan|/tmp/testoutput/*0|ant module 2||ant module 2 +O48f75282|stefan|/tmp/testoutput/*0|ant module 2||ant module 2 +O48f75d32|stefan|/tmp/testoutput/*0|ant module 2||ant module 2 +O48f75d34|stefan|/tmp/testoutput/*0|antmodule1||antmodule1 +O48f80394|stefan|/tmp/testoutput/*0|ant module 2||ant module 2 +O48f80395|stefan|/tmp/testoutput/*0|antmodule1||antmodule1 +O48f80ad6|stefan|/tmp/testoutput/*0|ant module 2||ant module 2 +O48f80ad7|stefan|/tmp/testoutput/*0|antmodule1||antmodule1 +O48f8a1d1|stefan|/tmp/testoutput/*0|ant module 2||ant module 2 +O48f8a1d2|stefan|/tmp/testoutput/*0|antmodule1||antmodule1 +O48f8a6a4|stefan|/tmp/testoutput/*0|ant module 2||ant module 2 +O48f8a6a6|stefan|/tmp/testoutput/*0|antmodule1||antmodule1 +O48f8a764|stefan|/tmp/testoutput/*0|ant module 2||ant module 2 +O48f8a766|stefan|/tmp/testoutput/*0|antmodule1||antmodule1 +O48f8abf0|stefan|/tmp/testoutput/*0|ant module 2||ant module 2 +O48f8abf2|stefan|/tmp/testoutput/*0|antmodule1||antmodule1 +O48f8ad8b|stefan|~/ASF/ant/ant-HEAD/*0|antmodule3||antmodule3 +M48f8add7|stefan|~/ASF/ant/ant-HEAD/*0|antmodule3|1.2|yet another test.txt +O48f8ae09|stefan|/tmp/testoutput/*0|ant module 2||ant module 2 +O48f8ae0a|stefan|/tmp/testoutput/*0|antmodule1||antmodule1 +O48f8b07c|stefan|/tmp/testoutput/*0|antmodule3||antmodule3 +O48f8b07d|stefan|/tmp/testoutput/*0|antmodule3||antmodule3 +O48f8b07e|stefan|/tmp/testoutput/*0|antmodule1||antmodule1 +O48f8b07f|stefan|/tmp/testoutput/*0|antmodule3||antmodule3 +O48f8b082|stefan|/tmp/testoutput/*0|ant module 2||ant module 2 +O48f8b141|stefan|/tmp/testoutput/*0|antmodule3||antmodule3 +O48f8b14c|stefan|/tmp/testoutput/*0|antmodule3||antmodule3 +O48f8b1c3|stefan|/tmp/testoutput/*0|antmodule3||antmodule3 +O48f8b1cd|stefan|/tmp/testoutput/*0|antmodule3||antmodule3 +O48f8b20c|stefan|/tmp/testoutput/*0|antmodule3||antmodule3 +O48f8b217|stefan|/tmp/testoutput/*0|antmodule3||antmodule3 +O48f8b301|stefan|/tmp/testoutput/*0|antmodule3||antmodule3 +O48f8b302|stefan|/tmp/testoutput/*0|antmodule1||antmodule1 +O48f8b303|stefan|/tmp/testoutput/*0|antmodule3||antmodule3 +O48f8b307|stefan|/tmp/testoutput/*0|ant module 2||ant module 2 +O48f8b308|stefan|/tmp/testoutput/*0|antmodule3||antmodule3 +O48f8b328|stefan|/tmp/testoutput/*0|antmodule3||antmodule3 +O48f8b329|stefan|/tmp/testoutput/*0|antmodule1||antmodule1 +O48f8b32b|stefan|/tmp/testoutput/*0|ant module 2||ant module 2 +O48f8b32c|stefan|/tmp/testoutput/*0|antmodule3||antmodule3 +O48fc5e01|stefan|/tmp/testoutput/*0|antmodule3||antmodule3 +O48fc5e03|stefan|/tmp/testoutput/*0|antmodule1||antmodule1 +O48fc5e05|stefan|/tmp/testoutput/*0|ant module 2||ant module 2 +O48fc5e06|stefan|/tmp/testoutput/*0|antmodule3||antmodule3 +O4936994c|stefan|/tmp/testoutput/*0|antmodule1||antmodule1 +M493699c6|stefan|/tmp/testoutput/*0|antmodule1|1.5|foo.txt +O49369a09|stefan|/tmp/testoutput/*0|antmodule1||antmodule1 +O49369b73|stefan|/tmp/testoutput/*0|antmodule3||antmodule3 +O49369b74|stefan|/tmp/testoutput/*0|antmodule1||antmodule1 +O49369b76|stefan|/tmp/testoutput/*0|ant module 2||ant module 2 +O49369b77|stefan|/tmp/testoutput/*0|antmodule3||antmodule3 diff --git a/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/cvs/repository/CVSROOT/loginfo b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/cvs/repository/CVSROOT/loginfo new file mode 100644 index 00000000..6a1580d8 --- /dev/null +++ b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/cvs/repository/CVSROOT/loginfo @@ -0,0 +1,36 @@ +# The "loginfo" file controls where "cvs commit" log information is +# sent. The first entry on a line is a regular expression which must +# match the directory that the change is being made to, relative to the +# $CVSROOT. If a match is found, then the remainder of the line is a +# filter program that should expect log information on its standard input. +# +# If the repository name does not match any of the regular expressions in this +# file, the "DEFAULT" line is used, if it is specified. +# +# If the name ALL appears as a regular expression it is always used +# in addition to the first matching regex or DEFAULT. +# +# If any format strings are present in the filter, they will be replaced +# as follows: +# %c = canonical name of the command being executed +# %R = the name of the referrer, if any, otherwise the value NONE +# %p = path relative to repository +# %r = repository (path portion of $CVSROOT) +# %{sVv} = attribute list = file name, old version number (pre-checkin), +# new version number (post-checkin). When either old or new revision +# is unknown, doesn't exist, or isn't applicable, the string "NONE" +# will be placed on the command line instead. +# +# Note that %{sVv} is a list operator and not all elements are necessary. +# Thus %{sv} is a legal format string, but will only be replaced with +# file name and new revision. +# It also generates multiple arguments for each file being operated upon. +# That is, if two files, file1 & file2, are being commited from 1.1 to +# version 1.1.2.1 and from 1.1.2.2 to 1.1.2.3, respectively, %{sVv} will +# generate the following six arguments in this order: +# file1, 1.1, 1.1.2.1, file2, 1.1.2.2, 1.1.2.3. +# +# For example: +#DEFAULT (echo ""; id; echo %s; date; cat) >> $CVSROOT/CVSROOT/commitlog +# or +#DEFAULT (echo ""; id; echo %{sVv}; date; cat) >> $CVSROOT/CVSROOT/commitlog diff --git a/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/cvs/repository/CVSROOT/loginfo,v b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/cvs/repository/CVSROOT/loginfo,v new file mode 100644 index 00000000..5a6b8255 --- /dev/null +++ b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/cvs/repository/CVSROOT/loginfo,v @@ -0,0 +1,60 @@ +head 1.1; +access ; +symbols ; +locks ; strict; +comment @# @; + + +1.1 +date 2008.10.16.12.52.41; author stefan; state Exp; +branches; +next ; +commitid f9748f739194567; + +desc +@@ + + + +1.1 +log +@initial checkin@ +text +@# The "loginfo" file controls where "cvs commit" log information is +# sent. The first entry on a line is a regular expression which must +# match the directory that the change is being made to, relative to the +# $CVSROOT. If a match is found, then the remainder of the line is a +# filter program that should expect log information on its standard input. +# +# If the repository name does not match any of the regular expressions in this +# file, the "DEFAULT" line is used, if it is specified. +# +# If the name ALL appears as a regular expression it is always used +# in addition to the first matching regex or DEFAULT. +# +# If any format strings are present in the filter, they will be replaced +# as follows: +# %c = canonical name of the command being executed +# %R = the name of the referrer, if any, otherwise the value NONE +# %p = path relative to repository +# %r = repository (path portion of $CVSROOT) +# %{sVv} = attribute list = file name, old version number (pre-checkin), +# new version number (post-checkin). When either old or new revision +# is unknown, doesn't exist, or isn't applicable, the string "NONE" +# will be placed on the command line instead. +# +# Note that %{sVv} is a list operator and not all elements are necessary. +# Thus %{sv} is a legal format string, but will only be replaced with +# file name and new revision. +# It also generates multiple arguments for each file being operated upon. +# That is, if two files, file1 & file2, are being commited from 1.1 to +# version 1.1.2.1 and from 1.1.2.2 to 1.1.2.3, respectively, %{sVv} will +# generate the following six arguments in this order: +# file1, 1.1, 1.1.2.1, file2, 1.1.2.2, 1.1.2.3. +# +# For example: +#DEFAULT (echo ""; id; echo %s; date; cat) >> $CVSROOT/CVSROOT/commitlog +# or +#DEFAULT (echo ""; id; echo %{sVv}; date; cat) >> $CVSROOT/CVSROOT/commitlog +@ + diff --git a/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/cvs/repository/CVSROOT/modules b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/cvs/repository/CVSROOT/modules new file mode 100644 index 00000000..cb9e9efc --- /dev/null +++ b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/cvs/repository/CVSROOT/modules @@ -0,0 +1,26 @@ +# Three different line formats are valid: +# key -a aliases... +# key [options] directory +# key [options] directory files... +# +# Where "options" are composed of: +# -i prog Run "prog" on "cvs commit" from top-level of module. +# -o prog Run "prog" on "cvs checkout" of module. +# -e prog Run "prog" on "cvs export" of module. +# -t prog Run "prog" on "cvs rtag" of module. +# -u prog Run "prog" on "cvs update" of module. +# -d dir Place module in directory "dir" instead of module name. +# -l Top-level directory only -- do not recurse. +# +# NOTE: If you change any of the "Run" options above, you'll have to +# release and re-checkout any working directories of these modules. +# +# And "directory" is a path to a directory relative to $CVSROOT. +# +# The "-a" option specifies an alias. An alias is interpreted as if +# everything on the right of the "-a" had been typed on the command line. +# +# You can encode a module within a module by using the special '&' +# character to interpose another module into the current module. This +# can be useful for creating a module that consists of many directories +# spread out over the entire source repository. diff --git a/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/cvs/repository/CVSROOT/modules,v b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/cvs/repository/CVSROOT/modules,v new file mode 100644 index 00000000..ca44716c --- /dev/null +++ b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/cvs/repository/CVSROOT/modules,v @@ -0,0 +1,50 @@ +head 1.1; +access ; +symbols ; +locks ; strict; +comment @# @; + + +1.1 +date 2008.10.16.12.52.41; author stefan; state Exp; +branches; +next ; +commitid f9748f739194567; + +desc +@@ + + + +1.1 +log +@initial checkin@ +text +@# Three different line formats are valid: +# key -a aliases... +# key [options] directory +# key [options] directory files... +# +# Where "options" are composed of: +# -i prog Run "prog" on "cvs commit" from top-level of module. +# -o prog Run "prog" on "cvs checkout" of module. +# -e prog Run "prog" on "cvs export" of module. +# -t prog Run "prog" on "cvs rtag" of module. +# -u prog Run "prog" on "cvs update" of module. +# -d dir Place module in directory "dir" instead of module name. +# -l Top-level directory only -- do not recurse. +# +# NOTE: If you change any of the "Run" options above, you'll have to +# release and re-checkout any working directories of these modules. +# +# And "directory" is a path to a directory relative to $CVSROOT. +# +# The "-a" option specifies an alias. An alias is interpreted as if +# everything on the right of the "-a" had been typed on the command line. +# +# You can encode a module within a module by using the special '&' +# character to interpose another module into the current module. This +# can be useful for creating a module that consists of many directories +# spread out over the entire source repository. +@ + diff --git a/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/cvs/repository/CVSROOT/notify b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/cvs/repository/CVSROOT/notify new file mode 100644 index 00000000..aaf98c59 --- /dev/null +++ b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/cvs/repository/CVSROOT/notify @@ -0,0 +1,19 @@ +# The "notify" file controls where notifications from watches set by +# "cvs watch add" or "cvs edit" are sent. The first entry on a line is +# a regular expression which is tested against the directory that the +# change is being made to, relative to the $CVSROOT. If it matches, +# then the remainder of the line is a filter program that should contain +# one occurrence of %s for the user to notify, and information on its +# standard input. +# +# "ALL" or "DEFAULT" can be used in place of the regular expression. +# +# format strings are replaceed as follows: +# %c = canonical name of the command being executed +# %R = the name of the referrer, if any, otherwise the value NONE +# %p = path relative to repository +# %r = repository (path portion of $CVSROOT) +# %s = user to notify +# +# For example: +#ALL (echo Committed to %r/%p; cat) |mail %s -s "CVS notification" diff --git a/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/cvs/repository/CVSROOT/notify,v b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/cvs/repository/CVSROOT/notify,v new file mode 100644 index 00000000..c0a02f98 --- /dev/null +++ b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/cvs/repository/CVSROOT/notify,v @@ -0,0 +1,43 @@ +head 1.1; +access ; +symbols ; +locks ; strict; +comment @# @; + + +1.1 +date 2008.10.16.12.52.41; author stefan; state Exp; +branches; +next ; +commitid f9748f739194567; + +desc +@@ + + + +1.1 +log +@initial checkin@ +text +@# The "notify" file controls where notifications from watches set by +# "cvs watch add" or "cvs edit" are sent. The first entry on a line is +# a regular expression which is tested against the directory that the +# change is being made to, relative to the $CVSROOT. If it matches, +# then the remainder of the line is a filter program that should contain +# one occurrence of %s for the user to notify, and information on its +# standard input. +# +# "ALL" or "DEFAULT" can be used in place of the regular expression. +# +# format strings are replaceed as follows: +# %c = canonical name of the command being executed +# %R = the name of the referrer, if any, otherwise the value NONE +# %p = path relative to repository +# %r = repository (path portion of $CVSROOT) +# %s = user to notify +# +# For example: +#ALL (echo Committed to %r/%p; cat) |mail %s -s "CVS notification" +@ + diff --git a/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/cvs/repository/CVSROOT/postadmin b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/cvs/repository/CVSROOT/postadmin new file mode 100644 index 00000000..a1a08128 --- /dev/null +++ b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/cvs/repository/CVSROOT/postadmin @@ -0,0 +1,20 @@ +# The "postadmin" file is called after the "admin" command finishes +# processing a directory. +# +# If any format strings are present in the filter, they will be replaced +# as follows: +# %c = canonical name of the command being executed +# %R = the name of the referrer, if any, otherwise the value NONE +# %p = path relative to repository +# %r = repository (path portion of $CVSROOT) +# +# The first entry on a line is a regular expression which is tested +# against the directory that the change is being committed to, relative +# to the $CVSROOT. For the first match that is found, then the remainder +# of the line is the name of the filter to run. +# +# If the repository name does not match any of the regular expressions in this +# file, the "DEFAULT" line is used, if it is specified. +# +# If the name "ALL" appears as a regular expression it is always used +# in addition to the first matching regex or "DEFAULT". diff --git a/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/cvs/repository/CVSROOT/postadmin,v b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/cvs/repository/CVSROOT/postadmin,v new file mode 100644 index 00000000..db853edc --- /dev/null +++ b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/cvs/repository/CVSROOT/postadmin,v @@ -0,0 +1,44 @@ +head 1.1; +access ; +symbols ; +locks ; strict; +comment @# @; + + +1.1 +date 2008.10.16.12.52.41; author stefan; state Exp; +branches; +next ; +commitid f9748f739194567; + +desc +@@ + + + +1.1 +log +@initial checkin@ +text +@# The "postadmin" file is called after the "admin" command finishes +# processing a directory. +# +# If any format strings are present in the filter, they will be replaced +# as follows: +# %c = canonical name of the command being executed +# %R = the name of the referrer, if any, otherwise the value NONE +# %p = path relative to repository +# %r = repository (path portion of $CVSROOT) +# +# The first entry on a line is a regular expression which is tested +# against the directory that the change is being committed to, relative +# to the $CVSROOT. For the first match that is found, then the remainder +# of the line is the name of the filter to run. +# +# If the repository name does not match any of the regular expressions in this +# file, the "DEFAULT" line is used, if it is specified. +# +# If the name "ALL" appears as a regular expression it is always used +# in addition to the first matching regex or "DEFAULT". +@ + diff --git a/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/cvs/repository/CVSROOT/postproxy b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/cvs/repository/CVSROOT/postproxy new file mode 100644 index 00000000..49c6cfb0 --- /dev/null +++ b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/cvs/repository/CVSROOT/postproxy @@ -0,0 +1,22 @@ +# The "postproxy" file is called from a secondary server as soon as +# the secondary server closes its connection to the primary server. +# This script might, for example, be used to shut down a dial up +# or VPN connection to the primary server's network. +# +# If any format strings are present in the filter, they will be replaced +# as follows: +# %c = canonical name of the command being executed +# %R = the name of the referrer, if any, otherwise the value NONE +# %p = path relative to repository (currently always ".") +# %r = repository (path portion of $CVSROOT) +# +# The first entry on a line is a regular expression which is tested +# against the directory that the change is being committed to, relative +# to the $CVSROOT. For the first match that is found, then the remainder +# of the line is the name of the filter to run. +# +# If the repository name does not match any of the regular expressions in this +# file, the "DEFAULT" line is used, if it is specified. +# +# If the name "ALL" appears as a regular expression it is always used +# in addition to the first matching regex or "DEFAULT". diff --git a/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/cvs/repository/CVSROOT/postproxy,v b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/cvs/repository/CVSROOT/postproxy,v new file mode 100644 index 00000000..454d19d7 --- /dev/null +++ b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/cvs/repository/CVSROOT/postproxy,v @@ -0,0 +1,46 @@ +head 1.1; +access ; +symbols ; +locks ; strict; +comment @# @; + + +1.1 +date 2008.10.16.12.52.41; author stefan; state Exp; +branches; +next ; +commitid f9748f739194567; + +desc +@@ + + + +1.1 +log +@initial checkin@ +text +@# The "postproxy" file is called from a secondary server as soon as +# the secondary server closes its connection to the primary server. +# This script might, for example, be used to shut down a dial up +# or VPN connection to the primary server's network. +# +# If any format strings are present in the filter, they will be replaced +# as follows: +# %c = canonical name of the command being executed +# %R = the name of the referrer, if any, otherwise the value NONE +# %p = path relative to repository (currently always ".") +# %r = repository (path portion of $CVSROOT) +# +# The first entry on a line is a regular expression which is tested +# against the directory that the change is being committed to, relative +# to the $CVSROOT. For the first match that is found, then the remainder +# of the line is the name of the filter to run. +# +# If the repository name does not match any of the regular expressions in this +# file, the "DEFAULT" line is used, if it is specified. +# +# If the name "ALL" appears as a regular expression it is always used +# in addition to the first matching regex or "DEFAULT". +@ + diff --git a/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/cvs/repository/CVSROOT/posttag b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/cvs/repository/CVSROOT/posttag new file mode 100644 index 00000000..7f369e38 --- /dev/null +++ b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/cvs/repository/CVSROOT/posttag @@ -0,0 +1,37 @@ +# The "posttag" file is called after the "tag" command finishes +# processing a directory. +# +# If any format strings are present in the filter, they will be replaced +# as follows: +# %b = branch mode = "?" (delete ops - unknown) | "T" (branch) +# | "N" (not branch) +# %o = operation = "add" | "mov" | "del" +# %c = canonical name of the command being executed +# %R = the name of the referrer, if any, otherwise the value NONE +# %p = path relative to repository +# %r = repository (path portion of $CVSROOT) +# %t = tagname +# %{sVv} = attribute list = file name, old version tag will be deleted +# from, new version tag will be added to (or deleted from, but +# this feature is deprecated. When either old or new revision is +# unknown, doesn't exist, or isn't applicable, the string "NONE" +# will be placed on the command line. +# +# Note that %{sVv} is a list operator and not all elements are necessary. +# Thus %{sV} is a legal format string, but will only be replaced with file +# name and old revision. it also generates multiple arguments for each file +# being operated upon. i.e. if two files, file1 & file2, are having a tag +# moved from version 1.1 to version 1.1.2.9, %{sVv} will generate the +# following six arguments in this order: +# file1, 1.1, 1.1.2.9, file2, 1.1, 1.1.2.9. +# +# The first entry on a line is a regular expression which is tested +# against the directory that the change is being committed to, relative +# to the $CVSROOT. For the first match that is found, then the remainder +# of the line is the name of the filter to run. +# +# If the repository name does not match any of the regular expressions in this +# file, the "DEFAULT" line is used, if it is specified. +# +# If the name "ALL" appears as a regular expression it is always used +# in addition to the first matching regex or "DEFAULT". diff --git a/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/cvs/repository/CVSROOT/posttag,v b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/cvs/repository/CVSROOT/posttag,v new file mode 100644 index 00000000..31c7024d --- /dev/null +++ b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/cvs/repository/CVSROOT/posttag,v @@ -0,0 +1,61 @@ +head 1.1; +access ; +symbols ; +locks ; strict; +comment @# @; + + +1.1 +date 2008.10.16.12.52.41; author stefan; state Exp; +branches; +next ; +commitid f9748f739194567; + +desc +@@ + + + +1.1 +log +@initial checkin@ +text +@# The "posttag" file is called after the "tag" command finishes +# processing a directory. +# +# If any format strings are present in the filter, they will be replaced +# as follows: +# %b = branch mode = "?" (delete ops - unknown) | "T" (branch) +# | "N" (not branch) +# %o = operation = "add" | "mov" | "del" +# %c = canonical name of the command being executed +# %R = the name of the referrer, if any, otherwise the value NONE +# %p = path relative to repository +# %r = repository (path portion of $CVSROOT) +# %t = tagname +# %{sVv} = attribute list = file name, old version tag will be deleted +# from, new version tag will be added to (or deleted from, but +# this feature is deprecated. When either old or new revision is +# unknown, doesn't exist, or isn't applicable, the string "NONE" +# will be placed on the command line. +# +# Note that %{sVv} is a list operator and not all elements are necessary. +# Thus %{sV} is a legal format string, but will only be replaced with file +# name and old revision. it also generates multiple arguments for each file +# being operated upon. i.e. if two files, file1 & file2, are having a tag +# moved from version 1.1 to version 1.1.2.9, %{sVv} will generate the +# following six arguments in this order: +# file1, 1.1, 1.1.2.9, file2, 1.1, 1.1.2.9. +# +# The first entry on a line is a regular expression which is tested +# against the directory that the change is being committed to, relative +# to the $CVSROOT. For the first match that is found, then the remainder +# of the line is the name of the filter to run. +# +# If the repository name does not match any of the regular expressions in this +# file, the "DEFAULT" line is used, if it is specified. +# +# If the name "ALL" appears as a regular expression it is always used +# in addition to the first matching regex or "DEFAULT". +@ + diff --git a/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/cvs/repository/CVSROOT/postwatch b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/cvs/repository/CVSROOT/postwatch new file mode 100644 index 00000000..5b001b12 --- /dev/null +++ b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/cvs/repository/CVSROOT/postwatch @@ -0,0 +1,20 @@ +# The "postwatch" file is called after any command finishes writing new +# file attibute (watch/edit) information in a directory. +# +# If any format strings are present in the filter, they will be replaced +# as follows: +# %c = canonical name of the command being executed +# %R = the name of the referrer, if any, otherwise the value NONE +# %p = path relative to repository +# %r = repository (path portion of $CVSROOT) +# +# The first entry on a line is a regular expression which is tested +# against the directory that the change is being committed to, relative +# to the $CVSROOT. For the first match that is found, then the remainder +# of the line is the name of the filter to run. +# +# If the repository name does not match any of the regular expressions in this +# file, the "DEFAULT" line is used, if it is specified. +# +# If the name "ALL" appears as a regular expression it is always used +# in addition to the first matching regex or "DEFAULT". diff --git a/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/cvs/repository/CVSROOT/postwatch,v b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/cvs/repository/CVSROOT/postwatch,v new file mode 100644 index 00000000..8e3825cb --- /dev/null +++ b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/cvs/repository/CVSROOT/postwatch,v @@ -0,0 +1,44 @@ +head 1.1; +access ; +symbols ; +locks ; strict; +comment @# @; + + +1.1 +date 2008.10.16.12.52.41; author stefan; state Exp; +branches; +next ; +commitid f9748f739194567; + +desc +@@ + + + +1.1 +log +@initial checkin@ +text +@# The "postwatch" file is called after any command finishes writing new +# file attibute (watch/edit) information in a directory. +# +# If any format strings are present in the filter, they will be replaced +# as follows: +# %c = canonical name of the command being executed +# %R = the name of the referrer, if any, otherwise the value NONE +# %p = path relative to repository +# %r = repository (path portion of $CVSROOT) +# +# The first entry on a line is a regular expression which is tested +# against the directory that the change is being committed to, relative +# to the $CVSROOT. For the first match that is found, then the remainder +# of the line is the name of the filter to run. +# +# If the repository name does not match any of the regular expressions in this +# file, the "DEFAULT" line is used, if it is specified. +# +# If the name "ALL" appears as a regular expression it is always used +# in addition to the first matching regex or "DEFAULT". +@ + diff --git a/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/cvs/repository/CVSROOT/preproxy b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/cvs/repository/CVSROOT/preproxy new file mode 100644 index 00000000..a9f514f4 --- /dev/null +++ b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/cvs/repository/CVSROOT/preproxy @@ -0,0 +1,24 @@ +# The "preproxy" file is called form the secondary server as soon as +# the secondary server determines that it will be proxying a write +# command to a primary server and immediately before it opens a +# connection to the primary server. This script might, for example, be +# used to launch a dial up or VPN connection to the primary server's +# network. +# +# If any format strings are present in the filter, they will be replaced +# as follows: +# %c = canonical name of the command being executed +# %R = the name of the referrer, if any, otherwise the value NONE +# %p = path relative to repository (currently always ".") +# %r = repository (path portion of $CVSROOT) +# +# The first entry on a line is a regular expression which is tested +# against the directory that the change is being committed to, relative +# to the $CVSROOT. For the first match that is found, then the remainder +# of the line is the name of the filter to run. +# +# If the repository name does not match any of the regular expressions in this +# file, the "DEFAULT" line is used, if it is specified. +# +# If the name "ALL" appears as a regular expression it is always used +# in addition to the first matching regex or "DEFAULT". diff --git a/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/cvs/repository/CVSROOT/preproxy,v b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/cvs/repository/CVSROOT/preproxy,v new file mode 100644 index 00000000..5dcaa279 --- /dev/null +++ b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/cvs/repository/CVSROOT/preproxy,v @@ -0,0 +1,48 @@ +head 1.1; +access ; +symbols ; +locks ; strict; +comment @# @; + + +1.1 +date 2008.10.16.12.52.41; author stefan; state Exp; +branches; +next ; +commitid f9748f739194567; + +desc +@@ + + + +1.1 +log +@initial checkin@ +text +@# The "preproxy" file is called form the secondary server as soon as +# the secondary server determines that it will be proxying a write +# command to a primary server and immediately before it opens a +# connection to the primary server. This script might, for example, be +# used to launch a dial up or VPN connection to the primary server's +# network. +# +# If any format strings are present in the filter, they will be replaced +# as follows: +# %c = canonical name of the command being executed +# %R = the name of the referrer, if any, otherwise the value NONE +# %p = path relative to repository (currently always ".") +# %r = repository (path portion of $CVSROOT) +# +# The first entry on a line is a regular expression which is tested +# against the directory that the change is being committed to, relative +# to the $CVSROOT. For the first match that is found, then the remainder +# of the line is the name of the filter to run. +# +# If the repository name does not match any of the regular expressions in this +# file, the "DEFAULT" line is used, if it is specified. +# +# If the name "ALL" appears as a regular expression it is always used +# in addition to the first matching regex or "DEFAULT". +@ + diff --git a/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/cvs/repository/CVSROOT/rcsinfo b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/cvs/repository/CVSROOT/rcsinfo new file mode 100644 index 00000000..49e59f4d --- /dev/null +++ b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/cvs/repository/CVSROOT/rcsinfo @@ -0,0 +1,13 @@ +# The "rcsinfo" file is used to control templates with which the editor +# is invoked on commit and import. +# +# The first entry on a line is a regular expression which is tested +# against the directory that the change is being made to, relative to the +# $CVSROOT. For the first match that is found, then the remainder of the +# line is the name of the file that contains the template. +# +# If the repository name does not match any of the regular expressions in this +# file, the "DEFAULT" line is used, if it is specified. +# +# If the name "ALL" appears as a regular expression it is always used +# in addition to the first matching regex or "DEFAULT". diff --git a/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/cvs/repository/CVSROOT/rcsinfo,v b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/cvs/repository/CVSROOT/rcsinfo,v new file mode 100644 index 00000000..df61bfb3 --- /dev/null +++ b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/cvs/repository/CVSROOT/rcsinfo,v @@ -0,0 +1,37 @@ +head 1.1; +access ; +symbols ; +locks ; strict; +comment @# @; + + +1.1 +date 2008.10.16.12.52.41; author stefan; state Exp; +branches; +next ; +commitid f9748f739194567; + +desc +@@ + + + +1.1 +log +@initial checkin@ +text +@# The "rcsinfo" file is used to control templates with which the editor +# is invoked on commit and import. +# +# The first entry on a line is a regular expression which is tested +# against the directory that the change is being made to, relative to the +# $CVSROOT. For the first match that is found, then the remainder of the +# line is the name of the file that contains the template. +# +# If the repository name does not match any of the regular expressions in this +# file, the "DEFAULT" line is used, if it is specified. +# +# If the name "ALL" appears as a regular expression it is always used +# in addition to the first matching regex or "DEFAULT". +@ + diff --git a/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/cvs/repository/CVSROOT/taginfo b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/cvs/repository/CVSROOT/taginfo new file mode 100644 index 00000000..ce9d0dea --- /dev/null +++ b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/cvs/repository/CVSROOT/taginfo @@ -0,0 +1,46 @@ +# The "taginfo" file is used to control pre-tag checks. +# The filter on the right is invoked with the following arguments +# if no format strings are present: +# +# $1 -- tagname +# $2 -- operation "add" for tag, "mov" for tag -F, and "del" for tag -d +# $3 -- tagtype "?" on delete, "T" for branch, "N" for static +# $4 -- repository +# $5-> file revision [file revision ...] +# +# If any format strings are present in the filter, they will be replaced +# as follows: +# %b = branch mode = "?" (delete ops - unknown) | "T" (branch) +# | "N" (not branch) +# %o = operation = "add" | "mov" | "del" +# %c = canonical name of the command being executed +# %R = the name of the referrer, if any, otherwise the value NONE +# %p = path relative to repository +# %r = repository (path portion of $CVSROOT) +# %t = tagname +# %{sVv} = attribute list = file name, old version tag will be deleted +# from, new version tag will be added to (or deleted from, but +# this feature is deprecated. When either old or new revision is +# unknown, doesn't exist, or isn't applicable, the string "NONE" +# will be placed on the command line. +# +# Note that %{sVv} is a list operator and not all elements are necessary. +# Thus %{sV} is a legal format string, but will only be replaced with file +# name and old revision. it also generates multiple arguments for each file +# being operated upon. i.e. if two files, file1 & file2, are having a tag +# moved from version 1.1 to version 1.1.2.9, %{sVv} will generate the +# following six arguments in this order: +# file1, 1.1, 1.1.2.9, file2, 1.1, 1.1.2.9. +# +# A non-zero exit of the filter program will cause the tag to be aborted. +# +# The first entry on a line is a regular expression which is tested +# against the directory that the change is being committed to, relative +# to the $CVSROOT. For the first match that is found, then the remainder +# of the line is the name of the filter to run. +# +# If the repository name does not match any of the regular expressions in this +# file, the "DEFAULT" line is used, if it is specified. +# +# If the name "ALL" appears as a regular expression it is always used +# in addition to the first matching regex or "DEFAULT". diff --git a/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/cvs/repository/CVSROOT/taginfo,v b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/cvs/repository/CVSROOT/taginfo,v new file mode 100644 index 00000000..82c87f25 --- /dev/null +++ b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/cvs/repository/CVSROOT/taginfo,v @@ -0,0 +1,70 @@ +head 1.1; +access ; +symbols ; +locks ; strict; +comment @# @; + + +1.1 +date 2008.10.16.12.52.41; author stefan; state Exp; +branches; +next ; +commitid f9748f739194567; + +desc +@@ + + + +1.1 +log +@initial checkin@ +text +@# The "taginfo" file is used to control pre-tag checks. +# The filter on the right is invoked with the following arguments +# if no format strings are present: +# +# $1 -- tagname +# $2 -- operation "add" for tag, "mov" for tag -F, and "del" for tag -d +# $3 -- tagtype "?" on delete, "T" for branch, "N" for static +# $4 -- repository +# $5-> file revision [file revision ...] +# +# If any format strings are present in the filter, they will be replaced +# as follows: +# %b = branch mode = "?" (delete ops - unknown) | "T" (branch) +# | "N" (not branch) +# %o = operation = "add" | "mov" | "del" +# %c = canonical name of the command being executed +# %R = the name of the referrer, if any, otherwise the value NONE +# %p = path relative to repository +# %r = repository (path portion of $CVSROOT) +# %t = tagname +# %{sVv} = attribute list = file name, old version tag will be deleted +# from, new version tag will be added to (or deleted from, but +# this feature is deprecated. When either old or new revision is +# unknown, doesn't exist, or isn't applicable, the string "NONE" +# will be placed on the command line. +# +# Note that %{sVv} is a list operator and not all elements are necessary. +# Thus %{sV} is a legal format string, but will only be replaced with file +# name and old revision. it also generates multiple arguments for each file +# being operated upon. i.e. if two files, file1 & file2, are having a tag +# moved from version 1.1 to version 1.1.2.9, %{sVv} will generate the +# following six arguments in this order: +# file1, 1.1, 1.1.2.9, file2, 1.1, 1.1.2.9. +# +# A non-zero exit of the filter program will cause the tag to be aborted. +# +# The first entry on a line is a regular expression which is tested +# against the directory that the change is being committed to, relative +# to the $CVSROOT. For the first match that is found, then the remainder +# of the line is the name of the filter to run. +# +# If the repository name does not match any of the regular expressions in this +# file, the "DEFAULT" line is used, if it is specified. +# +# If the name "ALL" appears as a regular expression it is always used +# in addition to the first matching regex or "DEFAULT". +@ + diff --git a/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/cvs/repository/CVSROOT/val-tags b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/cvs/repository/CVSROOT/val-tags new file mode 100644 index 00000000..a76de202 --- /dev/null +++ b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/cvs/repository/CVSROOT/val-tags @@ -0,0 +1,2 @@ +testtag1 y +testtag2 y diff --git a/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/cvs/repository/CVSROOT/verifymsg b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/cvs/repository/CVSROOT/verifymsg new file mode 100644 index 00000000..357a0b03 --- /dev/null +++ b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/cvs/repository/CVSROOT/verifymsg @@ -0,0 +1,31 @@ +# The "verifymsg" file is used to allow verification of logging +# information. It works best when a template (as specified in the +# rcsinfo file) is provided for the logging procedure. Given a +# template with locations for, a bug-id number, a list of people who +# reviewed the code before it can be checked in, and an external +# process to catalog the differences that were code reviewed, the +# following test can be applied to the code: +# +# Making sure that the entered bug-id number is correct. +# Validating that the code that was reviewed is indeed the code being +# checked in (using the bug-id number or a seperate review +# number to identify this particular code set.). +# +# If any of the above test failed, then the commit would be aborted. +# +# Format strings present in the filter will be replaced as follows: +# %c = canonical name of the command being executed +# %R = the name of the referrer, if any, otherwise the value NONE +# %p = path relative to repository +# %r = repository (path portion of $CVSROOT) +# %l = name of log file to be verified. +# +# If no format strings are present in the filter, a default " %l" will +# be appended to the filter, but this usage is deprecated. +# +# Actions such as mailing a copy of the report to each reviewer are +# better handled by an entry in the loginfo file. +# +# One thing that should be noted is the the ALL keyword is not +# supported. There can be only one entry that matches a given +# repository. diff --git a/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/cvs/repository/CVSROOT/verifymsg,v b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/cvs/repository/CVSROOT/verifymsg,v new file mode 100644 index 00000000..d80fd099 --- /dev/null +++ b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/cvs/repository/CVSROOT/verifymsg,v @@ -0,0 +1,55 @@ +head 1.1; +access ; +symbols ; +locks ; strict; +comment @# @; + + +1.1 +date 2008.10.16.12.52.41; author stefan; state Exp; +branches; +next ; +commitid f9748f739194567; + +desc +@@ + + + +1.1 +log +@initial checkin@ +text +@# The "verifymsg" file is used to allow verification of logging +# information. It works best when a template (as specified in the +# rcsinfo file) is provided for the logging procedure. Given a +# template with locations for, a bug-id number, a list of people who +# reviewed the code before it can be checked in, and an external +# process to catalog the differences that were code reviewed, the +# following test can be applied to the code: +# +# Making sure that the entered bug-id number is correct. +# Validating that the code that was reviewed is indeed the code being +# checked in (using the bug-id number or a seperate review +# number to identify this particular code set.). +# +# If any of the above test failed, then the commit would be aborted. +# +# Format strings present in the filter will be replaced as follows: +# %c = canonical name of the command being executed +# %R = the name of the referrer, if any, otherwise the value NONE +# %p = path relative to repository +# %r = repository (path portion of $CVSROOT) +# %l = name of log file to be verified. +# +# If no format strings are present in the filter, a default " %l" will +# be appended to the filter, but this usage is deprecated. +# +# Actions such as mailing a copy of the report to each reviewer are +# better handled by an entry in the loginfo file. +# +# One thing that should be noted is the the ALL keyword is not +# supported. There can be only one entry that matches a given +# repository. +@ + diff --git a/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/cvs/repository/ant module 2/test.txt,v b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/cvs/repository/ant module 2/test.txt,v new file mode 100644 index 00000000..b91d6968 --- /dev/null +++ b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/cvs/repository/ant module 2/test.txt,v @@ -0,0 +1,41 @@ +head 1.1; +branch 1.1.1; +access ; +symbols start:1.1.1.1 ant:1.1.1; +locks ; strict; +comment @# @; + + +1.1 +date 2008.10.16.14.14.17; author stefan; state Exp; +branches 1.1.1.1; +next ; +commitid cdf48f74c394567; + +1.1.1.1 +date 2008.10.16.14.14.17; author stefan; state Exp; +branches ; +next ; +commitid cdf48f74c394567; + + +desc +@@ + + + +1.1 +log +@Initial revision +@ +text +@What a nice file. +@ + + +1.1.1.1 +log +@module with space in it's name +@ +text +@@ diff --git a/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/cvs/repository/antmodule1/foo.txt,v b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/cvs/repository/antmodule1/foo.txt,v new file mode 100644 index 00000000..47669791 --- /dev/null +++ b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/cvs/repository/antmodule1/foo.txt,v @@ -0,0 +1,108 @@ +head 1.5; +access; +symbols + start:1.1.1.1 ant:1.1.1; +locks; strict; +comment @# @; + + +1.5 +date 2008.12.03.14.37.58; author stefan; state Exp; +branches; +next 1.4; +commitid 2ca3493699c64567; + +1.4 +date 2008.10.16.14.05.45; author stefan; state Exp; +branches; +next 1.3; +commitid 761748f74a394567; + +1.3 +date 2008.10.16.13.56.27; author stefan; state Exp; +branches; +next 1.2; +commitid 4dcd48f7480b4567; + +1.2 +date 2008.10.16.13.56.11; author stefan; state Exp; +branches; +next 1.1; +commitid 4dae48f747fb4567; + +1.1 +date 2008.10.16.12.56.07; author stefan; state Exp; +branches + 1.1.1.1; +next ; +commitid 17ca48f739e74567; + +1.1.1.1 +date 2008.10.16.12.56.07; author stefan; state Exp; +branches; +next ; +commitid 17ca48f739e74567; + + +desc +@@ + + +1.5 +log +@add yet another line +@ +text +@This is a text. +Added a line. +and one more line. +and another line. +@ + + +1.4 +log +@---------------------------- +@ +text +@d4 1 +@ + + +1.3 +log +@typo +@ +text +@d3 1 +@ + + +1.2 +log +@-------------------- +@ +text +@d2 1 +a2 1 +added a line. +@ + + +1.1 +log +@Initial revision +@ +text +@d2 1 +a2 1 + +@ + + +1.1.1.1 +log +@Initial import +@ +text +@@ diff --git a/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/cvs/repository/antmodule3/yet another test.txt,v b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/cvs/repository/antmodule3/yet another test.txt,v new file mode 100644 index 00000000..08f13b00 --- /dev/null +++ b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/cvs/repository/antmodule3/yet another test.txt,v @@ -0,0 +1,60 @@ +head 1.2; +access; +symbols + testtag2:1.2 + testtag1:1.1.1.1 + start:1.1.1.1 + ant:1.1.1; +locks; strict; +comment @# @; + + +1.2 +date 2008.10.17.15.23.03; author stefan; state Exp; +branches; +next 1.1; +commitid 7ddc48f8add74567; + +1.1 +date 2008.10.16.14.51.11; author stefan; state Exp; +branches + 1.1.1.1; +next ; +commitid 7f8d48f754df4567; + +1.1.1.1 +date 2008.10.16.14.51.11; author stefan; state Exp; +branches; +next ; +commitid 7f8d48f754df4567; + + +desc +@@ + + +1.2 +log +@update weather report +@ +text +@dark and cloudy. +a bit brighter today. +@ + + +1.1 +log +@Initial revision +@ +text +@d2 1 +@ + + +1.1.1.1 +log +@three times is a charm +@ +text +@@ diff --git a/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/defaultexcludes-test.xml b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/defaultexcludes-test.xml new file mode 100644 index 00000000..cbea93c2 --- /dev/null +++ b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/defaultexcludes-test.xml @@ -0,0 +1,52 @@ +<?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="setUp"> + <mkdir dir="${output}"/> + <available property="in working copy" file=".svn"/> + </target> + + <target name="testCopyNoExplicitExcludes" depends="setUp" + if="in working copy"> + <copy todir="${output}"> + <fileset dir="."/> + </copy> + <au:assertFileExists file="${output}/defaultexcludes-test.xml"/> + <au:assertFileDoesntExist file="${output}/.svn/entries"/> + </target> + + <target name="testCopyExplicitExcludes" depends="setUp" + if="in working copy"> + <copy todir="${output}"> + <fileset dir="." defaultexcludes="true"/> + </copy> + <au:assertFileExists file="${output}/defaultexcludes-test.xml"/> + <au:assertFileDoesntExist file="${output}/.svn/entries"/> + </target> + + <target name="testCopyExplicitNoExcludes" depends="setUp" + if="in working copy"> + <copy todir="${output}"> + <fileset dir="." defaultexcludes="false"/> + </copy> + <au:assertFileExists file="${output}/defaultexcludes-test.xml"/> + <au:assertFileExists file="${output}/.svn/entries"/> + </target> +</project> diff --git a/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/delete-and-symlinks-test.xml b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/delete-and-symlinks-test.xml new file mode 100644 index 00000000..ac789940 --- /dev/null +++ b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/delete-and-symlinks-test.xml @@ -0,0 +1,84 @@ +<?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 name="delete-test" basedir="." default="antunit" + xmlns:au="antlib:org.apache.ant.antunit"> + + <import file="../antunit-base.xml" /> + + <condition property="unix"> + <os family="unix" /> + </condition> + + <target name="tearDown" depends="removelink, antunit-base.tearDown"/> + + <target name="removelink" if="link"> + <symlink action="delete" link="${link}"/> + </target> + + <target name="setUp" if="unix"> + <mkdir dir="${input}/A/B"/> + <mkdir dir="${input}/C"/> + <property name="link" location="${input}/A/B/C"/> + <symlink link="${link}" resource="${input}/C"/> + </target> + + <target name="testNotFollowedLink" if="unix" depends="setUp"> + <delete> + <fileset dir="${input}" followSymlinks="false"/> + </delete> + <au:assertFileExists file="${input}/A/B/C"/> + </target> + + <target name="testRemoveNotFollowedLink" if="unix" depends="setUp"> + <delete removeNotFollowedSymlinks="true"> + <fileset dir="${input}/A" followSymlinks="false"/> + </delete> + <au:assertFileDoesntExist file="${input}/A/B/C"/> + <au:assertFileExists file="${input}/C"/> + </target> + + <target name="testRemoveNotFollowedLinkHonorsIncludesOnFiles" + depends="setUp" if="unix" + description="https://issues.apache.org/bugzilla/show_bug.cgi?id=53959"> + <delete dir="${input}/C"/> + <touch file="${input}/C"/> + <delete removeNotFollowedSymlinks="true"> + <fileset dir="${input}/A" followSymlinks="false" includes="**/D"/> + </delete> + <au:assertFileExists file="${input}/A/B/C"/> + </target> + + <target name="testRemoveNotFollowedLinkDeletesNotIncludedDirs" + depends="setUp" if="unix" + description="https://issues.apache.org/bugzilla/show_bug.cgi?id=53959"> + <delete removeNotFollowedSymlinks="true"> + <fileset dir="${input}/A" followSymlinks="false" includes="**/D"/> + </delete> + <au:assertFileDoesntExist file="${input}/A/B/C"/> + <au:assertFileExists file="${input}/C"/> + </target> + + <target name="testRemoveNotFollowedLinkHonorsExcludes" if="unix" + depends="setUp"> + <delete removeNotFollowedSymlinks="true"> + <fileset dir="${input}/A" followSymlinks="false" excludes="**/C/**"/> + </delete> + <au:assertFileExists file="${input}/A/B/C"/> + </target> +</project> diff --git a/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/delete-test.xml b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/delete-test.xml new file mode 100644 index 00000000..554f08fe --- /dev/null +++ b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/delete-test.xml @@ -0,0 +1,141 @@ +<?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 name="delete-test" basedir="." default="antunit" + xmlns:au="antlib:org.apache.ant.antunit"> + + <import file="../antunit-base.xml" /> + + <property name="existing.dir" location="${output}/exists"/> + <property name="nonexistent.dir" location="${output}/nonexists"/> + + <target name="init"> + <delete dir="${output}"/> + <mkdir dir="${output}"/> + <mkdir dir="${existing.dir}"/> + </target> + + <!--test that you can delete a fileset with a nonexistent dir without failure--> + <target name="testdelfileset" depends="init"> + <delete quiet="true" includeEmptyDirs="true"> + <fileset dir="${nonexistent.dir}"/> + </delete> + + <au:assertFileExists file="${existing.dir}" /> + + <delete quiet="true" includeEmptyDirs="true"> + <fileset dir="${existing.dir}"/> + </delete> + + <au:assertFileDoesntExist file="${existing.dir}" /> + + + <mkdir dir="${existing.dir}"/> + + <delete quiet="true" includeEmptyDirs="true"> + <fileset dir="${nonexistent.dir}"/> + <fileset dir="${existing.dir}"/> + </delete> + + + <au:assertFileDoesntExist file="${existing.dir}" /> + + <mkdir dir="${existing.dir}"/> + + <delete quiet="true" includeEmptyDirs="true"> + <fileset dir="${existing.dir}"/> + <fileset dir="${nonexistent.dir}"/> + </delete> + + + <au:assertFileDoesntExist file="${existing.dir}" /> + + </target> + + <target name="checkOs"> + <condition property="unix"> + <os family="unix" /> + </condition> + </target> + + <target name="testDanglingSymlinkInDir" if="unix" depends="checkOs,init"> + <touch file="${output}/foo"/> + <symlink link="${existing.dir}/link" + resource="${output}/foo"/> + <delete file="${output}/foo"/> + <delete dir="${existing.dir}"/> + <au:assertFileDoesntExist file="${existing.dir}" /> + </target> + + <target name="testDanglingSymlink" if="unix" depends="checkOs,init"> + <touch file="${output}/foo"/> + <symlink link="${output}/link" + resource="${output}/foo"/> + <delete file="${output}/foo"/> + <delete file="${output}/link"/> + + <!-- since File.exists returns false for dangling links, recreate + the file so that assertFileDoesntExist can actually work --> + <touch file="${output}/foo"/> + <au:assertFileDoesntExist file="${output}/link" /> + </target> + + <target name="testNotModifiedSelector" + description="https://issues.apache.org/bugzilla/show_bug.cgi?id=43574" + > + <mkdir dir="${input}/images"/> + <mkdir dir="${input}/cache"/> + <touch file="${input}/images/foo.jpg"/> + <selector id="cache.selector"> + <not> + <modified update="true" + seldirs="false" + cache="propertyfile" + algorithm="digest" + comparator="equal"> + <param name="cache.cachefile" + value="${input}/cache/cache.properties"/> + <param name="algorithm.algorithm" value="MD5"/> + </modified> + </not> + </selector> + <au:assertFileDoesntExist file="${input}/cache/cache.properties"/> + <delete> + <fileset dir="${input}/images"> + <include name="*.jpg" /> + <selector refid="cache.selector" /> + </fileset> + </delete> + <au:assertFileExists file="${input}/cache/cache.properties"/> + <au:assertFileExists file="${input}/images/foo.jpg"/> + <delete> + <fileset dir="${input}/images"> + <include name="*.jpg" /> + <selector refid="cache.selector" /> + </fileset> + </delete> + <au:assertFileDoesntExist file="${input}/images/foo.jpg"/> + </target> + + <target name="testFilesetWithMissingButIgnoredDir" + description="https://issues.apache.org/bugzilla/show_bug.cgi?id=50124"> + <delete> + <fileset dir="${input}/not-there" errorOnMissingDir="false"/> + </delete> + </target> +</project> diff --git a/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/dependset-test.xml b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/dependset-test.xml new file mode 100644 index 00000000..55252593 --- /dev/null +++ b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/dependset-test.xml @@ -0,0 +1,196 @@ +<?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 name="dependset-test" xmlns:au="antlib:org.apache.ant.antunit" default="antunit"> + + <import file="../antunit-base.xml" /> + + <target name="setUp"> + <mkdir dir="${input}" /> + <mkdir dir="${output}" /> + </target> + + <target name="testNoSourcesOrTargets"> + <au:expectfailure expectedMessage="At least one set of source resources must be specified"> + <dependset /> + </au:expectfailure> + </target> + + <target name="testNoTargets"> + <au:expectfailure expectedMessage="At least one set of target files must be specified"> + <dependset> + <srcfilelist dir="." files="test2.tmp" /> + </dependset> + </au:expectfailure> + </target> + + <target name="testNoSources"> + <au:expectfailure expectedMessage="At least one set of source resources must be specified"> + <dependset> + <targetfileset dir="." includes="test3.tmp" /> + </dependset> + </au:expectfailure> + </target> + + <target name="testMissingTargets" depends="setUp"> + <touch file="${input}/test4.tmp" /> + <dependset> + <srcfilelist dir="${input}" files="test4.tmp" /> + <targetfileset id="targetfs" dir="${output}" includes="i-do-not-exist" /> + </dependset> + <au:assertLogDoesntContain text="Deleting all target files." level="verbose" /> + </target> + + <target name="testMoreRecentSourceFile" depends="setUp"> + <touch file="${output}/older.tmp" /> + <sleep seconds="3" /> + <touch file="${input}/newer.tmp" /> + <dependset> + <srcfilelist dir="${input}" files="newer.tmp" /> + <targetfilelist dir="${output}" files="older.tmp" /> + </dependset> + <au:assertLogContains text="older.tmp" is oldest target file" level="verbose" /> + <au:assertLogContains text="newer.tmp" is newest source" level="verbose" /> + <au:assertLogContains text="Deleting all target files." level="verbose" /> + <au:assertLogDoesntContain text="Deleting" level="info" /> + <au:assertFileDoesntExist file="${output}/older.tmp" /> + </target> + + <target name="testMoreRecentSourceFileVerbose" depends="setUp"> + <touch file="${output}/older.tmp" /> + <sleep seconds="3" /> + <touch file="${input}/newer.tmp" /> + <dependset verbose="true"> + <srcfilelist dir="${input}" files="newer.tmp" /> + <targetfilelist dir="${output}" files="older.tmp" /> + </dependset> + <au:assertLogContains text="older.tmp" is oldest target file" level="info" /> + <au:assertLogContains text="newer.tmp" is newest source" level="info" /> + <au:assertLogContains text="Deleting all target files." level="verbose" /> + <au:assertLogContains text="Deleting" level="info" /> + <au:assertFileDoesntExist file="${output}/older.tmp" /> + </target> + + <target name="testMultipleFiles" depends="setUp"> + <touch file="${input}/sourceset_1.tmp" /> + <touch file="${output}/targetset_1.tmp" /> + <sleep seconds="3" /> + <touch file="${input}/sourceset_2.tmp" /> + <touch file="${output}/targetset_2.tmp" /> + <sleep seconds="2" /> + <dependset> + <sources> + <filelist dir="${input}" files="sourceset_1.tmp,sourceset_2.tmp" /> + </sources> + <targets> + <filelist dir="${output}/" files="targetset_1.tmp,targetset_2.tmp" /> + </targets> + </dependset> + <au:assertLogContains text="targetset_1.tmp" is oldest target file" level="verbose" /> + <au:assertLogContains text="sourceset_2.tmp" is newest source" level="verbose" /> + <au:assertLogContains text="Deleting all target files." level="verbose" /> + <au:assertLogDoesntContain text="Deleting" level="info" /> + <au:assertFileDoesntExist file="${output}/targetset_1.tmp" /> + <au:assertFileDoesntExist file="${output}/targetset_2.tmp" /> + </target> + + <target name="testMultipleFilesVerbose" depends="setUp"> + <touch file="${input}/sourceset_1.tmp" /> + <touch file="${output}/targetset_1.tmp" /> + <sleep seconds="3" /> + <touch file="${input}/sourceset_2.tmp" /> + <touch file="${output}/targetset_2.tmp" /> + <sleep seconds="2" /> + <dependset verbose="true"> + <sources> + <filelist dir="${input}" files="sourceset_1.tmp,sourceset_2.tmp" /> + </sources> + <targets> + <filelist dir="${output}/" files="targetset_1.tmp,targetset_2.tmp" /> + </targets> + </dependset> + <au:assertLogContains text="targetset_1.tmp" is oldest target file" level="info" /> + <au:assertLogContains text="sourceset_2.tmp" is newest source" level="info" /> + <au:assertLogContains text="Deleting all target files." level="verbose" /> + <au:assertLogContains text="Deleting" level="info" /> + <au:assertFileDoesntExist file="${output}/targetset_1.tmp" /> + <au:assertFileDoesntExist file="${output}/targetset_2.tmp" /> + </target> + + <target name="testMissingSourceResource" depends="setUp"> + <touch file="${output}/older.tmp" /> + <dependset> + <sources> + <propertyresource name="thereisnosuchproperty" /> + </sources> + <targets> + <filelist dir="${output}" files="older.tmp" /> + </targets> + </dependset> + <au:assertLogContains text="1 nonexistent sources" level="verbose" /> + <au:assertLogContains text="Deleting all target files." level="verbose" /> + <au:assertLogDoesntContain text="Deleting" level="info" /> + <au:assertLogDoesntContain text="Expected source propertyresource "null" is missing." level="info" /> + <au:assertFileDoesntExist file="${output}/older.tmp" /> + </target> + + <target name="testMissingSourceResourceVerbose" depends="setUp"> + <touch file="${output}/older.tmp" /> + <dependset verbose="true"> + <sources> + <propertyresource name="thereisnosuchproperty" /> + </sources> + <targets> + <filelist dir="${output}" files="older.tmp" /> + </targets> + </dependset> + <au:assertLogContains text="1 nonexistent sources" level="verbose" /> + <au:assertLogContains text="Deleting all target files." level="verbose" /> + <au:assertLogContains text="Deleting" level="info" /> + <au:assertLogContains text="Expected source propertyresource "null" is missing." level="info" /> + <au:assertFileDoesntExist file="${output}/older.tmp" /> + </target> + + <target name="testExistingSourceResource" depends="setUp"> + <touch file="${output}/older.tmp" /> + <property name="foo" value="bar" /> + <dependset> + <sources> + <propertyresource name="foo" /> + </sources> + <targets> + <filelist dir="${output}" files="older.tmp" /> + </targets> + </dependset> + <au:assertLogDoesntContain text="Deleting all target files." level="verbose" /> + <au:assertFileExists file="${output}/older.tmp" /> + </target> + + <target name="testMissingTargetDirectory" depends="setUp"> + <au:assertFalse> + <available file="${output}/test9dir" type="dir" /> + </au:assertFalse> + <touch file="${input}/test9.tmp" /> + <dependset> + <srcfileset dir="." includes="test9.tmp" /> + <targetfileset dir="${output}/test9dir" /> + </dependset> + <au:assertLogDoesntContain text="Deleting all target files." level="verbose" /> + </target> + +</project> diff --git a/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/dirname-test.xml b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/dirname-test.xml new file mode 100644 index 00000000..60caaf1a --- /dev/null +++ b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/dirname-test.xml @@ -0,0 +1,59 @@ +<?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 name="dirname-test" basedir="." default="antunit" xmlns:au="antlib:org.apache.ant.antunit"> + + <import file="../antunit-base.xml"/> + + <target name="test1"> + <au:expectfailure expectedmessage="property attribute required"> + <dirname/> + </au:expectfailure> + </target> + + <target name="test2"> + <au:expectfailure expectedmessage="file attribute required"> + <dirname property="propname"/> + </au:expectfailure> + </target> + + <target name="test3"> + <au:expectfailure expectedmessage="property attribute required"> + <dirname file="filename"/> + </au:expectfailure> + </target> + + <target name="init-test4"> + <condition property="valid.os"> + <and> + <not><os family="dos"/></not><not><os family="netware"/></not> + </and> + </condition> + </target> + + <target name="test4" depends="init-test4" if="valid.os"> + <dirname property="local.dir" file="/usr/local/foo.txt"/> + <au:assertPropertyEquals name="local.dir" + value="${file.separator}usr${file.separator}local"/> + </target> + + <target name="test5"> + <dirname property="base.dir" file="foo.txt"/> + <au:assertPropertyEquals name="base.dir" value="${basedir}"/> + </target> + +</project> diff --git a/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/ear-test.xml b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/ear-test.xml new file mode 100644 index 00000000..239c501a --- /dev/null +++ b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/ear-test.xml @@ -0,0 +1,31 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- + 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 xmlns:au="antlib:org.apache.ant.antunit" default="antunit"> + <import file="../antunit-base.xml" /> + + <target name="testOnlyOneAppXml"> + <mkdir dir="${input}/META-INF"/> + <mkdir dir="${output}"/> + <touch file="${input}/META-INF/application.xml"/> + <touch file="${input}/x.xml"/> + <ear destfile="${output}/test.ear" appxml="${input}/x.xml"> + <fileset dir="${input}"/> + </ear> + <au:assertLogContains text="Warning: selected ear files include a META-INF/application.xml which will be ignored (please use appxml attribute to ear task)"/> + </target> +</project> diff --git a/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/echo-test.xml b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/echo-test.xml new file mode 100644 index 00000000..bd1fc05e --- /dev/null +++ b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/echo-test.xml @@ -0,0 +1,138 @@ +<?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 name="echo-test" default="antunit" xmlns:au="antlib:org.apache.ant.antunit"> + <import file="../antunit-base.xml" /> + + <target name="setUp"> + <mkdir dir="${output}" /> + </target> + + <target name="test1"> + <echo/> + <au:assertTrue> + <length length="0"> + <au:logcontent /> + </length> + </au:assertTrue> + </target> + + <target name="test2"> + <echo message="OUTPUT OF ECHO"/> + <au:assertLogContains text="OUTPUT OF ECHO" /> + </target> + + <target name="test3"> + <echo> + This + is + a + multiline + message + </echo> + <au:assertTrue> + <resourcecount count="1"> + <restrict> + <au:logcontent /> + <contains text="This" /> + <contains text="is" /> + <contains text="a" /> + <contains text="multiline" /> + <contains text="message" /> + </restrict> + </resourcecount> + </au:assertTrue> + </target> + + <target name="testFile"> + <echo file="${output}/echo.txt">Simple text</echo> + <au:assertTrue> + <resourcecount count="1"> + <restrict> + <file file="${output}/echo.txt" /> + <contains text="Simple text" /> + </restrict> + </resourcecount> + </au:assertTrue> + </target> + + <target name="testOutputFile"> + <echo output="${output}/echo.txt">Simple text</echo> + <au:assertTrue> + <resourcecount count="1"> + <restrict> + <file file="${output}/echo.txt" /> + <contains text="Simple text" /> + </restrict> + </resourcecount> + </au:assertTrue> + </target> + + <target name="testAppend"> + <echo file="${output}/echo.txt">Simple text</echo> + <echo file="${output}/echo.txt" append="true">Appended</echo> + <concat> + <file file="${output}/echo.txt" /> + </concat> + <au:assertTrue> + <resourcecount count="1"> + <restrict> + <file file="${output}/echo.txt" /> + <contains text="Simple text" /> + <contains text="Appended" /> + </restrict> + </resourcecount> + </au:assertTrue> + </target> + + <target name="testEmptyEncoding"> + <echo file="${output}/echo.txt" encoding="">Simple text</echo> + <au:assertTrue> + <resourcecount count="1"> + <restrict> + <file file="${output}/echo.txt" /> + <contains text="Simple text" /> + </restrict> + </resourcecount> + </au:assertTrue> + </target> + + <target name="testUTF16Encoding"> + <property name="char" value="©" /> + <echo file="${output}/echo16.txt" encoding="UTF-16">${char}</echo> + <loadfile property="out.16" srcfile="${output}/echo16.txt" + encoding="UTF-16"/> + <au:assertEquals expected="${char}" actual="${out.16}"/> + </target> + + <target name="testUTF8Encoding"> + <property name="char" value="©" /> + <echo file="${output}/echo8.txt" encoding="UTF8">${char}</echo> + <au:assertTrue> + <resourcecount count="1"> + <restrict> + <concat encoding="UTF-8"> + <file file="${output}/echo8.txt"/> + </concat> + <contains text="${char}" encoding="UTF-8"/> + </restrict> + </resourcecount> + </au:assertTrue> + </target> + +</project> diff --git a/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/echoxml-test.xml b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/echoxml-test.xml new file mode 100644 index 00000000..d461d3d8 --- /dev/null +++ b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/echoxml-test.xml @@ -0,0 +1,87 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- + 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"> + + <!-- note relies on antunit 1.1 --> + <import file="../antunit-base.xml"/> + + <target name="setUp"> + <property name="file" location="${output}/echoed.xml"/> + <mkdir dir="${output}"/> + <echoxml file="${file}"> + <project> + <property name="foo" value="bar" /> + <fail message="$$$${foo}=$${foo}"> + <condition> + <istrue value="${mustfail}" /> + </condition> + </fail> + </project> + </echoxml> + </target> + + <target name="testPass"> + <ant antfile="${file}"/> + </target> + + <target name="testFail"> + <au:expectfailure expectedmessage="${foo}=bar" message="Should have thrown an exception"> + <ant antfile="${file}"> + <property name="mustfail" value="true" /> + </ant> + </au:expectfailure> + </target> + + <target name="testEmpty"> + <au:expectfailure expectedmessage="No nested XML specified" message="Should have thrown an exception"> + <echoxml /> + </au:expectfailure> + </target> + + <!-- comment this and the next targets if you don't have the svn + trunk of antunit --> + <target name="test-ns-all"> + <echoxml file="${file}" xmlns:a="antlib:a" + namespacepolicy="all"> + <a:something a:foo="bar"/> + </echoxml> + <au:assertResourceContains resource="${file}" value="a:something"/> + <au:assertResourceContains resource="${file}" value="antlib:a"/> + </target> + + <target name="test-ns-elementsOnly"> + <echoxml file="${file}" xmlns:a="antlib:a" + namespacepolicy="elementsOnly"> + <a:something a:foo="bar"/> + </echoxml> + <au:assertResourceContains resource="${file}" value="a:something"/> + <au:assertResourceContains resource="${file}" value="antlib:a"/> + </target> + + <target name="test-ns-ignore"> + <echoxml file="${file}" xmlns:a="antlib:a" + namespacepolicy="ignore"> + <a:something a:foo="bar"/> + </echoxml> + <au:assertResourceContains resource="${file}" value="a:something"/> + <au:assertFalse message="Didn't expecte ${file} to contain antlib:a"> + <resourcecontains resource="${file}" substring="antlib:a"/> + </au:assertFalse> + </target> + +</project> diff --git a/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/exec/apply-test.xml b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/exec/apply-test.xml new file mode 100644 index 00000000..1b5a661a --- /dev/null +++ b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/exec/apply-test.xml @@ -0,0 +1,792 @@ +<?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 name="apply-test" default="antunit" + xmlns:au="antlib:org.apache.ant.antunit"> + <import file="../../antunit-base.xml" /> + + <property environment="env" /> + <!-- UNIX --> + <available file="sh" filepath="${env.PATH}" property="sh.executable" /> + <!-- CYGWIN --> + <available file="sh.exe" filepath="${env.PATH}" property="sh.exe.executable" /> + <condition property="test.can.run"> + <or> + <isset property="sh.executable" /> + <isset property="sh.exe.executable" /> + </or> + </condition> + <!-- UNIX --> + <available file="sed" filepath="${env.PATH}" property="sed.executable" /> + <!-- CYGWIN --> + <available file="sed.exe" filepath="${env.PATH}" property="sed.exe.executable" /> + <condition property="sed.can.run"> + <or> + <isset property="sed.executable" /> + <isset property="sed.exe.executable" /> + </or> + </condition> + <!-- UNIX --> + <available file="echo" filepath="${env.PATH}" property="echo.executable" /> + <!-- CYGWIN --> + <available file="echo.exe" filepath="${env.PATH}" property="echo.exe.executable" /> + <condition property="echo.can.run"> + <or> + <isset property="echo.executable" /> + <isset property="echo.exe.executable" /> + </or> + </condition> + + <!-- UNIX --> + <available file="ls" filepath="${env.PATH}" property="ls.executable" /> + <!-- CYGWIN --> + <available file="ls.exe" filepath="${env.PATH}" property="ls.exe.executable" /> + <!-- piggyback the name of the executable here --> + <condition property="ls.can.run" value="ls"> + <isset property="ls.executable" /> + </condition> + <condition property="ls.can.run" value="ls.exe"> + <isset property="ls.exe.executable" /> + </condition> + + <property name="eol" value="${line.separator}" /> + + <macrodef name="rcat"> + <attribute name="refid" /> + <sequential> + <echo>@@{refid}=@{refid}</echo> + <concat><resources refid="@{refid}" /></concat> + </sequential> + </macrodef> + + <macrodef name="assertEmptyFile"> + <attribute name="file" /> + <sequential> + <au:assertTrue> + <and> + <available file="@{file}" type="file" /> + <length length="0" file="@{file}" /> + </and> + </au:assertTrue> + </sequential> + </macrodef> + + <target name="xyz"> + <mkdir dir="${input}"/> + <mkdir dir="${output}"/> + <echo file="${input}/x">s/x/blah/g${eol}</echo> + <echo file="${input}/y">s/y/blah/g${eol}</echo> + <echo file="${input}/z">s/z/blah/g${eol}</echo> + <fileset id="xyz" dir="${input}" includes="x,y,z" /> + <filelist id="xyzlist" dir="${input}" files="x,y,z" /> + <property name="x" location="${input}/x" /> + <property name="y" location="${input}/y" /> + <property name="z" location="${input}/z" /> + </target> + + <target name="testNoRedirect" depends="xyz" if="test.can.run"> + <apply executable="sh"> + <arg value="parrot.sh" /> + <fileset refid="xyz" /> + </apply> + + <au:assertLogContains text="${x} out" /> + <au:assertLogContains text="${y} out" /> + <au:assertLogContains text="${z} out" /> + <au:assertLogContains text="${x} err" /> + <au:assertLogContains text="${y} err" /> + <au:assertLogContains text="${z} err" /> + + <!-- + + The original junit test also verified that x out happened before + y out, and y out happened before z out; likewise with err output. + I added the antunit:logcontent resource hoping that would help, + but I think we need a way to filter (copy) resources first. + THAT necessitates the string-to-resource coding we are currently + discussing on the dev list IMO. MJB, 9/22/2006 + + --> + + </target> + + <target name="testRedirect1" depends="xyz" if="test.can.run"> + <apply executable="sh" output="${output}/redirect.out" append="true"> + <arg value="parrot.sh" /> + <fileset refid="xyz" /> + </apply> + + <au:assertTrue> + <resourcecount count="1"> + <restrict id="results"> + <file file="${output}/redirect.out" /> + <and xmlns="antlib:org.apache.tools.ant.types.resources.selectors"> + <contains text="${x} out" /> + <contains text="${y} out" /> + <contains text="${z} out" /> + <contains text="${x} err" /> + <contains text="${y} err" /> + <contains text="${z} err" /> + </and> + </restrict> + </resourcecount> + </au:assertTrue> + + </target> + + <target name="testRedirect2" depends="xyz" if="test.can.run"> + <apply executable="sh" output="${output}/redirect.out" + error="${output}/redirect.err" append="true"> + <arg value="parrot.sh" /> + <fileset refid="xyz" /> + </apply> + + <au:assertTrue> + <and> + <resourcesmatch astext="true"> + <string value="${x} out${eol}${y} out${eol}${z} out" /> + <file file="${output}/redirect.out" /> + </resourcesmatch> + <resourcesmatch astext="true"> + <string value="${x} err${eol}${y} err${eol}${z} err" /> + <file file="${output}/redirect.err" /> + </resourcesmatch> + </and> + </au:assertTrue> + </target> + + <target name="testRedirect3" depends="xyz" if="test.can.run"> + <apply executable="sh" logerror="true" append="true" + output="${output}/redirect.out" outputproperty="redirect3.out"> + <arg value="parrot.sh" /> + <fileset refid="xyz" /> + </apply> + + <au:assertTrue> + <resourcesmatch astext="true"> + <string value="${x} out${eol}${y} out${eol}${z} out" /> + <file file="${output}/redirect.out" /> + <propertyresource name="redirect3.out" /> + </resourcesmatch> + </au:assertTrue> + + <au:assertLogContains text="${x} err" /> + <au:assertLogContains text="${y} err" /> + <au:assertLogContains text="${z} err" /> + </target> + + <target name="testRedirect4" depends="xyz" if="test.can.run"> + <apply executable="sh" append="true" + error="${output}/redirect.err" errorproperty="redirect4.err" + output="${output}/redirect.out" outputproperty="redirect4.out"> + <arg value="parrot.sh" /> + <fileset refid="xyz" /> + </apply> + + <au:assertTrue> + <and> + <resourcesmatch astext="true"> + <string value="${x} out${eol}${y} out${eol}${z} out" /> + <file file="${output}/redirect.out" /> + <propertyresource name="redirect4.out" /> + </resourcesmatch> + <resourcesmatch astext="true"> + <string value="${x} err${eol}${y} err${eol}${z} err" /> + <file file="${output}/redirect.err" /> + <propertyresource name="redirect4.err" /> + </resourcesmatch> + </and> + </au:assertTrue> + </target> + + <target name="testRedirect5" depends="xyz" if="sed.can.run"> + <apply executable="sed" inputstring="x y z${eol}" append="true" + error="${output}/redirect.err" errorproperty="redirect5.err" + output="${output}/redirect.out" outputproperty="redirect5.out"> + <arg value="-f" /> + <fileset refid="xyz" /> + </apply> + + <au:assertTrue> + <and> + <resourcesmatch astext="true"> + <propertyresource name="redirect5.out" /> + <string value="blah y z${eol}x blah z${eol}x y blah" /> + <file file="${output}/redirect.out" /> + </resourcesmatch> + <equals arg1="${redirect5.err}" arg2="" /> + </and> + </au:assertTrue> + <assertEmptyFile file="${output}/redirect.err" /> + </target> + + <target name="testRedirect6" depends="xyz" if="sed.can.run"> + <echo file="${input}/redirect.in">x y z${eol}</echo> + <apply executable="sed" input="${input}/redirect.in" append="true" + error="${output}/redirect.err" errorproperty="redirect6.err" + output="${output}/redirect.out" outputproperty="redirect6.out"> + <arg value="-f" /> + <filelist refid="xyzlist" /> + </apply> + + <au:assertTrue> + <and> + <resourcesmatch astext="true"> + <propertyresource name="redirect6.out" /> + <string value="blah y z${eol}x blah z${eol}x y blah" /> + <file file="${output}/redirect.out" /> + </resourcesmatch> + <equals arg1="${redirect6.err}" arg2="" /> + <length length="0"><file file="${output}/redirect.err" /></length> + </and> + </au:assertTrue> + </target> + + <target name="testRedirect7" depends="xyz" if="sed.can.run"> + <apply executable="sed" inputstring="x y z${eol}" + error="${output}/redirect.err" output="${output}/redirect.out" + outputproperty="redirect7.out"> + <arg value="-f" /> + <fileset refid="xyz" /> + </apply> + + <au:assertTrue> + <and> + <equals arg1="${redirect7.out}" arg2="blah y z" /> + <resourcesmatch astext="true"> + <file file="${output}/redirect.out" /> + <string value="x y blah" /> + </resourcesmatch> + </and> + </au:assertTrue> + <assertEmptyFile file="${output}/redirect.err" /> + </target> + + <target name="testRedirector1" description="fail" + depends="xyz" if="test.can.run"> + <au:expectfailure + expectedmessage="cannot have > 1 nested <redirector>s"> + <apply executable="sh"> + <arg value="parrot.sh" /> + <fileset refid="xyz" /> + <redirector output="${output}/redirector.out" /> + <redirector output="${output}/whocares" /> + </apply> + </au:expectfailure> + </target> + + <target name="testRedirector2" depends="xyz" if="test.can.run"> + <apply executable="sh"> + <arg value="parrot.sh" /> + <fileset refid="xyz" /> + <redirector output="${output}/redirector.out" append="true" /> + </apply> + <au:assertTrue> + <resourcecount count="1"> + <restrict id="results"> + <file file="${output}/redirector.out" /> + <and xmlns="antlib:org.apache.tools.ant.types.resources.selectors"> + <contains text="${x} out" /> + <contains text="${y} out" /> + <contains text="${z} out" /> + <contains text="${x} err" /> + <contains text="${y} err" /> + <contains text="${z} err" /> + </and> + </restrict> + </resourcecount> + </au:assertTrue> + </target> + + <target name="testRedirector3" depends="xyz" if="test.can.run"> + <apply executable="sh"> + <arg value="parrot.sh" /> + <fileset refid="xyz" /> + <redirector append="true" + output="${output}/redirector.out" + error="${output}/redirector.err" /> + </apply> + <au:assertTrue> + <and> + <resourcesmatch astext="true"> + <string value="${x} out${eol}${y} out${eol}${z} out" /> + <file file="${output}/redirector.out" /> + </resourcesmatch> + <resourcesmatch astext="true"> + <string value="${x} err${eol}${y} err${eol}${z} err" /> + <file file="${output}/redirector.err" /> + </resourcesmatch> + </and> + </au:assertTrue> + </target> + + <target name="testRedirector4" depends="xyz" if="test.can.run"> + <apply executable="sh"> + <arg value="parrot.sh" /> + <fileset refid="xyz" /> + <redirector output="${output}/redirector.out" logerror="true" + append="true" outputproperty="redirector4.out" /> + </apply> + + <au:assertTrue> + <resourcesmatch astext="true"> + <string value="${x} out${eol}${y} out${eol}${z} out" /> + <file file="${output}/redirector.out" /> + <propertyresource name="redirector4.out" /> + </resourcesmatch> + </au:assertTrue> + + <au:assertLogContains text="${x} err" /> + <au:assertLogContains text="${y} err" /> + <au:assertLogContains text="${z} err" /> + </target> + + <target name="testRedirector5" depends="xyz" if="test.can.run"> + <apply executable="sh"> + <redirector error="${output}/redirector.err" + errorproperty="redirector5.err" + output="${output}/redirector.out" + outputproperty="redirector5.out" + append="true" /> + <arg value="parrot.sh" /> + <fileset refid="xyz" /> + </apply> + <au:assertTrue> + <and> + <resourcesmatch astext="true"> + <string value="${x} out${eol}${y} out${eol}${z} out" /> + <file file="${output}/redirector.out" /> + <propertyresource name="redirector5.out" /> + </resourcesmatch> + <resourcesmatch astext="true"> + <string value="${x} err${eol}${y} err${eol}${z} err" /> + <file file="${output}/redirector.err" /> + <propertyresource name="redirector5.err" /> + </resourcesmatch> + </and> + </au:assertTrue> + </target> + + <target name="testRedirector6" depends="xyz" if="test.can.run"> + <apply executable="sh"> + <redirector append="true" outputproperty="redirector6.out" + errorproperty="redirector6.err"> + <outputmapper type="merge" to="${output}/redirector.out" /> + <errormapper type="merge" to="${output}/redirector.err" /> + </redirector> + <arg value="parrot.sh" /> + <filelist refid="xyzlist" /> + </apply> + + <au:assertTrue> + <and> + <resourcesmatch astext="true"> + <string value="${x} out${eol}${y} out${eol}${z} out" /> + <file file="${output}/redirector.out" /> + <propertyresource name="redirector6.out" /> + </resourcesmatch> + <resourcesmatch astext="true"> + <string value="${x} err${eol}${y} err${eol}${z} err" /> + <file file="${output}/redirector.err" /> + <propertyresource name="redirector6.err" /> + </resourcesmatch> + </and> + </au:assertTrue> + </target> + + <target name="testRedirector7" depends="xyz" if="test.can.run"> + <apply executable="sh"> + <redirector append="true" outputproperty="redirector7.out" + errorproperty="redirector7.err"> + <outputmapper type="merge" to="${output}/redirector.out" /> + <errormapper type="merge" to="${output}/redirector.err" /> + <errorfilterchain> + <replacestring from="err" to="ERROR!!!" /> + </errorfilterchain> + </redirector> + <arg value="parrot.sh" /> + <fileset refid="xyz" /> + </apply> + + <au:assertTrue> + <and> + <resourcesmatch astext="true"> + <string value="${x} out${eol}${y} out${eol}${z} out" /> + <file file="${output}/redirector.out" /> + <propertyresource name="redirector7.out" /> + </resourcesmatch> + <resourcesmatch astext="true"> + <string value="${x} ERROR!!!${eol}${y} ERROR!!!${eol}${z} ERROR!!!" /> + <file file="${output}/redirector.err" /> + <propertyresource name="redirector7.err" /> + </resourcesmatch> + </and> + </au:assertTrue> + </target> + + <target name="testRedirector8" depends="xyz" if="sed.can.run"> + <echo file="${input}/redirector.in">x y z${eol}</echo> + <apply executable="sed"> + <redirector append="true" outputproperty="redirector8.out" + errorproperty="redirector8.err"> + <inputmapper type="merge" to="${input}/redirector.in" /> + <outputmapper type="merge" to="${output}/redirector.out" /> + <errormapper type="merge" to="${output}/redirector.err" /> + </redirector> + <arg value="-f" /> + <fileset refid="xyz" /> + </apply> + + <au:assertTrue> + <and> + <resourcesmatch astext="true"> + <propertyresource name="redirector8.out" /> + <string value="blah y z${eol}x blah z${eol}x y blah" /> + <file file="${output}/redirector.out" /> + </resourcesmatch> + <equals arg1="${redirector8.err}" arg2="" /> + </and> + </au:assertTrue> + <assertEmptyFile file="${output}/redirector.err" /> + </target> + + <macrodef name="valRor9-12"> + <attribute name="n" /> + <sequential> + <au:assertTrue> + <and> + <equals arg1="" arg2="${redirector@{n}.err}" /> + <resourcesmatch astext="true"> + <string value="blah after y after z${eol}x after blah after z${eol}x after y after blah" /> + <propertyresource name="redirector@{n}.out" /> + <file file="${output}/redirector.out" /> + </resourcesmatch> + </and> + </au:assertTrue> + <assertEmptyFile file="${output}/redirector.err" /> + </sequential> + </macrodef> + + <target name="testRedirector9" depends="xyz" if="sed.can.run"> + <echo file="${input}/redirector.in">x before y before z${eol}</echo> + <apply executable="sed"> + <redirector outputproperty="redirector9.out" + errorproperty="redirector9.err" append="true"> + <inputfilterchain> + <replacestring from="before" to="after" /> + </inputfilterchain> + <inputmapper type="merge" to="${input}/redirector.in" /> + <outputmapper type="merge" to="${output}/redirector.out" /> + <errormapper type="merge" to="${output}/redirector.err" /> + </redirector> + <arg value="-f" /> + <fileset refid="xyz" /> + </apply> + + <valRor9-12 n="9" /> + </target> + + <target name="testRedirector10" depends="xyz" if="sed.can.run"> + <echo file="${input}/redirector.in">x before y before z${eol}</echo> + <apply executable="sed"> + <redirector outputproperty="redirector10.out" + errorproperty="redirector10.err" append="true"> + <outputfilterchain> + <replacestring from="before" to="after" /> + </outputfilterchain> + <outputmapper type="merge" to="${output}/redirector.out" /> + <errormapper type="merge" to="${output}/redirector.err" /> + </redirector> + <arg value="-f" /> + <srcfile /> + <arg value="${input}/redirector.in" /> + <filelist refid="xyzlist" /> + </apply> + + <valRor9-12 n="10" /> + </target> + + <target name="testRedirector11" depends="xyz" if="sed.can.run"> + <apply executable="sed"> + <redirector outputproperty="redirector11.out" + errorproperty="redirector11.err" + inputstring="x before y before z${eol}" + append="true"> + <inputfilterchain> + <replacestring from="before" to="after" /> + </inputfilterchain> + <outputmapper type="merge" to="${output}/redirector.out" /> + <errormapper type="merge" to="${output}/redirector.err" /> + </redirector> + <arg value="-f" /> + <fileset refid="xyz" /> + </apply> + + <valRor9-12 n="11" /> + </target> + + <target name="testRedirector12" depends="xyz" if="sed.can.run"> + <echo file="${input}/redirector.in">x before y before z${eol}</echo> + <apply executable="sed" output="${output}/redirector.out" + error="${output}/redirector.err"> + <redirector outputproperty="redirector12.out" + errorproperty="redirector12.err" append="true"> + <outputfilterchain> + <replacestring from="before" to="after" /> + </outputfilterchain> + <outputmapper type="glob" from="nomatch" to="nomatchout" /> + <errormapper type="glob" from="nomatch" to="nomatcherr" /> + </redirector> + <arg value="-f" /> + <srcfile /> + <arg value="${input}/redirector.in" /> + <filelist refid="xyzlist" /> + </apply> + + <valRor9-12 n="12" /> + </target> + + <target name="testRedirector13" depends="xyz" if="test.can.run"> + <apply executable="sh"> + <redirector> + <outputfilterchain> + <replacestring from="out" to="OUTPUT???" /> + </outputfilterchain> + <errorfilterchain> + <replacestring from="err" to="ERROR!!!" /> + </errorfilterchain> + </redirector> + <arg value="parrot.sh" /> + <fileset refid="xyz" /> + </apply> + + <au:assertLogContains text="${x} OUTPUT???" /> + <au:assertLogContains text="${y} OUTPUT???" /> + <au:assertLogContains text="${z} OUTPUT???" /> + <au:assertLogContains text="${x} ERROR!!!" /> + <au:assertLogContains text="${y} ERROR!!!" /> + <au:assertLogContains text="${z} ERROR!!!" /> + </target> + + <target name="testRedirector14" depends="xyz" if="sed.can.run"> + <echo file="${input}/redirector.in">z before y before x${eol}</echo> + <apply executable="sed"> + <redirector append="true" + inputstring="x before y before z${eol}"> + <outputfilterchain> + <replacestring from="before" to="after" /> + </outputfilterchain> + <inputmapper type="glob" from="x" to="${input}/redirector.in" /> + <outputmapper type="glob" from="y" to="${output}/redirector.out" /> + <errormapper type="glob" from="z" to="${output}/redirector.err" /> + </redirector> + <arg value="-f" /> + <fileset refid="xyz" /> + </apply> + + <assertEmptyFile file="${output}/redirector.err" /> + + <au:assertTrue> + <and> + <resourcesmatch astext="true"> + <string value="x after blah after z" /> + <file file="${output}/redirector.out" /> + </resourcesmatch> + </and> + </au:assertTrue> + <au:assertLogContains text="z after y after blahx after y after blah"/> + </target> + + <target name="pad"> + <condition property="pad" value=""> + <or> + <not> + <os family="dos" /> + </not> + <not> + <or> + <equals arg1="${ant.java.version}" arg2="1.1" /> + <equals arg1="${ant.java.version}" arg2="1.2" /> + </or> + </not> + </or> + </condition> + + <condition property="pad" value=" "> + <and> + <os family="dos" /> + <or> + <equals arg1="${ant.java.version}" arg2="1.2" /> + </or> + </and> + </condition> + + </target> + + <target name="testIgnoreMissing" depends="xyz,pad" if="echo.can.run"> + <filelist id="xylist" dir="${input}" files="x,y" /> + <delete file="${input}/z" /> + + <pathconvert property="xy" pathsep="${pad}${eol}" refid="xylist" /> + + <pathconvert property="xyz" pathsep="${pad}${eol}" refid="xyzlist" /> + + <apply executable="echo" ignoremissing="true" + outputproperty="ignoretrue" append="true"> + <filelist refid="xyzlist" /> + </apply> + + <apply executable="echo" ignoremissing="false" + outputproperty="ignorefalse" append="true"> + <filelist refid="xyzlist" /> + </apply> + + <au:assertTrue> + <and> + <equals arg1="${xy}${pad}" arg2="${ignoretrue}" /> + <equals arg1="${xyz}${pad}" arg2="${ignorefalse}" /> + </and> + </au:assertTrue> + </target> + + <target name="testForce" depends="xyz,pad" if="echo.can.run"> + <presetdef name="ekko"> + <apply executable="echo" append="true" dest="${input}"> + <filelist refid="xyzlist" /> + <mapper type="identity" /> + </apply> + </presetdef> + + <pathconvert property="xyz" pathsep="${pad}${eol}" refid="xyzlist" /> + + <ekko outputproperty="foo" /> + <ekko outputproperty="bar" force="true" /> + + <au:assertTrue> + <and> + <equals arg1="${foo}" arg2="" /> + <equals arg1="${bar}" arg2="${xyz}" /> + </and> + </au:assertTrue> + </target> + + <target name="testNoDest" depends="xyz" if="echo.can.run"> + <presetdef name="ekko"> + <apply executable="echo" addsourcefile="false" force="true"> + <filelist dir="${input}" files="x" /> + <globmapper from="*" to="${input}/*" /> + <targetfile /> + </apply> + </presetdef> + <ekko outputproperty="dest" dest="${input}" /> + <ekko outputproperty="nodest" /> + + <au:assertFileDoesntExist file="${dest}" /> + <au:assertFileExists file="${nodest}" /> + </target> + + <target name="testLsPath" if="ls.can.run" depends="xyz"> + <apply executable="ls" parallel="false" outputproperty="lsPathOut" + force="true" dest="${input}" append="true" type="both"> + <path path="${env.PATH}" /> + <identitymapper/> + </apply> + <au:assertTrue> + <resourcecount count="1"> + <restrict> + <propertyresource name="lsPathOut" /> + <containsregexp expression="^${ls.can.run}$" + xmlns="antlib:org.apache.tools.ant.types.resources.selectors" /> + </restrict> + </resourcecount> + </au:assertTrue> + </target> + + <target name="testLsPathParallel" if="ls.can.run" depends="xyz"> + <apply executable="ls" parallel="true" outputproperty="lsPathParallelOut" + force="true" dest="${input}" append="true" type="both"> + <path path="${env.PATH}" /> + <identitymapper/> + </apply> + <au:assertTrue> + <resourcecount count="1"> + <restrict> + <propertyresource name="lsPathParallelOut" /> + <containsregexp expression="^${ls.can.run}$" + xmlns="antlib:org.apache.tools.ant.types.resources.selectors" /> + </restrict> + </resourcecount> + </au:assertTrue> + </target> + + <target name="testSrcfilePrefix" if="test.can.run" depends="xyz"> + <apply executable="sh" force="true"> + <arg value="parrot.sh" /> + <srcfile prefix="-Dfoo="/> + <fileset refid="xyz" /> + </apply> + <au:assertLogContains text="-Dfoo=${x} out" /> + <au:assertLogContains text="-Dfoo=${y} out" /> + <au:assertLogContains text="-Dfoo=${z} out" /> + </target> + + <target name="testTargetfileSuffix" if="test.can.run" depends="xyz"> + <apply executable="sh" addsourcefile="false" dest="${input}"> + <arg value="parrot.sh" /> + <targetfile suffix=",x"/> + <fileset refid="xyz" /> + <globmapper from="*" to="*.bar"/> + </apply> + <au:assertLogContains text="${x}.bar,x out" /> + <au:assertLogContains text="${y}.bar,x out" /> + <au:assertLogContains text="${z}.bar,x out" /> + </target> + + <target name="testRedirectorWithParallel" if="test.can.run" depends="xyz"> + <apply executable="sh" dest="${input}" parallel="true" addsourcefile="yes"> + <arg value="parrot.sh" /> + <targetfile/> + <fileset refid="xyz" /> + <globmapper from="*" to="*.bar"/> + <redirector output="${output}/all_out.txt" append="yes"/> + </apply> + <au:assertResourceContains resource="${output}/all_out.txt" + value="x.bar out"/> + <au:assertResourceContains resource="${output}/all_out.txt" + value="x.bar err"/> + <au:assertResourceContains resource="${output}/all_out.txt" + value="x out"/> + <au:assertResourceContains resource="${output}/all_out.txt" + value="x err"/> + <au:assertResourceContains resource="${output}/all_out.txt" + value="y.bar out"/> + <au:assertResourceContains resource="${output}/all_out.txt" + value="y.bar err"/> + <au:assertResourceContains resource="${output}/all_out.txt" + value="y out"/> + <au:assertResourceContains resource="${output}/all_out.txt" + value="y err"/> + <au:assertResourceContains resource="${output}/all_out.txt" + value="z.bar out"/> + <au:assertResourceContains resource="${output}/all_out.txt" + value="z.bar err"/> + <au:assertResourceContains resource="${output}/all_out.txt" + value="z out"/> + <au:assertResourceContains resource="${output}/all_out.txt" + value="z err"/> + </target> +</project> diff --git a/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/exec/exec-test.xml b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/exec/exec-test.xml new file mode 100644 index 00000000..25b00889 --- /dev/null +++ b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/exec/exec-test.xml @@ -0,0 +1,710 @@ +<?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 name="exec-test" default="antunit" xmlns:au="antlib:org.apache.ant.antunit"> + <import file="../../antunit-base.xml" /> + + <macrodef name="assert-trimmed-resource-content"> + <attribute name="content" /> + <attribute name="astext" default="true" /> + <element name="resource" implicit="true" /> + <sequential> + <au:assertTrue> + <resourcesmatch astext="@{astext}"> + <string value="@{content}" /> + <concat> + <resource /> + <filterchain> + <trim /> + </filterchain> + </concat> + </resourcesmatch> + </au:assertTrue> + </sequential> + </macrodef> + + <target name="setUp"> + <mkdir dir="${input}" /> + <mkdir dir="${output}" /> + <property environment="env" /> + <!-- UNIX --> + <available file="sh" filepath="${env.PATH}" property="sh.executable" /> + <!-- CYGWIN --> + <available file="sh.exe" filepath="${env.PATH}" property="sh.exe.executable" /> + <condition property="test.can.run"> + <or> + <isset property="sh.executable" /> + <isset property="sh.exe.executable" /> + </or> + </condition> + <!-- UNIX --> + <available file="wc" filepath="${env.PATH}" property="wc.executable" /> + <!-- CYGWIN --> + <available file="wc.exe" filepath="${env.PATH}" property="wc.exe.executable" /> + <condition property="wc.can.run"> + <or> + <isset property="wc.executable" /> + <isset property="wc.exe.executable" /> + </or> + </condition> + <!-- UNIX --> + <available file="cat" filepath="${env.PATH}" property="cat.executable" /> + <!-- CYGWIN --> + <available file="cat.exe" filepath="${env.PATH}" property="cat.exe.executable" /> + <condition property="cat.can.run"> + <or> + <isset property="cat.executable" /> + <isset property="cat.exe.executable" /> + </or> + </condition> + </target> + + <target name="test-no-redirect" depends="setUp" if="test.can.run"> + <exec executable="sh"> + <arg value="parrot.sh" /> + <arg value="${ant.file}" /> + </exec> + <au:assertLogContains text="${ant.file} out" /> + <au:assertLogContains text="${ant.file} err" /> + </target> + + <target name="test-redirect-output" depends="setUp" if="test.can.run"> + <exec executable="sh" output="${output}/redirect.out"> + <arg value="parrot.sh" /> + <arg value="${ant.file}" /> + </exec> + <au:assertTrue> + <resourcesmatch astext="true"> + <string>${ant.file} out${line.separator}${ant.file} err</string> + <file file="${output}/redirect.out" /> + </resourcesmatch> + </au:assertTrue> + </target> + + <target name="test-redirect-output-error" depends="setUp" if="test.can.run"> + <exec executable="sh" output="${output}/redirect.out" error="${output}/redirect.err"> + <arg value="parrot.sh" /> + <arg value="${ant.file}" /> + </exec> + <au:assertTrue> + <resourcesmatch astext="true"> + <string>${ant.file} out</string> + <file file="${output}/redirect.out" /> + </resourcesmatch> + </au:assertTrue> + <au:assertTrue> + <resourcesmatch astext="true"> + <string>${ant.file} err</string> + <file file="${output}/redirect.err" /> + </resourcesmatch> + </au:assertTrue> + </target> + + <target name="test-redirect-output-outputproperty-logerror" depends="setUp" if="test.can.run"> + <exec executable="sh" logerror="true" + output="${output}/redirect.out" outputproperty="redirect.out"> + <arg value="parrot.sh" /> + <arg value="${ant.file}" /> + </exec> + <au:assertTrue> + <resourcesmatch astext="true"> + <string>${ant.file} out</string> + <file file="${output}/redirect.out" /> + <propertyresource name="redirect.out" /> + </resourcesmatch> + </au:assertTrue> + <au:assertLogContains text="${ant.file} err" /> + </target> + + <target name="test-redirect-output-outputproperty-error-errorproperty" + depends="setUp" if="test.can.run"> + <exec executable="sh" + error="${output}/redirect.err" errorproperty="redirect.err" + output="${output}/redirect.out" outputproperty="redirect.out"> + <arg value="parrot.sh" /> + <arg value="${ant.file}" /> + </exec> + <au:assertTrue> + <resourcesmatch astext="true"> + <string>${ant.file} out</string> + <file file="${output}/redirect.out" /> + <propertyresource name="redirect.out" /> + </resourcesmatch> + </au:assertTrue> + <au:assertTrue> + <resourcesmatch astext="true"> + <string>${ant.file} err</string> + <file file="${output}/redirect.err" /> + <propertyresource name="redirect.err" /> + </resourcesmatch> + </au:assertTrue> + </target> + + <target name="test-redirect-inputstring-output-outputproperty-error-errorproperty" + depends="setUp" if="wc.can.run"> + <exec executable="wc" inputstring="x y z" + error="${output}/redirect.err" errorproperty="redirect.err" + output="${output}/redirect.out" outputproperty="redirect.out"> + <arg value="-w" /> + </exec> + <au:assertTrue> + <length length="0"> + <file file="${output}/redirect.err" /> + <propertyresource name="redirect.err" /> + </length> + </au:assertTrue> + <assert-trimmed-resource-content content="3"> + <file file="${output}/redirect.out" /> + </assert-trimmed-resource-content> + <assert-trimmed-resource-content content="3"> + <propertyresource name="redirect.out" /> + </assert-trimmed-resource-content> + </target> + + <target name="test-redirect-input-output-outputproperty-error-errorproperty" + depends="setUp" if="wc.can.run"> + <echo file="${input}/redirect.in">x y z</echo> + <exec executable="wc" input="${input}/redirect.in" + error="${output}/redirect.err" errorproperty="redirect.err" + output="${output}/redirect.out" outputproperty="redirect.out"> + <arg value="-w" /> + </exec> + <au:assertTrue> + <length length="0"> + <file file="${output}/redirect.err" /> + <propertyresource name="redirect.err" /> + </length> + </au:assertTrue> + <assert-trimmed-resource-content content="3"> + <file file="${output}/redirect.out" /> + </assert-trimmed-resource-content> + <assert-trimmed-resource-content content="3"> + <propertyresource name="redirect.out" /> + </assert-trimmed-resource-content> + </target> + + <target name="test-redirect-input-output-outputproperty-error" + depends="setUp" if="wc.can.run"> + <exec executable="wc" inputstring="x y z" + error="${output}/redirect.err" + output="${output}/redirect.out" outputproperty="redirect.out"> + <arg value="-w" /> + </exec> + <au:assertTrue> + <length length="0"> + <file file="${output}/redirect.err" /> + </length> + </au:assertTrue> + <concat> + <file file="${output}/redirect.out" /> + <propertyresource name="redirect.out" /> + </concat> + <assert-trimmed-resource-content content="3"> + <file file="${output}/redirect.out" /> + </assert-trimmed-resource-content> + <assert-trimmed-resource-content content="3"> + <propertyresource name="redirect.out" /> + </assert-trimmed-resource-content> + </target> + + <target name="test-multiple-redirectors" description="fail" + depends="setUp" if="test.can.run"> + <au:expectfailure> + <exec executable="sh"> + <arg value="parrot.sh" /> + <arg value="${ant.file}" /> + <redirector output="${output}/redirector.out" /> + <redirector output="whocares" /> + </exec> + </au:expectfailure> + </target> + + <target name="test-redirector-output" depends="setUp" if="test.can.run"> + <exec executable="sh"> + <arg value="parrot.sh" /> + <arg value="${ant.file}" /> + <redirector output="${output}/redirector.out" /> + </exec> + <au:assertTrue> + <resourcesmatch astext="true"> + <string>${ant.file} out${line.separator}${ant.file} err</string> + <file file="${output}/redirector.out" /> + </resourcesmatch> + </au:assertTrue> + </target> + + <target name="test-redirector-output-error" depends="setUp" if="test.can.run"> + <exec executable="sh"> + <arg value="parrot.sh" /> + <arg value="${ant.file}" /> + <redirector output="${output}/redirector.out" error="${output}/redirector.err" /> + </exec> + <au:assertTrue> + <resourcesmatch astext="true"> + <string>${ant.file} out</string> + <file file="${output}/redirector.out" /> + </resourcesmatch> + </au:assertTrue> + <au:assertTrue> + <resourcesmatch astext="true"> + <string>${ant.file} err</string> + <file file="${output}/redirector.err" /> + </resourcesmatch> + </au:assertTrue> + </target> + + <target name="test-redirector-output-outputproperty-logerror" depends="setUp" if="test.can.run"> + <exec executable="sh"> + <arg value="parrot.sh" /> + <arg value="${ant.file}" /> + <redirector output="${output}/redirector.out" logerror="true" + outputproperty="redirector.out" /> + </exec> + <au:assertTrue> + <resourcesmatch astext="true"> + <string>${ant.file} out</string> + <file file="${output}/redirector.out" /> + <propertyresource name="redirector.out" /> + </resourcesmatch> + </au:assertTrue> + <au:assertLogContains text="${ant.file} err" /> + </target> + + <target name="test-redirector-output-outputproperty-error-errorproperty" + depends="setUp" if="test.can.run"> + <exec executable="sh"> + <redirector error="${output}/redirector.err" errorproperty="redirector.err" + output="${output}/redirector.out" outputproperty="redirector.out" /> + <arg value="parrot.sh" /> + <arg value="${ant.file}" /> + </exec> + <au:assertTrue> + <resourcesmatch astext="true"> + <string>${ant.file} out</string> + <file file="${output}/redirector.out" /> + <propertyresource name="redirector.out" /> + </resourcesmatch> + </au:assertTrue> + <au:assertTrue> + <resourcesmatch astext="true"> + <string>${ant.file} err</string> + <file file="${output}/redirector.err" /> + <propertyresource name="redirector.err" /> + </resourcesmatch> + </au:assertTrue> + </target> + + <target name="test-redirector-outputproperty-errorproperty-outputmapper-errormapper" + depends="setUp" if="test.can.run"> + <exec executable="sh"> + <redirector outputproperty="redirector.out" + errorproperty="redirector.err"> + <outputmapper type="merge" to="${output}/redirector.out" /> + <errormapper type="merge" to="${output}/redirector.err" /> + </redirector> + <arg value="parrot.sh" /> + <arg value="${ant.file}" /> + </exec> + <au:assertTrue> + <resourcesmatch astext="true"> + <string>${ant.file} out</string> + <file file="${output}/redirector.out" /> + <propertyresource name="redirector.out" /> + </resourcesmatch> + </au:assertTrue> + <au:assertTrue> + <resourcesmatch astext="true"> + <string>${ant.file} err</string> + <file file="${output}/redirector.err" /> + <propertyresource name="redirector.err" /> + </resourcesmatch> + </au:assertTrue> + </target> + + <target name="test-redirector-outputproperty-errorproperty-outputmapper-errormapper-errorfilterchain" + depends="setUp" if="test.can.run"> + <exec executable="sh"> + <redirector outputproperty="redirector.out" + errorproperty="redirector.err"> + <outputmapper type="merge" to="${output}/redirector.out" /> + <errormapper type="merge" to="${output}/redirector.err" /> + <errorfilterchain> + <replacestring from="err" to="ERROR!!!" /> + </errorfilterchain> + </redirector> + <arg value="parrot.sh" /> + <arg value="${ant.file}" /> + </exec> + <au:assertTrue> + <resourcesmatch astext="true"> + <string>${ant.file} out</string> + <file file="${output}/redirector.out" /> + <propertyresource name="redirector.out" /> + </resourcesmatch> + </au:assertTrue> + <au:assertTrue> + <resourcesmatch astext="true"> + <string>${ant.file} ERROR!!!</string> + <file file="${output}/redirector.err" /> + <propertyresource name="redirector.err" /> + </resourcesmatch> + </au:assertTrue> + </target> + + <target name="test-redirector-outputproperty-errorproperty-inputmapper-outputmapper-errormapper" + depends="setUp" if="wc.can.run"> + <echo file="${input}/redirector.in">x y z</echo> + <exec executable="wc"> + <redirector outputproperty="redirector.out" + errorproperty="redirector.err"> + <inputmapper type="merge" to="${input}/redirector.in" /> + <outputmapper type="merge" to="${output}/redirector.out" /> + <errormapper type="merge" to="${output}/redirector.err" /> + </redirector> + <arg value="-w" /> + </exec> + <assert-trimmed-resource-content content="3"> + <file file="${output}/redirector.out" /> + </assert-trimmed-resource-content> + <assert-trimmed-resource-content content="3"> + <propertyresource name="redirector.out" /> + </assert-trimmed-resource-content> + <au:assertTrue> + <length length="0"> + <file file="${output}/redirector.err" /> + <propertyresource name="redirector.err" /> + </length> + </au:assertTrue> + </target> + + <target name="test-redirector-outputproperty-errorproperty-inputfilterchain-inputmapper-outputmapper-errormapper" + depends="setUp" if="cat.can.run"> + <echo file="${input}/redirector.in">blah before blah</echo> + <exec executable="cat"> + <redirector outputproperty="redirector.out" + errorproperty="redirector.err"> + <inputfilterchain> + <replacestring from="before" to="after" /> + </inputfilterchain> + <inputmapper type="merge" to="${input}/redirector.in" /> + <outputmapper type="merge" to="${output}/redirector.out" /> + <errormapper type="merge" to="${output}/redirector.err" /> + </redirector> + </exec> + <au:assertTrue> + <resourcesmatch astext="true"> + <string value="blah after blah" /> + <file file="${output}/redirector.out" /> + <propertyresource name="redirector.out" /> + </resourcesmatch> + </au:assertTrue> + <au:assertTrue> + <length length="0"> + <file file="${output}/redirector.err" /> + <propertyresource name="redirector.err" /> + </length> + </au:assertTrue> + </target> + + <target name="test-redirector-outputproperty-errorproperty-outputfilterchain-outputmapper-errormapper" + depends="setUp" if="cat.can.run"> + <echo file="${input}/redirector.in">blah before blah</echo> + <exec executable="cat"> + <redirector outputproperty="redirector.out" + errorproperty="redirector.err"> + <outputfilterchain> + <replacestring from="before" to="after" /> + </outputfilterchain> + <outputmapper type="merge" to="${output}/redirector.out" /> + <errormapper type="merge" to="${output}/redirector.err" /> + </redirector> + <arg value="${input}/redirector.in" /> + </exec> + <au:assertTrue> + <resourcesmatch astext="true"> + <string value="blah after blah" /> + <file file="${output}/redirector.out" /> + <propertyresource name="redirector.out" /> + </resourcesmatch> + </au:assertTrue> + <au:assertTrue> + <length length="0"> + <file file="${output}/redirector.err" /> + <propertyresource name="redirector.err" /> + </length> + </au:assertTrue> + </target> + + <target name="test-redirector-outputproperty-errorproperty-inputstring-inputfilterchain-outputmapper-errormapper" + depends="setUp" if="cat.can.run"> + <exec executable="cat"> + <redirector outputproperty="redirector.out" + errorproperty="redirector.err" + inputstring="blah before blah"> + <inputfilterchain> + <replacestring from="before" to="after" /> + </inputfilterchain> + <outputmapper type="merge" to="${output}/redirector.out" /> + <errormapper type="merge" to="${output}/redirector.err" /> + </redirector> + </exec> + <au:assertTrue> + <resourcesmatch astext="true"> + <string value="blah after blah" /> + <file file="${output}/redirector.out" /> + <propertyresource name="redirector.out" /> + </resourcesmatch> + </au:assertTrue> + <au:assertTrue> + <length length="0"> + <file file="${output}/redirector.err" /> + <propertyresource name="redirector.err" /> + </length> + </au:assertTrue> + </target> + + <target name="test-redirect-output-error-redirector-outputproperty-errorproperty-outputfilterchain-invalid-outputmapper-invalid-errormapper" + depends="setUp" if="cat.can.run"> + <echo file="${input}/redirector.in">blah before blah</echo> + <exec executable="cat" output="${output}/redirector.out" error="${output}/redirector.err"> + <redirector outputproperty="redirector.out" + errorproperty="redirector.err"> + <outputfilterchain> + <replacestring from="before" to="after" /> + </outputfilterchain> + <outputmapper type="glob" from="nomatch" to="${output}/nomatchout" /> + <errormapper type="glob" from="nomatch" to="${output}/nomatcherr" /> + </redirector> + <arg value="${input}/redirector.in" /> + </exec> + <au:assertTrue> + <resourcesmatch astext="true"> + <string value="blah after blah" /> + <file file="${output}/redirector.out" /> + <propertyresource name="redirector.out" /> + </resourcesmatch> + </au:assertTrue> + <au:assertTrue> + <length length="0"> + <file file="${output}/redirector.err" /> + <propertyresource name="redirector.err" /> + </length> + </au:assertTrue> + <au:assertTrue> + <resourcecount count="0"> + <fileset dir="${output}" includes="nomatch???" /> + </resourcecount> + </au:assertTrue> + </target> + + <target name="test-redirector-outputfilterchain-errorfilterchain" + depends="setUp" if="test.can.run"> + <exec executable="sh"> + <redirector> + <outputfilterchain> + <replacestring from="out" to="OUTPUT???" /> + </outputfilterchain> + <errorfilterchain> + <replacestring from="err" to="ERROR!!!" /> + </errorfilterchain> + </redirector> + <arg value="parrot.sh" /> + <arg value="${ant.file}" /> + </exec> + <au:assertLogContains text="${ant.file} OUTPUT???" /> + <au:assertLogContains text="${ant.file} ERROR!!!" /> + </target> + + <target name="test-redirector-inputstring-outputfilterchain-outputmapper-errormapper" + depends="setUp" if="cat.can.run"> + <exec executable="cat"> + <redirector inputstring="blah before blah"> + <outputfilterchain> + <replacestring from="before" to="after" /> + </outputfilterchain> + <outputmapper type="glob" from="nomatch" to="nomatchout" /> + <errormapper type="glob" from="nomatch" to="nomatcherr" /> + </redirector> + </exec> + <au:assertLogContains text="blah after blah" /> + </target> + + <target name="test-redirector-input-output-inputencoding-outputencoding" + depends="setUp" if="cat.can.run"> + <exec executable="cat"> + <redirector input="input/iso8859-1" output="${output}/redirector.out" + inputencoding="ISO8859_1" outputencoding="UTF8" /> + </exec> + <au:assertTrue> + <resourcesmatch astext="true"> + <file file="${output}/redirector.out" /> + <file file="expected/utf-8" /> + </resourcesmatch> + </au:assertTrue> + </target> + + <target name="test-redirector-inputstring-output-error" depends="setUp" if="test.can.run"> + <exec executable="sh"> + <redirector inputstring="exit" + output="${output}/redirector.out" error="${output}/redirector.err" /> + </exec> + <au:assertTrue> + <and> + <available file="${output}/redirector.out" type="file" /> + <available file="${output}/redirector.err" type="file" /> + </and> + </au:assertTrue> + </target> + + <target name="test-redirector-inputstring-nocreateempty-output-error" + depends="setUp" if="test.can.run"> + <exec executable="sh"> + <redirector inputstring="exit" createemptyfiles="false" + output="${output}/redirector.out" error="${output}/redirector.err" /> + </exec> + <au:assertTrue> + <not> + <or> + <available file="${output}/redirector.out" type="file" /> + <available file="${output}/redirector.err" type="file" /> + </or> + </not> + </au:assertTrue> + </target> + + <target name="test-redirector-alwayslog-outputproperty" depends="setUp" if="test.can.run"> + <exec executable="sh"> + <arg value="parrot.sh" /> + <arg value="${ant.file}" /> + <redirector alwayslog="true" logerror="true" + outputproperty="redirector.out" /> + </exec> + <au:assertTrue> + <equals arg1="${ant.file} out" arg2="${redirector.out}" /> + </au:assertTrue> + <au:assertLogContains text="${ant.file} out" /> + </target> + + <!-- test will succeed as the OS wont match--> + <target name="testExecUnknownOS"> + <exec executable="nonexistent-program-we-expect" + failonerror="true" + os="ZX81"> + </exec> + </target> + + <target name="testExecOSFamily"> + <exec executable="uptime" + failonerror="true" + osFamily="unix"> + </exec> + <exec executable="cmd.exe" + failonerror="true" + osFamily="winnt"> + <arg value="/c" /> + <arg value="time /t" /> + </exec> + </target> + + <target name="testExecInconsistentSettings"> + <exec executable="nonexistent-program-we-expect" + failonerror="true" + osFamily="WIN9X" + os="linux unix"> + </exec> + </target> + + <target name="testDoesntWaitForChildren" + description="https://issues.apache.org/bugzilla/show_bug.cgi?id=5003"> + <condition property="java" + value="${java.home}/bin/java.exe" + else="${java.home}/bin/java"> + <os family="dos"/> + </condition> + <mkdir dir="${input}/org/example"/> + <pathconvert dirsep="/" property="out"> + <path location="${output}"/> + </pathconvert> + <pathconvert dirsep="/" property="javaP"> + <path location="${java}"/> + </pathconvert> + <echo file="${input}/org/example/CallHello.java"><![CDATA[ +package org.example; +public class CallHello { + public static void main(String[] args) + throws Exception { + String[] cmd = new String[] { + "${javaP}", "-cp", "${out}", "org.example.Hello" + }; + Runtime.getRuntime().exec(cmd); + Thread.sleep(1 * 1000); + System.out.println("finished"); + } +}]]></echo> + <echo file="${input}/org/example/Hello.java"><![CDATA[ +package org.example; +public class Hello { + public static void main(String[] args) + throws Exception { + for (int i = 0; i < 20; ++i) { + System.out.println("Hello " + i); + System.out.flush(); + Thread.sleep(1 * 1000); + } + } +}]]></echo> + <mkdir dir="${output}"/> + <javac srcdir="${input}" destdir="${output}"/> + <exec executable="${java}" failonerror="true"> + <arg value="-cp"/> + <arg value="${output}"/> + <arg value="org.example.CallHello"/> + </exec> + <au:assertLogContains text="finished"/> + <au:assertLogDoesntContain text="Hello 20"/> + </target> + + <target name="test-output-is-split-into-lines" if="cat.can.run" depends="setUp"> + <echo file="${input}/redirector.in">1
2
3</echo> + <echo file="${output}/expected">1${line.separator}2${line.separator}3</echo> + <exec executable="cat"> + <redirector output="${output}/redirector.out" + input="${input}/redirector.in"/> + </exec> + <au:assertTrue> + <resourcesmatch astext="true"> + <file file="${output}/redirector.out" /> + <file file="${output}/expected" /> + </resourcesmatch> + </au:assertTrue> + </target> + + <target name="test-binary-output-is-not-split-into-lines" if="cat.can.run" depends="setUp"> + <echo file="${input}/redirector.in">1
2
3</echo> + <exec executable="cat"> + <redirector output="${output}/redirector.out" binaryOutput="true" + input="${input}/redirector.in"/> + </exec> + <au:assertTrue> + <resourcesmatch astext="true"> + <file file="${output}/redirector.out" /> + <file file="${input}/redirector.in" /> + </resourcesmatch> + </au:assertTrue> + </target> + +</project> diff --git a/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/exec/expected/utf-8 b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/exec/expected/utf-8 new file mode 100644 index 00000000..c1949bc1 --- /dev/null +++ b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/exec/expected/utf-8 @@ -0,0 +1 @@ +äöüÄÖÜß diff --git a/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/exec/input/iso8859-1 b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/exec/input/iso8859-1 new file mode 100644 index 00000000..09044014 --- /dev/null +++ b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/exec/input/iso8859-1 @@ -0,0 +1 @@ +äöüÄÖÜß diff --git a/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/exec/parrot.sh b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/exec/parrot.sh new file mode 100644 index 00000000..2467f23a --- /dev/null +++ b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/exec/parrot.sh @@ -0,0 +1,19 @@ +# 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. +for arg in "$@" ; do + echo $arg out + sleep 1 + echo $arg err>&2 +done diff --git a/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/fail-test.xml b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/fail-test.xml new file mode 100644 index 00000000..d525b731 --- /dev/null +++ b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/fail-test.xml @@ -0,0 +1,59 @@ +<?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 name="echo-test" default="antunit" + xmlns:au="antlib:org.apache.ant.antunit"> + <import file="../antunit-base.xml" /> + + <target name="testIfNotSet"> + <au:expectfailure> + <fail unless="${if}"/> + </au:expectfailure> + <fail if="${if}"/> + </target> + + <target name="testIfSet"> + <property name="if" value="whatever"/> + <au:expectfailure> + <fail unless="${if}"/> + </au:expectfailure> + <fail if="${if}"/> + + <fail unless="if"/> + <au:expectfailure> + <fail if="if"/> + </au:expectfailure> + </target> + + <target name="testIfTrue"> + <property name="if" value="true"/> + <fail unless="${if}"/> + <au:expectfailure> + <fail if="${if}"/> + </au:expectfailure> + </target> + + <target name="testIfFalse"> + <property name="if" value="false"/> + <au:expectfailure> + <fail unless="${if}"/> + </au:expectfailure> + <fail if="${if}"/> + </target> + +</project> diff --git a/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/get-test.xml b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/get-test.xml new file mode 100644 index 00000000..0bca337c --- /dev/null +++ b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/get-test.xml @@ -0,0 +1,125 @@ +<?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 name="get-test" default="antunit" xmlns:au="antlib:org.apache.ant.antunit"> + <import file="../antunit-base.xml" /> + + <property name="location" value="http://ant.apache.org/webtest/gettest" /> + + <target name="setUp"> + <mkdir dir="${output}" /> + </target> + + <target name="testSeeOtherRedirect"> + <get src="${location}/other.txt" dest="${output}/other.tmp"/> + <au:assertTrue> + <resourcecount count="1"> + <restrict> + <file file="${output}/other.tmp" /> + <contains text="seeother redirect succeeded" /> + </restrict> + </resourcecount> + </au:assertTrue> + <au:assertLogContains text="other.txt moved to http" /> + </target> + + <target name="testPermanentRedirect"> + <get src="${location}/permanent.txt" dest="${output}/permanent.tmp"/> + <au:assertTrue> + <resourcecount count="1"> + <restrict> + <file file="${output}/permanent.tmp" /> + <contains text="permanent redirect succeeded" /> + </restrict> + </resourcecount> + </au:assertTrue> + <au:assertLogContains text="permanent.txt permanently moved to http" /> + </target> + + <target name="testTemporaryRedirect"> + <get src="${location}/temp.txt" dest="${output}/temp.txt"/> + <au:assertTrue> + <resourcecount count="1"> + <restrict> + <file file="${output}/temp.txt" /> + <contains text="temporary redirect succeeded" /> + </restrict> + </resourcecount> + </au:assertTrue> + <au:assertLogContains text="temp.txt moved to http" /> + </target> + + <target name="testStatusCode307Redirect"> + <get src="${location}/307.txt" dest="${output}/307.txt"/> + <au:assertTrue> + <resourcecount count="1"> + <restrict> + <file file="${output}/307.txt" /> + <contains text="307 status code redirect succeeded" /> + </restrict> + </resourcecount> + </au:assertTrue> + <au:assertLogContains text="307.txt moved to http" /> + </target> + + <target name="test5LevelsOfRedirect"> + <get src="${location}/redir5.txt" dest="${output}/redir5.tmp"/> + <au:assertTrue> + <resourcecount count="1"> + <restrict> + <file file="${output}/redir5.tmp" /> + <contains text="5 levels of redirect succeeded" /> + </restrict> + </resourcecount> + </au:assertTrue> + + <au:assertLogContains text="redir5.txt moved to http" /> + + <au:assertLogContains text="redir5-4.txt moved to http" /> + </target> + + + <target name="testInfiniteRedirect"> + <au:expectfailure expectedmessage="More than 25 times redirected, giving up"> + <get src="${location}/infinite.txt" dest="${output}/infinite.tmp"/> + </au:expectfailure> + </target> + + + <target name="testNestedResources"> + <get dest="${output}/downloads"> + <url url="http://ant.apache.org/index.html"/> + <url url="http://ant.apache.org/faq.html"/> + </get> + <au:assertFileExists file="${output}/downloads/index.html"/> + <au:assertFileExists file="${output}/downloads/faq.html"/> + </target> + + <target name="XtestRelativeRedirect"> + <get src="${location}/local.cgi" dest="${output}/other.tmp"/> + <au:assertTrue> + <resourcecount count="1"> + <restrict> + <file file="${output}/other.tmp" /> + <contains text="local redirect succeeded"/> + </restrict> + </resourcecount> + </au:assertTrue> + <au:assertLogContains text="local.cgi moved to http" /> + </target> +</project> diff --git a/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/gzip-test.xml b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/gzip-test.xml new file mode 100644 index 00000000..38f0a7a6 --- /dev/null +++ b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/gzip-test.xml @@ -0,0 +1,46 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- + 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"> + + <!-- note relies on antunit 1.1 --> + <import file="../antunit-base.xml" /> + + <target name="setUp"> + <mkdir dir="${output}" /> + <mkdir dir="${output}/empty" /> + <touch file="${output}/fileone" /> + <touch file="${output}/filetwo" /> + </target> + + <target name="testFailNone"> + <au:expectfailure expectedmessage="No resource selected, gzip needs exactly one resource." message="Should have thrown an exception"> + <gzip destfile="${output}/file.gz"> + <fileset dir="${output}/empty" /> + </gzip> + </au:expectfailure> + </target> + + <target name="testFailTwo"> + <au:expectfailure expectedmessage="gzip cannot handle multiple resources at once. (2 resources were selected.)" message="Should have thrown an exception"> + <gzip destfile="${output}/file.gz"> + <fileset dir="${output}" /> + </gzip> + </au:expectfailure> + </target> + +</project> diff --git a/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/hostinfo-test.xml b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/hostinfo-test.xml new file mode 100644 index 00000000..a044b9b1 --- /dev/null +++ b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/hostinfo-test.xml @@ -0,0 +1,64 @@ +<?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 name="hostinfo-test" default="antunit" + xmlns:au="antlib:org.apache.ant.antunit"> + + <import file="../antunit-base.xml" /> + + <property name="undef-name" value="nonexistenthost.nonexistentdomain" /> + <property name="undef-hostname" value="nonexistenthost" /> + <property name="undef-domainname" value="nonexistentdomain" /> + + <property name="undef-ip4" value="0.0.0.0" /> + <property name="undef-ip6" value="::" /> + + <property name="xs4all-hostname" value="www.xs4all.nl" /> + <property name="xs4all-domain" value="xs4all.nl" /> + <property name="xs4all-realhost" value="www" /> + <property name="xs4all-ip4" value="194.109.6.92" /> + + <target name="setUp"> + </target> + + <target name="testLocal" depends="setUp"> + <hostinfo prefix="local" /> + <!-- Do not know what to expect here, machine dependent --> + </target> + + <target name="testForward" depends="setUp"> + <hostinfo host="${xs4all-hostname}"/> + <au:assertEquals expected="${xs4all-realhost}" actual="${NAME}"/> + <au:assertEquals expected="${xs4all-domain}" actual="${DOMAIN}"/> + <au:assertEquals expected="${xs4all-ip4}" actual="${ADDR4}"/> + </target> + + <target name="testReverse" depends="setUp"> + <hostinfo prefix="reverse" host="${xs4all-ip4}"/> + <au:assertEquals expected="${xs4all-realhost}" actual="${reverse.NAME}"/> + <au:assertEquals expected="${xs4all-domain}" actual="${reverse.DOMAIN}"/> + <au:assertEquals expected="${xs4all-ip4}" actual="${reverse.ADDR4}"/> + </target> + + <target name="testUndef" depends="setUp"> + <hostinfo prefix="undef" host="${undef-name}"/> + <au:assertEquals expected="${undef-hostname}" actual="${undef.NAME}"/> + <au:assertEquals expected="${undef-domainname}" actual="${undef.DOMAIN}"/> + <au:assertEquals expected="${undef-ip4}" actual="${undef.ADDR4}"/> + </target> + +</project> diff --git a/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/import-test.xml b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/import-test.xml new file mode 100644 index 00000000..f9e4b055 --- /dev/null +++ b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/import-test.xml @@ -0,0 +1,55 @@ +<?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" /> + + <import> + <file file="importtests/a.xml"/> + </import> + <import file="importtests/b.xml" as="c"/> + + <target name="testNoExplicitPrefix" depends="a.a"> + <au:assertEquals expected="bar" actual="${foo}"/> + </target> + + <target name="testExplicitPrefix" depends="c.b"> + <au:assertEquals expected="baz" actual="${foo}"/> + </target> + + <target name="testNoExplicitPrefixUsedWithoutPrefix" depends="a"> + <au:assertEquals expected="bar" actual="${foo}"/> + </target> + + <target name="testExplicitPrefixUsedWithoutPrefix" depends="b"> + <au:assertEquals expected="baz" actual="${foo}"/> + </target> + + <import> + <javaresource name="override.xml"> + <classpath location="importtests"/> + </javaresource> + </import> + + <target name="setProperty"> + <property name="prop" value="in including/importing"/> + </target> + + <target name="testOverride" depends="override.dummy"> + <au:assertEquals expected="in including/importing" actual="${prop}"/> + </target> +</project> diff --git a/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/import-url-test.xml b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/import-url-test.xml new file mode 100644 index 00000000..103ece3e --- /dev/null +++ b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/import-url-test.xml @@ -0,0 +1,101 @@ +<?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" /> + + <mkdir dir="${output}"/> + <mkdir dir="${input}/a/b"/> + <mkdir dir="${input}/a/c"/> + <echo file="${input}/a/b/outer.xml"><![CDATA[ +<project name="outer"> + <import file="../c/inner.xml"/> +</project> +]]></echo> + <echo file="${input}/a/c/inner.xml"><![CDATA[ +<project name="inner"> + <target name="foo"> + <echo>In inner</echo> + <echo>ant.file.inner is ${ant.file.inner}</echo> + <echo>type is ${ant.file.type.inner}</echo> + <loadproperties> + <url baseUrl="${ant.file.inner}" relativePath="test.properties"/> + </loadproperties> + <echo>foo is ${foo}</echo> + </target> +</project>]]></echo> + <echo file="${input}/a/c/test.properties"><![CDATA[ +foo=bar +]]></echo> + <echo file="${input}/a/b/external-import.xml"><![CDATA[ +<project name="external-import"> + <import file="${output}/imported.xml"/> +</project> +]]></echo> + <echo file="${output}/imported.xml"><![CDATA[ +<project name="imported"> + <target name="bar"> + <echo>In imported</echo> + </target> +</project> +]]></echo> + <jar destfile="${test.jar}"> + <fileset dir="${input}"/> + </jar> + <delete dir="${input}"/> + + <import> + <javaresource name="a/b/outer.xml"> + <classpath location="${test.jar}"/> + </javaresource> + </import> + <import> + <javaresource name="a/b/outer.xml"> + <classpath location="${test.jar}"/> + </javaresource> + </import> + <import> + <javaresource name="a/b/external-import.xml"> + <classpath location="${test.jar}"/> + </javaresource> + </import> + + <target name="testImportOfNestedFile" depends="foo"> + <au:assertLogContains text="In inner"/> + <au:assertLogContains text="type is url"/> + <au:assertLogContains text="foo is bar"/> + </target> + + <target name="testImportOfNestedFileWithAbsolutePath" depends="bar" + description="https://issues.apache.org/bugzilla/show_bug.cgi?id=50953"> + <au:assertLogContains text="In imported"/> + </target> + + <target name="tearDown"> + <taskdef name="close" + classname="org.apache.tools.ant.taskdefs.CloseResources"/> + <close> + <javaresource name="a/b/outer.xml"> + <classpath location="${test.jar}"/> + </javaresource> + </close> + <delete file="${test.jar}" quiet="true" deleteonexit="true"/> + <!-- Calling antunit-base.tearDown sometimes causes ISEs in <import> in Ant-Build-Matrix: --> + <delete dir="${input}"/> + <delete dir="${output}"/> + </target> +</project> diff --git a/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/importtests/a.xml b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/importtests/a.xml new file mode 100644 index 00000000..6082990f --- /dev/null +++ b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/importtests/a.xml @@ -0,0 +1,23 @@ +<?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 name="a"> + <target name="a"> + <property name="foo" value="bar"/> + </target> +</project> + diff --git a/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/importtests/b.xml b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/importtests/b.xml new file mode 100644 index 00000000..546badf5 --- /dev/null +++ b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/importtests/b.xml @@ -0,0 +1,23 @@ +<?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 name="b"> + <target name="b"> + <property name="foo" value="baz"/> + </target> +</project> + diff --git a/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/importtests/nested.xml b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/importtests/nested.xml new file mode 100644 index 00000000..28d7ad4b --- /dev/null +++ b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/importtests/nested.xml @@ -0,0 +1,21 @@ +<?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> + <include file="b.xml" as="b" prefixSeparator="::"/> + <include file="a.xml" as="a" prefixSeparator=""/> +</project> diff --git a/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/importtests/override.xml b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/importtests/override.xml new file mode 100644 index 00000000..97fd320b --- /dev/null +++ b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/importtests/override.xml @@ -0,0 +1,25 @@ +<?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 name="override"> + <target name="setProperty"> + <property name="prop" value="in included/imported"/> + </target> + + <target name="dummy" depends="setProperty"/> +</project> + diff --git a/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/importtests/w.xml b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/importtests/w.xml new file mode 100644 index 00000000..e400c501 --- /dev/null +++ b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/importtests/w.xml @@ -0,0 +1,22 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + 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="w"> + <echo>${ant.file.w}</echo> + <include file="x.xml"/> + <target name="ww" depends="x.xx, x.y.yy, x.y.z.zz"/> +</project> diff --git a/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/importtests/x.xml b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/importtests/x.xml new file mode 100644 index 00000000..a509e574 --- /dev/null +++ b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/importtests/x.xml @@ -0,0 +1,22 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + 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="x"> + <echo>${ant.file.x}</echo> + <include file="y.xml"/> + <target name="xx" depends="y.yy, y.z.zz"/> +</project> diff --git a/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/importtests/y.xml b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/importtests/y.xml new file mode 100644 index 00000000..0e54fa83 --- /dev/null +++ b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/importtests/y.xml @@ -0,0 +1,22 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + 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="y"> + <echo>${ant.file.y}</echo> + <include file="z.xml" as="z"/> + <target name="yy" depends="z.zz"/> +</project> diff --git a/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/importtests/z.xml b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/importtests/z.xml new file mode 100644 index 00000000..607dee7e --- /dev/null +++ b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/importtests/z.xml @@ -0,0 +1,21 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + 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="z"> + <echo>${ant.file.z}</echo> + <target name="zz"/> +</project> diff --git a/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/include-test.xml b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/include-test.xml new file mode 100644 index 00000000..7e1a4523 --- /dev/null +++ b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/include-test.xml @@ -0,0 +1,58 @@ +<?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" /> + + <include> + <file file="importtests/a.xml"/> +</include> + <include file="importtests/b.xml" as="c"/> + + <target name="testNoExplicitPrefix" depends="a.a"> + <au:assertEquals expected="bar" actual="${foo}"/> + </target> + + <target name="testExplicitPrefix" depends="c.b"> + <au:assertEquals expected="baz" actual="${foo}"/> + </target> + + <include file="importtests/override.xml"/> + + <target name="setProperty"> + <property name="prop" value="in including/importing"/> + </target> + + <target name="testNoOverride" depends="override.dummy"> + <au:assertEquals expected="in included/imported" actual="${prop}"/> + </target> + + <include as="nested"> + <javaresource name="nested.xml"> + <classpath location="importtests"/> + </javaresource> + </include> + + <!-- really only tests that the targets have the expected names by + forcing an exception if the dependencies don't exist --> + <target name="testNesting" depends="nested.b::b, nested.aa"/> + <target name="testNoExplicitPrefixNested"> + <ant target="x.y.z.zz" antfile="importtests/w.xml"/> + </target> + + +</project> diff --git a/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/jar-spi-test.xml b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/jar-spi-test.xml new file mode 100644 index 00000000..c05311aa --- /dev/null +++ b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/jar-spi-test.xml @@ -0,0 +1,149 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- + 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 xmlns:au="antlib:org.apache.ant.antunit"> + <property name="jar.dir" location="jar_spi_dir"/> + <property name="jar.src.dir" location="jar_spi_dir/src"/> + <property name="jar.src.file" location="jar_spi_dir/src/a_file"/> + + <available property="jdk1.4+" classname="java.lang.CharSequence"/> + <condition property="some.regexp.support"> + <or> + <isset property="jdk1.4+"/> + <isset property="apache.regexp.present"/> + <isset property="apache.oro.present"/> + </or> + </condition> + + <target name="init"> + <mkdir dir="${jar.src.dir}"/> + <delete quiet="yes" file="${jar.src.file}"/> + <touch file="${jar.src.file}"/> + <delete quiet="yes" file="${jar.dir}/file.jar"/> + <delete quiet="yes" dir="${jar.dir}/output"/> + </target> + + <target name="test-simple" depends="init" if="some.regexp.support"> + + <jar jarfile="${jar.dir}/file.jar"> + <fileset dir="${jar.src.dir}"/> + <service type="a.b.c" provider="a.b.c.d"/> + </jar> + + <unjar src="${jar.dir}/file.jar" + dest="${jar.dir}/output"/> + + <loadfile property="simple" + srcfile="${jar.dir}/output/META-INF/services/a.b.c" + encoding="UTF-8"/> + + <au:assertTrue> + <matches string="${simple}" pattern="^a\.b\.c\.d$"/> + </au:assertTrue> + + </target> + + <target name="test-providers" depends="init" if="some.regexp.support"> + + <jar jarfile="${jar.dir}/file.jar"> + <fileset dir="${jar.src.dir}"/> + <service type="a.b.c"> + <provider classname="a.X"/> + <provider classname="a.D"/> + </service> + </jar> + + <unjar src="${jar.dir}/file.jar" + dest="${jar.dir}/output"/> + + <loadfile property="providers" + srcfile="${jar.dir}/output/META-INF/services/a.b.c" + encoding="UTF-8"/> + <au:assertTrue> + <matches string="${providers}" pattern="^a\.X\na\.D$"/> + </au:assertTrue> + + </target> + + <target name="test-multi" depends="init" if="some.regexp.support"> + + <jar jarfile="${jar.dir}/file.jar"> + <fileset dir="${jar.src.dir}"/> + <service type="a.b.c"> + <provider classname="a.X"/> + <provider classname="a.D"/> + </service> + <service type="javax.a.service"> + <provider classname="a.O.T"/> + <provider classname="a.B"/> + </service> + </jar> + + <unjar src="${jar.dir}/file.jar" + dest="${jar.dir}/output"/> + + <loadfile property="multi-a" + srcfile="${jar.dir}/output/META-INF/services/a.b.c" + encoding="UTF-8"/> + + <au:assertTrue> + <matches string="${multi-a}" pattern="^a\.X\na\.D$"/> + </au:assertTrue> + + <loadfile property="multi-b" + srcfile="${jar.dir}/output/META-INF/services/javax.a.service" + encoding="UTF-8"/> + + <au:assertTrue> + <matches string="${multi-b}" pattern="^a\.O\.T\na\.B$"/> + </au:assertTrue> + + </target> + + <target name="test-reject-no-type" depends="init"> + <au:expectfailure> + <jar jarfile="${jar.dir}/file.jar"> + <fileset dir="${jar.src.dir}"/> + <service provider="a.X"/> + </jar> + </au:expectfailure> + </target> + + <target name="test-reject-no-provider" depends="init"> + <au:expectfailure> + <jar jarfile="${jar.dir}/file.jar"> + <fileset dir="${jar.src.dir}"/> + <service type="a.X"/> + </jar> + </au:expectfailure> + </target> + + <target name="test-reject-no-classname" depends="init"> + <au:expectfailure> + <jar jarfile="${jar.dir}/file.jar"> + <fileset dir="${jar.src.dir}"/> + <service type="a.X"> + <provider/> + </service> + </jar> + </au:expectfailure> + </target> + + <target name="tearDown"> + <delete quiet="yes" dir="${jar.dir}"/> + </target> +</project> diff --git a/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/jar-test.xml b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/jar-test.xml new file mode 100644 index 00000000..c2c8834e --- /dev/null +++ b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/jar-test.xml @@ -0,0 +1,252 @@ +<?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="testIndexOnlyUpdate"> + <mkdir dir="${output}"/> + <property name="index.jar" location="${output}/index.jar" /> + + <jar destfile="${index.jar}" index="false"> + <fileset dir="${basedir}" includes="*-test.xml" /> + </jar> + <au:assertTrue> + <resourcecount count="0"> + <restrict> + <zipentry zipfile="${index.jar}" name="META-INF/INDEX.LIST" /> + <exists /> + </restrict> + </resourcecount> + </au:assertTrue> + <jar destfile="${index.jar}" index="true" update="true"> + <fileset dir="${basedir}" includes="*-test.xml" /> + </jar> + <au:assertTrue> + <resourcecount count="1"> + <restrict> + <zipentry zipfile="${index.jar}" name="META-INF/INDEX.LIST" /> + <exists /> + </restrict> + </resourcecount> + </au:assertTrue> + </target> + + <target name="testResourcesOnly" + description="https://issues.apache.org/bugzilla/show_bug.cgi?id=47470"> + <mkdir dir="${input}"/> + <mkdir dir="${output}"/> + <touch file="${input}/foo"/> + <touch file="${output}/bar"/> + <jar destfile="${output}/foo.jar"> + <union> + <fileset dir="${input}"/> + <fileset dir="${output}" excludes="foo.jar"/> + </union> + </jar> + <au:assertLogDoesntContain text="skipping jar archive"/> + </target> + + <target name="-metainf-setup"> + <mkdir dir="${input}/services"/> + <touch file="${input}/services/foo"/> + <mkdir dir="${output}"/> + </target> + + <target name="testIndexNoMetaInf" depends="-metainf-setup"> + <jar index="true" destfile="${output}/test.jar"> + <metainf dir="${input}"/> + </jar> + <unjar src="${output}/test.jar" dest="${output}"/> + <au:assertFileExists file="${output}/META-INF/INDEX.LIST"/> + <au:assertResourceDoesntContain value="META-INF" + resource="${output}/META-INF/INDEX.LIST"/> + </target> + + <target name="testIndexMetaInf" depends="-metainf-setup"> + <jar index="true" destfile="${output}/test.jar" indexMetaInf="true"> + <metainf dir="${input}"/> + </jar> + <unjar src="${output}/test.jar" dest="${output}"/> + <au:assertFileExists file="${output}/META-INF/INDEX.LIST"/> + <au:assertResourceContains value="META-INF" + resource="${output}/META-INF/INDEX.LIST"/> + </target> + + <target name="testMergeWithoutMain" + description="https://issues.apache.org/bugzilla/show_bug.cgi?id=29731"> + <mkdir dir="${input}"/> + <mkdir dir="${output}"/> + <jar destfile="${input}/first.jar"> + <manifest> + <attribute name="First" value="Main Section"/> + <section name="Nested"> + <attribute name="First" value="Nested Section"/> + </section> + </manifest> + </jar> + <jar destfile="${output}/second.jar" filesetmanifest="mergewithoutmain"> + <manifest> + <attribute name="Second" value="Main Section"/> + <section name="Nested"> + <attribute name="Second" value="Nested Section"/> + </section> + </manifest> + <zipgroupfileset dir="${input}" includes="first.jar"/> + </jar> + <unjar src="${output}/second.jar" dest="${output}"/> + <au:assertFileExists file="${output}/META-INF/MANIFEST.MF"/> + <au:assertResourceContains value="First: Nested Section" + resource="${output}/META-INF/MANIFEST.MF"/> + <au:assertResourceContains value="Second: Nested Section" + resource="${output}/META-INF/MANIFEST.MF"/> + <au:assertResourceDoesntContain + value="First: Main Section" + resource="${output}/META-INF/MANIFEST.MF"/> + <au:assertResourceContains value="Second: Main Section" + resource="${output}/META-INF/MANIFEST.MF"/> + </target> + + <target name="testWhenManifestOnly" + description="https://issues.apache.org/bugzilla/show_bug.cgi?id=43946"> + <mkdir dir="${input}"/> + <mkdir dir="${output}"/> + <jar destfile="${output}/first.jar"> + <fileset dir="${input}"/> + </jar> + <au:assertFileExists file="${output}/first.jar"/> + <au:assertLogDoesntContain text="skipping jar archive"/> + <jar destfile="${output}/second.jar" whenmanifestonly="create"> + <fileset dir="${input}"/> + </jar> + <au:assertFileExists file="${output}/second.jar"/> + <au:assertLogDoesntContain text="skipping jar archive"/> + <jar destfile="${output}/third.jar" whenmanifestonly="skip"> + <fileset dir="${input}"/> + </jar> + <au:assertFileDoesntExist file="${output}/third.jar"/> + <au:assertLogContains text="skipping jar archive"/> + <au:expectfailure> + <jar destfile="${output}/forth.jar" whenmanifestonly="fail"> + <fileset dir="${input}"/> + </jar> + </au:expectfailure> + </target> + + <target name="test-update-and-filesetmanifest" + description="https://issues.apache.org/bugzilla/show_bug.cgi?id=30751"> + <mkdir dir="${input}"/> + <mkdir dir="${output}"/> + <jar destfile="${input}/manifest.jar"> + <manifest> + <attribute name="Origin" value="manifest.jar"/> + </manifest> + </jar> + + <touch file="${input}/foo"/> + <jar destfile="${output}/test.jar"> + <fileset dir="${input}" excludes="*.jar"/> + <manifest> + <attribute name="Second-Origin" value="test.jar"/> + </manifest> + </jar> + + <touch file="${input}/bar"/> + <jar destfile="${output}/test.jar" update="true" filesetmanifest="merge"> + <fileset dir="${input}" excludes="*.jar"/> + <zipgroupfileset dir="${input}" includes="*.jar"/> + </jar> + + <unjar src="${output}/test.jar" dest="${output}"/> + <au:assertFileExists file="${output}/foo"/> + <au:assertFileExists file="${output}/bar"/> + <au:assertResourceContains value="Origin: manifest.jar" + resource="${output}/META-INF/MANIFEST.MF"/> + <au:assertResourceContains value="Second-Origin: test.jar" + resource="${output}/META-INF/MANIFEST.MF"/> + </target> + + <target name="testDuplicateFail"> + <mkdir dir="${input}/1"/> + <mkdir dir="${input}/2"/> + <mkdir dir="${output}"/> + <touch file="${input}/1/a.txt"/> + <touch file="${input}/2/a.txt"/> + <au:expectfailure message="Duplicate file"> + <jar destfile="${output}/test.jar" duplicate="fail"> + <fileset dir="${input}/1"/> + <fileset dir="${input}/2"/> + </jar> + </au:expectfailure> + </target> + + <target name="testFileSetMerge" + description="https://issues.apache.org/bugzilla/show_bug.cgi?id=49090"> + <mkdir dir="${input}/META-INF"/> + <mkdir dir="${output}"/> + <echo file="${input}/META-INF/MANIFEST.MF"><![CDATA[Test: Header +]]></echo> + <jar destfile="${output}/test.jar" filesetmanifest="merge"> + <fileset dir="${input}"/> + </jar> + <unjar src="${output}/test.jar" dest="${output}"/> + <au:assertResourceContains value="Test: Header" + resource="${output}/META-INF/MANIFEST.MF"/> + </target> + + <target name="testZipfilesetMerge" + description="https://issues.apache.org/bugzilla/show_bug.cgi?id=49605"> + <mkdir dir="${input}"/> + <mkdir dir="${output}"/> + <echo file="${input}/MANIFEST.MF">Manifest-Version: 1.0 +Main-Class: MyClass + +</echo> + <jar destfile="${input}/manifesttest.jar" + filesetmanifest="merge"> + <zipfileset file="${input}/MANIFEST.MF" prefix="META-INF"/> + </jar> + <unjar src="${input}/manifesttest.jar" dest="${output}"/> + <au:assertFileExists file="${output}/META-INF/MANIFEST.MF"/> + <au:assertResourceContains value="Main-Class: MyClass" + resource="${output}/META-INF/MANIFEST.MF"/> + </target> + + <target name="testMergeWithoutMainWithoutExplicitManifest" + description="https://issues.apache.org/bugzilla/show_bug.cgi?id=54171"> + <mkdir dir="${input}"/> + <mkdir dir="${output}"/> + <jar destfile="${input}/input.jar"> + <manifest> + <attribute name="Foo" value="Main Section"/> + </manifest> + <fileset dir="."/> + </jar> + <jar destfile="${input}/test.jar" + filesetmanifest="mergewithoutmain"> + <zipgroupfileset dir="${input}"> + <include name="input.jar"/> + </zipgroupfileset> + </jar> + <unjar src="${input}/test.jar" dest="${output}"/> + <au:assertFileExists file="${output}/META-INF/MANIFEST.MF"/> + <au:assertResourceDoesntContain + value="Foo: Main Section" + resource="${output}/META-INF/MANIFEST.MF"/> + </target> + +</project> diff --git a/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/java-test.xml b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/java-test.xml new file mode 100644 index 00000000..db673161 --- /dev/null +++ b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/java-test.xml @@ -0,0 +1,75 @@ +<?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="-setUpWriterClass"> + <mkdir dir="${input}"/> + <echo file="${input}/A.java"><![CDATA[ +public class A { + public static void main(String[] args) { + System.err.println("to System.err"); + System.out.println("to System.out"); + } +}]]></echo> + <mkdir dir="${output}"/> + <javac srcdir="${input}" destdir="${output}"/> + </target> + + <target name="testOutputProperty" + description="https://issues.apache.org/bugzilla/show_bug.cgi?id=47602" + depends="-setUpWriterClass"> + <java fork="false" classname="A" outputproperty="out" + errorproperty="err"> + <classpath location="${output}"/> + </java> + <au:assertPropertyEquals name="out" value="to System.out"/> + <au:assertPropertyEquals name="err" value="to System.err"/> + </target> + + <target name="testLogErrorNoInput" + description="https://issues.apache.org/bugzilla/show_bug.cgi?id=47844" + depends="-setUpWriterClass"> + <property name="stdout" location="${output}/standard.txt"/> + <java fork="false" classname="A" output="${stdout}" logError="true"> + <classpath location="${output}"/> + </java> + <au:assertResourceContains resource="${stdout}" + value="to System.out"/> + <au:assertResourceDoesntContain resource="${stdout}" + value="to System.err"/> + <au:assertLogContains text="to System.err"/> + </target> + + <target name="testLogErrorWithInput" + description="https://issues.apache.org/bugzilla/show_bug.cgi?id=47844" + depends="-setUpWriterClass"> + <property name="stdout" location="${output}/standard.txt"/> + <java fork="false" classname="A" output="${stdout}" + logError="true" inputstring=""> + <classpath location="${output}"/> + </java> + <au:assertResourceContains resource="${stdout}" + value="to System.out"/> + <au:assertResourceDoesntContain resource="${stdout}" + value="to System.err"/> + <au:assertLogContains text="to System.err"/> + </target> + +</project> + diff --git a/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/javac-dir/bad-src/Bad.java b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/javac-dir/bad-src/Bad.java new file mode 100644 index 00000000..3b749f88 --- /dev/null +++ b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/javac-dir/bad-src/Bad.java @@ -0,0 +1,22 @@ +/* + * 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. + * + */ +/** a simple class with a bug */ +public class Simple { + // should get a not-terminated error + String s = "; +} diff --git a/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/javac-dir/good-src/Simple.java b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/javac-dir/good-src/Simple.java new file mode 100644 index 00000000..9c08f568 --- /dev/null +++ b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/javac-dir/good-src/Simple.java @@ -0,0 +1,20 @@ +/* + * 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. + * + */ +/** a simple do nothing class */ +public class Simple { +} diff --git a/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/javac-test.xml b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/javac-test.xml new file mode 100644 index 00000000..3c4d8489 --- /dev/null +++ b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/javac-test.xml @@ -0,0 +1,316 @@ +<?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" /> + + <property name="javac-dir" location="${output}/javac-dir" /> + <property name="build-dir" location="${javac-dir}/build" /> + + <target name="test-includeDestClasses"> + <property name="DATE" value="09/10/1999 4:30 pm" /> + <delete dir="${javac-dir}/src" /> + <mkdir dir="${javac-dir}/src" /> + <echo file="${javac-dir}/src/A.java"> + public class A { B b;} + </echo> + <echo file="${javac-dir}/src/B.java"> + public class B { } + </echo> + <delete dir="${javac-dir}/classes" quiet="yes" /> + <mkdir dir="${javac-dir}/classes" /> + <javac srcdir="${javac-dir}/src" destdir="${javac-dir}/classes" /> + <touch file="${javac-dir}/src/B.java" datetime="${DATE}" /> + <touch file="${javac-dir}/classes/B.class" datetime="${DATE}" /> + <!-- following should not update B.class --> + <delete quiet="yes" file="${javac-dir}/classes/A.class" /> + <javac srcdir="${javac-dir}/src" destdir="${javac-dir}/classes" /> + <au:assertTrue> + <isfileselected file="${javac-dir}/classes/B.class"> + <date datetime="${DATE}" when="equal" /> + </isfileselected> + </au:assertTrue> + <!-- following should update B.class --> + <delete quiet="yes" file="${javac-dir}/classes/A.class" /> + <javac srcdir="${javac-dir}/src" destdir="${javac-dir}/classes" includeDestClasses="no" /> + <au:assertFalse> + <isfileselected file="${javac-dir}/classes/B.class"> + <date datetime="${DATE}" when="equal" /> + </isfileselected> + </au:assertFalse> + </target> + + <target name="test-updated-property"> + <delete quiet="yes" dir="${build-dir}" /> + <mkdir dir="${build-dir}" /> + <javac srcdir="javac-dir/good-src" destdir="${build-dir}" updatedProperty="classes-updated" /> + <au:assertTrue> + <equals arg1="${classes-updated}" arg2="true" /> + </au:assertTrue> + <javac srcdir="javac-dir/good-src" destdir="${build-dir}" updatedProperty="classes-updated-2" /> + <au:assertFalse> + <isset property="classes-updated-2" /> + </au:assertFalse> + </target> + + <target name="test-error-property"> + <delete quiet="yes" dir="${build-dir}" /> + <mkdir dir="${build-dir}" /> + <javac srcdir="javac-dir/good-src" destdir="${build-dir}" failOnError="false" errorProperty="compile-failed" /> + <au:assertTrue> + <equals arg1="${compile-failed}" arg2="${compile-failed}" /> + </au:assertTrue> + <javac srcdir="javac-dir/bad-src" destdir="${build-dir}" failOnError="false" errorProperty="compile-failed" /> + <au:assertTrue> + <equals arg1="${compile-failed}" arg2="true" /> + </au:assertTrue> + </target> + + <target name="setUpForPackageInfoJava"> + <mkdir dir="${javac-dir}/src/a" /> + <mkdir dir="${build-dir}" /> + <echo file="${javac-dir}/src/a/package-info.java"> + <![CDATA[ +/** + * Some test javadocs at the package level. + */ +]]> + </echo> + <javac srcdir="${javac-dir}/src" destdir="${build-dir}" updatedProperty="first-pass" /> + <au:assertPropertyEquals name="first-pass" value="true" /> + </target> + + <target name="testPackageInfoJava" + depends="setUpForPackageInfoJava" + description="https://issues.apache.org/bugzilla/show_bug.cgi?id=43114"> + <!-- no changes, shouldn't recompile, the initial bug --> + <javac srcdir="${javac-dir}/src" destdir="${build-dir}" updatedProperty="second-pass" /> + <au:assertFalse> + <isset property="second-pass" /> + </au:assertFalse> + <sleep seconds="2" /> + + <!-- change package-info.java but make containing target dir even + more recent - the regression in Ant 1.7.1 --> + <touch file="${javac-dir}/src/a/package-info.java" /> + <sleep seconds="2" /> + <touch> + <file file="${build-dir}/a" /> + </touch> + <javac srcdir="${javac-dir}/src" destdir="${build-dir}" updatedProperty="third-pass" /> + <au:assertPropertyEquals name="third-pass" value="true" /> + </target> + + <target name="testPackageInfoJavaNoDest" + depends="setUpForPackageInfoJava" + description="https://issues.apache.org/bugzilla/show_bug.cgi?id=51947"> + <javac srcdir="${javac-dir}/src" updatedProperty="first-pass" /> + <au:assertPropertyEquals name="first-pass" value="true" /> + + <!-- no changes, shouldn't recompile, the initial bug --> + <javac srcdir="${javac-dir}/src" updatedProperty="second-pass" /> + <au:assertFalse> + <isset property="second-pass" /> + </au:assertFalse> + <sleep seconds="2" /> + + <!-- change package-info.java but make containing target dir even + more recent - the regression in Ant 1.7.1 --> + <touch file="${javac-dir}/src/a/package-info.java" /> + <sleep seconds="2" /> + <touch> + <file file="${javac-dir}/src/a" /> + </touch> + <javac srcdir="${javac-dir}/src" updatedProperty="third-pass" /> + <au:assertPropertyEquals name="third-pass" value="true" /> + </target> + + <target name="testSuppressPackageInfoClass" + depends="setUpForPackageInfoJava" + description="https://issues.apache.org/bugzilla/show_bug.cgi?id=52096"> + <au:assertFileExists file="${build-dir}/a/package-info.class"/> + <delete file="${build-dir}/a/package-info.class"/> + <javac srcdir="${javac-dir}/src" destdir="${build-dir}" + createMissingPackageInfoClass="false" + updatedProperty="second-pass" /> + <au:assertPropertyEquals name="second-pass" value="true" /> + <au:assertFileDoesntExist file="${build-dir}/a/package-info.class"/> + </target> + + <target name="-create-javac-adapter"> + <property name="adapter.dir" location="${output}/adapter" /> + <mkdir dir="${input}/org/example" /> + <echo file="${input}/org/example/Adapter.java"> + <![CDATA[ +package org.example; +import org.apache.tools.ant.taskdefs.compilers.CompilerAdapter; +import org.apache.tools.ant.taskdefs.Javac; + +public class Adapter implements CompilerAdapter { + public void setJavac(Javac attributes) {} + public boolean execute() { + System.err.println("adapter called"); + return true; + } +}]]> + </echo> + <mkdir dir="${resources}" /> + <javac srcdir="${input}" destdir="${resources}" /> + </target> + + <target name="testCompilerNotFound" depends="-create-javac-adapter"> + <au:expectfailure> + <javac srcdir="${input}" destdir="${output}" compiler="org.example.Adapter" /> + </au:expectfailure> + <au:assertLogDoesntContain text="adapter called" /> + </target> + + <target name="testCompilerClasspath" depends="-create-javac-adapter" description="https://issues.apache.org/bugzilla/show_bug.cgi?id=11143"> + <mkdir dir="${output}" /> + <javac srcdir="${input}" destdir="${output}" compiler="org.example.Adapter"> + <compilerclasspath location="${resources}" /> + </javac> + <au:assertLogContains text="adapter called" /> + </target> + + <target name="testCompilerAsNestedElement" depends="-create-javac-adapter"> + <componentdef classname="org.example.Adapter" name="myjavac"> + <classpath location="${resources}" /> + </componentdef> + <mkdir dir="${output}" /> + <javac srcdir="${input}" destdir="${output}"> + <myjavac /> + </javac> + <au:assertLogContains text="adapter called" /> + </target> + + <target name="testSourceAttributes" xmlns:if="ant:if" xmlns:unless="ant:unless"> + <delete dir="${javac-dir}/src" /> + <mkdir dir="${javac-dir}/src" /> + <mkdir dir="${javac-dir}/classes" /> + <echo file="${javac-dir}/src/A.java"> + public class A { } + </echo> + <presetdef name="testJavac"> + <javac srcdir="${javac-dir}/src" destdir="${javac-dir}/classes" includeantruntime="false"/> + </presetdef> + + <au:expectfailure> + <testJavac source="notValid"/> + </au:expectfailure> + + <sequential unless:set="jdk1.9+"> + <echo>JDK 1.4+</echo> + <testJavac source="1.4"/> + <delete dir="${javac-dir}/classes"/> + <mkdir dir="${javac-dir}/classes"/> + </sequential> + + <sequential unless:set="jdk1.9+"> + <echo>JDK 1.5+</echo> + <testJavac source="1.5"/> + <delete dir="${javac-dir}/classes"/> + <mkdir dir="${javac-dir}/classes"/> + </sequential> + + <sequential if:set="jdk1.6+"> + <echo>JDK 1.6+</echo> + <testJavac source="1.6"/> + <delete dir="${javac-dir}/classes"/> + <mkdir dir="${javac-dir}/classes"/> + </sequential> + + <sequential if:set="jdk1.7+"> + <echo>JDK 1.7+</echo> + <testJavac source="1.7"/> + <delete dir="${javac-dir}/classes"/> + <mkdir dir="${javac-dir}/classes"/> + </sequential> + + <sequential if:set="jdk1.8+"> + <echo>JDK 1.8+</echo> + <testJavac source="1.8"/> + <delete dir="${javac-dir}/classes"/> + <mkdir dir="${javac-dir}/classes"/> + </sequential> + + <sequential if:set="jdk1.9+"> + <echo>JDK 1.9+</echo> + <testJavac source="1.9"/> + <delete dir="${javac-dir}/classes"/> + <mkdir dir="${javac-dir}/classes"/> + </sequential> + </target> + + <target name="testTargetAttributes" xmlns:if="ant:if" xmlns:unless="ant:unless"> + <delete dir="${javac-dir}/src" /> + <mkdir dir="${javac-dir}/src" /> + <mkdir dir="${javac-dir}/classes" /> + <echo file="${javac-dir}/src/A.java"> + public class A { } + </echo> + <presetdef name="testJavac"> + <javac srcdir="${javac-dir}/src" destdir="${javac-dir}/classes" includeantruntime="false"/> + </presetdef> + + <au:expectfailure> + <testJavac target="notValid"/> + </au:expectfailure> + + <sequential unless:set="jdk1.9+"> + <echo>JDK 1.4+</echo> + <testJavac source="1.4" target="1.4"/> + <delete dir="${javac-dir}/classes"/> + <mkdir dir="${javac-dir}/classes"/> + </sequential> + + <sequential unless:set="jdk1.9+"> + <echo>JDK 1.5+</echo> + <testJavac source="1.5" target="1.5"/> + <delete dir="${javac-dir}/classes"/> + <mkdir dir="${javac-dir}/classes"/> + </sequential> + + <sequential if:set="jdk1.6+"> + <echo>JDK 1.6+</echo> + <testJavac source="1.6" target="1.6"/> + <delete dir="${javac-dir}/classes"/> + <mkdir dir="${javac-dir}/classes"/> + </sequential> + + <sequential if:set="jdk1.7+"> + <echo>JDK 1.7+</echo> + <testJavac source="1.7" target="1.7"/> + <delete dir="${javac-dir}/classes"/> + <mkdir dir="${javac-dir}/classes"/> + </sequential> + + <sequential if:set="jdk1.8+"> + <echo>JDK 1.8+</echo> + <testJavac source="1.8" target="1.8"/> + <delete dir="${javac-dir}/classes"/> + <mkdir dir="${javac-dir}/classes"/> + </sequential> + + <sequential if:set="jdk1.9+"> + <echo>JDK 1.9+</echo> + <testJavac source="1.9" target="1.9"/> + <delete dir="${javac-dir}/classes"/> + <mkdir dir="${javac-dir}/classes"/> + </sequential> + </target> +</project> diff --git a/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/javadoc-test.xml b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/javadoc-test.xml new file mode 100644 index 00000000..200082ba --- /dev/null +++ b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/javadoc-test.xml @@ -0,0 +1,157 @@ +<?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"> + <macrodef name="mktest"> + <attribute name="package"/> + <attribute name="class"/> + <sequential> + <mkdir dir="${input}/@{package}"/> + <echo file="${input}/@{package}/@{class}.java"><![CDATA[ +package @{package}; + +/** + * This is a test class. + */ +public class @{class} { + /** + * With a test method. + */ + public void foo(String bar) {} +} +]]></echo> + </sequential> + </macrodef> + <mktest package="test" class="A"/> + </target> + + <target name="-makeTwoTestClasses" depends="-makeTestClass"> + <mktest package="test2" class="B"/> + </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="-create-file-with-warning"> + <mkdir dir="${input}/test"/> + <echo file="${input}/test/Foo.java"><![CDATA[ +package test; + +/** + * This is a test class. + */ +public class Foo { + /** + * With a test method. + * @param baz wrong parameter name should cause warning. + */ + public void foo(String bar) {} +} +]]></echo> + </target> + + <target name="testPackageSetNoExcludes" depends="-makeTwoTestClasses"> + <javadoc destdir="${output}"> + <packageset dir="${input}"/> + </javadoc> + <au:assertFileExists file="${output}/test/A.html"/> + <au:assertFileExists file="${output}/test2/B.html"/> + </target> + + <target name="testPackageSetWithExcludes" + depends="-makeTwoTestClasses" + description="https://issues.apache.org/bugzilla/show_bug.cgi?id=47196"> + <javadoc destdir="${output}"> + <packageset dir="${input}"> + <exclude name="test2"/> + </packageset> + </javadoc> + <au:assertFileExists file="${output}/test/A.html"/> + <au:assertFileDoesntExist file="${output}/test2/B.html"/> + </target> + + <!-- basically tests no exception is thrown --> + <target name="testDontFailOnWarning" + depends="-create-file-with-warning"> + <javadoc destdir="${output}"> + <packageset dir="${input}"/> + </javadoc> + </target> + + <target name="testFailOnWarning" + description="https://issues.apache.org/bugzilla/show_bug.cgi?id=55015" + depends="-create-file-with-warning"> + <au:expectfailure> + <javadoc destdir="${output}" failonwarning="true"> + <packageset dir="${input}"/> + </javadoc> + </au:expectfailure> + </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> diff --git a/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/length-test.xml b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/length-test.xml new file mode 100644 index 00000000..acd5310b --- /dev/null +++ b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/length-test.xml @@ -0,0 +1,240 @@ +<?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 name="length-test" default="antunit" + xmlns:au="antlib:org.apache.ant.antunit"> + + <import file="../antunit-base.xml" /> + + <property name="dir.a" location="${input}/a" /> + <property name="dir.b" location="${input}/b" /> + <property name="zipfile" location="${output}/lengthtest.zip" /> + + <target name="setUp"> + <mkdir dir="${output}" /> + <mkdir dir="${dir.a}" /> + <mkdir dir="${dir.b}" /> + <property name="foo" location="${dir.a}/foo" /> + <property name="bar" location="${dir.b}/bar" /> + <echo file="${foo}" message="foo" /> + <echo file="${bar}" message="bar" /> + </target> + + <target name="testEach" depends="setUp"> + <length mode="each" property="length.each"> + <fileset id="fs" dir="${input}" /> + </length> + <length string="${length.each}" property="length.length.each" /> + <length string="${foo}${bar}........${line.separator}" + property="length.expected" /> + + <au:assertTrue> + <!-- test that both files are represented, and that the + output is the expected length; do not assume order. --> + <and> + <contains string="${length.each}" substring="${foo} : 3" /> + <contains string="${length.each}" substring="${bar} : 3" /> + <equals arg1="${length.length.each}" arg2="${length.expected}" /> + </and> + </au:assertTrue> + </target> + + <target name="testEachCondition" depends="setUp"> + <length mode="each" property="length.each"> + <fileset id="fs" dir="${input}" /> + </length> + <length string="${foo}${bar}........${line.separator}" + property="length.expected" /> + <au:assertTrue> + <!-- test that both files are represented, and that the + output is the expected length; do not assume order. --> + <and> + <contains string="${length.each}" substring="${foo} : 3" /> + <contains string="${length.each}" substring="${bar} : 3" /> + <length string="${length.each}" length="${length.expected}" /> + </and> + </au:assertTrue> + </target> + + <target name="testAll" depends="setUp"> + <length property="length.all"> + <fileset id="foo" file="${dir.a}/foo" /> + <fileset id="bar" file="${dir.b}/bar" /> + </length> + <au:assertTrue> + <equals arg1="6" arg2="${length.all}" /> + </au:assertTrue> + </target> + + <target name="testAllCondition" depends="setUp"> + <au:assertTrue> + <length length="6"> + <fileset id="foo" file="${dir.a}/foo" /> + <fileset id="bar" file="${dir.b}/bar" /> + </length> + </au:assertTrue> + </target> + + <target name="testFile" depends="setUp"> + <length property="length.foo" file="${dir.a}/foo" /> + <au:assertTrue> + <equals arg1="3" arg2="${length.foo}" /> + </au:assertTrue> + </target> + + <target name="testFileCondition" depends="setUp"> + <au:assertTrue> + <length length="3" file="${dir.a}/foo" /> + </au:assertTrue> + </target> + + <target name="testBoth" depends="setUp"> + <length property="length.foo" file="${dir.a}/foo"> + <fileset file="${dir.b}/bar" /> + </length> + <au:assertTrue> + <equals arg1="6" arg2="${length.foo}" /> + </au:assertTrue> + </target> + + <target name="testBothCondition" depends="setUp"> + <au:assertTrue> + <length length="6" file="${dir.a}/foo"> + <fileset file="${dir.b}/bar" /> + </length> + </au:assertTrue> + </target> + + <target name="testDupes" depends="setUp"> + <length property="length.foo" file="${dir.a}/foo"> + <fileset dir="${input}" /> + </length> + <au:assertTrue> + <equals arg1="9" arg2="${length.foo}" /> + </au:assertTrue> + </target> + + <target name="testDupesCondition" depends="setUp"> + <au:assertTrue> + <length length="9" file="${dir.a}/foo"> + <fileset dir="${input}" /> + </length> + </au:assertTrue> + </target> + + <target name="testString"> + <length string="foo" property="length.string" /> + <au:assertTrue> + <equals arg1="3" arg2="${length.string}" /> + </au:assertTrue> + </target> + + <target name="testStringCondition"> + <au:assertTrue> + <length string="foo" length="3" /> + </au:assertTrue> + </target> + + <target name="testTrimString"> + <length string=" foo " trim="true" property="length.string" /> + <au:assertTrue> + <equals arg1="3" arg2="${length.string}" /> + </au:assertTrue> + </target> + + <target name="testTrimStringCondition"> + <au:assertTrue> + <length string=" foo " trim="true" length="3" /> + </au:assertTrue> + </target> + + <target name="testNoTrimString"> + <length string=" foo " property="length.string" /> + <au:assertTrue> + <equals arg1="5" arg2="${length.string}" /> + </au:assertTrue> + </target> + + <target name="testNoTrimStringCondition"> + <au:assertTrue> + <length string=" foo " length="5" /> + </au:assertTrue> + </target> + + <target name="testTrimFile" description="should fail"> + <au:expectfailure> + <length file="${ant.file}" trim="false" /> + </au:expectfailure> + </target> + + <target name="testStringFile" description="should fail"> + <au:expectfailure> + <length string="foo" file="${ant.file}" /> + </au:expectfailure> + </target> + + <target name="testImmutable"> + <length string="foo" property="length.string" /> + <length string="foobar" property="length.string" /> + <au:assertTrue> + <equals arg1="3" arg2="${length.string}" /> + </au:assertTrue> + </target> + + <target name="zip" depends="setUp"> + <zip destfile="${zipfile}"> + <fileset file="${foo}" /> + <fileset file="${bar}" /> + </zip> + </target> + + <target name="testZipFileSet" depends="zip"> + <length property="length.zipfile1"> + <zipfileset src="${zipfile}" /> + </length> + <length property="length.zipfile2"> + <zipfileset src="${zipfile}" includes="bar" /> + </length> + <au:assertTrue> + <and> + <equals arg1="6" arg2="${length.zipfile1}" /> + <equals arg1="3" arg2="${length.zipfile2}" /> + </and> + </au:assertTrue> + </target> + + <target name="testZipFileSetCondition" depends="zip"> + <au:assertTrue> + <and> + <length length="6"> + <zipfileset src="${zipfile}" /> + </length> + <length length="3"> + <zipfileset src="${zipfile}" includes="bar" /> + </length> + </and> + </au:assertTrue> + </target> + + <target name="testResourceAttribute"> + <string id="s" value="foo-bar-baz" /> + <au:assertTrue> + <length length="11" resource="${ant.refid:s}" /> + </au:assertTrue> + </target> + +</project> diff --git a/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/loadproperties-test.xml b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/loadproperties-test.xml new file mode 100644 index 00000000..04b53f11 --- /dev/null +++ b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/loadproperties-test.xml @@ -0,0 +1,192 @@ +<?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 name="loadproperties-test" default="antunit" xmlns:au="antlib:org.apache.ant.antunit"> + + <import file="../antunit-base.xml" /> + + <target name="setUp"> + <mkdir dir="${input}" /> + <property name="properties.tmp" location="${input}/properties.tmp" /> + </target> + + <target name="test-basic"> + <loadproperties> + <string>basic.foo=foo +basic.bar=bar +basic.baz=baz</string> + </loadproperties> + <au:assertPropertyEquals name="basic.foo" value="foo" /> + <au:assertPropertyEquals name="basic.bar" value="bar" /> + <au:assertPropertyEquals name="basic.baz" value="baz" /> + </target> + + <target name="test-xref"> + <loadproperties> + <string>xref.foo=foo +xref.bar=$${xref.foo} +xref.baz=$${xref.bar}</string> + </loadproperties> + <au:assertPropertyEquals name="xref.foo" value="foo" /> + <au:assertPropertyEquals name="xref.bar" value="foo" /> + <au:assertPropertyEquals name="xref.baz" value="foo" /> + </target> + + <target name="test-xref-complex"> + <loadproperties> + <string>xref-complex.a=$$ +xref-complex.b={ +xref-complex.c=} +xref-complex.d=x +xref-complex.e=$${xref-complex.a}$${xref-complex.b}xref-complex.d$${xref-complex.c} +xref-complex.f=$${xref-complex.e}</string> + </loadproperties> + <au:assertPropertyEquals name="xref-complex.a" value="$$" /> + <au:assertPropertyEquals name="xref-complex.b" value="{" /> + <au:assertPropertyEquals name="xref-complex.c" value="}" /> + <au:assertPropertyEquals name="xref-complex.d" value="x" /> + <au:assertPropertyEquals name="xref-complex.e" value="$${xref-complex.d}" /> + <au:assertPropertyEquals name="xref-complex.f" value="$${xref-complex.d}" /> + </target> + + <target name="testEncoding" + description="https://issues.apache.org/bugzilla/show_bug.cgi?id=47382"> + <mkdir dir="${input}"/> + <echo file="${input}/ebcdic.properties" encoding="Cp1047"> +a=Hello world in EBCDIC + </echo> + <loadproperties srcfile="${input}/ebcdic.properties" encoding="Cp1047"/> + <au:assertPropertyEquals name="a" value="Hello world in EBCDIC"/> + </target> + + <target name="testPrefixedProperties" depends="setUp"> + <property name="server" value="localhost"/> + <echo file="${properties.tmp}"> +#http.@PORT@ = 90 +http.@PORT@ = 80 +http.@SERVER@ = ${server} + </echo> + <loadproperties srcFile="${properties.tmp}"> + <filterchain> + <striplinecomments> + <comment value="#"/> + </striplinecomments> + <prefixlines prefix="server1."/> + <replacetokens> + <token key="PORT" value="port"/> + <token key="SERVER" value="server"/> + </replacetokens> + <expandproperties/> + </filterchain> + </loadproperties> + <property name="server1.http.url" + value="http://${server1.http.server}:${server1.http.port}"/> + </target> + + <target name="testLineCommentsWithoutFiltering"> + <loadproperties> + <string value="#foo=bar" /> + </loadproperties> + <au:assertFalse> + <isset property="foo" /> + </au:assertFalse> + </target> + + <target name="testPrefixAttributeProperties"> + <loadproperties prefix="prefixFromAttribute."> + <string>foo=foo +bar=bar +baz=${foo} ${bar} + </string> + </loadproperties> + <au:assertTrue> + <and> + <equals arg1="foo" arg2="${prefixFromAttribute.foo}" /> + <equals arg1="bar" arg2="${prefixFromAttribute.bar}" /> + <equals arg1="foo bar" arg2="${prefixFromAttribute.baz}" /> + </and> + </au:assertTrue> + </target> + + <target name="testSelfContainedPrefixFilterFailure" + description="Show why the prefix attribute is needed"> + <loadproperties> + <string>foo=foo +bar=bar +baz=${foo} ${bar} + </string> + <filterchain> + <prefixlines prefix="prefixFromFilter." /> + </filterchain> + </loadproperties> + <au:assertTrue> + <and> + <equals arg1="$${foo} $${bar}" arg2="${prefixFromFilter.baz}" /> + <isset property="prefixFromFilter." /> + </and> + </au:assertTrue> + </target> + + <target name="write properties.tmp" depends="setUp"> + <echo file="${properties.tmp}"> +#tpfr.a=a +tpfr.a=A +tpfr.b=b\ + e +tpfr.c=@C@ + </echo> + </target> + + <presetdef name="assertPropertiesFromResourceOkay"> + <au:assertTrue> + <equals arg1="Abesea" arg2="${tpfr.a}${tpfr.b}${tpfr.c}" /> + </au:assertTrue> + </presetdef> + + <target name="testPropertiesFromResource" depends="write properties.tmp"> + <loadproperties resource="properties.tmp" classpath="${input}"> + <filterchain> + <replacetokens> + <token key="C" value="sea"/> + </replacetokens> + </filterchain> + </loadproperties> + </target> + + <target name="testPropertiesFromFileSet" depends="write properties.tmp"> + <loadproperties> + <fileset file="${properties.tmp}" /> + <filterchain> + <replacetokens> + <token key="C" value="sea"/> + </replacetokens> + </filterchain> + </loadproperties> + <assertPropertiesFromResourceOkay /> + </target> + + <target name="testLastPropertyWins"> + <loadproperties> + <string>foo=foo +foo=bar</string> + </loadproperties> + <au:assertTrue> + <equals arg1="bar" arg2="${foo}" /> + </au:assertTrue> + </target> + +</project> diff --git a/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/loadresource-test.xml b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/loadresource-test.xml new file mode 100644 index 00000000..814ded5b --- /dev/null +++ b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/loadresource-test.xml @@ -0,0 +1,41 @@ +<?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="test-resourceString"> + <loadresource property="p"> + <string value="one"/> + </loadresource > + <au:assertPropertyEquals name="p" value="one"/> + </target> + + <target name="test-resourceSizeZero" description="Bug 42319"> + <loadresource property="p"> + <string value=""/> + </loadresource > + <au:assertTrue> + <not> + <isset property="p"/> + </not> + </au:assertTrue> + <au:assertLogContains text="Do not set property p as its length is 0."/> + </target> + +</project> diff --git a/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/local-test.xml b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/local-test.xml new file mode 100644 index 00000000..9c4e7b7e --- /dev/null +++ b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/local-test.xml @@ -0,0 +1,96 @@ +<?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" /> + + <property name="foo" value="foo" /> + + <local name="bar" /> + <property name="bar" value="bar" /> + <au:assertPropertyEquals name="bar" value="bar" /> + + <target name="testGlobalLocal"> + <au:assertFalse> + <isset property="bar" /> + </au:assertFalse> + </target> + + <target name="testBaseline"> + <au:assertPropertyEquals name="foo" value="foo" /> + </target> + + <target name="testTarget"> + <au:assertPropertyEquals name="foo" value="foo" /> + <local name="foo" /> + <property name="foo" value="foo.target" /> + <au:assertPropertyEquals name="foo" value="foo.target" /> + </target> + + <target name="testSequential"> + <sequential> + <local name="foo" /> + <property name="foo" value="foo.1" /> + <sequential> + <local name="foo" /> + <property name="foo" value="foo.2" /> + <au:assertPropertyEquals name="foo" value="foo.2" /> + </sequential> + <au:assertPropertyEquals name="foo" value="foo.1" /> + </sequential> + <au:assertPropertyEquals name="foo" value="foo" /> + </target> + + <target name="testParallel"> + <macrodef name="p"> + <attribute name="value" /> + <attribute name="sleep" default="0" /> + <sequential> + <local name="foo" /> + <sleep seconds="@{sleep}" /> + <property name="foo" value="@{value}" /> + <au:assertPropertyEquals name="foo" value="@{value}" /> + </sequential> + </macrodef> + <parallel> + <p sleep="2" value="foo.a" /> + <au:assertPropertyEquals name="foo" value="foo" /> + <p sleep="1" value="foo.b" /> + <au:assertPropertyEquals name="foo" value="foo" /> + <p sleep="0" value="foo.c" /> + <au:assertPropertyEquals name="foo" value="foo" /> + </parallel> + <au:assertPropertyEquals name="foo" value="foo" /> + </target> + + <target name="testMacrodef"> + <macrodef name="m"> + <sequential> + <local name="foo" /> + <property name="foo" value="foo.x" /> + <au:assertPropertyEquals name="foo" value="foo.x" /> + </sequential> + </macrodef> + <m /> + <au:assertPropertyEquals name="foo" value="foo" /> + <m /> + <au:assertPropertyEquals name="foo" value="foo" /> + <m /> + <au:assertPropertyEquals name="foo" value="foo" /> + </target> + +</project> diff --git a/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/macrodef-test.xml b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/macrodef-test.xml new file mode 100644 index 00000000..b12e6f75 --- /dev/null +++ b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/macrodef-test.xml @@ -0,0 +1,60 @@ +<?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 name="length-test" default="antunit" + xmlns:au="antlib:org.apache.ant.antunit"> + + <import file="../antunit-base.xml" /> + + <target name="testDefaultTest"> + <macrodef name="test-log"> + <text name="log" default="DEFAULT-LOG-VALUE"/> + <sequential> + <concat>@{log}</concat> + </sequential> + </macrodef> + <test-log/> + <au:assertLogContains text="DEFAULT-LOG-VALUE"/> + <test-log>THIS IS NOT DEFAULT LOG</test-log> + <au:assertLogContains text="THIS IS NOT DEFAULT LOG"/> + </target> + + <target name="testDisableDoubleExpandedProperties" + description="https://issues.apache.org/bugzilla/show_bug.cgi?id=42046"> + <macrodef name="indirect"> + <attribute name="value" doubleexpanding="false"/> + <sequential> + <echo message="@{value}"/> + </sequential> + </macrodef> + <indirect value="$${basedir}"/> + <au:assertLogContains text="{basedir}"/> + </target> + + <target name="testEnableDoubleExpandedProperties" + description="https://issues.apache.org/bugzilla/show_bug.cgi?id=52621"> + <macrodef name="indirect"> + <attribute name="value"/> + <sequential> + <echo message="@{value}"/> + </sequential> + </macrodef> + <indirect value="$${basedir}"/> + <au:assertLogDoesntContain text="{basedir}"/> + </target> + +</project> diff --git a/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/manifest-test.xml b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/manifest-test.xml new file mode 100644 index 00000000..4247ef2d --- /dev/null +++ b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/manifest-test.xml @@ -0,0 +1,180 @@ +<?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="setUp"> + <mkdir dir="${output}"/> + <property name="file" location="${output}/test.mf"/> + </target> + + <target name="test8IsAllowed" + description="https://issues.apache.org/bugzilla/show_bug.cgi?id=45675" + depends="setUp"> + <manifest file="${file}"> + <attribute name="attrib8" value="test attribute"/> + </manifest> + </target> + + <target name="testMergeOverrides" depends="setUp"> + <manifest file="${file}"> + <attribute name="foo" value="value1"/> + <attribute name="bar" value="value1"/> + <section name="bar"> + <attribute name="foo" value="value2"/> + </section> + </manifest> + <manifest file="${file}" mode="update"> + <attribute name="foo" value="value3"/> + <section name="bar"> + <attribute name="foo" value="value5"/> + </section> + </manifest> + <au:assertResourceContains + resource="${file}" + value="foo: value3 "/> + <au:assertResourceContains + resource="${file}" + value="bar: value1 "/> + <au:assertResourceContains + resource="${file}" + value="foo: value5 "/> + <au:assertResourceDoesntContain + resource="${file}" + value="foo: value1 "/> + <au:assertResourceDoesntContain + resource="${file}" + value="foo: value2 "/> + </target> + + <target name="testMergeOverridesClassPath" depends="setUp"> + <manifest file="${file}"> + <attribute name="Class-Path" value="foo"/> + </manifest> + <manifest file="${file}" mode="update"> + <attribute name="Class-Path" value="bar"/> + </manifest> + <au:assertResourceContains + resource="${file}" + value="Class-Path: bar "/> + <au:assertResourceDoesntContain + resource="${file}" + value="Class-Path: foo "/> + </target> + + <target name="testMultipleClassPathAttributes" depends="setUp"> + <manifest file="${file}"> + <attribute name="Class-Path" value="foo"/> + <attribute name="Class-Path" value="bar"/> + </manifest> + <au:assertResourceContains + resource="${file}" + value="Class-Path: foo "/> + <au:assertResourceContains + resource="${file}" + value="Class-Path: bar "/> + </target> + + <target name="testMergeClassPathAttributes" depends="setUp"> + <manifest file="${file}"> + <attribute name="Class-Path" value="foo"/> + <attribute name="Class-Path" value="bar"/> + </manifest> + <manifest file="${file}" mergeClassPathAttributes="true" mode="update"> + <attribute name="Class-Path" value="baz"/> + </manifest> + <au:assertResourceContains + resource="${file}" + value="Class-Path: foo "/> + <au:assertResourceContains + resource="${file}" + value="Class-Path: bar "/> + <au:assertResourceContains + resource="${file}" + value="Class-Path: baz "/> + </target> + + <target name="testFlattenMultipleClassPathAttributes" depends="setUp"> + <manifest file="${file}" flattenAttributes="true"> + <attribute name="Class-Path" value="foo"/> + <attribute name="Class-Path" value="bar"/> + </manifest> + <au:assertResourceContains + resource="${file}" + value="Class-Path: foo bar "/> + </target> + + <target name="testMergeAndFlattenClassPathAttributes" depends="setUp"> + <manifest file="${file}"> + <attribute name="Class-Path" value="foo"/> + <attribute name="Class-Path" value="bar"/> + </manifest> + <manifest file="${file}" + mergeClassPathAttributes="true" + flattenAttributes="true" + mode="update"> + <attribute name="Class-Path" value="baz"/> + </manifest> + <au:assertResourceContains + resource="${file}" + value="Class-Path: baz foo bar "/> + </target> + + <target name="-prepareJava5JarTest" depends="setUp"> + <mkdir dir="${output}/bin"/> + <mkdir dir="${input}/org/example"/> + <echo file="${input}/org/example/AntFail.java"><![CDATA[ +package org.example; + +public class AntFail { + public static + void main(String[] args) { + System.out.println(System.getProperty("java.version")); + } + } +]]></echo> + <javac srcdir="${input}" destdir="${output}/bin" includeantruntime="no" /> + </target> + + <target name="testJava5JarProblemManifestInSeparateTask" + depends="-prepareJava5JarTest" + description="https://issues.apache.org/bugzilla/show_bug.cgi?id=54762"> + <manifest file="${output}/MANIFEST.MF"> + <attribute name="Main-Class" value="org.example.AntFail" /> + </manifest> + + <jar manifest="${output}/MANIFEST.MF" destfile="${output}/antfail.jar" + basedir="${output}/bin" /> + <java jar="${output}/antfail.jar" fork="true" failonerror="true"/> + </target> + + <target name="testJava5JarProblemManifestAsNestedElement" + depends="-prepareJava5JarTest" + description="https://issues.apache.org/bugzilla/show_bug.cgi?id=54762"> + + <jar destfile="${output}/antfail.jar" + basedir="${output}/bin"> + <manifest> + <attribute name="Main-Class" value="org.example.AntFail" /> + </manifest> + </jar> + <java jar="${output}/antfail.jar" fork="true" failonerror="true"/> + </target> +</project> diff --git a/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/manifestclasspath-test.xml b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/manifestclasspath-test.xml new file mode 100644 index 00000000..612990b6 --- /dev/null +++ b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/manifestclasspath-test.xml @@ -0,0 +1,30 @@ +<?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="testRelativePathOfParentDir"> + <manifestclasspath property="jar.classpath" + jarfile="${basedir}/foo.jar"> + <classpath path="${basedir}"/> + </manifestclasspath> + <au:assertPropertyEquals name="jar.classpath" value="./"/> + </target> +</project> diff --git a/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/move-test.xml b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/move-test.xml new file mode 100644 index 00000000..9acac749 --- /dev/null +++ b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/move-test.xml @@ -0,0 +1,234 @@ +<?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="test-move-caseonly"> + <!-- this test is inspired by bugzilla 41948 --> + <!-- Especially interesting if executed on case-insensitive file systems --> + <mkdir dir="${output}"/> + <touch file="${output}/abc"/> + <move file="${output}/abc" tofile="${output}/aBc"/> + <fileset dir="${output}" id="myfs"> + <include name="aBc"/> + </fileset> + <pathconvert refid="myfs" property="myproperty" setonempty="false"/> + <au:assertPropertySet name="myproperty" message="abc was not renamed aBc"/> + </target> + + <target name="test-regex-mapper" + description="https://issues.apache.org/bugzilla/show_bug.cgi?id=18656"> + <mkdir dir="${input}/AAA/foo"/> + <touch file="${input}/AAA/foo/bar.txt"/> + <mkdir dir="${input}/foo/AAA"/> + <touch file="${input}/foo/bar.txt"/> + <touch file="${input}/foo/AAA/bar.txt"/> + <mkdir dir="${input}/foo/bar"/> + <touch file="${input}/foo/bar/AAA.txt"/> + <touch file="${input}/foo/bar/baz.txt"/> + + <mkdir dir="${output}"/> + + <move todir="${output}"> + <fileset dir="${input}"/> + <firstmatchmapper> + <regexpmapper from="(.*)AAA(.*)" to="\1BBB\2"/> + <identitymapper/> + </firstmatchmapper> + </move> + + <au:assertFileExists file="${output}/BBB/foo/bar.txt"/> + <au:assertFileExists file="${output}/foo/bar.txt"/> + <au:assertFileExists file="${output}/foo/BBB/bar.txt"/> + <au:assertFileExists file="${output}/foo/bar/BBB.txt"/> + <au:assertFileExists file="${output}/foo/bar/baz.txt"/> + </target> + + <target name="testNotModifiedSelector" + description="https://issues.apache.org/bugzilla/show_bug.cgi?id=43574" + > + <mkdir dir="${input}/images"/> + <mkdir dir="${input}/cache"/> + <touch file="${input}/images/foo.jpg"/> + <mkdir dir="${output}"/> + <selector id="cache.selector"> + <not> + <modified update="true" + seldirs="false" + cache="propertyfile" + algorithm="digest" + comparator="equal"> + <param name="cache.cachefile" + value="${input}/cache/cache.properties"/> + <param name="algorithm.algorithm" value="MD5"/> + </modified> + </not> + </selector> + <au:assertFileDoesntExist file="${input}/cache/cache.properties"/> + <move todir="${output}" overwrite="true"> + <fileset dir="${input}/images"> + <include name="*.jpg" /> + <selector refid="cache.selector" /> + </fileset> + </move> + <au:assertFileExists file="${input}/cache/cache.properties"/> + <au:assertFileExists file="${input}/images/foo.jpg"/> + <au:assertFileDoesntExist file="${output}/foo.jpg"/> + <move todir="${output}" overwrite="true"> + <fileset dir="${input}/images"> + <include name="*.jpg" /> + <selector refid="cache.selector" /> + </fileset> + </move> + <au:assertFileDoesntExist file="${input}/images/foo.jpg"/> + <au:assertFileExists file="${output}/foo.jpg"/> + </target> + + <target name="testOverwriteIsTrueByDefault"> + <mkdir dir="${input}"/> + <mkdir dir="${output}"/> + <echo file="${input}/x.txt">X</echo> + <sleep seconds="2"/> + <echo file="${output}/y.txt">Y</echo> + <move file="${input}/x.txt" tofile="${output}/y.txt"/> + <au:assertFileDoesntExist file="${input}/x.txt"/> + <au:assertResourceContains resource="${output}/y.txt" + value="X"/> + </target> + + <target name="testOverwriteIsHonored" + description="https://issues.apache.org/bugzilla/show_bug.cgi?id=47755"> + <mkdir dir="${input}"/> + <mkdir dir="${output}"/> + <echo file="${input}/x.txt">X</echo> + <sleep seconds="2"/> + <echo file="${output}/y.txt">Y</echo> + <move file="${input}/x.txt" tofile="${output}/y.txt" overwrite="false"/> + <au:assertFileExists file="${input}/x.txt"/> + <au:assertResourceContains resource="${output}/y.txt" + value="Y"/> + </target> + + <!-- stolen from ../types/readwrite-test.xml - create a read-only file --> + <property name="file" value="testfile"/> + <condition property="unix"> + <os family="unix"/> + </condition> + <target name="createTestdir"> + <mkdir dir="${output}"/> + <mkdir dir="${input}"/> + <touch file="${output}/${file}"/> + </target> + <target name="makeFileUnwritable" + depends="createTestdir,makeFileUnwritable-Unix,makeFileUnwritable-Windows"/> + <target name="makeFileUnwritable-Unix" id="unix"> + <chmod file="${output}/${file}" perm="444"/> + </target> + <target name="makeFileUnwritable-Windows" unless="unix"> + <attrib file="${output}/${file}" readonly="true"/> + </target> + + <target name="testMoveOverReadOnlyFile" depends="makeFileUnwritable"> + <sleep seconds="2"/> + <touch file="${input}/${file}"/> + <au:expectfailure + expectedMessage="can't replace read-only destination file "> + <move toDir="${output}"> + <fileset dir="${input}"/> + </move> + </au:expectfailure> + </target> + + <target name="testFilteredMoveOverReadOnlyFile" depends="makeFileUnwritable"> + <sleep seconds="2"/> + <touch file="${input}/${file}"/> + <au:expectfailure + expectedMessage="can't write to read-only destination file "> + <move toDir="${output}"> + <fileset dir="${input}"/> + <filterset> + <filter token="foo" value="bar"/> + </filterset> + </move> + </au:expectfailure> + </target> + + <target name="testMoveOverReadOnlyFileWithOverwrite" + depends="makeFileUnwritable"> + <touch file="${input}/${file}"/> + <au:expectfailure + expectedMessage="can't replace read-only destination file "> + <move toDir="${output}" overwrite="true"> + <fileset dir="${input}"/> + </move> + </au:expectfailure> + </target> + + <target name="testFilteredMoveOverReadOnlyFileWithOverwrite" + depends="makeFileUnwritable"> + <touch file="${input}/${file}"/> + <au:expectfailure + expectedMessage="can't write to read-only destination file "> + <move toDir="${output}" overwrite="true"> + <fileset dir="${input}"/> + <filterset> + <filter token="foo" value="bar"/> + </filterset> + </move> + </au:expectfailure> + </target> + + <target name="testForcedMoveOverReadOnlyFile" depends="makeFileUnwritable"> + <sleep seconds="2"/> + <touch file="${input}/${file}"/> + <move toDir="${output}" force="true"> + <fileset dir="${input}"/> + </move> + </target> + + <target name="testForcedFilteredMoveOverReadOnlyFile" + depends="makeFileUnwritable"> + <sleep seconds="2"/> + <touch file="${input}/${file}"/> + <move toDir="${output}" force="true"> + <fileset dir="${input}"/> + <filterset> + <filter token="foo" value="bar"/> + </filterset> + </move> + </target> + + <target name="testForcedMoveOverReadOnlyFileWithOverwrite" + depends="makeFileUnwritable"> + <touch file="${input}/${file}"/> + <move toDir="${output}" overwrite="true" force="true"> + <fileset dir="${input}"/> + </move> + </target> + + <target name="testForcedFilteredMoveOverReadOnlyFileWithOverwrite" + depends="makeFileUnwritable"> + <touch file="${input}/${file}"/> + <move toDir="${output}" overwrite="true" force="true"> + <fileset dir="${input}"/> + <filterset> + <filter token="foo" value="bar"/> + </filterset> + </move> + </target> +</project> diff --git a/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/optional/depend/depend-test.xml b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/optional/depend/depend-test.xml new file mode 100644 index 00000000..48f94aa3 --- /dev/null +++ b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/optional/depend/depend-test.xml @@ -0,0 +1,131 @@ +<?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" /> + + <property name="src1" location="${input}/src1"/> + <property name="src2" location="${input}/src2"/> + + <target name="setUp"> + <mkdir dir="${src1}"/> + <mkdir dir="${output}"/> + <mkdir dir="${src1}/a"/> + <echo file="${src1}/a/B.java"><![CDATA[ +package a; +public class B { + public static String hello() { + return "Hello"; + } +} +]]></echo> + <mkdir dir="${src2}/b"/> + </target> + + <target name="testBug45916" depends="setUp"> + <echo file="${src2}/b/Main.java"><![CDATA[ +package b; + +import a.B; + +public class Main { + + public static void main(String[] args) { + new Runnable() { + public void run() { + System.err.println(B.hello()); + } + }.run(); + } + +} +]]></echo> + <javac srcdir="${src1}:${src2}" + destdir="${output}"/> + + <!--to ensure that the classfiles generated in the previous step + will be outdated--> + <sleep seconds="3" /> + <touch file="${src1}/a/B.java" /> + <javac srcdir="${src1}" destdir="${output}"/> + <jar destfile="${output}/A.jar" basedir="${output}" includes="a/**"/> + <delete dir="${output}/a"/> + + <depend srcDir="${src1}" + destDir="${output}" cache="${output}" + classpath="${output}/A.jar"/> + <au:assertFileExists file="${output}/b/Main$1.class"/> + </target> + + <target name="classpathTestSetUp" depends="setUp"> + <echo file="${src2}/b/Main.java"><![CDATA[ +package b; + +import a.B; + +public class Main { + + public static void main(String[] args) { + System.err.println(B.hello()); + } + +} +]]></echo> + + <property name="dest2" location="${output}/dest2"/> + + <mkdir dir="${resources}"/> + <mkdir dir="${dest2}"/> + + <javac srcdir="${src1}" destdir="${resources}"/> + <javac srcdir="${src2}" destdir="${dest2}" classpath="${resources}"/> + <sleep seconds="3" /> + <touch file="${src1}/a/B.java" /> + <javac srcdir="${src1}" destdir="${resources}"/> + <au:assertFileExists file="${dest2}/b/Main.class"/> + </target> + + <target name="testClasspathJar" depends="classpathTestSetUp"> + + <jar destfile="${test.jar}" basedir="${resources}"/> + <delete dir="${resources}"/> + <path id="resources-id"> + <pathelement location="${test.jar}"/> + </path> + + <depend srcDir="${src2}" + destDir="${dest2}" cache="${output}" + classpathref="resources-id" + /> + <au:assertFileDoesntExist file="${dest2}/b/Main.class"/> + + </target> + + <target name="testClasspathDir" depends="classpathTestSetUp"> + + <path id="resources-id"> + <pathelement location="${resources}"/> + </path> + + <depend srcDir="${src2}" + destDir="${dest2}" cache="${output}" + classpathref="resources-id" + /> + <au:assertFileDoesntExist file="${dest2}/b/Main.class"/> + + </target> +</project> diff --git a/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/optional/funtest-test.xml b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/optional/funtest-test.xml new file mode 100644 index 00000000..6baa4f7e --- /dev/null +++ b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/optional/funtest-test.xml @@ -0,0 +1,128 @@ +<?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"/> + + <!-- three presets for state--> + <presetdef name="p1"> + <property name="p1" value="true"/> + </presetdef> + <presetdef name="p2"> + <property name="p2" value="true"/> + </presetdef> + <presetdef name="p3"> + <property name="p3" value="true"/> + </presetdef> + <presetdef name="p4"> + <property name="p4" value="true"/> + </presetdef> + <presetdef name="p5"> + <property name="p5" value="true"/> + </presetdef> + + <presetdef name="assertP1"> + <au:assertPropertySet name="p1"/> + </presetdef> + <presetdef name="assertP2"> + <au:assertPropertySet name="p2"/> + </presetdef> + <presetdef name="assertP3"> + <au:assertPropertySet name="p3"/> + </presetdef> + <presetdef name="assertP4"> + <au:assertPropertySet name="p4"/> + </presetdef> + <presetdef name="assertP5"> + <au:assertPropertySet name="p5"/> + </presetdef> + + <target name="setUp"> + <taskdef name="funtest" + classname="org.apache.tools.ant.taskdefs.optional.testing.Funtest"/> + </target> + + <target name="testPresets" + description="test the presets behave"> + <p1/> + <assertP1/> + <p2/> + <assertP2/> + <p3/> + <assertP3/> + <p4/> + <assertP4/> + <p5/> + <assertP5/> + </target> + + <target name="testToSuccess"> + <funtest> + <setup> + <p1/> + </setup> + <application> + <assertP1/> + <p2/> + </application> + <block> + <isset property="p2"/> + </block> + <tests> + <assertP1/> + <assertP2/> + <p3/> + </tests> + <reporting> + <assertP3/> + <p4/> + </reporting> + <teardown> + <assertP4/> + <p5/> + </teardown> + </funtest> + <assertP5/> + </target> + + <target name="testCondition"> + <funtest > + <condition> + <isset property="unset"/> + </condition> + <setup> + <fail>should not be reached</fail> + </setup> + </funtest> + </target> + + <target name="testSetupFailureSkipsTeardown"> + <au:expectfailure message="setup failed"> + <funtest> + <setup> + <p1/> + <fail>setup failed</fail> + </setup> + <teardown> + <p5/> + </teardown> + </funtest> + </au:expectfailure> + <assertP1/> + </target> + +</project> diff --git a/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/optional/javah-test.xml b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/optional/javah-test.xml new file mode 100644 index 00000000..e85293e2 --- /dev/null +++ b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/optional/javah-test.xml @@ -0,0 +1,65 @@ +<?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="-create-javah-adapter"> + <mkdir dir="${input}/org/example" /> + <echo file="${input}/org/example/Adapter.java"> + <![CDATA[ +package org.example; +import org.apache.tools.ant.taskdefs.optional.javah.JavahAdapter; +import org.apache.tools.ant.taskdefs.optional.Javah; + +public class Adapter implements JavahAdapter { + public boolean compile(Javah javah) { + System.err.println("adapter called"); + return true; + } +}]]> + </echo> + <mkdir dir="${resources}" /> + <javac srcdir="${input}" destdir="${resources}" /> + </target> + + <target name="testAdapterNotFound" depends="-create-javah-adapter"> + <au:expectfailure> + <javah class="org.example.Adapter" destdir="${output}" implementation="org.example.Adapter" /> + </au:expectfailure> + <au:assertLogDoesntContain text="adapter called" /> + </target> + + <target name="testImplementationClasspath" depends="-create-javah-adapter" description="https://issues.apache.org/bugzilla/show_bug.cgi?id=11143"> + <mkdir dir="${output}" /> + <javah class="org.example.Adapter" destdir="${output}" implementation="org.example.Adapter"> + <implementationclasspath location="${resources}" /> + </javah> + <au:assertLogContains text="adapter called" /> + </target> + + <target name="testImplementationAsNestedElement" depends="-create-javah-adapter"> + <componentdef classname="org.example.Adapter" name="myjavac"> + <classpath location="${resources}" /> + </componentdef> + <mkdir dir="${output}" /> + <javah class="org.example.Adapter" destdir="${output}"> + <myjavac /> + </javah> + <au:assertLogContains text="adapter called" /> + </target> +</project> diff --git a/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/optional/junit/junit-formatter-test.xml b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/optional/junit/junit-formatter-test.xml new file mode 100644 index 00000000..b9a63c94 --- /dev/null +++ b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/optional/junit/junit-formatter-test.xml @@ -0,0 +1,93 @@ +<?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" /> + + <path id="junit"> + <fileset dir="../../../../../../lib/optional" includes="junit*"/> + </path> + + <target name="setUp"> + <mkdir dir="${input}"/> + <mkdir dir="${output}"/> + <echo file="${input}/ATest.java"><![CDATA[ +package test; +import junit.framework.TestCase; + +public class ATest extends TestCase { + public void testEmpty() {} +} +]]></echo> + <javac srcdir="${input}" destdir="${output}"> + <classpath refid="junit"/> + </javac> + <macrodef name="j"> + <sequential> + <junit fork="true" forkMode="perBatch"> + <classpath refid="junit"/> + <classpath location="${output}"/> + <batchtest todir="${output}"> + <fileset dir="${output}"> + <include name="**/*Test.class" /> + </fileset> + </batchtest> + <formatter type="plain" if="${if}" extension=".dollar_if"/> + <formatter type="plain" if="if" extension=".if"/> + <formatter type="plain" unless="${if}" extension=".dollar_unless"/> + <formatter type="plain" unless="if" extension=".unless"/> + </junit> + </sequential> + </macrodef> + </target> + + <target name="testPropertyNotSet" depends="setUp"> + <j/> + <au:assertFileDoesntExist file="${output}/TEST-test.ATest.dollar_if"/> + <au:assertFileDoesntExist file="${output}/TEST-test.ATest.if"/> + <au:assertFileExists file="${output}/TEST-test.ATest.dollar_unless"/> + <au:assertFileExists file="${output}/TEST-test.ATest.unless"/> + </target> + + <target name="testPropertySet" depends="setUp"> + <property name="if" value="whatever"/> + <j/> + <au:assertFileDoesntExist file="${output}/TEST-test.ATest.dollar_if"/> + <au:assertFileExists file="${output}/TEST-test.ATest.if"/> + <au:assertFileExists file="${output}/TEST-test.ATest.dollar_unless"/> + <au:assertFileDoesntExist file="${output}/TEST-test.ATest.unless"/> + </target> + + <target name="testPropertyTrue" depends="setUp"> + <property name="if" value="true"/> + <j/> + <au:assertFileExists file="${output}/TEST-test.ATest.dollar_if"/> + <au:assertFileExists file="${output}/TEST-test.ATest.if"/> + <au:assertFileDoesntExist file="${output}/TEST-test.ATest.dollar_unless"/> + <au:assertFileDoesntExist file="${output}/TEST-test.ATest.unless"/> + </target> + + <target name="testPropertyFalse" depends="setUp"> + <property name="if" value="false"/> + <j/> + <au:assertFileDoesntExist file="${output}/TEST-test.ATest.dollar_if"/> + <au:assertFileExists file="${output}/TEST-test.ATest.if"/> + <au:assertFileExists file="${output}/TEST-test.ATest.dollar_unless"/> + <au:assertFileDoesntExist file="${output}/TEST-test.ATest.unless"/> + </target> + +</project> diff --git a/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/optional/junit/junit-outputtoformatters-test.xml b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/optional/junit/junit-outputtoformatters-test.xml new file mode 100644 index 00000000..29068e48 --- /dev/null +++ b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/optional/junit/junit-outputtoformatters-test.xml @@ -0,0 +1,137 @@ +<?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="all" xmlns:au="antlib:org.apache.ant.antunit"> + <import file="../../../antunit-base.xml" /> + <property name="ant-build" location="../../../../../../build"/> + <property name="build-junit-dir" location="${ant-build}/ant-unit/junit-dir"/> + <property name="reports.dir" location="${build-junit-dir}/report"/> + + <macrodef name="assert-file-not-contains" backtrace="no"> + <sequential> + <au:assertFalse> + <isfileselected file="${reports.dir}/TEST-ExampleTest.txt"> + <contains text="Hello From Test"/> + </isfileselected> + </au:assertFalse> + </sequential> + </macrodef> + + <macrodef name="assert-file-contains" backtrace="no"> + <sequential> + <au:assertTrue> + <isfileselected file="${reports.dir}/TEST-ExampleTest.txt"> + <contains text="Hello From Test"/> + </isfileselected> + </au:assertTrue> + </sequential> + </macrodef> + + <macrodef name="assert-log-not-contains" backtrace="no"> + <sequential> + <au:assertLogDoesntContain text="Hello From Test" /> + </sequential> + </macrodef> + + <macrodef name="assert-log-contains" backtrace="no"> + <sequential> + <au:assertLogContains text="Hello From Test"/> + </sequential> + </macrodef> + + <macrodef name="run-junit"> + <attribute name="fork"/> + <attribute name="showoutput"/> + <attribute name="outputtoformatters"/> + <sequential> + <junit fork="@{fork}" haltonfailure="no" showoutput="@{showoutput}" + outputtoformatters="@{outputtoformatters}"> + <test name="ExampleTest" todir="${reports.dir}"/> + <classpath path="${resources}"/> + <formatter type="plain" usefile="yes"/> + </junit> + </sequential> + </macrodef> + + <target name="init"> + <delete quiet="yes" dir="${build-junit-dir}"/> + <mkdir dir="${resources}"/> + <mkdir dir="${reports.dir}"/> + </target> + + <target name="compile" depends="init"> + <javac srcdir="src" destdir="${resources}" debug="yes"/> + </target> + + <target name="test-show-yes-formatters-yes" depends="compile"> + <run-junit fork="yes" showoutput="yes" + outputtoformatters="yes"/> + <assert-log-contains/> + <assert-file-contains/> + </target> + + <target name="test-show-yes-formatters-no" depends="compile"> + <run-junit fork="yes" showoutput="yes" + outputtoformatters="no"/> + <assert-log-contains/> + <assert-file-not-contains/> + </target> + + <target name="test-show-yes-formatters-no-forkno" depends="compile"> + <run-junit fork="no" showoutput="yes" + outputtoformatters="no"/> + <assert-log-contains/> + <assert-file-not-contains/> + </target> + + <target name="test-show-no-formatters-no" depends="compile"> + <run-junit fork="yes" showoutput="no" + outputtoformatters="no"/> + <assert-log-not-contains/> + <assert-file-not-contains/> + </target> + + <target name="test-show-no-formatters-no-fork-no" depends="compile"> + <run-junit fork="no" showoutput="no" + outputtoformatters="no"/> + <assert-log-not-contains/> + <assert-file-not-contains/> + </target> + + <target name="test-show-no-formatters-yes" depends="compile"> + <run-junit fork="yes" showoutput="no" + outputtoformatters="yes"/> + <assert-log-not-contains/> + <assert-file-contains/> + </target> + + <target name="test-show-no-formatters-yes-fork-no" depends="compile"> + <run-junit fork="no" showoutput="no" + outputtoformatters="yes"/> + <assert-log-not-contains/> + <assert-file-contains/> + </target> + + <target name="all"> + <au:antunit> + <fileset file="${ant.file}"/> + <au:plainlistener/> + </au:antunit> + </target> + +</project> + diff --git a/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/optional/junit/junit-test.xml b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/optional/junit/junit-test.xml new file mode 100644 index 00000000..e6aa794c --- /dev/null +++ b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/optional/junit/junit-test.xml @@ -0,0 +1,372 @@ +<?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" /> + + <path id="junit"> + <fileset dir="../../../../../../lib/optional" includes="junit*" /> + <fileset dir="../../../../../../lib/optional" includes="hamcrest-core*" /> + </path> + + <macrodef name="empty-test"> + <attribute name="classname" /> + <attribute name="package" default="test" /> + <sequential> + <echo file="${input}/@{classname}.java"> + <![CDATA[ +package @{package}; +import junit.framework.TestCase; + +public class @{classname} extends TestCase { + public void testEmpty() {} +} +]]> + </echo> + </sequential> + </macrodef> + + <target name="setUp"> + <mkdir dir="${input}" /> + <mkdir dir="${output}" /> + </target> + + <target name="testTimeoutLogOfBatchTests"> + <mkdir dir="${input}" /> + <mkdir dir="${output}" /> + <empty-test classname="ATest" package="org.apache.ant.test" /> + <echo file="${input}/BTest.java"> + <![CDATA[ +package org.apache.ant.test; +import junit.framework.TestCase; + +public class BTest extends TestCase { + public void testEmpty() throws Exception { + Thread.sleep(20 * 1000); + } +} +]]> + </echo> + <empty-test classname="CTest" package="org.apache.ant.test" /> + <empty-test classname="DTest" package="org.apache.ant.test" /> + <javac srcdir="${input}" destdir="${output}"> + <classpath refid="junit" /> + </javac> + <junit fork="true" forkMode="perBatch" timeout="5000" printsummary="yes"> + <classpath refid="junit" /> + <classpath location="${output}" /> + <batchtest> + <fileset dir="${output}"> + <include name="**/*Test.class" /> + </fileset> + </batchtest> + </junit> + <au:assertLogContains text="ATest" /> + <au:assertLogContains text="BTest" /> + <au:assertLogContains text="org.apache.ant.test.Batch-With-Multiple-Tests" /> + <au:assertLogDoesntContain text="CTest" /> + <au:assertLogDoesntContain text="DTest" /> + </target> + + <target name="testFailurePropertyOnTestCase"> + <mkdir dir="${input}" /> + <mkdir dir="${output}" /> + <echo file="${input}/ATest.java"> + <![CDATA[ +package test; +import junit.framework.TestCase; + +public class ATest extends TestCase { + public void testFail() { + assertTrue(false); + } +} +]]> + </echo> + <javac srcdir="${input}" destdir="${output}"> + <classpath refid="junit" /> + </javac> + <junit failureProperty="testcase.failed" haltonfailure="false"> + <classpath refid="junit" /> + <classpath location="${output}" /> + <batchtest> + <fileset dir="${output}"> + <include name="**/*Test.class" /> + </fileset> + </batchtest> + </junit> + <au:assertPropertySet name="testcase.failed" /> + </target> + + <target name="testFailurePropertyOnTestSuite"> + <mkdir dir="${input}" /> + <mkdir dir="${output}" /> + <echo file="${input}/ATest.java"> + <![CDATA[ +package test; +import junit.framework.Assert; +import junit.framework.TestSuite; + +public class ATest extends TestSuite { + public ATest() { + super(test.ATest.class); + } + public void testFail() { + Assert.assertTrue(false); + } +} +]]> + </echo> + <javac srcdir="${input}" destdir="${output}"> + <classpath refid="junit" /> + </javac> + <junit failureProperty="testsuite.failed" haltonfailure="false"> + <classpath refid="junit" /> + <classpath location="${output}" /> + <batchtest> + <fileset dir="${output}"> + <include name="**/*Test.class" /> + </fileset> + </batchtest> + </junit> + <au:assertPropertySet name="testsuite.failed" /> + </target> + + <target name="testTimeoutAndFormattersForkPerTest"> + <antcall target="runTimeoutAndFormattersTest"> + <param name="forkMode" value="perTest" /> + </antcall> + <au:assertFileExists file="${output}/TEST-test.CTest.txt" /> + <au:assertFileExists file="${output}/TEST-test.CTest.xml" /> + <au:assertFileExists file="${output}/TEST-test.DTest.txt" /> + <au:assertFileExists file="${output}/TEST-test.DTest.xml" /> + </target> + + <target name="testTimeoutAndFormattersForkOnce"> + <antcall target="runTimeoutAndFormattersTest"> + <param name="forkMode" value="once" /> + </antcall> + <au:assertFileDoesntExist file="${output}/TEST-test.CTest.txt" /> + <au:assertFileDoesntExist file="${output}/TEST-test.CTest.xml" /> + <au:assertFileDoesntExist file="${output}/TEST-test.DTest.txt" /> + <au:assertFileDoesntExist file="${output}/TEST-test.DTest.xml" /> + </target> + + <target name="runTimeoutAndFormattersTest" description="https://issues.apache.org/bugzilla/show_bug.cgi?id=35634"> + <mkdir dir="${input}" /> + <mkdir dir="${output}" /> + <empty-test classname="ATest" /> + <echo file="${input}/BTest.java"> + <![CDATA[ +package test; +import junit.framework.TestCase; + +public class BTest extends TestCase { + public void testEmpty() throws Exception { + Thread.sleep(20 * 1000); + } +} +]]> + </echo> + <empty-test classname="CTest" /> + <empty-test classname="DTest" /> + <javac srcdir="${input}" destdir="${output}"> + <classpath refid="junit" /> + </javac> + <junit fork="true" timeout="5000" forkmode="${forkMode}"> + <classpath refid="junit" /> + <classpath location="${output}" /> + <batchtest todir="${output}"> + <fileset dir="${output}"> + <include name="**/*Test.class" /> + </fileset> + </batchtest> + <formatter type="brief" /> + <formatter type="xml" /> + </junit> + <au:assertFileExists file="${output}/TEST-test.ATest.txt" /> + <au:assertFileExists file="${output}/TEST-test.ATest.xml" /> + <!-- + <au:assertFileExists file="${output}/TEST-test.BTest.txt" /> + <au:assertFileExists file="${output}/TEST-test.BTest.xml" /> + + These files should only exist if something was written to the log by te runner. + The test previously passed even though the files were empty, which isn't a meaningful result. + TODO we should probably improve the testing around reporting of tests that have timed-out + --> + </target> + + <target name="-ifUnlessSetup" depends="setUp"> + <empty-test classname="ATest" /> + <empty-test classname="BTest" /> + <empty-test classname="CTest" /> + <empty-test classname="DTest" /> + <empty-test classname="ETest" /> + <empty-test classname="FTest" /> + <empty-test classname="GTest" /> + <empty-test classname="HTest" /> + <javac srcdir="${input}" destdir="${output}"> + <classpath refid="junit" /> + </javac> + <macrodef name="j"> + <sequential> + <junit fork="true" forkMode="perBatch" printsummary="yes"> + <classpath refid="junit" /> + <classpath location="${output}" /> + <test name="test.ATest" if="${if}" /> + <test name="test.BTest" if="if" /> + <test name="test.CTest" unless="${if}" /> + <test name="test.DTest" unless="if" /> + <batchtest if="${if}"> + <fileset dir="${output}"> + <include name="**/ETest.class" /> + </fileset> + </batchtest> + <batchtest if="if"> + <fileset dir="${output}"> + <include name="**/FTest.class" /> + </fileset> + </batchtest> + <batchtest unless="${if}"> + <fileset dir="${output}"> + <include name="**/GTest.class" /> + </fileset> + </batchtest> + <batchtest unless="if"> + <fileset dir="${output}"> + <include name="**/HTest.class" /> + </fileset> + </batchtest> + </junit> + </sequential> + </macrodef> + </target> + + <target name="testPropertiesNotSet" depends="-ifUnlessSetup"> + <j /> + <au:assertLogDoesntContain text="Running test.ATest" /> + <au:assertLogDoesntContain text="Running test.BTest" /> + <au:assertLogContains text="Running test.CTest" /> + <au:assertLogContains text="Running test.DTest" /> + <au:assertLogDoesntContain text="Running test.ETest" /> + <au:assertLogDoesntContain text="Running test.FTest" /> + <au:assertLogContains text="Running test.GTest" /> + <au:assertLogContains text="Running test.HTest" /> + </target> + + <target name="testPropertiesSet" depends="-ifUnlessSetup"> + <property name="if" value="whatever" /> + <j /> + <au:assertLogDoesntContain text="Running test.ATest" /> + <au:assertLogContains text="Running test.BTest" /> + <au:assertLogContains text="Running test.CTest" /> + <au:assertLogDoesntContain text="Running test.DTest" /> + <au:assertLogDoesntContain text="Running test.ETest" /> + <au:assertLogContains text="Running test.FTest" /> + <au:assertLogContains text="Running test.GTest" /> + <au:assertLogDoesntContain text="Running test.HTest" /> + </target> + + <target name="testPropertiesTrue" depends="-ifUnlessSetup"> + <property name="if" value="true" /> + <j /> + <au:assertLogContains text="Running test.ATest" /> + <au:assertLogContains text="Running test.BTest" /> + <au:assertLogDoesntContain text="Running test.CTest" /> + <au:assertLogDoesntContain text="Running test.DTest" /> + <au:assertLogContains text="Running test.ETest" /> + <au:assertLogContains text="Running test.FTest" /> + <au:assertLogDoesntContain text="Running test.GTest" /> + <au:assertLogDoesntContain text="Running test.HTest" /> + </target> + + <target name="testPropertiesFalse" depends="-ifUnlessSetup"> + <property name="if" value="false" /> + <j /> + <au:assertLogDoesntContain text="Running test.ATest" /> + <au:assertLogContains text="Running test.BTest" /> + <au:assertLogContains text="Running test.CTest" /> + <au:assertLogDoesntContain text="Running test.DTest" /> + <au:assertLogDoesntContain text="Running test.ETest" /> + <au:assertLogContains text="Running test.FTest" /> + <au:assertLogContains text="Running test.GTest" /> + <au:assertLogDoesntContain text="Running test.HTest" /> + </target> + + <target name="testMissingTestName"> + <property name="test.name" value="null" /> + <au:expectfailure message="test name must be specified"> + <junit fork="false"> + <test name="${test.name}" /> + </junit> + </au:expectfailure> + </target> + + <target name="testTestMethods"> + <condition property="source" value="6"> + <isset property="jdk1.6+"/> + </condition> + <property name="source" value="5"/> + <echo file="${input}/T1.java">public class T1 extends + junit.framework.TestCase { + public void testOK() {} + public void testBad() {throw new RuntimeException("failed");} + }</echo> + <echo file="${input}/T2.java"> + import org.junit.Test; + public class T2 { + @Test + public void ok() {} + @Test + public void bad() { + throw new RuntimeException("failed");} + }</echo> + <javac srcdir="${input}" destdir="${output}" includes="T1.java,T2.java" source="${source}" includeantruntime="false"> + <classpath> + <path refid="junit" /> + </classpath> + </javac> + <junit fork="true" printsummary="true" haltonerror="true"> + <classpath> + <pathelement location="${output}" /> + <path refid="junit" /> + </classpath> + <test name="T1" methods="testOK" /> + <test name="T2" methods="ok" /> + </junit> + </target> + + <target name="testClasspathBuildingSurvivesNonZips" depends="setUp" + description="https://issues.apache.org/bugzilla/show_bug.cgi?id=53964"> + <empty-test classname="ATest" package="org.apache.ant.test" /> + <javac srcdir="${input}" destdir="${output}"> + <classpath refid="junit" /> + </javac> + <junit fork="true" printsummary="true" haltonerror="true"> + <classpath> + <pathelement location="${output}" /> + <pathelement location="${ant.file}" /> + <path refid="junit" /> + </classpath> + <batchtest> + <fileset dir="${output}"> + <include name="**/*Test.class" /> + </fileset> + </batchtest> + </junit> + </target> +</project> diff --git a/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/optional/junit/src/ExampleTest.java b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/optional/junit/src/ExampleTest.java new file mode 100644 index 00000000..f1e5ca2b --- /dev/null +++ b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/optional/junit/src/ExampleTest.java @@ -0,0 +1,23 @@ +/* +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. +*/ +import junit.framework.TestCase; + +public class ExampleTest extends TestCase { + public void testHello() { + System.out.println("Hello From Test"); + } +} diff --git a/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/optional/junit/xmlformatter-test.xml b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/optional/junit/xmlformatter-test.xml new file mode 100644 index 00000000..4aa6e4da --- /dev/null +++ b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/optional/junit/xmlformatter-test.xml @@ -0,0 +1,126 @@ +<?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"/> + + <path id="junit"> + <fileset dir="../../../../../../lib/optional" includes="junit*"/> + </path> + + <target name="test0Character"> + <mkdir dir="${input}/org/example"/> + <echo file="${input}/org/example/A.java"><![CDATA[ +package org.example; +import junit.framework.TestCase; +public class A extends TestCase { + public void testX() { + System.err.println("Here comes the zero: \u0000"); + } +} +]]></echo> + <mkdir dir="${output}"/> + <javac srcdir="${input}" destdir="${output}"> + <classpath refid="junit"/> + </javac> + <junit fork="true"> + <classpath refid="junit"/> + <classpath location="${output}"/> + <batchtest todir="${output}"> + <fileset dir="${output}"> + <include name="**/A.class" /> + </fileset> + </batchtest> + <formatter type="xml"/> + </junit> + <xmlvalidate file="${output}/TEST-org.example.A.xml" + lenient="true"/> + </target> + + <target name="testEntities" + description="https://issues.apache.org/bugzilla/show_bug.cgi?id=49404"> + <mkdir dir="${input}/org/example"/> + <echo file="${input}/org/example/A.java"><![CDATA[ +package org.example; +import junit.framework.TestCase; +public class A extends TestCase { + public void testX() { + assertTrue("&&", false); + } +} +]]></echo> + <mkdir dir="${output}"/> + <javac srcdir="${input}" destdir="${output}"> + <classpath refid="junit"/> + </javac> + <junit fork="true"> + <classpath refid="junit"/> + <classpath location="${output}"/> + <batchtest todir="${output}"> + <fileset dir="${output}"> + <include name="**/A.class" /> + </fileset> + </batchtest> + <formatter type="xml"/> + </junit> + <xmlvalidate file="${output}/TEST-org.example.A.xml" + lenient="true"/> + <au:assertResourceContains + resource="${output}/TEST-org.example.A.xml" + value="message="&amp;amp;&amp;"/> + <au:assertResourceContains + resource="${output}/TEST-org.example.A.xml" + value="AssertionFailedError: &amp;amp;&"/> + </target> + + <target name="testMessageWithTheWordMore"> + <mkdir dir="${input}/org/example"/> + <echo file="${input}/org/example/A.java"><![CDATA[ +package org.example; +import junit.framework.TestCase; +public class A extends TestCase { + public void testX() { + assertTrue("Expected more than one result", 0 > 1); + } + public void testY() { + assertTrue("Expected less than one result", 2 < 1); + } +} +]]></echo> + <mkdir dir="${output}"/> + <javac srcdir="${input}" destdir="${output}"> + <classpath refid="junit"/> + </javac> + <junit fork="true"> + <classpath refid="junit"/> + <classpath location="${output}"/> + <batchtest todir="${output}"> + <fileset dir="${output}"> + <include name="**/A.class" /> + </fileset> + </batchtest> + <formatter type="xml"/> + </junit> + <au:assertResourceContains + resource="${output}/TEST-org.example.A.xml" + value="junit.framework.AssertionFailedError: Expected less than one result"/> + <au:assertResourceContains + resource="${output}/TEST-org.example.A.xml" + value="junit.framework.AssertionFailedError: Expected more than one result"/> + </target> + +</project> diff --git a/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/optional/native2ascii-test.xml b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/optional/native2ascii-test.xml new file mode 100644 index 00000000..7a30df79 --- /dev/null +++ b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/optional/native2ascii-test.xml @@ -0,0 +1,68 @@ +<?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="-create-native2ascii-adapter"> + <mkdir dir="${input}/org/example"/> + <echo file="${input}/org/example/Adapter.java"><![CDATA[ +package org.example; +import java.io.File; +import org.apache.tools.ant.taskdefs.optional.native2ascii.Native2AsciiAdapter; +import org.apache.tools.ant.taskdefs.optional.Native2Ascii; + +public class Adapter implements Native2AsciiAdapter { + public boolean convert(Native2Ascii native2ascii, File f1, File f2) { + System.err.println("adapter called"); + return true; + } +}]]></echo> + <mkdir dir="${resources}"/> + <javac srcdir="${input}" destdir="${resources}"/> + </target> + + <target name="testAdapterNotFound" depends="-create-native2ascii-adapter" unless="build.sysclasspath.only"> + <!-- under gump the failure will not happen because the ${resources} directory is systematically on the classpath + what would be cool would be a task which removes a path element from the classpath. Do we have that ? --> + <au:expectfailure> + <native2ascii src="${input}" dest="${output}" includes="**/*.java" + implementation="org.example.Adapter"/> + </au:expectfailure> + <au:assertLogDoesntContain text="adapter called"/> + </target> + + <target name="testImplementationClasspath" depends="-create-native2ascii-adapter" + description="https://issues.apache.org/bugzilla/show_bug.cgi?id=11143"> + <native2ascii src="${input}" dest="${output}" includes="**/*.java" + implementation="org.example.Adapter"> + <implementationclasspath location="${resources}"/> + </native2ascii> + <au:assertLogContains text="adapter called"/> + </target> + + <target name="testImplementationAsNestedElement" + depends="-create-native2ascii-adapter"> + <componentdef classname="org.example.Adapter" name="myjavac"> + <classpath location="${resources}"/> + </componentdef> + <native2ascii src="${input}" dest="${output}" includes="**/*.java"> + <myjavac/> + </native2ascii> + <au:assertLogContains text="adapter called"/> + </target> +</project> diff --git a/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/optional/propertyfile-test.xml b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/optional/propertyfile-test.xml new file mode 100644 index 00000000..0ea70513 --- /dev/null +++ b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/optional/propertyfile-test.xml @@ -0,0 +1,44 @@ +<?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="setUp"> + <mkdir dir="${output}"/> + </target> + + <target name="testReadWithPrefix" depends="setUp" + description="https://issues.apache.org/bugzilla/show_bug.cgi?id=48768"> + <property name="test.txt" location="${output}/test.txt"/> + <echo file="${test.txt}"><![CDATA[ +bbb=val2 +aaa=val1 +]]></echo> + + <property file="${test.txt}"/> + <au:assertPropertyEquals name="aaa" value="val1"/> + <au:assertPropertyEquals name="bbb" value="val2"/> + <propertyfile file="${test.txt}"> + <entry key="bbb" value="dummy"/> + </propertyfile> + + <property file="${test.txt}" prefix="xxx"/> + <au:assertPropertyEquals name="xxx.aaa" value="val1"/> + <au:assertPropertyEquals name="xxx.bbb" value="dummy"/> + </target> +</project> diff --git a/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/optional/propertyfilelayout-test.xml b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/optional/propertyfilelayout-test.xml new file mode 100644 index 00000000..f1b367f9 --- /dev/null +++ b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/optional/propertyfilelayout-test.xml @@ -0,0 +1,289 @@ +<?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="setUp"> + <mkdir dir="${input}"/> + <mkdir dir="${output}"/> + <echo file="${input}/initial.properties"><![CDATA[#my comment +foo=bar +#second comment +x=1 +]]></echo> + <fixcrlf file="${input}/initial.properties"/> + <presetdef name="pf"> + <propertyfile file="${output}/created.properties"> + <entry key="foo" value="bar"/> + <entry key="x" value="1" type="int"/> + </propertyfile> + </presetdef> + </target> + + <target name="testCreateWithoutComment" depends="setUp"> + <pf/> + <local name="head.in"/> + <local name="head.out"/> + <local name="tail.in"/> + <local name="tail.out"/> + <!-- skip comment --> + <loadfile srcfile="${input}/initial.properties" property="head.in"> + <filterchain> + <headfilter lines="1" skip="1"/> + </filterchain> + </loadfile> + <loadfile srcfile="${input}/initial.properties" property="tail.in"> + <filterchain> + <tailfilter lines="1"/> + </filterchain> + </loadfile> + <!-- skip date and blank line --> + <loadfile srcfile="${output}/created.properties" property="head.out"> + <filterchain> + <headfilter lines="1" skip="2"/> + </filterchain> + </loadfile> + <loadfile srcfile="${output}/created.properties" property="tail.out"> + <filterchain> + <tailfilter lines="1"/> + </filterchain> + </loadfile> + <au:assertPropertyEquals name="head.out" value="${head.in}"/> + <au:assertPropertyEquals name="tail.out" value="${tail.in}"/> + </target> + + <target name="testCreateWithComment" depends="setUp"> + <pf comment="my comment"/> + <local name="head.in"/> + <local name="head.out"/> + <local name="middle.in"/> + <local name="middle.out"/> + <local name="tail.in"/> + <local name="tail.out"/> + <!-- just comment --> + <loadfile srcfile="${input}/initial.properties" property="head.in"> + <filterchain> + <headfilter lines="1"/> + </filterchain> + </loadfile> + <!-- skip comment --> + <loadfile srcfile="${input}/initial.properties" property="middle.in"> + <filterchain> + <headfilter lines="1" skip="1"/> + </filterchain> + </loadfile> + <loadfile srcfile="${input}/initial.properties" property="tail.in"> + <filterchain> + <tailfilter lines="1"/> + </filterchain> + </loadfile> + <!-- just comment --> + <loadfile srcfile="${output}/created.properties" property="head.out"> + <filterchain> + <headfilter lines="1"/> + </filterchain> + </loadfile> + <!-- skip comment, date and blank line --> + <loadfile srcfile="${output}/created.properties" property="middle.out"> + <filterchain> + <headfilter lines="1" skip="3"/> + </filterchain> + </loadfile> + <loadfile srcfile="${output}/created.properties" property="tail.out"> + <filterchain> + <tailfilter lines="1"/> + </filterchain> + </loadfile> + <au:assertPropertyEquals name="head.out" value="${head.in}"/> + <au:assertPropertyEquals name="middle.out" value="${middle.in}"/> + <au:assertPropertyEquals name="tail.out" value="${tail.in}"/> + </target> + + <target name="-updateSetUp" depends="setUp"> + <copy file="${input}/initial.properties" + tofile="${output}/created.properties"/> + </target> + + <target name="testUpdateWithoutComment" depends="-updateSetUp"> + <pf/> + <local name="head.in"/> + <local name="head.out"/> + <loadfile srcfile="${input}/initial.properties" property="head.in"/> + <!-- skip date --> + <loadfile srcfile="${output}/created.properties" property="head.out"> + <filterchain> + <headfilter skip="1"/> + </filterchain> + </loadfile> + <au:assertPropertyEquals name="head.out" value="${head.in}"/> + </target> + + <target name="testUpdateWithNewComment" depends="-updateSetUp"> + <pf comment="new comment"/> + <local name="head.in"/> + <local name="head.out"/> + <local name="tail.in"/> + <local name="tail.out"/> + <property name="head.in" value="#new comment${line.separator}"/> + <!-- just comment --> + <loadfile srcfile="${output}/created.properties" property="head.out"> + <filterchain> + <headfilter lines="1"/> + </filterchain> + </loadfile> + <loadfile srcfile="${input}/initial.properties" property="tail.in"/> + <!-- skip new comment and date --> + <loadfile srcfile="${output}/created.properties" property="tail.out"> + <filterchain> + <headfilter skip="2"/> + </filterchain> + </loadfile> + <au:assertPropertyEquals name="head.out" value="${head.in}"/> + <au:assertPropertyEquals name="tail.out" value="${tail.in}"/> + </target> + + <target name="testUpdateWithSameComment" depends="-updateSetUp"> + <pf comment="my comment"/> + <local name="head.in"/> + <local name="head.out"/> + <local name="tail.in"/> + <local name="tail.out"/> + <!-- just comment --> + <loadfile srcfile="${input}/initial.properties" property="head.in"> + <filterchain> + <headfilter lines="1"/> + </filterchain> + </loadfile> + <!-- just comment --> + <loadfile srcfile="${output}/created.properties" property="head.out"> + <filterchain> + <headfilter lines="1"/> + </filterchain> + </loadfile> + <!-- skip comment --> + <loadfile srcfile="${input}/initial.properties" property="tail.in"> + <filterchain> + <headfilter skip="1"/> + </filterchain> + </loadfile> + <!-- skip comment and date --> + <loadfile srcfile="${output}/created.properties" property="tail.out"> + <filterchain> + <headfilter skip="2"/> + </filterchain> + </loadfile> + <au:assertPropertyEquals name="head.out" value="${head.in}"/> + <au:assertPropertyEquals name="tail.out" value="${tail.in}"/> + </target> + + <target name="testRepeatedUpdateWithoutComment" depends="-updateSetUp"> + <pf/> + <pf/> + <local name="head.in"/> + <local name="head.out"/> + <loadfile srcfile="${input}/initial.properties" property="head.in"/> + <!-- skip date --> + <loadfile srcfile="${output}/created.properties" property="head.out"> + <filterchain> + <headfilter skip="1"/> + </filterchain> + </loadfile> + <au:assertPropertyEquals name="head.out" value="${head.in}"/> + </target> + + <target name="testRepeatedUpdateWithSameComment" depends="-updateSetUp"> + <pf comment="my comment"/> + <pf comment="my comment"/> + <local name="head.in"/> + <local name="head.out"/> + <local name="tail.in"/> + <local name="tail.out"/> + <!-- just comment --> + <loadfile srcfile="${input}/initial.properties" property="head.in"> + <filterchain> + <headfilter lines="1"/> + </filterchain> + </loadfile> + <!-- just comment --> + <loadfile srcfile="${output}/created.properties" property="head.out"> + <filterchain> + <headfilter lines="1"/> + </filterchain> + </loadfile> + <!-- skip comment --> + <loadfile srcfile="${input}/initial.properties" property="tail.in"> + <filterchain> + <headfilter skip="1"/> + </filterchain> + </loadfile> + <!-- skip comment and date --> + <loadfile srcfile="${output}/created.properties" property="tail.out"> + <filterchain> + <headfilter skip="2"/> + </filterchain> + </loadfile> + <au:assertPropertyEquals name="head.out" value="${head.in}"/> + <au:assertPropertyEquals name="tail.out" value="${tail.in}"/> + </target> + + + <target name="testPreservesDosLineEnds" depends="setUp" + description="https://issues.apache.org/bugzilla/show_bug.cgi?id=50049"> + <property name="test.txt" location="${output}/test.txt"/> + <echo file="${test.txt}"><![CDATA[ +bbb=val2 +aaa=val1 +]]></echo> + <fixcrlf eol="dos" file="${test.txt}"/> + <propertyfile file="${test.txt}" comment="${header}"/> + <copy file="${test.txt}" tofile="${test.txt}.expected"/> + <fixcrlf eol="dos" file="${test.txt}.expected"/> + <au:assertFilesMatch expected="${test.txt}.expected" + actual="${test.txt}"/> + </target> + + <target name="testPreservesUnixLineEnds" depends="setUp" + description="https://issues.apache.org/bugzilla/show_bug.cgi?id=50049"> + <property name="test.txt" location="${output}/test.txt"/> + <echo file="${test.txt}"><![CDATA[ +bbb=val2 +aaa=val1 +]]></echo> + <fixcrlf eol="unix" file="${test.txt}"/> + <propertyfile file="${test.txt}" comment="${header}"/> + <copy file="${test.txt}" tofile="${test.txt}.expected"/> + <fixcrlf eol="unix" file="${test.txt}.expected"/> + <au:assertFilesMatch expected="${test.txt}.expected" + actual="${test.txt}"/> + </target> + + <target name="testPreservesMacLineEnds" depends="setUp" + description="https://issues.apache.org/bugzilla/show_bug.cgi?id=50049"> + <property name="test.txt" location="${output}/test.txt"/> + <echo file="${test.txt}"><![CDATA[ +bbb=val2 +aaa=val1 +]]></echo> + <fixcrlf eol="mac" file="${test.txt}"/> + <propertyfile file="${test.txt}" comment="${header}"/> + <copy file="${test.txt}" tofile="${test.txt}.expected"/> + <fixcrlf eol="mac" file="${test.txt}.expected"/> + <au:assertFilesMatch expected="${test.txt}.expected" + actual="${test.txt}"/> + </target> +</project> diff --git a/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/optional/replaceregexp-test.xml b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/optional/replaceregexp-test.xml new file mode 100644 index 00000000..2d64ce7a --- /dev/null +++ b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/optional/replaceregexp-test.xml @@ -0,0 +1,32 @@ +<?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="testRCSupport"> + <mkdir dir="${output}"/> + <echo file="${output}/text.txt"><![CDATA[ +Hello, world! +]]></echo> + <replaceregexp match="world" replace="Ant"> + <file file="${output}/text.txt"/> + </replaceregexp> + <au:assertResourceContains + resource="${output}/text.txt" value="Hello, Ant!"/> + </target> +</project> diff --git a/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/optional/script/scriptdef-test.xml b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/optional/script/scriptdef-test.xml new file mode 100644 index 00000000..da78e427 --- /dev/null +++ b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/optional/script/scriptdef-test.xml @@ -0,0 +1,131 @@ +<?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" /> + + <description> + In which we test interesting aspects of scripting. + The targeted language is javascript; this lets us run without + additions on Java6+. + </description> + + <condition property="prereqs-ok"> + <or> + <and> + <available classname="org.apache.bsf.BSFManager" /> + <available classname="org.apache.bsf.engines.javascript.JavaScriptEngine" /> + </and> + <available classname="javax.script.ScriptEngineManager" /> + </or> + </condition> + + <!-- auto doesn't verify the language is supported and selects BSF + even if the JavaScriptEngine is not there --> + <condition property="script.manager" value="javax"> + <and> + <not> + <available classname="org.apache.bsf.engines.javascript.JavaScriptEngine" /> + </not> + <isset property="prereqs-ok"/> + </and> + </condition> + <property name="script.manager" value="auto" /> + + <string id="script.code"> + self.log("Ant version =${ant.version}"); + project.setNewProperty("property","live"); + </string> + + <presetdef name="js"> + <scriptdef language="javascript" name="scripttest" manager="${script.manager}"> + <!-- optional property attribute--> + <attribute name="property" /> + </scriptdef> + </presetdef> + + <property name="prop" value='self.log("Ant version =${ant.version}");project.setNewProperty("property","live");' /> + + <presetdef name="assertPropSet"> + <au:assertPropertyEquals name="property" value="live" /> + </presetdef> + + + <!--purely to test that everything works --> + <target name="testInline" if="prereqs-ok"> + <js>self.log("Hello");</js> + <scripttest /> + </target> + + <target name="testStringResource" if="prereqs-ok"> + <js> + <string value='self.log("Ant version =${ant.version}");' /> + </js> + <scripttest /> + </target> + + <target name="testStringResourceRef" if="prereqs-ok"> + <js> + <string refid="script.code" /> + </js> + <scripttest /> + <assertPropSet /> + </target> + + <target name="testStringResourceInline" if="prereqs-ok"> + <js> + <string> + self.log("Ant version =${ant.version}"); + project.setNewProperty("property","live"); + </string> + </js> + <scripttest /> + <assertPropSet /> + </target> + + <target name="testPropertyResource" if="prereqs-ok"> + <js> + <propertyresource name="prop" /> + </js> + <scripttest /> + <assertPropSet /> + </target> + + <target name="testMixedResources" if="prereqs-ok"> + <js> + <string refid="script.code" /> + <propertyresource name="prop" /> + <string> + project.setNewProperty("property2","live"); + </string> + </js> + <scripttest /> + <assertPropSet name="property2" /> + </target> + + <target name="testExceptionNesting" description="https://issues.apache.org/bugzilla/show_bug.cgi?id=47509" if="prereqs-ok"> + <scriptdef name="quickfail" language="javascript"> + <![CDATA[ + self.fail("I failed!"); + ]]> + </scriptdef> + <au:expectfailure message="I failed!"> + <quickfail /> + </au:expectfailure> + </target> +</project> diff --git a/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/optional/unix/symlink-test.xml b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/optional/unix/symlink-test.xml new file mode 100644 index 00000000..90c57f43 --- /dev/null +++ b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/optional/unix/symlink-test.xml @@ -0,0 +1,109 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- + 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="symlink-test" + default="antunit" xmlns:au="antlib:org.apache.ant.antunit"> + <import file="../../../antunit-base.xml"/> + + <target name="setUp"> + <condition property="isUnix"> + <os family="unix" /> + </condition> + </target> + + <target name="tearDown" depends="antunit-base.tearDown" + if="chmod.tmp"> + <chmod dir="${chmod.tmp}" perm="755"/> + <delete dir="${chmod.tmp}"/> + </target> + + <target name="os"> + + <mkdir dir="${output}" /> + <condition property="unix"> + <os family="unix" /> + </condition> + <property name="file_ref" + location="${output}/file"/> + <property name="hanging_ref" + location="${output}/hanging_ref"/> + </target> + + <target name="init" depends="os" if="unix"> + <touch file="${file_ref}" /> + </target> + + <target name="testCreateDouble" depends="init" if="unix"> + <symlink overwrite="true" link="${output}/link" + resource="${file_ref}"/> + <symlink overwrite="true" link="${output}/link" + resource="${file_ref}"/> + </target> + + + <target name="testCreateDoubleHanging" depends="init" if="unix"> + <symlink overwrite="true" link="${output}/link2" + resource="${hanging_ref}"/> + <symlink overwrite="true" link="${output}/link2" + resource="${hanging_ref}"/> + </target> + + <target name="testCreateOverFile" depends="init" if="unix"> + <touch file="${output}/link3" /> + <symlink overwrite="true" link="${output}/link3" + resource="${file_ref}"/> + </target> + + <target name="testDeleteOfBrokenLink" depends="init" if="unix"> + <symlink link="${output}/link" resource="${file_ref}"/> + <delete file="${file_ref}"/> + <symlink link="${output}/link" action="delete"/> + <au:assertFileDoesntExist file="${output}/link"/> + </target> + + <target name="testDeleteLinkToParent" depends="init" if="unix"> + <symlink link="${output}/link" resource="${output}"/> + <symlink link="${output}/link" action="delete"/> + <au:assertFileDoesntExist file="${output}/link"/> + </target> + + <target name="testDeleteWithNoPermissionToRenameTarget" + depends="init" if="unix"> + <!-- must be outside of ${output} or "base" tearDown will fail --> + <property name="chmod.tmp" location="${output}/../ant-symlink-test"/> + <mkdir dir="${chmod.tmp}/A"/> + <chmod perm="555" dir="${chmod.tmp}"/> + <symlink link="${output}/link" resource="${chmod.tmp}/A"/> + <symlink link="${output}/link" action="delete"/> + <au:assertFileDoesntExist file="${output}/link"/> + </target> + + <target name="testDeleteLinkInSameDirAsBuildFile" depends="setUp" if="isUnix" + description="https://issues.apache.org/bugzilla/show_bug.cgi?id=49137"> + <mkdir dir="${output}/Templates"/> + <mkdir dir="${output}/project1"/> + <symlink action="single" link="${output}/project1/Templates" + resource="../Templates"/> + <echo file="${output}/project1/build.xml"><![CDATA[ +<project name="project1" default="build" basedir="."> + <target name="build"> + <symlink action="delete" link="Templates"/> + </target> +</project>]]></echo> + <ant antfile="${output}/project1/build.xml"/> + </target> +</project> diff --git a/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/optional/windows/attrib-test.xml b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/optional/windows/attrib-test.xml new file mode 100644 index 00000000..d5cea2b5 --- /dev/null +++ b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/optional/windows/attrib-test.xml @@ -0,0 +1,46 @@ +<?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="setUp"> + <condition property="windows?"> + <os family="windows"/> + </condition> + <mkdir dir="${input}"/> + </target> + + <target name="testPerformance" depends="setUp" if="windows?" + description="https://issues.apache.org/bugzilla/show_bug.cgi?id=48734"> + <touch file="${input}/0.tld"/> + <touch file="${input}/1.tld"/> + <touch file="${input}/2.tld"/> + <touch file="${input}/3.tld"/> + <touch file="${input}/4.tld"/> + <touch file="${input}/5.tld"/> + <touch file="${input}/6.tld"/> + <touch file="${input}/7.tld"/> + <touch file="${input}/8.tld"/> + <touch file="${input}/9.tld"/> + <attrib readonly="false"> + <fileset dir="${input}"> + <include name="*.tld" /> + </fileset> + </attrib> + </target> +</project> diff --git a/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/parallel-test.xml b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/parallel-test.xml new file mode 100644 index 00000000..72e4828d --- /dev/null +++ b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/parallel-test.xml @@ -0,0 +1,37 @@ +<?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="testTimeout" + description="https://issues.apache.org/bugzilla/show_bug.cgi?id=49527"> + <au:expectfailure message="Parallel execution timed out"> + <parallel timeout="2000"> + <sequential> + <echo message="Before sleep" /> + <sleep seconds="10" /> + <echo message="After sleep" /> + </sequential> + </parallel> + </au:expectfailure> + <au:assertLogDoesntContain text="After sleep"/> + </target> +</project>
\ No newline at end of file diff --git a/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/pathconvert-test.xml b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/pathconvert-test.xml new file mode 100644 index 00000000..3683affe --- /dev/null +++ b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/pathconvert-test.xml @@ -0,0 +1,31 @@ +<?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="test-dir-char"> + <pathconvert property="def|ghi" dirsep="|"> + <map from="${basedir}/abc/" to=''/> + <path location="abc/def/ghi"/> + </pathconvert> + <au:assertTrue> + <equals arg1="${def|ghi}" arg2="def|ghi"/> + </au:assertTrue> + </target> + +</project> diff --git a/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/property-test.xml b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/property-test.xml new file mode 100644 index 00000000..2eb0e18f --- /dev/null +++ b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/property-test.xml @@ -0,0 +1,171 @@ +<?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="testNestedText"> + <property name="foo">bar</property> + <au:assertPropertyEquals name="foo" value="bar"/> + </target> + + <target name="testNoNestedTextButValueAttribute"> + <property name="foo" value="bar"> + </property> + <au:assertPropertyEquals name="foo" value="bar"/> + </target> + + <target name="testNestedTextAndValueAttribute"> + <au:expectfailure> + <property name="foo" value="bar"> + hello + </property> + </au:expectfailure> + </target> + + <!-- Ensure we have platform dependent path separator --> + <property name="base" location="${basedir}"/> + <!-- an existing file as anchor for calculating paths --> + <property name="testfile" value="condition${file.separator}antversion-test.xml"/> + + <target name="testLocation"> + <property name="foo" location="${testfile}"/> + <au:assertPropertyEquals name="foo" value="${base}${file.separator}${testfile}"/> + </target> + + <target name="testLocationWithRecursive"> + <property name="foo" location="${testfile}" relative="false"/> + <au:assertPropertyEquals name="foo" value="${base}${file.separator}${testfile}"/> + </target> + + <target name="testRelative"> + <property name="foo" location="${testfile}" relative="true"/> + <au:assertPropertyEquals name="foo" value="${testfile}"/> + </target> + + <target name="testRelativeBase"> + <property name="foo" location="${testfile}" relative="true" basedir="${base}"/> + <au:assertPropertyEquals name="foo" value="${testfile}"/> + </target> + + <target name="testRelativeUnderBase"> + <property name="foo" location="${testfile}" relative="true" basedir="condition"/> + <au:assertPropertyEquals name="foo" value="antversion-test.xml"/> + </target> + + <target name="testRelativeUnderBase2"> + <property name="foo" location="${testfile}" relative="true" basedir="cvs"/> + <au:assertPropertyEquals name="foo" value="..${file.separator}condition${file.separator}antversion-test.xml"/> + </target> + + <target name="testRelativeOverBase"> + <property name="foo" location="${testfile}" relative="true" basedir=".."/> + <au:assertPropertyEquals name="foo" value="taskdefs${file.separator}${testfile}"/> + </target> + + <target name="testNestedExpansionHonorsImmutability"> + <mkdir dir="${input}"/> + <property name="x" value="x"/> + <echo file="${input}/x.properties"><![CDATA[ +x=y +y=$${x} +]]></echo> + <property file="${input}/x.properties"/> + <au:assertPropertyEquals name="y" value="x"/> + <echo file="${input}/y.properties"><![CDATA[ +x=y +y=$${x} +]]></echo> + <property file="${input}/y.properties" prefix="foo"/> + <!-- passes in Ant 1.8.0 and 1.7.1, fails in 1.8.1 --> + <au:assertPropertyEquals name="foo.y" value="x"/> + <echo file="${input}/z.properties"><![CDATA[ +x=y +y=$${bar.x} +]]></echo> + <property file="${input}/z.properties" prefix="bar"/> + <!-- passes in Ant 1.7.1 and 1.8.1, fails in 1.8.0 --> + <!--echo>bar.y is ${bar.y}</echo> + <au:assertLogContains text="bar.y is y"/> + <au:assertPropertyEquals name="bar.y" value="y"/--> + </target> + + <!-- passes in Ant 1.7.1 and 1.8.1, fails in 1.8.0 --> + <target name="testMultiplePrefixes" + description="https://issues.apache.org/bugzilla/show_bug.cgi?id=48768"> + <mkdir dir="${input}"/> + <echo file="${input}/x.properties"><![CDATA[ +x=1 +y=2 +]]></echo> + <property file="${input}/x.properties"/> + <au:assertPropertyEquals name="x" value="1"/> + <au:assertPropertyEquals name="y" value="2"/> + <echo file="${input}/y.properties"><![CDATA[ +x=3 +]]></echo> + <property file="${input}/y.properties" prefix="foo"/> + <au:assertPropertyEquals name="foo.x" value="3"/> + </target> + + <!-- passes in Ant 1.7.1 and 1.8.0, fails in 1.8.1 --> + <target name="testNestedExpansionDoesntUsePrefix" + description="https://issues.apache.org/bugzilla/show_bug.cgi?id=49373"> + <mkdir dir="${input}"/> + <property name="x" value="x"/> + <echo file="${input}/x.properties"><![CDATA[ +x=y +y=$${x} +]]></echo> + <property file="${input}/x.properties" prefix="foo"/> + <au:assertPropertyEquals name="foo.y" value="x"/> + </target> + + <target name="testInternalExpansionWithPrefixOnlyExpandsWhenPrefixValuesIsTrue" + description="https://issues.apache.org/bugzilla/show_bug.cgi?id=54769"> + <mkdir dir="${input}"/> + <echo file="${input}/x.properties"><![CDATA[ +a=A +b=$${a} +]]></echo> + <property file="${input}/x.properties" prefix="foo" prefixValues="true"/> + <au:assertPropertyEquals name="foo.b" value="A"/> + <property file="${input}/x.properties" prefix="bar" prefixValues="false"/> + <au:assertPropertyEquals name="bar.b" value="$${a}"/> + <property file="${input}/x.properties" prefix="baz"/> + <au:assertPropertyEquals name="baz.b" value="$${a}"/> + </target> + + <!-- + Problems with @-sign discussed on the mailinglist. + Seems to work. + http://mail-archives.apache.org/mod_mbox/ant-user/201412.mbox/%3CCAPxjwW%2BQKFFj45O-ZbCGOnAkJXe9KJ5qKtVQCvS2x7hObRJmkQ%40mail.gmail.com%3E + --> + <target name="testAtSign"> + <mkdir dir="${input}"/> + <echo file="${input}/x.properties"><![CDATA[ +once=@ +double=@@ +triple=@@@ +]]></echo> + <property file="${input}/x.properties"/> + <au:assertPropertyEquals name="once" value="@"/> + <au:assertPropertyEquals name="double" value="@@"/> + <au:assertPropertyEquals name="triple" value="@@@"/> + </target> +</project> diff --git a/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/propertyfile-test.xml b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/propertyfile-test.xml new file mode 100644 index 00000000..b02cfa4c --- /dev/null +++ b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/propertyfile-test.xml @@ -0,0 +1,44 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + 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="-fileResourceSetup"> + <mkdir dir="${output}"/> + </target> + + <target name="testInternationalText" depends="-fileResourceSetup" + description="https://issues.apache.org/bugzilla/show_bug.cgi?id=50515"> + <property name="line1" value="è¬ åˆ© 食 å“ æ‰¹ 發 å…¬ å¸" /> + <property name="line2" value="TEL: (123)123-1234" /> + <propertyfile file="${output}/test.properties"> + <entry key="line1" value="${line1}" /> + <entry key="line2" value="${line2}" /> + </propertyfile> + <loadproperties prefix="rereading" srcfile="${output}/test.properties"/> + <au:assertTrue message="${line2}"> + <equals arg1="${line2}" arg2="${rereading.line2}" /> + </au:assertTrue> + <au:assertTrue message="${line1}"> + <equals arg1="${line1}" arg2="${rereading.line1}" /> + </au:assertTrue> + + </target> + +</project>
\ No newline at end of file diff --git a/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/propertyhelper-test.xml b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/propertyhelper-test.xml new file mode 100644 index 00000000..f86342e1 --- /dev/null +++ b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/propertyhelper-test.xml @@ -0,0 +1,151 @@ +<?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"> + <!-- each test verifies that the PropertyEvaluator delegate works --> + <import file="../antunit-base.xml" /> + + <condition property="prereqs-ok"> + <and> + <available classname="org.apache.bsf.BSFManager"/> + <available classname="bsh.util.BeanShellBSFEngine"/> + </and> + </condition> + + <target name="setUp" unless="setup.complete" if="prereqs-ok"> + <script language="beanshell" manager="bsf"> + import org.apache.tools.ant.PropertyHelper; + public class MapEvaluator implements PropertyHelper.PropertyEvaluator { + HashMap map = new HashMap(); + public MapEvaluator() { + map.put("string", "string"); + map.put("object", new Object()); + map.put("int", new Integer(1)); + map.put("null", null); + } + public Object evaluate(String property, PropertyHelper propertyHelper) { + return map.get(property.toLowerCase()); + } + } + project.addReference("mapEvaluator", new MapEvaluator()); + </script> + <propertyhelper> + <delegate refid="mapEvaluator" /> + </propertyhelper> + <property name="setup.complete" value="true" /> + </target> + + <target name="testValueTypes" depends="setUp" if="prereqs-ok"> + <!-- verify BC, strings --> + <au:assertPropertyEquals name="string" value="${STRING}" /> + + <!-- verify non-string properties --> + <au:assertPropertyEquals name="object" value="${OBJECT}" /> + <au:assertPropertyEquals name="int" value="${INT}" /> + + <!-- verify that a string containing nothing but a property reference is a valid value --> + <property name="string2" value="${string}" /> + <au:assertPropertyEquals name="string2" value="${string}" /> + + <property name="object2" value="${object}" /> + <!-- demonstrate that equals args can be non-string --> + <au:assertPropertyEquals name="object2" value="${object}" /> + + <property name="int2" value="${int}" /> + <au:assertPropertyEquals name="int2" value="${int}" /> + </target> + + <target name="testNull" depends="setUp" if="prereqs-ok"> + <!-- demonstrate that a null value always implies a nonexistent property --> + <au:assertFalse> + <isset property="null" /> + </au:assertFalse> + </target> + + <target name="testAvailable" depends="setUp" if="prereqs-ok"> + <!-- verify the available task can set a non-string property --> + <available file="${ant.file}" type="file" property="available.string" value="bc" /> + <au:assertPropertyEquals name="available.string" value="bc" /> + <available file="${ant.file}" type="file" property="available.object" value="${object}" /> + <au:assertPropertyEquals name="available.object" value="${OBJECT}" /> + </target> + + <target name="testCondition" depends="setUp" if="prereqs-ok"> + <!-- verify the condition task can set a non-string property --> + <echo>$${ant.file}=${ant.file}</echo> + <condition property="condition.true.string"> + <available file="${ant.file}" type="file" /> + </condition> + <au:assertPropertyEquals name="condition.true.string" value="true" /> + <condition property="condition.else.string" value="true" else="false"> + <not><available file="${ant.file}" type="file" /></not> + </condition> + <au:assertPropertyEquals name="condition.else.string" value="false" /> + <condition property="condition.true.object" value="${object}"> + <available file="${ant.file}" type="file" /> + </condition> + <au:assertPropertyEquals name="condition.true.object" value="${OBJECT}" /> + <condition property="condition.else.int" value="${object}" else="${int}"> + <not><available file="${ant.file}" type="file" /></not> + </condition> + <au:assertPropertyEquals name="condition.else.int" value="${INT}" /> + </target> + + <target name="testEmbeddedNonString" if="prereqs-ok"> + <!-- verify that a property embedded in a string is a substring --> + <au:assertTrue> + <equals arg1="@${int}@" arg2="@1@" /> + </au:assertTrue> + </target> + + <target name="XtestLoadPropertiesWithObjects" if="prereqs-ok" depends="setUp"> + <au:assertFalse> + <isset property="object2" /> + </au:assertFalse> + <string id="props" value="object2=$${object}" /> + <!-- verify the property is not yet expanded --> + <au:assertTrue> + <length length="17"> + <resource refid="props" /> + </length> + </au:assertTrue> + <loadproperties> + <resource refid="props" /> + </loadproperties> + <au:assertPropertyEquals name="object2" value="${object}" /> + <au:assertPropertyEquals name="object2" value="${OBJECT}" /> + </target> + + <target name="testLoadPropertiesWithStrings" if="prereqs-ok" depends="setUp"> + <au:assertFalse> + <isset property="string2" /> + </au:assertFalse> + <string id="props" value="string2=$${string}" /> + <!-- verify the property is not yet expanded --> + <au:assertTrue> + <length length="17"> + <resource refid="props" /> + </length> + </au:assertTrue> + <loadproperties> + <resource refid="props" /> + </loadproperties> + <au:assertPropertyEquals name="string2" value="${string}" /> + <au:assertPropertyEquals name="string2" value="${STRING}" /> + </target> + +</project> diff --git a/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/replace-test.xml b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/replace-test.xml new file mode 100644 index 00000000..dd1617a6 --- /dev/null +++ b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/replace-test.xml @@ -0,0 +1,103 @@ +<?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" /> + + <import file="../propertyhelpers.xml" as="ph"/> + + <target name="tearDown" depends="antunit-base.tearDown"> + <delete dir="foo"/> + </target> + + <target name="setUp"> + <mkdir dir="${output}"/> + <echo file="${output}/text.txt"><![CDATA[ +Hello, world! +]]></echo> + </target> + + <target name="testRCSupport" depends="setUp"> + <replace token="world" value="Ant"> + <file file="${output}/text.txt"/> + </replace> + <au:assertResourceContains + resource="${output}/text.txt" value="Hello, Ant!"/> + </target> + + <target name="testNestedElementsOfFilter" depends="setUp"> + <replace> + <file file="${output}/text.txt"/> + <replacefilter> + <replacetoken>world</replacetoken> + <replacevalue>Ant</replacevalue> + </replacefilter> + </replace> + <au:assertResourceContains + resource="${output}/text.txt" value="Hello, Ant!"/> + </target> + + <target name="testNoPropertyExpansion" depends="setUp"> + <property name="ant" value="Ant"/> + <replace> + <file file="${output}/text.txt"/> + <replacetoken>world</replacetoken> + <replacevalue>${ant}</replacevalue> + </replace> + <au:assertResourceDoesntContain + resource="${output}/text.txt" value="Hello, Ant!"/> + </target> + + <target name="testPropertyExpansion" depends="setUp"> + <property name="ant" value="Ant"/> + <replace> + <file file="${output}/text.txt"/> + <replacetoken>world</replacetoken> + <replacevalue expandproperties="true">${ant}</replacevalue> + </replace> + <au:assertResourceContains + resource="${output}/text.txt" value="Hello, Ant!"/> + </target> + + <target name="testNoReplace" depends="setUp"> + <replace token="ant" value="ant" summary="true"> + <file file="${output}/text.txt"/> + </replace> + <au:assertLogContains text="Replaced 0 occurrences in 0 files."/> + </target> + + <target name="testFailOnNoReplace" depends="setUp"> + <au:expectfailure expectedMessage="didn't replace anything"> + <replace token="ant" value="ant" failOnNoReplacements="true"> + <file file="${output}/text.txt"/> + </replace> + </au:expectfailure> + </target> + + <target name="testPropertyFilterResource" depends="setUp,ph.defineHelpers"> + <mkdir dir="foo"/> + <echo file="foo/foo.properties"><![CDATA[ +world=Ant +]]></echo> + <replace replacefilterresource="${java:foo!foo.properties}"> + <file file="${output}/text.txt"/> + </replace> + <au:assertResourceContains + resource="${output}/text.txt" value="Hello, Ant!"/> + </target> + +</project> diff --git a/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/retry-test.xml b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/retry-test.xml new file mode 100644 index 00000000..e81853b8 --- /dev/null +++ b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/retry-test.xml @@ -0,0 +1,45 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- + 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="retry-test" default="antunit" xmlns:au="antlib:org.apache.ant.antunit"> + <import file="../antunit-base.xml"/> + + <target name="setUp"> + <property name="i" value="3"/> + <mkdir dir="${output}"/> + <property name="dest" value="${output}/dest"/> + </target> + + <target name="test-fail-and-retry" depends="setUp"> + <!-- just in case this ever becomes a legit url... --> + <property name="src" value="http://iojasodjojaosdj"/> + <au:expectfailure expectedmessage="Task [get] failed after [${i}] attempts; giving up"> + <retry retrycount="${i}"> + <get src="${src}" dest="${dest}"/> + </retry> + </au:expectfailure> + <au:assertLogContains text="Attempt [1]: error occurred; retrying..."/> + </target> + + <target name="test-success" depends="setUp"> + <retry retrycount="${i}"> + <touch file="${dest}"/> + </retry> + <au:assertLogDoesntContain text="Attempt [1]: error occurred; retrying..."/> + </target> + +</project> diff --git a/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/rmic-test.xml b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/rmic-test.xml new file mode 100644 index 00000000..67b4afc3 --- /dev/null +++ b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/rmic-test.xml @@ -0,0 +1,105 @@ +<?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="-create-rmic-adapter"> + <mkdir dir="${input}/org/example"/> + <echo file="${input}/org/example/Adapter.java"><![CDATA[ +package org.example; +import org.apache.tools.ant.taskdefs.rmic.RmicAdapter; +import org.apache.tools.ant.taskdefs.Rmic; +import org.apache.tools.ant.types.Path; +import org.apache.tools.ant.util.FileNameMapper; +import org.apache.tools.ant.util.GlobPatternMapper; + +public class Adapter implements RmicAdapter { + public void setRmic(Rmic attributes) {} + public boolean execute() { + System.err.println("adapter called"); + return true; + } + public FileNameMapper getMapper() { + GlobPatternMapper m = new GlobPatternMapper(); + m.setFrom("*.class"); + m.setTo("*_foo.class"); + return m; + } + + public Path getClasspath() { + return new Path(null); + } +}]]></echo> + <mkdir dir="${resources}"/> + <javac srcdir="${input}" destdir="${resources}"/> + </target> + + <target name="testCompilerNotFound" depends="-create-rmic-adapter" unless="build.sysclasspath.only"> + <au:expectfailure> + <rmic base="${resources}" includes="**/*.class" + compiler="org.example.Adapter"/> + </au:expectfailure> + <au:assertLogDoesntContain text="adapter called"/> + </target> + + <target name="testCompilerClasspath" depends="-create-rmic-adapter" + description="https://issues.apache.org/bugzilla/show_bug.cgi?id=11143"> + <rmic base="${resources}" includes="**/*.class" + compiler="org.example.Adapter"> + <compilerclasspath location="${resources}"/> + </rmic> + <au:assertLogContains text="adapter called"/> + </target> + + <target name="testCompilerAsNestedElement" depends="-create-rmic-adapter"> + <componentdef classname="org.example.Adapter" name="myjavac"> + <classpath location="${resources}"/> + </componentdef> + <rmic base="${resources}" includes="**/*.class"> + <myjavac/> + </rmic> + <au:assertLogContains text="adapter called"/> + </target> + + <target name="testSourceBase" + description="https://issues.apache.org/bugzilla/show_bug.cgi?id=48970"> + <mkdir dir="${input}/org/example"/> + <mkdir dir="${output}"/> + <echo file="${input}/org/example/Foo.java"><![CDATA[ +package org.example; +import java.rmi.Remote; +import java.rmi.RemoteException; +public interface Foo extends Remote { + long bar() throws RemoteException ; +}]]></echo> + <echo file="${input}/org/example/FooImpl.java"><![CDATA[ +package org.example; +import java.rmi.RemoteException; +public class FooImpl implements Foo { + public long bar() throws RemoteException { + return 0; + } +}]]></echo> + <javac srcdir="${input}" destdir="${output}"/> + <rmic sourcebase="${input}" base="${output}"> + <include name="**/*Impl.class"/> + </rmic> + <au:assertFileExists file="${input}/org/example/FooImpl_Stub.java"/> + <au:assertFileDoesntExist file="${output}/org/example/FooImpl_Stub.java"/> + </target> +</project> diff --git a/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/secure-input.xml b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/secure-input.xml new file mode 100644 index 00000000..8311ce9c --- /dev/null +++ b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/secure-input.xml @@ -0,0 +1,32 @@ +<?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 name="test-input" default="antunit" xmlns:au="antlib:org.apache.ant.antunit"> + + <import file="../antunit-base.xml" /> + + <target name="setUp"> + </target> + + <target name="test-secure-input" if="jdk1.6+"> + <input message="secure-input:>" addproperty="the.password"> + <handler classname="org.apache.tools.ant.input.SecureInputHandler" /> + </input> + <au:assertPropertySet name="the.password" /> + </target> + +</project> diff --git a/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/signjar-test.xml b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/signjar-test.xml new file mode 100644 index 00000000..0f03bc58 --- /dev/null +++ b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/signjar-test.xml @@ -0,0 +1,272 @@ +<?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" /> + + <property name="classes.dir" value="../../../../build/classes" /> + <property name="sign.dir" location="${output}" /> + <property name="subdir" location="${sign.dir}/subdir" /> + <property name="signtest.jar" location="${sign.dir}/signtest.jar" /> + <property name="subdirsigntest.jar" location="${subdir}/signtest.jar" /> + <property name="testkeystore" location="../../../etc/testcases/testkeystore" /> + + <macrodef name="assertSigned"> + <attribute name="jar" default="${signtest.jar}" /> + <sequential> + <au:assertTrue message="not signed: @{jar}"> + <issigned file="@{jar}" /> + </au:assertTrue> + </sequential> + </macrodef> + + <presetdef name="sign-base"> + <signjar alias="testonly" keystore="${testkeystore}" storepass="apacheant" /> + </presetdef> + + <presetdef name="verify-base"> + <verifyjar keystore="${testkeystore}" storepass="apacheant" /> + </presetdef> + + <presetdef name="sign"> + <sign-base jar="${signtest.jar}" /> + </presetdef> + + <target name="setUp"> + <mkdir dir="${sign.dir}" /> + <mkdir dir="${subdir}" /> + </target> + + <target name="jar" depends="setUp"> + <jar jarfile="${signtest.jar}" basedir="${classes.dir}" includes="**/Task.class" /> + </target> + + <target name="basic" depends="jar"> + <sign /> + </target> + + <target name="testBasic" depends="basic"> + <assertSigned /> + </target> + + <target name="testMaxmemory" depends="jar"> + <sign maxmemory="128m" /> + <assertSigned /> + </target> + + <target name="testPreserveLastModified" depends="jar"> + <touch file="${signtest.jar}" datetime="06/28/2000 2:02 pm" /> + <sign preservelastmodified="true" /> + <assertSigned /> + <fail message="preserveLastModified did not preserve the last modified time"> + <condition> + <not> + <isfileselected file="${signtest.jar}"> + <date datetime="06/28/2000 2:02 pm" when="equal" /> + </isfileselected> + </not> + </condition> + </fail> + </target> + + <target name="testFileset" depends="jar"> + <sign-base> + <fileset file="${signtest.jar}" /> + </sign-base> + <assertSigned /> + </target> + + <target name="testFilesetAndJar" depends="jar"> + <sign-base jar="${signtest.jar}" lazy="true"> + <fileset file="${signtest.jar}" /> + </sign-base> + <assertSigned /> + </target> + + <target name="testFilesetAndSignedJar" depends="jar"> + <au:expectfailure expectedMessage="You cannot specify the signed JAR when using paths or filesets"> + <sign-base signedjar="${sign.dir}/newfile.jar"> + <fileset file="${signtest.jar}" /> + </sign-base> + </au:expectfailure> + </target> + + <target name="testPath" depends="jar"> + <sign-base> + <path> + <fileset file="${signtest.jar}" /> + </path> + </sign-base> + <assertSigned /> + </target> + + <target name="testPathAndJar" depends="jar"> + <sign-base jar="${signtest.jar}" lazy="true"> + <path> + <fileset file="${signtest.jar}" /> + </path> + </sign-base> + <assertSigned /> + </target> + + <target name="testPathAndSignedJar" depends="jar"> + <au:expectfailure expectedMessage="You cannot specify the signed JAR when using paths or filesets"> + <sign-base signedjar="${sign.dir}/newfile.jar"> + <path> + <fileset file="${signtest.jar}" /> + </path> + </sign-base> + </au:expectfailure> + </target> + + <target name="testSignedJar" depends="jar"> + <sign signedjar="${subdirsigntest.jar}" /> + <assertSigned jar="${subdirsigntest.jar}" /> + </target> + + <target name="testDestDirAndSignedJar" depends="jar"> + <au:expectfailure expectedMessage="'destdir' and 'signedjar' cannot both be set"> + <sign destDir="${subdir}" signedjar="${sign.dir}/newfile.jar" /> + </au:expectfailure> + </target> + + <target name="testDestDir" depends="jar"> + <sign destDir="${subdir}" /> + <assertSigned jar="${subdirsigntest.jar}" /> + </target> + + <target name="testDestDirFileset" depends="jar"> + <sign-base destDir="${subdir}"> + <fileset file="${signtest.jar}" /> + </sign-base> + <assertSigned jar="${subdirsigntest.jar}" /> + </target> + + <target name="testDestDirPath" depends="jar"> + <sign-base destDir="${subdir}"> + <path> + <fileset file="${signtest.jar}" /> + </path> + </sign-base> + <assertSigned jar="${subdirsigntest.jar}" /> + </target> + + <target name="testMapperNoDest" depends="jar"> + <au:expectfailure expectedMessage="The destDir attribute is required if a mapper is set"> + <sign-base> + <flattenmapper /> + <fileset file="${signtest.jar}" /> + </sign-base> + </au:expectfailure> + </target> + + <target name="testMapperFileset" depends="jar"> + <sign-base destDir="${subdir}"> + <fileset file="${signtest.jar}" /> + <flattenmapper /> + </sign-base> + <assertSigned jar="${subdirsigntest.jar}" /> + </target> + + <target name="testMapperPath" depends="jar"> + <sign-base destDir="${subdir}"> + <path> + <pathelement location="${signtest.jar}" /> + </path> + <flattenmapper /> + </sign-base> + <assertSigned jar="${subdirsigntest.jar}" /> + </target> + + <target name="testTwoMappers" depends="jar"> + <au:expectfailure expectedMessage="Too many mappers"> + <sign-base destDir="${subdir}"> + <fileset file="${signtest.jar}" /> + <flattenmapper /> + <flattenmapper /> + </sign-base> + </au:expectfailure> + </target> + + <target name="testNoAlias" depends="jar"> + <au:expectfailure expectedMessage="alias attribute must be set"> + <signjar keystore="${testkeystore}" jar="${signtest.jar}" storepass="apacheant" /> + </au:expectfailure> + </target> + + <target name="testNoFiles"> + <au:expectfailure expectedMessage="jar must be set through jar attribute"> + <sign-base /> + </au:expectfailure> + </target> + + <target name="testNoStorePass" depends="jar"> + <au:expectfailure expectedMessage="storepass attribute must be set"> + <signjar keystore="${testkeystore}" alias="testonly" jar="${signtest.jar}" /> + </au:expectfailure> + </target> + + <target name="testSysProperty" depends="jar"> + <sign> + <sysproperty key="ant.home" value="${ant.home}" /> + </sign> + <assertSigned /> + </target> + + <target name="testVerifyJar" depends="basic"> + <verify-base jar="${signtest.jar}" /> + </target> + + <target name="testVerifyJarCertificates" depends="basic"> + <verify-base jar="${signtest.jar}" certificates="true" verbose="true" /> + </target> + + <target name="testVerifyJarUnsigned" depends="jar"> + <au:expectfailure expectedMessage="Failed to verify ${signtest.jar}"> + <verify-base jar="${signtest.jar}" /> + </au:expectfailure> + </target> + + <target name="NOtestVerifyJarNotInKeystore" depends="basic"> + <au:expectfailure> + <verifyjar jar="${signtest.jar}" certificates="true" verbose="true" /> + </au:expectfailure> + </target> + + <target name="testVerifyFileset" depends="basic"> + <verify-base> + <fileset file="${signtest.jar}" /> + </verify-base> + </target> + + <target name="testVerifyPath" depends="basic"> + <verify-base> + <path> + <pathelement location="${signtest.jar}" /> + </path> + </verify-base> + </target> + + <target name="testVerifyNoArgs"> + <au:expectfailure expectedMessage="jar must be set through jar attribute"> + <verify-base /> + </au:expectfailure> + </target> + +</project> + diff --git a/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/subant-helper/echo.xml b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/subant-helper/echo.xml new file mode 100644 index 00000000..24f445cc --- /dev/null +++ b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/subant-helper/echo.xml @@ -0,0 +1,20 @@ +<?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 xmlns:au="antlib:org.apache.ant.antunit"> + <au:assertMatches string="${basedir}" pattern=".*subant-helper$"/> +</project> diff --git a/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/subant-test.xml b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/subant-test.xml new file mode 100644 index 00000000..3bc44059 --- /dev/null +++ b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/subant-test.xml @@ -0,0 +1,111 @@ +<?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"> + + <description> + Test that subant properly sets various properties + </description> + <import file="../antunit-base.xml" /> + + <target name="assertProperties"> + <au:assertPropertySet name="ant.version" /> + <au:assertPropertySet name="java.home" /> + <au:assertPropertySet name="java.class.path" /> + </target> + + <target name="testAntVersion"> + <subant inheritall="false" target="assertProperties"> + <fileset file="${ant.file}" /> + </subant> + </target> + + <!-- four testcases for bug 30542, the last one failed --> + <target name="testSubAntDoesntSetBasedir"> + <subant antfile="echo.xml"> + <dirset dir="." includes="subant-helper"/> + </subant> + </target> + + <target name="testSubAntDoesntSetBasedirAfterAntCall"> + <antcall target="testSubAntDoesntSetBasedir"/> + </target> + + <target name="testSubAntDoesntSetBasedirAfterAnt"> + <ant antfile="${ant.file}" target="testSubAntDoesntSetBasedir"/> + </target> + + <target name="testSubAntDoesntSetBasedirAfterAntWithDir"> + <ant antfile="${ant.file}" dir="${basedir}" + target="testSubAntDoesntSetBasedir"/> + </target> + + <target name="testSubAntDoesntSetBasedirAfterAntWithDirWhenNativeDir"> + <ant antfile="${ant.file}" dir="${basedir}" + target="testSubAntDoesntSetBasedir" + useNativeBaseDir="true"/> + </target> + + <target name="testLastPropertyWins"> + <subant target="checkB"> + <file file="antcall-test.xml"/> + <property name="b" value="1"/> + <property name="b" value="2"/> + <property name="expected" value="2"/> + </subant> + </target> + + <target name="makePropertiesFile"> + <ant antfile="antcall-test.xml" target="makePropertiesFile"/> + </target> + + <target name="testPropertiesLoadedFromFile" depends="makePropertiesFile"> + <subant target="checkB"> + <file file="antcall-test.xml"/> + <property name="expected" value="2"/> + <property file="${input}/ant.properties"/> + </subant> + </target> + + <target name="testFileDoesntSeeExternalProperty" depends="makePropertiesFile"> + <property name="a" value="x"/> + <subant target="checkB"> + <file file="antcall-test.xml"/> + <property name="expected" value="2"/> + <property file="${input}/ant.properties"/> + </subant> + </target> + + <target name="testFileSeesExternalPropertyWhenInheritAll" + depends="makePropertiesFile"> + <property name="a" value="x"/> + <subant target="checkB" inheritall="true"> + <file file="antcall-test.xml"/> + <property name="expected" value="x"/> + <property file="${input}/ant.properties"/> + </subant> + </target> + + <target name="testFileSeesInternalProperty" depends="makePropertiesFile"> + <subant target="checkB"> + <file file="antcall-test.xml"/> + <property name="a" value="y"/> + <property name="expected" value="y"/> + <property file="${input}/ant.properties"/> + </subant> + </target> +</project> diff --git a/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/sync-test.xml b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/sync-test.xml new file mode 100644 index 00000000..21a14426 --- /dev/null +++ b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/sync-test.xml @@ -0,0 +1,175 @@ +<?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="setUp"> + <mkdir dir="${input}/a"/> + <mkdir dir="${input}/d"/> + <mkdir dir="${output}/a"/> + <mkdir dir="${output}/d"/> + <mkdir dir="${output}/b/c"/> + <touch file="${input}/a/foo.txt"/> + <touch file="${output}/a/bar.txt"/> + <touch file="${output}/b/baz.txt"/> + </target> + + <target name="testIncludeEmptyPreservesEmptyDirs" depends="setUp"> + + <sync todir="${output}" includeemptydirs="true"> + <fileset dir="${input}"/> + <preserveintarget> + <include name="**/b/**"/> + </preserveintarget> + </sync> + + <au:assertFileDoesntExist file="${output}/a/bar.txt"/> + <au:assertFileExists file="${output}/a/foo.txt"/> + <au:assertFileExists file="${output}/b/baz.txt"/> + <au:assertFileExists file="${output}/b/c"/> + <au:assertFileExists file="${output}/d"/> + </target> + + <target name="testDefaultDoesntPreserveEmptyDirs" depends="setUp"> + + <sync todir="${output}"> + <fileset dir="${input}"/> + <preserveintarget> + <include name="**/b/**"/> + </preserveintarget> + </sync> + + <au:assertFileDoesntExist file="${output}/a/bar.txt"/> + <au:assertFileExists file="${output}/a/foo.txt"/> + <au:assertFileExists file="${output}/b/baz.txt"/> + <au:assertFileDoesntExist file="${output}/b/c"/> + <au:assertFileDoesntExist file="${output}/d"/> + </target> + + <target name="testPreserveEmptyOverridesDefault" depends="setUp"> + + <sync todir="${output}"> + <fileset dir="${input}"/> + <preserveintarget preserveEmptyDirs="true"> + <include name="**/b/**"/> + </preserveintarget> + </sync> + + <au:assertFileDoesntExist file="${output}/a/bar.txt"/> + <au:assertFileExists file="${output}/a/foo.txt"/> + <au:assertFileExists file="${output}/b/baz.txt"/> + <au:assertFileExists file="${output}/b/c"/> + <au:assertFileDoesntExist file="${output}/d"/> + </target> + + <target name="testPreserveEmptyOverrulesIncludeEmpty" depends="setUp"> + + <sync todir="${output}" includeEmptyDirs="true"> + <fileset dir="${input}"/> + <preserveintarget preserveEmptyDirs="false"> + <include name="**/b/**"/> + </preserveintarget> + </sync> + + <au:assertFileDoesntExist file="${output}/a/bar.txt"/> + <au:assertFileExists file="${output}/a/foo.txt"/> + <au:assertFileExists file="${output}/b/baz.txt"/> + <au:assertFileDoesntExist file="${output}/b/c"/> + <au:assertFileExists file="${output}/d"/> + </target> + + <target name="testPreserveEmptyAndIncludeEmptyFalse" depends="setUp"> + + <sync todir="${output}" includeEmptyDirs="false"> + <fileset dir="${input}"/> + <preserveintarget preserveEmptyDirs="false"> + <include name="**/b/**"/> + </preserveintarget> + </sync> + + <au:assertFileDoesntExist file="${output}/a/bar.txt"/> + <au:assertFileExists file="${output}/a/foo.txt"/> + <au:assertFileExists file="${output}/b/baz.txt"/> + <au:assertFileDoesntExist file="${output}/b/c"/> + <au:assertFileDoesntExist file="${output}/d"/> + </target> + + <target name="testPreserveEmptyAndIncludeEmptyTrue" depends="setUp"> + + <sync todir="${output}" includeEmptyDirs="true"> + <fileset dir="${input}"/> + <preserveintarget preserveEmptyDirs="true"> + <include name="**/b/**"/> + </preserveintarget> + </sync> + + <au:assertFileDoesntExist file="${output}/a/bar.txt"/> + <au:assertFileExists file="${output}/a/foo.txt"/> + <au:assertFileExists file="${output}/b/baz.txt"/> + <au:assertFileExists file="${output}/b/c"/> + <au:assertFileExists file="${output}/d"/> + </target> + + <target name="testPreserveEmptyDirsWithNonRecursiveExclude" depends="setUp"> + + <sync todir="${output}"> + <fileset dir="${input}"/> + <preserveintarget preserveEmptyDirs="true"> + <include name="**/b"/> + </preserveintarget> + </sync> + + <au:assertFileDoesntExist file="${output}/a/bar.txt"/> + <au:assertFileExists file="${output}/a/foo.txt"/> + <au:assertFileExists file="${output}/b"/> + <au:assertFileDoesntExist file="${output}/b/baz.txt"/> + <au:assertFileDoesntExist file="${output}/b/c"/> + <au:assertFileDoesntExist file="${output}/d"/> + </target> + + <!-- really only tests no exception is thrown --> + <target name="testCanAddMultipleResources" depends="setUp" + description="https://issues.apache.org/bugzilla/show_bug.cgi?id=51462"> + <sync todir="${output}"> + <file file="${input}/x"/> + <file file="${input}/y"/> + </sync> + </target> + + <target name="testSyncWithResources" depends="setUp" + description="https://issues.apache.org/bugzilla/show_bug.cgi?id=51462"> + <sync todir="${output}"> + <mappedresources> + <fileset dir="${input}"/> + <globmapper from="*" to="test/*"/> + </mappedresources> + </sync> + <au:assertFileDoesntExist file="${output}/bar.txt"/> + <au:assertFileExists file="${output}/test/a/foo.txt"/> + + <sync todir="${output}"> + <mappedresources> + <fileset dir="${input}"/> + <globmapper from="*" to="test/*"/> + </mappedresources> + </sync> + <au:assertFileDoesntExist file="${output}/bar.txt"/> + <au:assertFileExists file="${output}/test/a/foo.txt"/> + </target> + +</project> diff --git a/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/tar-test.xml b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/tar-test.xml new file mode 100644 index 00000000..1aac9a8d --- /dev/null +++ b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/tar-test.xml @@ -0,0 +1,118 @@ +<?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 name="tar-test" default="antunit" + xmlns:cond="antlib:org.apache.tools.ant.types.conditions" + xmlns:au="antlib:org.apache.ant.antunit"> + <import file="../antunit-base.xml" /> + + <target name="setUp"> + <mkdir dir="${input}" /> + <mkdir dir="${output}" /> + </target> + + <target name="testTarFilesetHandlesFilesetReferences" depends="setUp"> + <fileset id="xml.fileset" dir="." includes="*.xml" /> + <tar destfile="${output}/testtar.tar"> + <tarfileset prefix="pre" refid="xml.fileset" /> + </tar> + </target> + + <target name="testRemoveLeadingSlashes" depends="setUp"> + <tar destfile="${output}/testtar.tar"> + <tarfileset file="${ant.file}" fullpath="/foo.xml"/> + </tar> + <au:assertTrue> + <cond:resourceexists> + <tarentry name="foo.xml"> + <file file="${output}/testtar.tar"/> + </tarentry> + </cond:resourceexists> + </au:assertTrue> + <au:assertFalse> + <cond:resourceexists> + <tarentry name="/foo.xml"> + <file file="${output}/testtar.tar"/> + </tarentry> + </cond:resourceexists> + </au:assertFalse> + </target> + + <target name="testPreserveLeadingSlashes" depends="setUp"> + <tar destfile="${output}/testtar.tar"> + <tarfileset file="${ant.file}" fullpath="/foo.xml" + preserveleadingslashes="true"/> + </tar> + <au:assertTrue> + <cond:resourceexists> + <tarentry name="/foo.xml"> + <file file="${output}/testtar.tar"/> + </tarentry> + </cond:resourceexists> + </au:assertTrue> + <au:assertFalse> + <cond:resourceexists> + <tarentry name="foo.xml"> + <file file="${output}/testtar.tar"/> + </tarentry> + </cond:resourceexists> + </au:assertFalse> + </target> + + <target name="testSingleFile" depends="setUp" + description="https://issues.apache.org/bugzilla/show_bug.cgi?id=48035"> + <touch file="${input}/foo.txt"/> + <tar destfile="${output}/foo.tar"> + <file file="${input}/foo.txt"/> + </tar> + <au:assertFileExists file="${output}/foo.tar"/> + <copy file="${output}/foo.tar" tofile="${output}/bar.tar" + preservelastmodified="true"/> + <sleep seconds="2"/> + <touch file="${input}/foo.txt"/> + <tar destfile="${output}/foo.tar"> + <file file="${input}/foo.txt"/> + </tar> + <au:assertDestIsOutofdate src="${output}/foo.tar" dest="${output}/bar.tar"/> + </target> + + <target name="-longfileSetup" depends="setUp"> + <property name="longfile.dir.name" + value="this/path/name/contains/more/than/one/hundred/characters/in/order/to/test/the/GNU/and/POSIX/long/file/name/capability/round"/> + <property name="longfile.file.name" + value="${longfile.dir.name}/tripped"/> + <mkdir dir="${input}/${longfile.dir.name}"/> + <touch file="${input}/${longfile.file.name}"/> + </target> + + <target name="testLongfileGNU" depends="-longfileSetup"> + <tar destfile="${output}/x.tar" longfile="gnu"> + <fileset dir="${input}"/> + </tar> + <untar dest="${output}" src="${output}/x.tar"/> + <au:assertFileExists file="${output}/${longfile.file.name}"/> + </target> + + <target name="testLongfilePOSIX" depends="-longfileSetup"> + <tar destfile="${output}/x.tar" longfile="posix"> + <fileset dir="${input}"/> + </tar> + <untar dest="${output}" src="${output}/x.tar"/> + <au:assertFileExists file="${output}/${longfile.file.name}"/> + </target> +</project> diff --git a/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/taskdef-antlib-test.xml b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/taskdef-antlib-test.xml new file mode 100644 index 00000000..58d01f06 --- /dev/null +++ b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/taskdef-antlib-test.xml @@ -0,0 +1,64 @@ +<?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" /> + + <!-- Java5 has some trouble with the recursive Antlib lookup --> + + <target name="setUp" if="jdk1.6+"> + <mkdir dir="${input}/org/example" /> + <property name="tmpdir" location="../../../../build/ant-unit/taskdef" /> + <mkdir dir="${tmpdir}" /> + <echo file="${input}/org/example/antlib.xml"> + <![CDATA[<antlib xmlns:e="ant:current"> + <macrodef name="echoo" backtrace="false"> + <attribute name="message" /> + <sequential> + <echo message="@{message}@{message}" /> + </sequential> + </macrodef> + <macrodef name="echoooo" backtrace="false"> + <attribute name="message" /> + <sequential> + <e:echoo message="@{message}@{message}" /> + </sequential> + </macrodef> + </antlib>]]> + </echo> + <jar destfile="${test.jar}"> + <fileset dir="${input}" /> + </jar> + <sleep seconds="1"/> + </target> + + <target name="testAntlib" depends="setUp" if="jdk1.6+"> + <taskdef classpath="${test.jar}" uri="antlib:org.example" + loaderref="loader1"/> + <echoooo xmlns="antlib:org.example" message="exemple" /> + <au:assertLogContains text="exempleexempleexempleexemple" /> + </target> + + <target name="testURI" depends="setUp" if="jdk1.6+"> + <taskdef classpath="${test.jar}" uri="urn:my:exemple" + loaderref="loader2" + resource="org/example/antlib.xml" /> + <echoooo xmlns="urn:my:exemple" message="exemple" /> + <au:assertLogContains text="exempleexempleexempleexemple" /> + </target> + +</project> diff --git a/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/taskdef-test.xml b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/taskdef-test.xml new file mode 100644 index 00000000..95745082 --- /dev/null +++ b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/taskdef-test.xml @@ -0,0 +1,99 @@ +<?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="setUp"> + <mkdir dir="${input}/org/example"/> + <property name="tmpdir" location="../../../../build/ant-unit/taskdef"/> + <mkdir dir="${tmpdir}"/> + <echoxml file="${input}/org/example/antlib.xml"> + <antlib> + <taskdef name="echooo" + classname="org.apache.tools.ant.taskdefs.Echo"/> + </antlib> + </echoxml> + </target> + + <target name="testPlainDir" depends="setUp"> + <jar destfile="${test1.jar}"> + <fileset dir="${input}"/> + </jar> + <taskdef resource="org/example/antlib.xml" + classpath="${test1.jar}" + uri="urn:test:plain"/> + <echooo xmlns="urn:test:plain">Hello</echooo> + <au:assertLogContains text="Hello"/> + </target> + + <target name="testDirWithPling" depends="setUp" if="jdk1.6+" + description="https://issues.apache.org/bugzilla/show_bug.cgi?id=50007"> + <property name="dir" location="${tmpdir}/pl!ng"/> + <mkdir dir="${dir}"/> + <jar destfile="${test2.jar}"> + <fileset dir="${input}"/> + </jar> + <taskdef resource="org/example/antlib.xml" + classpath="${test2.jar}" + uri="urn:test:indir"/> + <echooo xmlns="urn:test:indir">Hello</echooo> + <au:assertLogContains text="Hello"/> + </target> + + <!-- fails because URLConnection.connect() fails on the JAR URL returned + by ClassLoader.getResources() --> + <target name="NOtestDirWithPlingAtEnd" depends="setUp" + description="https://issues.apache.org/bugzilla/show_bug.cgi?id=50007"> + <property name="dir" location="${tmpdir}/pling!"/> + <mkdir dir="${dir}"/> + <jar destfile="${test3.jar}"> + <fileset dir="${input}"/> + </jar> + <taskdef resource="org/example/antlib.xml" + classpath="${test3.jar}" + uri="urn:test:atend"/> + <echooo xmlns="urn:test:atend">Hello</echooo> + <au:assertLogContains text="Hello"/> + </target> + + <target name="testPlingInJar" depends="setUp"> + <move file="${input}/org/example/antlib.xml" + tofile="${input}/org/examp!e/antlib.xml"/> + <jar destfile="${test4.jar}"> + <fileset dir="${input}"/> + </jar> + <taskdef resource="org/examp!e/antlib.xml" + classpath="${test4.jar}" + uri="urn:test:injar"/> + <echooo xmlns="urn:test:injar">Hello</echooo> + <au:assertLogContains text="Hello"/> + </target> + + <target name="testPlingInJarAtEnd" depends="setUp"> + <move file="${input}/org/example/antlib.xml" + tofile="${input}/org/example!/antlib.xml"/> + <jar destfile="${test5.jar}"> + <fileset dir="${input}"/> + </jar> + <taskdef resource="org/example!/antlib.xml" + classpath="${test5.jar}" + uri="urn:test:injaratend"/> + <echooo xmlns="urn:test:injaratend">Hello</echooo> + <au:assertLogContains text="Hello"/> + </target> +</project> diff --git a/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/tempfile-test.xml b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/tempfile-test.xml new file mode 100644 index 00000000..1132007a --- /dev/null +++ b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/tempfile-test.xml @@ -0,0 +1,30 @@ +<?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="tearDown" depends="antunit-base.tearDown"> + <delete file="${tmp}" quiet="true"/> + </target> + + <target name="testCreateWithoutPrefix" + description="https://issues.apache.org/bugzilla/show_bug.cgi?id=49755"> + <tempfile property="tmp" createfile="true"/> + <au:assertFileExists file="${tmp}"/> + </target> +</project> diff --git a/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/touch-test.xml b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/touch-test.xml new file mode 100644 index 00000000..a9327ed8 --- /dev/null +++ b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/touch-test.xml @@ -0,0 +1,35 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- + 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="touch-test" default="antunit" xmlns:au="antlib:org.apache.ant.antunit"> + <import file="../antunit-base.xml"/> + + <target name="test-no-child"> + <au:expectfailure> + <touch /> + </au:expectfailure> + </target> + + <target name="test-no-match"> + <touch> + <fileset file="${ant.file}"> + <filename name="IDONOTMATCH" /> + </fileset> + </touch> + </target> + +</project> diff --git a/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/truncate/truncate-test.xml b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/truncate/truncate-test.xml new file mode 100644 index 00000000..86f896c6 --- /dev/null +++ b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/truncate/truncate-test.xml @@ -0,0 +1,145 @@ +<?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 name="truncate-test" default="default" + xmlns:au="antlib:org.apache.ant.antunit"> + + <target name="default"> + <au:antunit> + <file file="${ant.file}" /> + </au:antunit> + </target> + + <target name="tearDown"> + <delete file="foo" /> + <delete file="bar" /> + <delete dir="baz" /> + </target> + + <target name="test-basic"> + <truncate file="foo" /> + <au:assertTrue> + <length file="foo" length="0" /> + </au:assertTrue> + </target> + + <target name="test-explicit"> + <truncate file="foo" length="1034" /> + <au:assertTrue> + <length file="foo" length="1034" /> + </au:assertTrue> + </target> + + <target name="test-extend"> + <truncate file="foo" length="5" /> + <au:assertTrue> + <length file="foo" length="5" /> + </au:assertTrue> + <truncate file="foo" adjust="5" /> + <au:assertTrue> + <length file="foo" length="10" /> + </au:assertTrue> + </target> + + <target name="test-truncate"> + <truncate file="foo" length="5" /> + <au:assertTrue> + <length file="foo" length="5" /> + </au:assertTrue> + <truncate file="foo" adjust="-5" /> + <au:assertTrue> + <length file="foo" length="0" /> + </au:assertTrue> + </target> + + <target name="test-bigger"> + <truncate file="foo" length="1K" /> + <au:assertTrue> + <and> + <length file="foo" length="1K" /> + <length file="foo" length="1024" /> + </and> + </au:assertTrue> + </target> + + <target name="truncate-bigger"> + <truncate file="foo" length="3K" /> + <au:assertTrue> + <length file="foo" length="3K" /> + </au:assertTrue> + <truncate file="foo" adjust="-2K" /> + <au:assertTrue> + <length file="foo" length="1K" /> + </au:assertTrue> + </target> + + <target name="test-no-create"> + <au:assertFileDoesntExist file="foo" /> + <truncate file="foo" create="false" length="0" /> + <au:assertFileDoesntExist file="foo" /> + </target> + + <target name="test-mkdirs"> + <au:assertFileDoesntExist file="baz" /> + <truncate file="baz/foo" mkdirs="true" length="0" /> + <au:assertTrue> + <length file="baz/foo" length="0" /> + </au:assertTrue> + </target> + + <target name="test-rc"> + <truncate length="10"> + <resources> + <file file="foo" /> + <file file="bar" /> + </resources> + </truncate> + <au:assertTrue> + <and> + <length file="foo" length="10" /> + <length file="bar" length="10" /> + </and> + </au:assertTrue> + </target> + + <target name="test-bad-resource"> + <au:expectfailure> + <truncate length="1P"> + <string value="blah" /> + </truncate> + </au:expectfailure> + </target> + + <target name="test-invalid-attrs"> + <au:expectfailure> + <truncate file="foo" length="0" adjust="0" /> + </au:expectfailure> + </target> + + <target name="test-bad-length"> + <au:expectfailure> + <truncate file="foo" length="-1P" /> + </au:expectfailure> + </target> + + <target name="test-no-files"> + <au:expectfailure> + <truncate length="0" /> + </au:expectfailure> + </target> + +</project> diff --git a/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/unzip-test.xml b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/unzip-test.xml new file mode 100644 index 00000000..b2c2105d --- /dev/null +++ b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/unzip-test.xml @@ -0,0 +1,70 @@ +<?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 name="unzip-test" default="antunit" + xmlns:au="antlib:org.apache.ant.antunit"> + <import file="../antunit-base.xml" /> + + <target name="setUp"> + <mkdir dir="${output}" /> + </target> + + <target name="testFailureOnBrokenCentralDirectoryStructure"> + <au:expectfailure + expectedmessage="central directory is empty, can't expand corrupt archive."> + <unzip src="broken_cd.zip" dest="${output}"/> + </au:expectfailure> + </target> + + <!-- Issue 28911 --> + <target name="testStrippingOfPathsep"> + <mkdir dir="${input}"/> + <mkdir dir="${output}"/> + <touch file="${input}/file"/> + <zip destfile="${output}/a.zip"> + <zipfileset dir="${input}" prefix="/foo"/> + </zip> + <unzip src="${output}/a.zip" stripAbsolutePathSpec="true" + dest="${output}"/> + <au:assertFileExists file="${output}/foo/file"/> + </target> + + <target name="testTwoByteExtraFieldInLFH" + description="https://issues.apache.org/bugzilla/show_bug.cgi?id=42940" + > + <mkdir dir="${input}"/> + <mkdir dir="${output}"/> + <copy file="zip/Bugzilla-42940.zip" tofile="${input}/test.zip"/> + <unzip src="${input}/test.zip" dest="${output}"/> + <au:assertFileExists file="${output}/META-INF/MANIFEST.MF"/> + </target> + + <target name="testArchiveIsClosedForInvalidZips" + description="https://issues.apache.org/bugzilla/show_bug.cgi?id=46559" + > + <mkdir dir="${input}"/> + <mkdir dir="${output}"/> + <copy file="broken_cd.zip" tofile="${input}/test.zip"/> + <au:expectfailure> + <unzip src="${input}/test.zip" dest="${output}"/> + </au:expectfailure> + <delete file="${input}/test.zip" quiet="true"/> + <!-- failed on Windows and other OSes with implicit file locking --> + <au:assertFileDoesntExist file="${input}/test.zip"/> + </target> +</project> diff --git a/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/uptodate-test.xml b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/uptodate-test.xml new file mode 100644 index 00000000..e477803e --- /dev/null +++ b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/uptodate-test.xml @@ -0,0 +1,86 @@ +<?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="testModifiedDirectories" + description="https://issues.apache.org/bugzilla/show_bug.cgi?id=39122 + and + https://issues.apache.org/bugzilla/show_bug.cgi?id=44430"> + <mkdir dir="${input}/source"/> + <mkdir dir="${output}"/> + <sleep seconds="2"/> + <touch file="${input}/source/file"/> + <au:assertFalse> + <uptodate> + <srcresources> + <fileset dir="${input}"/> + <dirset dir="${input}"/> + </srcresources> + <globmapper from="*" to="${output}/*"/> + </uptodate> + </au:assertFalse> + <mkdir dir="${output}/source"/> + <touch file="${output}/source/file"/> + <au:assertTrue> + <uptodate targetfile="${output}"> + <srcresources> + <fileset dir="${input}"/> + <dirset dir="${input}"/> + </srcresources> + <globmapper from="*" to="${output}/*"/> + </uptodate> + </au:assertTrue> + <sleep seconds="2"/> + <touch> + <file file="${input}/source"/> + </touch> + <au:assertFalse> + <uptodate targetfile="${output}"> + <srcresources> + <fileset dir="${input}"/> + <dirset dir="${input}"/> + </srcresources> + <globmapper from="*" to="${output}/*"/> + </uptodate> + </au:assertFalse> + <touch> + <file file="${output}/source"/> + </touch> + <au:assertTrue> + <uptodate targetfile="${output}"> + <srcresources> + <fileset dir="${input}"/> + <dirset dir="${input}"/> + </srcresources> + <globmapper from="*" to="${output}/*"/> + </uptodate> + </au:assertTrue> + <sleep seconds="2"/> + <delete file="${input}/source/file"/> + <au:assertFalse> + <uptodate targetfile="${output}"> + <srcresources> + <fileset dir="${input}"/> + <dirset dir="${input}"/> + </srcresources> + <globmapper from="*" to="${output}/*"/> + </uptodate> + </au:assertFalse> + </target> +</project> diff --git a/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/utf-16.expected b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/utf-16.expected Binary files differnew file mode 100644 index 00000000..7c7c2a78 --- /dev/null +++ b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/utf-16.expected diff --git a/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/utf-16.expected.windows b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/utf-16.expected.windows Binary files differnew file mode 100644 index 00000000..1e138e81 --- /dev/null +++ b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/utf-16.expected.windows diff --git a/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/war-test.xml b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/war-test.xml new file mode 100644 index 00000000..e264ebda --- /dev/null +++ b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/war-test.xml @@ -0,0 +1,194 @@ +<?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 name="war-test" default="antunit" + xmlns:au="antlib:org.apache.ant.antunit"> + + <import file="../antunit-base.xml" /> + + <target name="setUp"> + <mkdir dir="${input}"/> + <property name="warfile" location="${input}/test.war"/> + <property name="web.xml" location="web.xml"/> + <property name="webxml.generated" location="${input}/WEB-INF/web.xml"/> + + <!--failing on duplicates is half our testing--> + <presetdef name="mkwar"> + <war destfile="${warfile}" duplicate="fail"/> + </presetdef> + <presetdef name="expandwar"> + <unzip src="${input}/test.war" dest="${input}"/> + </presetdef> + </target> + + <!--test that you can patch a fileset reference into a lib element--> + <target name="testlibrefs" depends="setUp"> + <mkwar webxml="${web.xml}"> + <fileset id="test" dir="." includes="web.xml"/> + <lib refid="test"/> + </mkwar> + <expandwar/> + <au:assertFileExists file="${webxml.generated}" /> + </target> + + <!-- + This checks that as of Java EE 5, the web.xml attr is optional. + Here there is a web.xml, in the webinf fileset, rather than a fileset + --> + <target name="testWebXmlInWebinf" depends="setUp"> + <mkwar> + <webinf dir="." includes="web.xml"/> + </mkwar> + <expandwar/> + <au:assertFileExists file="${webxml.generated}" /> + </target> + + <target name="testWebXmlMissingFromUpdate" depends="setUp"> + <mkwar webxml="${web.xml}" /> + <!-- there is no web.xml file, but that is ok, as + we are updating --> + <mkwar update="true"> + <classes dir="." includes="web.xml"/> + </mkwar> + <expandwar/> + <au:assertFileExists file="${webxml.generated}" /> + </target> + + <target name="testWebXmlInImplicitUpdate" depends="setUp"> + <mkwar webxml="${web.xml}" /> + <!-- when we are implicitly updating, the web.xml file does not get + pulled in, but the command still succeeds.--> + <mkwar webxml="${web.xml}" > + <classes dir="." includes="web.xml"/> + </mkwar> + <expandwar/> + <au:assertFileExists file="${webxml.generated}" /> + </target> + + <target name="NotestWebXmlFilesetInImplicitUpdate" depends="setUp"> + <mkwar webxml="${web.xml}" /> + <!-- when we are implicitly updating, the web.xml file does not get + pulled in, but the command still succeeds.--> + <mkwar > + <webinf dir="." includes="web.xml"/> + </mkwar> + <expandwar/> + <au:assertFileExists file="${webxml.generated}" /> + </target> + + + <target name="testDuplicateWebXml" depends="setUp"> + <mkwar webxml="${web.xml}" > + <webinf dir="." includes="web.xml"/> + <webinf file="${web.xml}"/> + <zipfileset file="${web.xml}" prefix="WEB-INF"/> + </mkwar> + <expandwar/> + <au:assertFileExists file="${webxml.generated}" /> + </target> + + <target name="testDifferentDuplicateWebXml" depends="setUp"> + <copy file="${web.xml}" todir="${input}" /> + <mkwar webxml="${web.xml}" > + <webinf dir="${input}" includes="web.xml"/> + <webinf file="${web.xml}"/> + <zipfileset file="${web.xml}" prefix="WEB-INF"/> + </mkwar> + <expandwar/> + <au:assertFileExists file="${webxml.generated}" /> + <au:assertLogContains text="The duplicate entry is"/> + </target> + + + <!-- + this target does not have a web.xml file. + Instead it pulls in + --> + <target name="testWebXmlOptional" depends="setUp"> + <mkwar needxmlfile="false"> + <classes dir="." includes="web.xml"/> + </mkwar> + <expandwar/> + <au:assertFileExists file="${input}/WEB-INF/classes/web.xml" /> + <au:assertFalse> + <available file="${webxml.generated}" /> + </au:assertFalse> + </target> + + <target name="testWebXmlOptionalFailure" depends="setUp"> + <au:expectfailure> + <mkwar > + <classes dir="." includes="web.xml"/> + </mkwar> + </au:expectfailure> + </target> + + <target name="testWebXmlOptionalFailure2" depends="setUp"> + <au:expectfailure> + <mkwar needxmlfile="true"> + <classes dir="." includes="web.xml"/> + </mkwar> + </au:expectfailure> + </target> + + <target name="testClassesElement" depends="setUp"> + <mkwar needxmlfile="false"> + <classes dir="." includes="web.xml"/> + </mkwar> + <expandwar/> + <au:assertFileExists file="${input}/WEB-INF/classes/web.xml" /> + </target> + + <target name="testLibElement" depends="setUp"> + <mkwar needxmlfile="false"> + <lib dir="." includes="web.xml"/> + </mkwar> + <expandwar/> + <au:assertFileExists file="${input}/WEB-INF/lib/web.xml" /> + </target> + + <target name="testMappedClasspathFromManual"> + <mkdir dir="${input}"/> + <mkdir dir="${output}/out"/> + <war destfile="${output}/test.war" webxml="${ant.file}"> + <mappedresources> + <restrict> + <path path="${java.class.path}"/> + <type type="file"/> + </restrict> + <chainedmapper> + <flattenmapper/> + <globmapper from="*" to="WEB-INF/lib/*"/> + </chainedmapper> + </mappedresources> + </war> + <unzip src="${output}/test.war" dest="${output}/out"/> + <au:assertFileExists file="${output}/out/WEB-INF/lib/ant.jar"/> + </target> + + <target name="testOnlyOneWebXml"> + <mkdir dir="${input}/WEB-INF"/> + <mkdir dir="${output}"/> + <touch file="${input}/WEB-INF/web.xml"/> + <touch file="${input}/x.xml"/> + <war destfile="${output}/test.war" webxml="${input}/x.xml"> + <fileset dir="${input}"/> + </war> + <au:assertLogContains text="Warning: selected war files include a second WEB-INF/web.xml which will be ignored."/> + </target> +</project> diff --git a/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/web.xml b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/web.xml new file mode 100644 index 00000000..414625ae --- /dev/null +++ b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/web.xml @@ -0,0 +1,21 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + 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. +--> +<web-app xmlns="http://java.sun.com/xml/ns/javaee" + version="2.5" metadata-complete="true"> + +</web-app> diff --git a/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/whichresource-test.xml b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/whichresource-test.xml new file mode 100644 index 00000000..6bf5a881 --- /dev/null +++ b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/whichresource-test.xml @@ -0,0 +1,51 @@ +<?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="init"> + <delete quiet="yes" dir="${output}"/> + <mkdir dir="${output}"/> + <javac srcdir="javac-dir/good-src" destdir="${output}"/> + <path id="whichresource-build" path="${output}"/> + </target> + + <target name="test-reference" depends="init"> + <whichresource + property="whichresource.prop" + class="Simple" + classpathref="whichresource-build"/> + + <au:assertTrue> + <contains string="${whichresource.prop}" + substring="Simple.class"/> + </au:assertTrue> + </target> + + <target name="test-not-present" depends="init"> + <whichresource + property="whichresource2.prop" + class="ClassNotPresent" + classpathref="whichresource-build"/> + + <au:assertFalse> + <isset property="whichresource.prop2"/> + </au:assertFalse> + </target> + +</project> diff --git a/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/xmlproperty-test.xml b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/xmlproperty-test.xml new file mode 100644 index 00000000..5be04207 --- /dev/null +++ b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/xmlproperty-test.xml @@ -0,0 +1,144 @@ +<?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"> + <description/> + + <import file="../antunit-base.xml" /> + + <target name="test-empty"> + <xmlproperty file="xmlproperty-test.xml"/> + <au:assertTrue> + <equals arg1="" arg2="${project.description}"/> + </au:assertTrue> + </target> + + <target name="test-multi"> + <property name="root.element.value" value="original"/> + <xmlproperty file="xmlproperty.multi.xml" collapseAttributes="yes"/> + <au:assertTrue> + <equals arg1="original" arg2="${root.element.value}"/> + </au:assertTrue> + </target> + + <target name="load"> + <xmlproperty + file="xmlproperty.inline-expansion.xml" + collapseAttributes="true" + keepRoot="false" + semanticAttributes="true"/> + <echo> + element expected actual + p $${app.n} ${app.p} + n n ${app.n} + o n ${app.o} + m n ${app.m} + </echo> + </target> + + <target name="NotestInlineExpansion" depends="load"> + <au:assertPropertyEquals name="app.m" value="n"/> + <au:assertPropertyEquals name="app.n" value="n"/> + <au:assertPropertyEquals name="app.o" value="n"/> + <au:assertPropertyEquals name="app.p" value="$${app.n}"/> + <property name="sequence" value="${app.m}${app.n}${app.o}${app.p}"/> + <fail> + xml attributes are not expanding correctly + expected: mnop=nnn$${app.n} + actual mnop=${sequence} + <condition> + <not> + <equals arg1="${sequence}" arg2="nnn${app.n}"/> + </not> + </condition> + </fail> + </target> + + <target name="createDocExample"> + <mkdir dir="${input}"/> + <echoxml file="${input}/example.xml"> + <root-tag> + <version value="0.0.1"/> + <build folder="build"> + <classes id="build.classes" location="${build.folder}/classes"/> + <reference refid="build.classes"/> + </build> + <compile> + <classpath pathid="compile.classpath"> + <pathelement location="${build.classes}"/> + </classpath> + </compile> + <run-time> + <jars>*.jar</jars> + <classpath pathid="run-time.classpath"> + <path refid="compile.classpath"/> + <pathelement path="${run-time.jars}"/> + </classpath> + </run-time> + </root-tag> + </echoxml> + </target> + + <target name="testSemanticLoadingDocExample" depends="createDocExample"> + <xmlproperty file="${input}/example.xml" semanticAttributes="true" + keepRoot="false"/> + + <au:assertPropertyEquals name="version" value="0.0.1"/> + <au:assertPropertyEquals name="build.folder" value="build"/> + <property name="b.c" location="${build.folder}/classes"/> + <au:assertPropertyEquals name="build.classes" value="${b.c}"/> + <au:assertReferenceSet refid="build.classes"/> + <property name="b.c.r" refid="build.classes"/> + <au:assertPropertyEquals name="b.c.r" value="${b.c}"/> + <au:assertPropertyEquals name="build.reference" value="${b.c}"/> + <au:assertPropertyEquals name="run-time.jars" value="*.jar"/> + <au:assertReferenceIsType refid="compile.classpath" type="path"/> + <au:assertReferenceIsType refid="run-time.classpath" type="path"/> + <property name="c.c" refid="compile.classpath"/> + <au:assertPropertyEquals name="c.c" value="${b.c}"/> + <property name="rt.c" refid="run-time.classpath"/> + <property name="glob.dot.jar" location="*.jar"/> + <au:assertPropertyEquals name="rt.c" + value="${b.c}${path.separator}${glob.dot.jar}"/> + </target> + + <target name="testIncludeSemanticDocExample" depends="createDocExample"> + <xmlproperty file="${input}/example.xml" semanticAttributes="true" + keepRoot="false" includeSemanticAttribute="true"/> + + <au:assertPropertyEquals name="version.value" value="0.0.1"/> + <au:assertPropertyEquals name="build.folder" value="build"/> + <property name="b.c" location="${build.folder}/classes"/> + <au:assertPropertyEquals name="build.classes.location" value="${b.c}"/> + <au:assertReferenceSet refid="build.classes"/> + <property name="b.c.r" refid="build.classes"/> + <au:assertPropertyEquals name="b.c.r" value="${b.c}"/> + <au:assertPropertyEquals name="build.reference" value="${b.c}"/> + <au:assertPropertyEquals name="run-time.jars" value="*.jar"/> + <au:assertReferenceIsType refid="compile.classpath" type="path"/> + <au:assertReferenceIsType refid="run-time.classpath" type="path"/> + <property name="c.c" refid="compile.classpath"/> + <!-- not set at all because property's name is build.classes.refid now --> + <property name="b.c.loc" location="${build.classes}"/> + <au:assertPropertyEquals name="c.c" value="${b.c.loc}"/> + <property name="rt.c" refid="run-time.classpath"/> + <property name="glob.dot.jar" location="*.jar"/> + <au:assertPropertyEquals name="rt.c" + value="${b.c.loc}${path.separator}${glob.dot.jar}"/> + </target> +</project> + diff --git a/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/xmlproperty.inline-expansion.xml b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/xmlproperty.inline-expansion.xml new file mode 100644 index 00000000..a9151799 --- /dev/null +++ b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/xmlproperty.inline-expansion.xml @@ -0,0 +1,33 @@ +<?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. +--> +<root-tag> + <!--used to check that the ordering of attribute expansion/eval is the order of + declaration in the build file, not alphabetical + + expectations are + p : ${app.n} + n : n + o : n + m : n + --> + <app + p="${app.n}" + n="n" + o="${app.n}" + m="${app.n}"/> +</root-tag>
\ No newline at end of file diff --git a/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/xmlproperty.multi.xml b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/xmlproperty.multi.xml new file mode 100644 index 00000000..9899c586 --- /dev/null +++ b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/xmlproperty.multi.xml @@ -0,0 +1,21 @@ +<?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. +--> +<root> + <element value="a" /> + <element value="b" /> +</root> diff --git a/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/xslt-test.xml b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/xslt-test.xml new file mode 100644 index 00000000..d6f6d668 --- /dev/null +++ b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/xslt-test.xml @@ -0,0 +1,260 @@ +<?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="setUp"> + <mkdir dir="${output}"/> + <property name="legacy.dir" + location="../../../etc/testcases/taskdefs/style/"/> + </target> + + <target name="testParameterPropagation" depends="setUp"> + <xslt in="${legacy.dir}/data.xml" + out="${output}/out.xml" + style="${legacy.dir}/printParams.xsl"> + <param name="set" expression="myvalue"/> + </xslt> + <au:assertResourceContains + resource="${output}/out.xml" + value="set='myvalue'"/> + </target> + + <target name="testParameterTypes" depends="setUp" description="parameters of various data types and XPath expressions"> + + <property name="antProperty1" value="ANT_PROPERTY_1"/> + <property name="antProperty2" value="ANT_PROPERTY_2"/> + <property name="antProperty3" value="3"/> + <property name="antProperty4" value="substring-before"/> + + <xslt in="${legacy.dir}/data.xml" + out="${output}/out.xml"> + <param name="p1" expression="123" type="INT"/> + <param name="p2" expression="64 * 64 div 128 + 10" type="XPATH_NUMBER"/> + <param name="p3" expression="${antProperty4}($antProperty2, '_')" type="XPATH_STRING"/> + + <style> + <string><![CDATA[<xsl:stylesheet + version="1.0" + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + xmlns:fo="http://www.w3.org/1999/XSL/Format"> + +<!-- get the xsl-parameter --> +<xsl:param name="p1"/> +<xsl:param name="p2"/> +<xsl:param name="p3"/> + +<!-- use the xsl-parameter --> +<xsl:template match="/"> +p1_result='<xsl:value-of select="$p1 + 321"/>' +p2_result='<xsl:value-of select="$p2"/>' +p3_result='<xsl:value-of select="$p3"/>' +</xsl:template> + +</xsl:stylesheet> +]]></string> + </style> + </xslt> + <au:assertResourceContains resource="${output}/out.xml" value="p1_result='444'"/> + <au:assertResourceContains resource="${output}/out.xml" value="p2_result='42'"/> + <au:assertResourceContains resource="${output}/out.xml" value="p3_result='ANT'"/> + </target> + + <target name="testInlineStyleSheet" depends="setUp"> + <xslt in="${legacy.dir}/data.xml" + out="${output}/out.xml"> + <param name="set" expression="somevalue"/> + <style> + <string><![CDATA[<xsl:stylesheet + version="1.0" + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + xmlns:fo="http://www.w3.org/1999/XSL/Format"> + +<!-- get the xsl-parameter --> +<xsl:param name="set">set default value</xsl:param> +<xsl:param name="empty">empty default value</xsl:param> +<xsl:param name="undefined">undefined default value</xsl:param> + +<!-- use the xsl-parameter --> +<xsl:template match="/"> +set='<xsl:value-of select="$set"/>' +empty='<xsl:value-of select="$empty"/>' +undefined='<xsl:value-of select="$undefined"/>' +</xsl:template> + +</xsl:stylesheet> +]]></string> + </style> + </xslt> + <au:assertResourceContains + resource="${output}/out.xml" + value="set='somevalue'"/> + </target> + + <target name="testStyleDoesntExist" depends="setUp"> + <au:expectfailure expectedmessage="i-m-not-there.xslt doesn't exist."> + <xslt in="${legacy.dir}/data.xml" + out="${output}/out.xml" + style="i-m-not-there.xslt"/> + </au:expectfailure> + </target> + + <target name="testStyleDoesntExistNoError" depends="setUp"> + <xslt in="${legacy.dir}/data.xml" + out="${output}/out.xml" + style="i-m-not-there.xslt" + failOnError="false"/> + <au:assertFileDoesntExist file="${output}/out.xml"/> + </target> + + <target name="testStyleDoesntExistNoTransformationError" depends="setUp"> + <au:expectfailure expectedmessage="i-m-not-there.xslt doesn't exist."> + <xslt in="${legacy.dir}/data.xml" + out="${output}/out.xml" + style="i-m-not-there.xslt" + failOnTransformationError="false"/> + </au:expectfailure> + </target> + + <target name="testTransformationError" depends="setUp"> + <au:expectfailure expectedmessage="Fatal error during transformation"> + <xslt in="${legacy.dir}/data.xml" + out="${output}/out.xml" + style="xslt/printParams-invalid.xsl" + /> + </au:expectfailure> + </target> + + <target name="testTransformationErrorNoFail" depends="setUp"> + <xslt in="${legacy.dir}/data.xml" + out="${output}/out.xml" + style="xslt/printParams-invalid.xsl" + failOnError="false"/> + <au:assertFileDoesntExist file="${output}/out.xml"/> + </target> + + <target name="testTransformationErrorNoFailOnTransformation" depends="setUp"> + <xslt in="${legacy.dir}/../input.stdin" + out="${output}/out.xml" + style="${legacy.dir}/printParams.xsl" + failOnTransformationError="false"/> + <au:assertFileDoesntExist file="${output}/out.xml"/> + </target> + + <target name="testNoResources" depends="setUp"> + <au:expectfailure expectedmessage="no resources specified"> + <xslt destdir="${output}" style="${legacy.dir}/printParams.xsl" + useImplicitFileset="false"> + <fileset dir="."> + <include name="I don't exist"/> + </fileset> + </xslt> + </au:expectfailure> + </target> + + <target name="testNoResourcesNoFail" depends="setUp"> + <xslt destdir="${output}" style="${legacy.dir}/printParams.xsl" + useImplicitFileset="false" + failOnNoResources="false"> + <fileset dir="."> + <include name="I don't exist"/> + </fileset> + </xslt> + </target> + + <target name="testNoResourcesNoError" depends="setUp"> + <xslt destdir="${output}" style="${legacy.dir}/printParams.xsl" + useImplicitFileset="false" + failOnError="false"> + <fileset dir="."> + <include name="I don't exist"/> + </fileset> + </xslt> + </target> + + + <target name="testTraceJdk14" unless="jdk1.5+" depends="setUp"> + <xslt in="${legacy.dir}/data.xml" + out="${output}/out.xml" + style="${legacy.dir}/printParams.xsl"> + <param name="set" expression="myvalue"/> + <trace templates="true"/> + </xslt> + <au:assertLogContains text="Failed to enable tracing" level="warning"/> + </target> + + <target name="testTraceJdk15+" if="jdk1.5+" depends="setUp"> + <xslt in="${legacy.dir}/data.xml" + out="${output}/out.xml" + style="${legacy.dir}/printParams.xsl"> + <param name="set" expression="myvalue"/> + <trace templates="true" elements="true" generation="true" + selection="true" extension="true"/> + </xslt> + <au:assertLogDoesntContain text="Failed to enable tracing"/> + </target> + + <target name="setUpIfUnlessTests" depends="setUp"> + <macrodef name="xs"> + <sequential> + <xslt in="${legacy.dir}/data.xml" out="${output}/out.xml" + style="${legacy.dir}/printParams.xsl"> + <param name="set" expression="if-value" if="${if}"/> + <param name="set" expression="unless-value" unless="${if}"/> + <param name="empty" expression="if-value" if="if"/> + <param name="empty" expression="unless-value" unless="if"/> + </xslt> + </sequential> + </macrodef> + </target> + + <target name="testPropertiesNotSet" depends="setUpIfUnlessTests"> + <xs/> + <au:assertResourceContains resource="${output}/out.xml" + value="set='unless-value'"/> + <au:assertResourceContains resource="${output}/out.xml" + value="empty='unless-value'"/> + </target> + + <target name="testPropertiesSet" depends="setUpIfUnlessTests"> + <property name="if" value="whatever"/> + <xs/> + <au:assertResourceContains resource="${output}/out.xml" + value="set='unless-value'"/> + <au:assertResourceContains resource="${output}/out.xml" + value="empty='if-value'"/> + </target> + + <target name="testIfTrue" depends="setUpIfUnlessTests"> + <property name="if" value="true"/> + <xs/> + <au:assertResourceContains resource="${output}/out.xml" + value="set='if-value'"/> + <au:assertResourceContains resource="${output}/out.xml" + value="empty='if-value'"/> + </target> + + <target name="testIfFalse" depends="setUpIfUnlessTests"> + <property name="if" value="false"/> + <xs/> + <au:assertResourceContains resource="${output}/out.xml" + value="set='unless-value'"/> + <au:assertResourceContains resource="${output}/out.xml" + value="empty='if-value'"/> + </target> +</project> diff --git a/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/xslt/printParams-invalid.xsl b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/xslt/printParams-invalid.xsl new file mode 100644 index 00000000..36d404e8 --- /dev/null +++ b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/xslt/printParams-invalid.xsl @@ -0,0 +1,36 @@ +<?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. +--> + +<xsl:stylesheet + version="1.0" + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + xmlns:fo="http://www.w3.org/1999/XSL/Format"> + +<!-- get the xsl-parameter --> +<xsl:param name="set">set default value</xsl:param> +<xsl:param name="empty">empty default value</xsl:param> +<xsl:param name="undefined">undefined default value</xsl:param> + +<!-- use the xsl-parameter --> +<xsl:template match="'"> +set='<xsl:value-of select="$set"/>' +empty='<xsl:value-of select="$empty"/>' +undefined='<xsl:value-of select="$undefined"/>' +</xsl:template> + +</xsl:stylesheet> diff --git a/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/zip-test.xml b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/zip-test.xml new file mode 100644 index 00000000..6a054f13 --- /dev/null +++ b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/zip-test.xml @@ -0,0 +1,185 @@ +<?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="testEmptyDirs"> + <mkdir dir="${input}/foo"/> + <mkdir dir="${output}/bar"/> + <zip destfile="${output}/test.zip"> + <fileset dir="${input}"/> + </zip> + <unzip src="${output}/test.zip" dest="${output}/bar"/> + <au:assertFileExists file="${output}/bar/foo"/> + </target> + + <target name="testMappedResources"> + <mkdir dir="${input}"/> + <mkdir dir="${output}/out"/> + <echo file="${input}/foo.txt">Hello, world!</echo> + <zip destfile="${output}/test.zip"> + <mappedresources> + <fileset dir="${input}"/> + <globmapper from="foo.*" to="bar.*"/> + </mappedresources> + </zip> + <unzip src="${output}/test.zip" dest="${output}/out"/> + <au:assertFileDoesntExist file="${output}/out/foo.txt"/> + <au:assertFileExists file="${output}/out/bar.txt"/> + <au:assertFilesMatch expected="${input}/foo.txt" + actual="${output}/out/bar.txt"/> + </target> + + <target name="test-54026"> + <mkdir dir="${input}"/> + <touch file="${input}/test1"/> + <mkdir dir="${input}/subdir"/> + <touch file="${input}/subdir/test2"/> + <zip destfile="${output}/br54026-destzip.zip"> + <mappedresources> + <fileset dir="${input}"/> + <globmapper from="subdir/*" to="subdir.orig/*"/> + </mappedresources> + </zip> + + <au:assertFileExists file="${output}/br54026-destzip.zip"/> + </target> + + <target name="testMappedClasspath"> + <mkdir dir="${input}"/> + <mkdir dir="${output}/out"/> + <zip destfile="${output}/test.zip"> + <mappedresources> + <path path="${java.class.path}"/> + <chainedmapper> + <flattenmapper/> + <globmapper from="*" to="WEB-INF/lib/*"/> + </chainedmapper> + </mappedresources> + </zip> + <unzip src="${output}/test.zip" dest="${output}/out"/> + <au:assertFileExists file="${output}/out/WEB-INF/lib/ant.jar"/> + </target> + + <target name="testIssue45902" + description="https://issues.apache.org/bugzilla/show_bug.cgi?id=45902"> + <mkdir dir="${input}/src/p"/> + <mkdir dir="${output}"/> + <touch file="${input}/src/p/X.java"/> + <touch file="${input}/src/p/x.properties"/> + <mkdir dir="${input}/build"/> + <copy todir="${input}/build"> + <fileset dir="${input}/src" includes="**/*.java"/> + </copy> + + <jar jarfile="${output}/jar.jar"> + <fileset dir="${input}/build"/> + <fileset dir="${input}/src" excludes="**/*.java"/> + </jar> + <copy file="${output}/jar.jar" tofile="${output}/reference.jar"/> + + <sleep seconds="1"/> + <touch file="${input}/src/p/y.properties"/> + <sleep seconds="1"/> + <delete file="${input}/src/p/y.properties"/> + <jar jarfile="${output}/jar.jar"> + <fileset dir="${input}/build"/> + <fileset dir="${input}/src" excludes="**/*.java"/> + </jar> + <au:assertDestIsUptodate src="${output}/jar.jar" + dest="${output}/reference.jar"/> + + <sleep seconds="1"/> + <jar jarfile="${output}/jar.jar"> + <fileset dir="${input}/build"/> + <fileset dir="${input}/src" excludes="**/*.java"/> + </jar> + <au:assertDestIsUptodate src="${output}/jar.jar" + dest="${output}/reference.jar"/> + + <jar jarfile="${output}/jar.jar"> + <fileset dir="${input}/build"/> + <fileset dir="${input}/src" excludes="**/*.java"/> + </jar> + <au:assertDestIsUptodate src="${output}/jar.jar" + dest="${output}/reference.jar"/> + </target> + + <target name="testNewEmptyDirUpdatesArchive"> + <mkdir dir="${input}"/> + <touch file="${input}/x"/> + <mkdir dir="${output}"/> + <jar jarfile="${output}/jar.jar"> + <fileset dir="${input}"/> + </jar> + <copy file="${output}/jar.jar" tofile="${output}/reference.jar"/> + + <mkdir dir="${input}/y"/> + <sleep seconds="2"/> + <jar jarfile="${output}/jar.jar"> + <fileset dir="${input}"/> + </jar> + <au:assertDestIsOutofdate src="${output}/jar.jar" + dest="${output}/reference.jar"/> + </target> + + <target name="testFilesetInsideResources" + description="https://issues.apache.org/bugzilla/show_bug.cgi?id=50115"> + <mkdir dir="${input}/test2"/> + <touch file="${input}/test1.txt"/> + <mkdir dir="${output}"/> + <mkdir dir="${output}/expand"/> + <zip destfile="${output}/test.zip" whenempty="skip"> + <resources> + <fileset dir="${input}" includes="test**"/> + </resources> + </zip> + <au:assertLogDoesntContain text="skipping zip archive"/> + <unzip src="${output}/test.zip" dest="${output}/expand"/> + <au:assertFileExists file="${output}/expand/test1.txt"/> + <!--au:assertFileExists file="${output}/expand/test2"/--> + </target> + + <target name="testWhenEmptyChecksNonFileSets" + description="https://issues.apache.org/bugzilla/show_bug.cgi?id=50115"> + <mkdir dir="${input}/"/> + <touch file="${input}/test1.txt"/> + <mkdir dir="${output}"/> + <mkdir dir="${output}/expand"/> + <zip destfile="${output}/test.zip" whenempty="fail"> + <resources> + <fileset dir="${input}" includes="test**"/> + </resources> + </zip> + <unzip src="${output}/test.zip" dest="${output}/expand"/> + <au:assertFileExists file="${output}/expand/test1.txt"/> + </target> + + <target name="testUpdateZipWithDuplicateEntries" + description="https://issues.apache.org/bugzilla/show_bug.cgi?id=54967"> + <mkdir dir="${input}/"/> + <touch file="${input}/test1.txt"/> + <mkdir dir="${output}"/> + <zip destfile="${output}/test.zip" basedir="${input}"> + <fileset dir="${input}"/> + </zip> + <zip destfile="${output}/test.zip" update="true"> + <fileset dir="${basedir}" includes="zip-test.xml"/> + </zip> + </target> +</project> diff --git a/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/zip/Bugzilla-42940.zip b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/zip/Bugzilla-42940.zip Binary files differnew file mode 100644 index 00000000..2f756608 --- /dev/null +++ b/framework/src/ant/apache-ant-1.9.6/src/tests/antunit/taskdefs/zip/Bugzilla-42940.zip |