cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stuart Roebuck <stuart.roeb...@adolos.co.uk>
Subject [C2][PATCH] IOUtils.normalizedFilename + JUnit Test
Date Thu, 02 Aug 2001 20:57:41 GMT
Attached is a patch for IOUtils to fix a bug I ran across today, along 
with a JUnit test case and a patch for build.xml to allow for automatic 
command line testing.

The bug relates to requests for XSP pages from Cocoon from servers without 
a hostname (i.e. only a numeric address).  Such requests result in IOUtils.
normalizedFilename returning a normalized filename with an element 
starting with a number.  This is converted into an XSP Java package name 
and is invalid, resulting in a compile error.  So the patch here appends 
an "_" to the beginning of any element that starts with a non Alpha 
character.

I don't think there are any JUnit tests in Cocoon right now, so I created 
a new parallel directory hierachy mimicking the src directory and called 
it "test" instead of "src".  Inside that I placed the attached 
"IOUtilsTest.java" file.

The patch to build.xml adds a "test" target which relies on "compile" and 
then generates a new build/test directory where it compiles the tests in 
place and uses the JUnit extension to ant to run all the tests.

Stuart.

<Attachment missing><Attachment missing><Attachment missing>

-------------------------------------------------------------------------
Stuart Roebuck                                  stuart.roebuck@adolos.com
Lead Developer                               Java, XML, MacOS X, XP, etc.
ADOLOS                                           <http://www.adolos.com/>

Mime
View raw message