Claudenw commented on code in PR #311: URL: https://github.com/apache/creadur-rat/pull/311#discussion_r1807065289
########## apache-rat-core/src/test/java/org/apache/rat/document/impl/guesser/NoteGuesserTest.java: ########## @@ -34,34 +39,24 @@ public void testMatches() { assertTrue(NoteGuesser.isNote(new TestingDocument("NOTICE.txt"))); assertTrue(NoteGuesser.isNote(new TestingDocument("README"))); assertTrue(NoteGuesser.isNote(new TestingDocument("README.txt"))); - } + assertTrue(NoteGuesser.isNote(new TestingDocument("src/test/DEPENDENCIES"))); + assertTrue(NoteGuesser.isNote(new TestingDocument("src/test/LICENSE"))); + assertTrue(NoteGuesser.isNote(new TestingDocument("src/test/LICENSE.txt"))); + assertTrue(NoteGuesser.isNote(new TestingDocument("src/test/NOTICE"))); + assertTrue(NoteGuesser.isNote(new TestingDocument("src/test/NOTICE.txt"))); + assertTrue(NoteGuesser.isNote(new TestingDocument("src/test/README"))); + assertTrue(NoteGuesser.isNote(new TestingDocument("src/test/README.txt"))); - @Test - public void isNote() { - assertTrue(NoteGuesser.isNote("DEPENDENCIES")); - assertTrue(NoteGuesser.isNote("LICENSE")); - assertTrue(NoteGuesser.isNote("LICENSE.txt")); - assertTrue(NoteGuesser.isNote("NOTICE")); - assertTrue(NoteGuesser.isNote("NOTICE.txt")); - assertTrue(NoteGuesser.isNote("README")); - assertTrue(NoteGuesser.isNote("README.txt")); } - - @Test - public void isNoteWithPath() { - assertTrue(NoteGuesser.isNote("src/test/DEPENDENCIES")); - assertTrue(NoteGuesser.isNote("src/test/LICENSE")); - assertTrue(NoteGuesser.isNote("src/test/LICENSE.txt")); - assertTrue(NoteGuesser.isNote("src/test/NOTICE")); - assertTrue(NoteGuesser.isNote("src/test/NOTICE.txt")); - assertTrue(NoteGuesser.isNote("src/test/README")); - assertTrue(NoteGuesser.isNote("src/test/README.txt")); - assertTrue(NoteGuesser.isNote("src\\test\\DEPENDENCIES")); - assertTrue(NoteGuesser.isNote("src\\test\\LICENSE")); - assertTrue(NoteGuesser.isNote("src\\test\\LICENSE.txt")); - assertTrue(NoteGuesser.isNote("src\\test\\NOTICE")); - assertTrue(NoteGuesser.isNote("src\\test\\NOTICE.txt")); - assertTrue(NoteGuesser.isNote("src\\test\\README")); - assertTrue(NoteGuesser.isNote("src\\test\\README.txt")); + + @Disabled("RAT-390: old tests that do not work anymore") Review Comment: Short answer -- no. Long answer. The TestingDocument assumes that it is running on a linux box if you don't tell it otherwise. To make the test work on any platform we need to create a DocumentName with the proper separator character.. The new I modified TestingDocument to accept a DocumentName and modified the NoteGuesserTest to generate document names in Linux and Windows formats. The base name is the point from which the search for files started. In the test case I used the root directory though the "src" directory could have been used for the ones with paths. Once the DocumentNames are set correctly it works. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: dev-unsubscr...@creadur.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org