diff options
Diffstat (limited to 'framework/src/ant/apache-ant-1.9.6/src/etc/testcases/types/mappers')
4 files changed, 147 insertions, 0 deletions
diff --git a/framework/src/ant/apache-ant-1.9.6/src/etc/testcases/types/mappers/define.mapperresult.xml b/framework/src/ant/apache-ant-1.9.6/src/etc/testcases/types/mappers/define.mapperresult.xml new file mode 100644 index 00000000..d9152a1c --- /dev/null +++ b/framework/src/ant/apache-ant-1.9.6/src/etc/testcases/types/mappers/define.mapperresult.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> + <typedef name="mapperresult" + classpath="../../../../../build/testcases" + classname="org.apache.tools.ant.types.mappers.MapperResult"/> + + <!-- this is what you get with no result --> + <property name="no-results" value="<NULL>" /> +</project> diff --git a/framework/src/ant/apache-ant-1.9.6/src/etc/testcases/types/mappers/globmapper.xml b/framework/src/ant/apache-ant-1.9.6/src/etc/testcases/types/mappers/globmapper.xml new file mode 100644 index 00000000..1666d810 --- /dev/null +++ b/framework/src/ant/apache-ant-1.9.6/src/etc/testcases/types/mappers/globmapper.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> + <import file="define.mapperresult.xml"/> + + <target name="handle.dirsep"> + <mapperresult input="d\e/f/j.java" output="f/j.java"> + <globmapper from="d/e\*" to="*" handledirsep="yes"/> + </mapperresult> + </target> + + <target name="ignore.case"> + <mapperresult input="AbcDef.JaVa" output="bcDef.java.bak"> + <globmapper from="a*.java" to="*.java.bak" casesensitive="no"/> + </mapperresult> + </target> +</project> diff --git a/framework/src/ant/apache-ant-1.9.6/src/etc/testcases/types/mappers/regexpmapper.xml b/framework/src/ant/apache-ant-1.9.6/src/etc/testcases/types/mappers/regexpmapper.xml new file mode 100644 index 00000000..a85c49cf --- /dev/null +++ b/framework/src/ant/apache-ant-1.9.6/src/etc/testcases/types/mappers/regexpmapper.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> + <import file="define.mapperresult.xml"/> + + <target name="ignore.case"> + <mapperresult input="AbcDef.javA" output="bcDef.java.bak"> + <regexpmapper from="a(.*).JaVa" to="\1.java.bak" casesensitive="no"/> + </mapperresult> + </target> + + <target name="handle.dirsep"> + <mapperresult input="d\e/f\j.java" output="f/j.java"> + <regexpmapper from="d/e/(.*)" to="\1" handledirsep="yes"/> + </mapperresult> + </target> +</project> diff --git a/framework/src/ant/apache-ant-1.9.6/src/etc/testcases/types/mappers/scriptmapper.xml b/framework/src/ant/apache-ant-1.9.6/src/etc/testcases/types/mappers/scriptmapper.xml new file mode 100644 index 00000000..d3e7a8d0 --- /dev/null +++ b/framework/src/ant/apache-ant-1.9.6/src/etc/testcases/types/mappers/scriptmapper.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 name="scriptmapper"> + <import file="define.mapperresult.xml"/> + + + <target name="testSetSingle"> + <mapperresult input="" output="a"> + <scriptmapper language="javascript"> + self.addMappedName("a"); + </scriptmapper> + </mapperresult> + </target> + + <target name="testClear"> + <mapperresult input="" output="${no-results}"> + <scriptmapper language="javascript"> + self.addMappedName("a"); + self.clear(); + </scriptmapper> + </mapperresult> + </target> + + <target name="testSetMultiple"> + <mapperresult input="" output="a|b"> + <scriptmapper language="javascript"> + self.addMappedName("a"); + self.addMappedName("b"); + </scriptmapper> + </mapperresult> + </target> + + <target name="testPassthrough"> + <mapperresult input="a" output="A|a"> + <scriptmapper language="javascript"> + //relying on "a" to map to "A" on all locales. + self.addMappedName(source.toUpperCase()); + self.addMappedName(source.toLowerCase()); + </scriptmapper> + </mapperresult> + </target> + +</project> |