You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@creadur.apache.org by rd...@apache.org on 2008/06/28 12:43:00 UTC

svn commit: r672491 - in /incubator/rat/main/trunk/scan/src: main/org/apache/rat/scan/ test/org/apache/rat/scan/ test/org/apache/rat/scan/scanner/ test/org/apache/rat/scan/scanner/sub/ test/org/apache/rat/scan/scanner/sub/deep/

Author: rdonkin
Date: Sat Jun 28 03:42:59 2008
New Revision: 672491

URL: http://svn.apache.org/viewvc?rev=672491&view=rev
Log:
Added more test documents for scanner

Added:
    incubator/rat/main/trunk/scan/src/test/org/apache/rat/scan/Sample.txt
    incubator/rat/main/trunk/scan/src/test/org/apache/rat/scan/scanner/
    incubator/rat/main/trunk/scan/src/test/org/apache/rat/scan/scanner/HenryV.txt
    incubator/rat/main/trunk/scan/src/test/org/apache/rat/scan/scanner/RichardIII.txt
    incubator/rat/main/trunk/scan/src/test/org/apache/rat/scan/scanner/sub/
    incubator/rat/main/trunk/scan/src/test/org/apache/rat/scan/scanner/sub/deep/
    incubator/rat/main/trunk/scan/src/test/org/apache/rat/scan/scanner/sub/deep/Hamlet.txt
    incubator/rat/main/trunk/scan/src/test/org/apache/rat/scan/scanner/sub/deep/JuliusCaesar
Modified:
    incubator/rat/main/trunk/scan/src/main/org/apache/rat/scan/tests.py

Modified: incubator/rat/main/trunk/scan/src/main/org/apache/rat/scan/tests.py
URL: http://svn.apache.org/viewvc/incubator/rat/main/trunk/scan/src/main/org/apache/rat/scan/tests.py?rev=672491&r1=672490&r2=672491&view=diff
==============================================================================
--- incubator/rat/main/trunk/scan/src/main/org/apache/rat/scan/tests.py (original)
+++ incubator/rat/main/trunk/scan/src/main/org/apache/rat/scan/tests.py Sat Jun 28 03:42:59 2008
@@ -18,6 +18,8 @@
 import xml.parsers.expat
 
 TEST_BASE_DIR="../../../../../test/org/apache/rat/scan/"
+SCANNER_OUT="""<?xml version='1.0'?>
+<documents basedir='../../../../../test/org/apache/rat/scan/scanner/' at='NOW'>\n <document dir='../../../../../test/org/apache/rat/scan/scanner/' name='HenryV.txt' >\n  <md5>c81f4cd3b2203ae869b8c6acea6bf73c</md5>\n  <sha512>2ae73f5cfe7943a7d51b46e653948af7f067a6b01e61c827201c8e17b9231956f48b3e8e0da64e822ca9fdeb7a62f5af623406e2dbb9b39a8dabf569d2046402</sha512>\n  <ripemd160>4b0a5f9317e0d3165ea4982f90e7266a553d8353</ripemd160>\n </document>\n <document dir='../../../../../test/org/apache/rat/scan/scanner/' name='RichardIII.txt' >\n  <md5>911bade3f0bcdb652f1331fb19d7bf07</md5>\n  <sha512>3fd5d26bbbea1dfddeeab642bffd0d7fbdc6c4ed0d06faae3283e1e7b220d943200048630663c6a33e7cbd26fceab585920cd77d3481ce4dfa209b5000ccd4de</sha512>\n  <ripemd160>30ddc78d8bf08ef52ec8a7a8f7553c27931a6d0d</ripemd160>\n </document>\n <document dir='../../../../../test/org/apache/rat/scan/scanner/sub/deep' name='Hamlet.txt' >\n  <md5>1ccce242df4a39d25057aebed53be182</md5>\n  <sha512>2b92d82dcd9db3a3142f1bd1
 522d0a3818555edfb3fd579d80e3b7ebc67adb8fb73db0185ccdc72704294005fb3830529e8962715f2dbfa7da0bb0553abb573a</sha512>\n  <ripemd160>307a14094c28da7a46f894ed10eb732fb4d0f199</ripemd160>\n </document>\n <document dir='../../../../../test/org/apache/rat/scan/scanner/sub/deep' name='JuliusCaesar' >\n  <md5>0ef9754818b94baecca3596b43eb0753</md5>\n  <sha512>54184034009fc6b4e0dadfb0e14a1bad9c4c03791a982c4a7111dc7e4596164c1ca3dc49ec37c6081daf2bcd59d73a6c085beb1203b667066b77b58731f72460</sha512>\n  <ripemd160>0aa5485c5b892be83910fae34c304c1ac41240ec</ripemd160>\n </document>\n</documents>"""
 
 class ReadXmlTestCase(unittest.TestCase):
     
@@ -161,8 +163,9 @@
         
         
 class ScanScannerTest(unittest.TestCase):
+
     def setUp(self):
         self.scanner = scanner.Scanner(TEST_BASE_DIR + "scanner/", "NOW")
         
     def testScan(self):
-        self.assertEquals("<?xml version='1.0'?>\n<documents basedir='../../../../../test/org/apache/rat/scan/scanner/' at='NOW'>\n <document dir='../../../../../test/org/apache/rat/scan/scanner/' name='HenryV.txt' >\n  <md5>c81f4cd3b2203ae869b8c6acea6bf73c</md5>\n  <sha512>2ae73f5cfe7943a7d51b46e653948af7f067a6b01e61c827201c8e17b9231956f48b3e8e0da64e822ca9fdeb7a62f5af623406e2dbb9b39a8dabf569d2046402</sha512>\n  <ripemd160>4b0a5f9317e0d3165ea4982f90e7266a553d8353</ripemd160>\n </document>\n</documents>", self.scanner.scan())
\ No newline at end of file
+        self.assertEquals(SCANNER_OUT, self.scanner.scan())
\ No newline at end of file

Added: incubator/rat/main/trunk/scan/src/test/org/apache/rat/scan/Sample.txt
URL: http://svn.apache.org/viewvc/incubator/rat/main/trunk/scan/src/test/org/apache/rat/scan/Sample.txt?rev=672491&view=auto
==============================================================================
--- incubator/rat/main/trunk/scan/src/test/org/apache/rat/scan/Sample.txt (added)
+++ incubator/rat/main/trunk/scan/src/test/org/apache/rat/scan/Sample.txt Sat Jun 28 03:42:59 2008
@@ -0,0 +1,53 @@
+#########################################################################################
+# Licensed 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.
+#########################################################################################
+
+<blockquote cite='http://www.gutenberg.org/dirs/etext00/0ws2310.txt'>
+Once more vnto the Breach,
+Deare friends, once more;
+Or close the Wall vp with our English dead:
+In Peace, there's nothing so becomes a man,
+As modest stillnesse, and humilitie:
+But when the blast of Warre blowes in our eares,
+Then imitate the action of the Tyger:
+Stiffen the sinewes, commune vp the blood,
+Disguise faire Nature with hard-fauour'd Rage:
+Then lend the Eye a terrible aspect:
+Let it pry through the portage of the Head,
+Like the Brasse Cannon: let the Brow o'rewhelme it,
+As fearefully, as doth a galled Rocke
+O're-hang and iutty his confounded Base,
+Swill'd with the wild and wastfull Ocean.
+Now set the Teeth, and stretch the Nosthrill wide,
+Hold hard the Breath, and bend vp euery Spirit
+To his full height. On, on, you Noblish English,
+Whose blood is fet from Fathers of Warre-proofe:
+Fathers, that like so many Alexanders,
+Haue in these parts from Morne till Euen fought,
+And sheath'd their Swords, for lack of argument.
+Dishonour not your Mothers: now attest,
+That those whom you call'd Fathers, did beget you.
+Be Coppy now to men of grosser blood,
+And teach them how to Warre. And you good Yeomen,
+Whose Lyms were made in England; shew vs here
+The mettell of your Pasture: let vs sweare,
+That you are worth your breeding: which I doubt not:
+For there is none of you so meane and base,
+That hath not Noble luster in your eyes.
+I see you stand like Grey-hounds in the slips,
+Straying vpon the Start. The Game's afoot:
+Follow your Spirit; and vpon this Charge,
+Cry, God for Harry, England, and S[aint]. George.
+</blockquote>
+
+From Henry V By William Shakespeare, 1564-1616
\ No newline at end of file

Added: incubator/rat/main/trunk/scan/src/test/org/apache/rat/scan/scanner/HenryV.txt
URL: http://svn.apache.org/viewvc/incubator/rat/main/trunk/scan/src/test/org/apache/rat/scan/scanner/HenryV.txt?rev=672491&view=auto
==============================================================================
--- incubator/rat/main/trunk/scan/src/test/org/apache/rat/scan/scanner/HenryV.txt (added)
+++ incubator/rat/main/trunk/scan/src/test/org/apache/rat/scan/scanner/HenryV.txt Sat Jun 28 03:42:59 2008
@@ -0,0 +1,53 @@
+#########################################################################################
+# Licensed 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.
+#########################################################################################
+
+<blockquote cite='http://www.gutenberg.org/dirs/etext00/0ws2310.txt'>
+Once more vnto the Breach,
+Deare friends, once more;
+Or close the Wall vp with our English dead:
+In Peace, there's nothing so becomes a man,
+As modest stillnesse, and humilitie:
+But when the blast of Warre blowes in our eares,
+Then imitate the action of the Tyger:
+Stiffen the sinewes, commune vp the blood,
+Disguise faire Nature with hard-fauour'd Rage:
+Then lend the Eye a terrible aspect:
+Let it pry through the portage of the Head,
+Like the Brasse Cannon: let the Brow o'rewhelme it,
+As fearefully, as doth a galled Rocke
+O're-hang and iutty his confounded Base,
+Swill'd with the wild and wastfull Ocean.
+Now set the Teeth, and stretch the Nosthrill wide,
+Hold hard the Breath, and bend vp euery Spirit
+To his full height. On, on, you Noblish English,
+Whose blood is fet from Fathers of Warre-proofe:
+Fathers, that like so many Alexanders,
+Haue in these parts from Morne till Euen fought,
+And sheath'd their Swords, for lack of argument.
+Dishonour not your Mothers: now attest,
+That those whom you call'd Fathers, did beget you.
+Be Coppy now to men of grosser blood,
+And teach them how to Warre. And you good Yeomen,
+Whose Lyms were made in England; shew vs here
+The mettell of your Pasture: let vs sweare,
+That you are worth your breeding: which I doubt not:
+For there is none of you so meane and base,
+That hath not Noble luster in your eyes.
+I see you stand like Grey-hounds in the slips,
+Straying vpon the Start. The Game's afoot:
+Follow your Spirit; and vpon this Charge,
+Cry, God for Harry, England, and S[aint]. George.
+</blockquote>
+
+From Henry V By William Shakespeare, 1564-1616
\ No newline at end of file

Added: incubator/rat/main/trunk/scan/src/test/org/apache/rat/scan/scanner/RichardIII.txt
URL: http://svn.apache.org/viewvc/incubator/rat/main/trunk/scan/src/test/org/apache/rat/scan/scanner/RichardIII.txt?rev=672491&view=auto
==============================================================================
--- incubator/rat/main/trunk/scan/src/test/org/apache/rat/scan/scanner/RichardIII.txt (added)
+++ incubator/rat/main/trunk/scan/src/test/org/apache/rat/scan/scanner/RichardIII.txt Sat Jun 28 03:42:59 2008
@@ -0,0 +1,59 @@
+#########################################################################################
+# Licensed 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.
+#########################################################################################
+
+<blockquote cite='http://www.gutenberg.org/dirs/etext98/2ws0410.txt'>
+Now is the winter of our discontent
+Made glorious summer by this sun of York;
+And all the clouds that lour'd upon our house
+In the deep bosom of the ocean buried.
+Now are our brows bound with victorious wreaths;
+Our bruised arms hung up for monuments;
+Our stern alarums chang'd to merry meetings,
+Our dreadful marches to delightful measures.
+Grim-visag'd war hath smooth'd his wrinkled front;
+And now,--instead of mounting barbed steeds
+To fright the souls of fearful adversaries,--
+He capers nimbly in a lady's chamber
+To the lascivious pleasing of a lute.
+But I,--that am not shap'd for sportive tricks,
+Nor made to court an amorous looking-glass;
+I, that am rudely stamp'd, and want love's majesty
+To strut before a wanton ambling nymph;
+I, that am curtail'd of this fair proportion,
+Cheated of feature by dissembling nature,
+Deform'd, unfinish'd, sent before my time
+Into this breathing world scarce half made up,
+And that so lamely and unfashionable
+That dogs bark at me as I halt by them;--
+Why, I, in this weak piping time of peace,
+Have no delight to pass away the time,
+Unless to spy my shadow in the sun,
+And descant on mine own deformity:
+And therefore,--since I cannot prove a lover,
+To entertain these fair well-spoken days,--
+I am determined to prove a villain,
+And hate the idle pleasures of these days.
+Plots have I laid, inductions dangerous,
+By drunken prophecies, libels, and dreams,
+To set my brother Clarence and the king
+In deadly hate the one against the other:
+And if King Edward be as true and just
+As I am subtle, false, and treacherous,
+This day should Clarence closely be mew'd up,--
+About a prophecy which says that G
+Of Edward's heirs the murderer shall be.
+Dive, thoughts, down to my soul:--here Clarence comes.
+</blockquote>
+
+From Richard III By William Shakespeare, 1564-1616
\ No newline at end of file

Added: incubator/rat/main/trunk/scan/src/test/org/apache/rat/scan/scanner/sub/deep/Hamlet.txt
URL: http://svn.apache.org/viewvc/incubator/rat/main/trunk/scan/src/test/org/apache/rat/scan/scanner/sub/deep/Hamlet.txt?rev=672491&view=auto
==============================================================================
--- incubator/rat/main/trunk/scan/src/test/org/apache/rat/scan/scanner/sub/deep/Hamlet.txt (added)
+++ incubator/rat/main/trunk/scan/src/test/org/apache/rat/scan/scanner/sub/deep/Hamlet.txt Sat Jun 28 03:42:59 2008
@@ -0,0 +1,43 @@
+#########################################################################################
+# Licensed 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.
+#########################################################################################
+
+<blockquote cite='http://www.gutenberg.org/dirs/etext00/0ws2610.txt'
+  Ham. Let me see. Alas poore Yorick, I knew him Horatio,
+a fellow of infinite Iest; of most excellent fancy, he
+hath borne me on his backe a thousand times: And how
+abhorred my Imagination is, my gorge rises at it. Heere
+hung those lipps, that I haue kist I know not how oft.
+Where be your Iibes now? Your Gambals? Your
+Songs? Your flashes of Merriment that were wont to
+set the Table on a Rore? No one now to mock your own
+Ieering? Quite chopfalne? Now get you to my Ladies
+Chamber, and tell her, let her paint an inch thicke, to this
+fauour she must come. Make her laugh at that: prythee
+Horatio tell me one thing
+
+   Hor. What's that my Lord?
+  Ham. Dost thou thinke Alexander lookt o'this fashion
+i'th' earth?
+  Hor. E'ene so
+
+   Ham. And smelt so? Puh
+
+   Hor. E'ene so, my Lord
+
+   Ham. To what base vses we may returne Horatio.
+Why may not Imagination trace the Noble dust of Alexander,
+till he find it stopping a bunghole
+</blockquote>
+
+From Hamlet By William Shakespeare, 1564-1616
\ No newline at end of file

Added: incubator/rat/main/trunk/scan/src/test/org/apache/rat/scan/scanner/sub/deep/JuliusCaesar
URL: http://svn.apache.org/viewvc/incubator/rat/main/trunk/scan/src/test/org/apache/rat/scan/scanner/sub/deep/JuliusCaesar?rev=672491&view=auto
==============================================================================
--- incubator/rat/main/trunk/scan/src/test/org/apache/rat/scan/scanner/sub/deep/JuliusCaesar (added)
+++ incubator/rat/main/trunk/scan/src/test/org/apache/rat/scan/scanner/sub/deep/JuliusCaesar Sat Jun 28 03:42:59 2008
@@ -0,0 +1,54 @@
+#########################################################################################
+# Licensed 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.
+#########################################################################################
+
+<blockquote cite='http://www.gutenberg.org/dirs/etext98/2ws2410.txt'>
+ANTONY.
+Friends, Romans, countrymen, lend me your ears;
+I come to bury Caesar, not to praise him.
+The evil that men do lives after them;
+The good is oft interred with their bones:
+So let it be with Caesar. The noble Brutus
+Hath told you Caesar was ambitious:
+If it were so, it was a grievous fault;
+And grievously hath Caesar answer'd it.
+Here, under leave of Brutus and the rest,--
+For Brutus is an honourable man;
+So are they all, all honorable men,--
+Come I to speak in Caesar's funeral.
+He was my friend, faithful and just to me:
+But Brutus says he was ambitious;
+And Brutus is an honourable man.
+He hath brought many captives home to Rome,
+Whose ransoms did the general coffers fill:
+Did this in Caesar seem ambitious?
+When that the poor have cried, Caesar hath wept:
+Ambition should be made of sterner stuff:
+Yet Brutus says he was ambitious;
+And Brutus is an honourable man.
+You all did see that on the Lupercal
+I thrice presented him a kingly crown,
+Which he did thrice refuse: was this ambition?
+Yet Brutus says he was ambitious;
+And, sure, he is an honourable man.
+I speak not to disprove what Brutus spoke,
+But here I am to speak what I do know.
+You all did love him once,--not without cause:
+What cause withholds you, then, to mourn for him?--
+O judgment, thou art fled to brutish beasts,
+And men have lost their reason!--Bear with me;
+My heart is in the coffin there with Caesar,
+And I must pause till it come back to me.
+</blockquote>
+
+From Julius Caesar By William Shakespeare, 1564-1616
\ No newline at end of file