| <?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> |