Author: peterreilly Date: Thu Dec 28 08:03:45 2006 New Revision: 490748 URL: http://svn.apache.org/viewvc?view=rev&rev=490748 Log: tests for errorProperty and updatedProperty of javac
Added: ant/core/trunk/src/tests/antunit/taskdefs/javac-dir/ ant/core/trunk/src/tests/antunit/taskdefs/javac-dir/bad-src/ ant/core/trunk/src/tests/antunit/taskdefs/javac-dir/bad-src/Bad.java ant/core/trunk/src/tests/antunit/taskdefs/javac-dir/good-src/ ant/core/trunk/src/tests/antunit/taskdefs/javac-dir/good-src/Simple.java ant/core/trunk/src/tests/antunit/taskdefs/javac-test.xml Added: ant/core/trunk/src/tests/antunit/taskdefs/javac-dir/bad-src/Bad.java URL: http://svn.apache.org/viewvc/ant/core/trunk/src/tests/antunit/taskdefs/javac-dir/bad-src/Bad.java?view=auto&rev=490748 ============================================================================== --- ant/core/trunk/src/tests/antunit/taskdefs/javac-dir/bad-src/Bad.java (added) +++ ant/core/trunk/src/tests/antunit/taskdefs/javac-dir/bad-src/Bad.java Thu Dec 28 08:03:45 2006 @@ -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 = "; +} Added: ant/core/trunk/src/tests/antunit/taskdefs/javac-dir/good-src/Simple.java URL: http://svn.apache.org/viewvc/ant/core/trunk/src/tests/antunit/taskdefs/javac-dir/good-src/Simple.java?view=auto&rev=490748 ============================================================================== --- ant/core/trunk/src/tests/antunit/taskdefs/javac-dir/good-src/Simple.java (added) +++ ant/core/trunk/src/tests/antunit/taskdefs/javac-dir/good-src/Simple.java Thu Dec 28 08:03:45 2006 @@ -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 { +} Added: ant/core/trunk/src/tests/antunit/taskdefs/javac-test.xml URL: http://svn.apache.org/viewvc/ant/core/trunk/src/tests/antunit/taskdefs/javac-test.xml?view=auto&rev=490748 ============================================================================== --- ant/core/trunk/src/tests/antunit/taskdefs/javac-test.xml (added) +++ ant/core/trunk/src/tests/antunit/taskdefs/javac-test.xml Thu Dec 28 08:03:45 2006 @@ -0,0 +1,42 @@ +<project default="all" xmlns:au="antlib:org.apache.ant.antunit"> + <property name="ant-build" location="../../../../build"/> + <property name="build-dir" location="${ant-build}/ant-unit/javac-dir/build"/> + + <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:assertTrue> + <equals arg1="${classes-updated-2}" arg2="${classes-updated-2}"/> + </au:assertTrue> + </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="all"> + <au:antunit> + <fileset file="${ant.file}"/> + <au:plainlistener/> + </au:antunit> + </target> +</project> --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]