|
|
@@ -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 |
|
|
|
|
|
|
|
https://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="expect-js"> |
|
|
|
<not> |
|
|
|
<and> |
|
|
|
<isset property="jenkins" /> |
|
|
|
<javaversion atleast="15" /> |
|
|
|
</and> |
|
|
|
</not> |
|
|
|
</condition> |
|
|
|
<echo>$${expect-js}=${expect-js}</echo> |
|
|
|
</target> |
|
|
|
|
|
|
|
<target name="test-available-property-default" depends="setUp" if="expect-js"> |
|
|
|
<property name="foo" value="FOO" /> |
|
|
|
<script language="javascript"> |
|
|
|
project.setProperty('bar', foo); |
|
|
|
</script> |
|
|
|
<au:assertEquals expected="${foo}" actual="${bar}" /> |
|
|
|
</target> |
|
|
|
|
|
|
|
<target name="test-available-property-setbeans-false" depends="setUp" if="expect-js"> |
|
|
|
<property name="baz" value="BAZ" /> |
|
|
|
<au:expectfailure> |
|
|
|
<script language="javascript" setbeans="false"> |
|
|
|
project.log(nosuch); |
|
|
|
var b = (baz == project.getProperty('baz')); |
|
|
|
</script> |
|
|
|
</au:expectfailure> |
|
|
|
</target> |
|
|
|
|
|
|
|
<target name="test-available-local-property" depends="setUp" if="expect-js"> |
|
|
|
<local name="localproperty" /> |
|
|
|
<property name="localproperty" value="iamlocal" /> |
|
|
|
<script language="javascript"> |
|
|
|
if (localproperty != project.getProperty('localproperty')) throw new org.apache.tools.ant.BuildException(); |
|
|
|
</script> |
|
|
|
</target> |
|
|
|
|
|
|
|
<target name="test-shaded-local-property" depends="setUp" if="expect-js"> |
|
|
|
<property name="shademe" value="FOO" /> |
|
|
|
<sequential> |
|
|
|
<local name="shademe" /> |
|
|
|
<property name="shademe" value="BAR" /> |
|
|
|
<script language="javascript"> |
|
|
|
if (shademe != project.getProperty('shademe')) throw new org.apache.tools.ant.BuildException(); |
|
|
|
</script> |
|
|
|
</sequential> |
|
|
|
</target> |
|
|
|
|
|
|
|
</project> |