Repository: ant Updated Branches: refs/heads/1.9.x a394a0bdf -> d24dbe78c
add a real test for native2ascii Project: http://git-wip-us.apache.org/repos/asf/ant/repo Commit: http://git-wip-us.apache.org/repos/asf/ant/commit/d24dbe78 Tree: http://git-wip-us.apache.org/repos/asf/ant/tree/d24dbe78 Diff: http://git-wip-us.apache.org/repos/asf/ant/diff/d24dbe78 Branch: refs/heads/1.9.x Commit: d24dbe78c56546941da73080837161d97d57b3d9 Parents: a394a0b Author: Stefan Bodewig <[email protected]> Authored: Sun Jul 24 07:31:55 2016 +0200 Committer: Stefan Bodewig <[email protected]> Committed: Sun Jul 24 07:34:47 2016 +0200 ---------------------------------------------------------------------- .../taskdefs/optional/native2ascii-test.xml | 46 ++++++++++++++++++++ 1 file changed, 46 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ant/blob/d24dbe78/src/tests/antunit/taskdefs/optional/native2ascii-test.xml ---------------------------------------------------------------------- diff --git a/src/tests/antunit/taskdefs/optional/native2ascii-test.xml b/src/tests/antunit/taskdefs/optional/native2ascii-test.xml index 7a30df7..1f7aa7f 100644 --- a/src/tests/antunit/taskdefs/optional/native2ascii-test.xml +++ b/src/tests/antunit/taskdefs/optional/native2ascii-test.xml @@ -65,4 +65,50 @@ public class Adapter implements Native2AsciiAdapter { </native2ascii> <au:assertLogContains text="adapter called"/> </target> + + <target name="-setup-UTF8-To-ASCII"> + <mkdir dir="${input}"/> + <mkdir dir="${output}"/> + <echo file="${input}/umlauts.properties" encoding="UTF-8">äöü=ÃÃà +</echo> + <echo file="${output}/expected/umlauts.properties" + encoding="ASCII">\u00e4\u00f6\u00fc=\u00c4\u00d6\u00dc +</echo> + </target> + + <target name="testUTF8-To-ASCII" depends="-setup-UTF8-To-ASCII"> + <native2ascii src="${input}" dest="${output}" + includes="**/*.properties"/> + <au:assertFilesMatch actual="${output}/umlauts.properties" + expected="${output}/expected/umlauts.properties"/> + </target> + + <target name="testUTF8-To-ASCII-sun" depends="-setup-UTF8-To-ASCII" + description="https://bz.apache.org/bugzilla/show_bug.cgi?id=59855" + unless="jdk1.9+"> + <native2ascii src="${input}" dest="${output}" implementation="sun" + includes="**/*.properties"/> + <au:assertFilesMatch actual="${output}/umlauts.properties" + expected="${output}/expected/umlauts.properties"/> + </target> + + <target name="-setup-ASCII-To-UTF8"> + <mkdir dir="${input}"/> + <mkdir dir="${output}"/> + <echo file="${input}/umlauts.properties" encoding="ASCII">\u00e4\u00f6\u00fc=\u00c4\u00d6\u00dc +</echo> + <echo file="${output}/expected/umlauts.properties" + encoding="UTF-8">äöü=ÃÃà +</echo> + </target> + + <target name="testASCII-To-UTF8-sun" depends="-setup-ASCII-To-UTF8" + description="https://bz.apache.org/bugzilla/show_bug.cgi?id=59855" + unless="jdk1.9+"> + <native2ascii src="${input}" dest="${output}" implementation="sun" + reverse="true" includes="**/*.properties"/> + <au:assertFilesMatch actual="${output}/umlauts.properties" + expected="${output}/expected/umlauts.properties"/> + </target> + </project>
