diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 000000000..31d1184ef --- /dev/null +++ b/.gitattributes @@ -0,0 +1,43 @@ +*.bat eol=crlf +*.bz2 binary +*.cmd eol=crlf +*.css text +*.dtd text +*.g text +*.gif binary +*.gz binary +*.html text diff=html +*.ico binary +*.inc text +*.jar binary +*.jpg binary +*.jsp text +*.md text +*.md5 text +*.md5sum text +*.mf text +*.pl text diff=perl +*.properties text +*.py text diff=python +*.result text +*.sample text +*.sh eol=lf +*.tar binary +*.test text +*.txt text +*.wxs text +*.xml text +*.xsd text +*.xsl text +*.zip binary +.gitattributes text +.gitignore text +CONTRIBUTORS text +INSTALL text +KEY text +LICENSE text +NOTICE text +README text +ReleaseInstructions text +STATUS text +WHATSNEW text diff --git a/.gitignore b/.gitignore index 53948912b..ac9499a02 100644 --- a/.gitignore +++ b/.gitignore @@ -1,29 +1,29 @@ -*.el -*.ipr -*.iws -*.pif -.ant.properties -.classpath -.project -.settings -bin -apache-ant-1.* -bootstrap -build -dist -distribution -java-repository -patch.tar.gz -patch.txt -target -velocity.log* -lib/optional/*.jar -src/tests/antunit/core/output -.idea -*.iml -/src/GPATH -/src/GRTAGS -/src/GSYMS -/src/GTAGS -/log.xml -lib/optional/license.txt +*.el +*.ipr +*.iws +*.pif +.ant.properties +.classpath +.project +.settings +bin +apache-ant-1.* +bootstrap +build +dist +distribution +java-repository +patch.tar.gz +patch.txt +target +velocity.log* +lib/optional/*.jar +src/tests/antunit/core/output +.idea +*.iml +/src/GPATH +/src/GRTAGS +/src/GSYMS +/src/GTAGS +/log.xml +lib/optional/license.txt diff --git a/src/etc/poms/ant-junit4/pom.xml b/src/etc/poms/ant-junit4/pom.xml index b380de484..ac6ed6f4d 100644 --- a/src/etc/poms/ant-junit4/pom.xml +++ b/src/etc/poms/ant-junit4/pom.xml @@ -1,71 +1,71 @@ - - - - - - org.apache.ant - ant-parent - ../pom.xml - 1.9.5-SNAPSHOT - - 4.0.0 - http://ant.apache.org/ - org.apache.ant - ant-junit4 - 1.9.5-SNAPSHOT - Apache Ant + JUnit 4 - contains JUnit 4.x support - - - org.apache.ant - ant - 1.9.5-SNAPSHOT - compile - - - junit - junit - 4.11 - compile - - - - - - org.apache.maven.plugins - maven-compiler-plugin - - - org/apache/tools/ant/taskdefs/optional/junit/JUnit4TestMethodAdapter* - org/apache/tools/ant/taskdefs/optional/junit/CustomJUnit4TestAdapterCache* - - - - - ../../../../src/main - ../../../../src/testcases - ../../../../target/${project.artifactId}/classes - ../../../../target/${project.artifactId}/testcases - ../../../../target/${project.artifactId} - - + + + + + + org.apache.ant + ant-parent + ../pom.xml + 1.9.5-SNAPSHOT + + 4.0.0 + http://ant.apache.org/ + org.apache.ant + ant-junit4 + 1.9.5-SNAPSHOT + Apache Ant + JUnit 4 + contains JUnit 4.x support + + + org.apache.ant + ant + 1.9.5-SNAPSHOT + compile + + + junit + junit + 4.11 + compile + + + + + + org.apache.maven.plugins + maven-compiler-plugin + + + org/apache/tools/ant/taskdefs/optional/junit/JUnit4TestMethodAdapter* + org/apache/tools/ant/taskdefs/optional/junit/CustomJUnit4TestAdapterCache* + + + + + ../../../../src/main + ../../../../src/testcases + ../../../../target/${project.artifactId}/classes + ../../../../target/${project.artifactId}/testcases + ../../../../target/${project.artifactId} + + diff --git a/src/etc/testcases/.gitattributes b/src/etc/testcases/.gitattributes new file mode 100644 index 000000000..3dfdde17e --- /dev/null +++ b/src/etc/testcases/.gitattributes @@ -0,0 +1 @@ +input.stdin text diff --git a/src/etc/testcases/filters/expected/escapeunicode.test b/src/etc/testcases/filters/expected/escapeunicode.test index ffede99d2..4ad328033 100644 --- a/src/etc/testcases/filters/expected/escapeunicode.test +++ b/src/etc/testcases/filters/expected/escapeunicode.test @@ -1,9 +1,9 @@ -#hebrew shalom olam (hello world) -text.hebrew=\u05e9\u05dc\u05d5\u05dd \u05e2\u05d5\u05dc\u05dd -#goethe gingko biloba -text.german.1=Sp\u00fcrst du nicht an meinen Liedern, -text.german.2=Da\u00df ich eins und doppelt bin ? -# Francois Villon Ballade des Pendus -text.french=Fr\u00e8res humains qui apr\u00e8s nous vivez -# Usual IT example -text.basic.latin=Hello World +#hebrew shalom olam (hello world) +text.hebrew=\u05e9\u05dc\u05d5\u05dd \u05e2\u05d5\u05dc\u05dd +#goethe gingko biloba +text.german.1=Sp\u00fcrst du nicht an meinen Liedern, +text.german.2=Da\u00df ich eins und doppelt bin ? +# Francois Villon Ballade des Pendus +text.french=Fr\u00e8res humains qui apr\u00e8s nous vivez +# Usual IT example +text.basic.latin=Hello World diff --git a/src/etc/testcases/filters/input/escapeunicode.test b/src/etc/testcases/filters/input/escapeunicode.test index 1f0117815..bf8615034 100644 --- a/src/etc/testcases/filters/input/escapeunicode.test +++ b/src/etc/testcases/filters/input/escapeunicode.test @@ -1,9 +1,9 @@ -#hebrew shalom olam (hello world) -text.hebrew=שלום עולם -#goethe gingko biloba -text.german.1=Spürst du nicht an meinen Liedern, -text.german.2=Daß ich eins und doppelt bin ? -# Francois Villon Ballade des Pendus -text.french=Frères humains qui après nous vivez -# Usual IT example -text.basic.latin=Hello World +#hebrew shalom olam (hello world) +text.hebrew=שלום עולם +#goethe gingko biloba +text.german.1=Spürst du nicht an meinen Liedern, +text.german.2=Daß ich eins und doppelt bin ? +# Francois Villon Ballade des Pendus +text.french=Frères humains qui après nous vivez +# Usual IT example +text.basic.latin=Hello World diff --git a/src/etc/testcases/taskdefs/exec/blabla.xml b/src/etc/testcases/taskdefs/exec/blabla.xml index 1c3ba0707..3b13195fd 100644 --- a/src/etc/testcases/taskdefs/exec/blabla.xml +++ b/src/etc/testcases/taskdefs/exec/blabla.xml @@ -1,19 +1,19 @@ - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + diff --git a/src/script/.gitattributes b/src/script/.gitattributes new file mode 100644 index 000000000..25bc157af --- /dev/null +++ b/src/script/.gitattributes @@ -0,0 +1,2 @@ +ant eol=lf +anrRun eol=lf diff --git a/src/tests/antunit/taskdefs/.gitattributes b/src/tests/antunit/taskdefs/.gitattributes new file mode 100644 index 000000000..dc5b3e83f --- /dev/null +++ b/src/tests/antunit/taskdefs/.gitattributes @@ -0,0 +1 @@ +utf-16.* binary diff --git a/src/tests/antunit/taskdefs/get-test.xml b/src/tests/antunit/taskdefs/get-test.xml index e1f021b56..0bca337c7 100644 --- a/src/tests/antunit/taskdefs/get-test.xml +++ b/src/tests/antunit/taskdefs/get-test.xml @@ -1,125 +1,125 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/tests/antunit/taskdefs/propertyfile-test.xml b/src/tests/antunit/taskdefs/propertyfile-test.xml index 106991ade..b02cfa4c9 100644 --- a/src/tests/antunit/taskdefs/propertyfile-test.xml +++ b/src/tests/antunit/taskdefs/propertyfile-test.xml @@ -1,44 +1,44 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/tests/junit/org/apache/tools/ant/types/selectors/README b/src/tests/junit/org/apache/tools/ant/types/selectors/README index de407b4f4..eb48f6bbc 100644 --- a/src/tests/junit/org/apache/tools/ant/types/selectors/README +++ b/src/tests/junit/org/apache/tools/ant/types/selectors/README @@ -1,96 +1,96 @@ -A DESCRIPTION OF THE SELECTOR TEST FRAMEWORK - -When writing tests for selectors, I found that I wanted to have some -standard way of working with a set of files and testing whether one or -another of them was selected. To that end, I created a base class called -BaseSelectorTest that does most of the heavy lifting. Of course, you can -test your selectors any way you want, but if you want to reuse this code, -read on. - -What BaseSelectorTest does is use an ant build file -"src/etc/testcases/types/selector.xml" to copy a tree of files out of -"src/etc/testcases/taskdefs/expected" into a "selectortest" directories. -Then it takes a list of 12 of the files and directories in this tree, and -applies whatever selector you pass in to each one. It passes back to your -test a 12 character long string indicating which of the 12 files and -directories was selected, using 'T' for selected and 'F' for not selected. -In the Test class for your selector, you override the getInstance() method -to create your own type of selector, and set the elements of your selector -a variety of ways to ensure that the string of T's and F's returned when -the selector is applied to those 12 files is correct. - -So, for example, DepthSelectorTest.java extends BaseSelectorTest and has -the following code: - - - public BaseSelector getInstance() { - return new DepthSelector(); - } - - - public void testSelectionBehaviour() { - DepthSelector s; - String results; - - - try { - makeBed(); - - - s = (DepthSelector)getInstance(); - s.setMin(20); - s.setMax(25); - results = selectionString(s); - assertEquals("FFFFFFFFFFFF", results); - - - s = (DepthSelector)getInstance(); - s.setMin(0); - results = selectionString(s); - assertEquals("TTTTTTTTTTTT", results); - - - s = (DepthSelector)getInstance(); - s.setMin(1); - results = selectionString(s); - assertEquals("FFFFFTTTTTTT", results); - - -The first test says that none of the 12 files or directories will match if -the depth range for the selector is between 20 and 25 (that would be one -deep directory tree!). The second says that all files and directories -match if the minimum depth is set to 0 and the maximum isn't specified. The -third test says that if the minumum depth is 1, the first 5 entries in the -list of 12 will not be selected and the rest will. - - -You can find the 12 files and directories that are tested for selection in -the BaseSelectorTest class. I used a fixed list so that if someone added -new files to the src/etc/testcases/types directory it wouldn't break my -tests: - - - protected String[] filenames = {".","asf-logo.gif.md5","asf- - logo.gif.bz2", - "asf-logo.gif.gz","copy.filterset.filtered","zip/asf- - logo.gif.zip", - "tar/asf-logo.gif.tar","tar/asf-logo-huge.tar.gz", - "tar/gz/asf-logo.gif.tar.gz","tar/bz2/asf-logo.gif.tar.bz2", - "tar/bz2/asf-logo-huge.tar.bz2","tar/bz2"}; - - -If you wish to use this set of files and directories to test your selector, -you can reuse the BaseSelectorTest with no change to it. - -You may find you need to alter the build file so that you get some -variation in the files that your selector can work with. Most of the core -selectors have required that kind of modification. If you do that, make -sure that it doesn't alter the output strings on the other selector test, -or if it does that you update their expected return results. - -You may also want to alter the set of files you look at in a particular -selector test. Since the filelist in BaseSelectorTest is protected, you -should be able to override it as you need to. Or you can alter the fileset -in BaseSelectorTest itself, provided you update the test strings in all the -other unit tests. - +A DESCRIPTION OF THE SELECTOR TEST FRAMEWORK + +When writing tests for selectors, I found that I wanted to have some +standard way of working with a set of files and testing whether one or +another of them was selected. To that end, I created a base class called +BaseSelectorTest that does most of the heavy lifting. Of course, you can +test your selectors any way you want, but if you want to reuse this code, +read on. + +What BaseSelectorTest does is use an ant build file +"src/etc/testcases/types/selector.xml" to copy a tree of files out of +"src/etc/testcases/taskdefs/expected" into a "selectortest" directories. +Then it takes a list of 12 of the files and directories in this tree, and +applies whatever selector you pass in to each one. It passes back to your +test a 12 character long string indicating which of the 12 files and +directories was selected, using 'T' for selected and 'F' for not selected. +In the Test class for your selector, you override the getInstance() method +to create your own type of selector, and set the elements of your selector +a variety of ways to ensure that the string of T's and F's returned when +the selector is applied to those 12 files is correct. + +So, for example, DepthSelectorTest.java extends BaseSelectorTest and has +the following code: + + + public BaseSelector getInstance() { + return new DepthSelector(); + } + + + public void testSelectionBehaviour() { + DepthSelector s; + String results; + + + try { + makeBed(); + + + s = (DepthSelector)getInstance(); + s.setMin(20); + s.setMax(25); + results = selectionString(s); + assertEquals("FFFFFFFFFFFF", results); + + + s = (DepthSelector)getInstance(); + s.setMin(0); + results = selectionString(s); + assertEquals("TTTTTTTTTTTT", results); + + + s = (DepthSelector)getInstance(); + s.setMin(1); + results = selectionString(s); + assertEquals("FFFFFTTTTTTT", results); + + +The first test says that none of the 12 files or directories will match if +the depth range for the selector is between 20 and 25 (that would be one +deep directory tree!). The second says that all files and directories +match if the minimum depth is set to 0 and the maximum isn't specified. The +third test says that if the minumum depth is 1, the first 5 entries in the +list of 12 will not be selected and the rest will. + + +You can find the 12 files and directories that are tested for selection in +the BaseSelectorTest class. I used a fixed list so that if someone added +new files to the src/etc/testcases/types directory it wouldn't break my +tests: + + + protected String[] filenames = {".","asf-logo.gif.md5","asf- + logo.gif.bz2", + "asf-logo.gif.gz","copy.filterset.filtered","zip/asf- + logo.gif.zip", + "tar/asf-logo.gif.tar","tar/asf-logo-huge.tar.gz", + "tar/gz/asf-logo.gif.tar.gz","tar/bz2/asf-logo.gif.tar.bz2", + "tar/bz2/asf-logo-huge.tar.bz2","tar/bz2"}; + + +If you wish to use this set of files and directories to test your selector, +you can reuse the BaseSelectorTest with no change to it. + +You may find you need to alter the build file so that you get some +variation in the files that your selector can work with. Most of the core +selectors have required that kind of modification. If you do that, make +sure that it doesn't alter the output strings on the other selector test, +or if it does that you update their expected return results. + +You may also want to alter the set of files you look at in a particular +selector test. Since the filelist in BaseSelectorTest is protected, you +should be able to override it as you need to. Or you can alter the fileset +in BaseSelectorTest itself, provided you update the test strings in all the +other unit tests. + diff --git a/src/tests/junit/org/example/tasks/antlib.xml b/src/tests/junit/org/example/tasks/antlib.xml index 2d8765793..b920da7eb 100644 --- a/src/tests/junit/org/example/tasks/antlib.xml +++ b/src/tests/junit/org/example/tasks/antlib.xml @@ -1,26 +1,26 @@ - - - - - - - - - - - + + + + + + + + + + + diff --git a/src/tests/junit/org/example/tasks/antlib2.xml b/src/tests/junit/org/example/tasks/antlib2.xml index 2d8765793..b920da7eb 100644 --- a/src/tests/junit/org/example/tasks/antlib2.xml +++ b/src/tests/junit/org/example/tasks/antlib2.xml @@ -1,26 +1,26 @@ - - - - - - - - - - - + + + + + + + + + + +