"Eric Pugh" <[EMAIL PROTECTED]> writes:

>I dug in a bit more, and actually, only one unit test fails,
>TestPropertiesConfiguration.testLoadViaPropertyWithBasePath2.

>When I change the basepath's to use "src/test-resources":

>private String testBasePath2 = new
>File("src/test-resources").getAbsoluteFile().getParentFile().getAbsolutePath
>();

>the resulting file is c:\java\cvs\jakarta-commons\configuration\src.  I
>think this is wrong, becase I don't see how the unit test later would work..
>I get a NPE, and it seem reasonable..

>So, if no one has an object, I'd like to apply this change.  All the unit
>tests (99.76%) pass.

The parent directory of "foo/bar" should be the directory in which
"foo" resides. However the

File("src/test-resources").getAbsoluteFile().getParentFile().getAbsolutePath()

expression first concatenates "src/test-resources" with its parent and
then finds the parent of "test-resources". Which is what you see: The
parent of "test-resources", not "src/test-resources".

The test does not expect new File("foo") to contain "dir/foo". So the
behaviour is as expected but different.

        Regards
                Henning

-- 
Dipl.-Inf. (Univ.) Henning P. Schmiedehausen          INTERMETA GmbH
[EMAIL PROTECTED]        +49 9131 50 654 0   http://www.intermeta.de/

RedHat Certified Engineer -- Jakarta Turbine Development  -- hero for hire
   Linux, Java, perl, Solaris -- Consulting, Training, Development

"Fighting for one's political stand is an honorable action, but re-
 fusing to acknowledge that there might be weaknesses in one's
 position - in order to identify them so that they can be remedied -
 is a large enough problem with the Open Source movement that it
 deserves to be on this list of the top five problems."
                       -- Michelle Levesque, "Fundamental Issues with
                                    Open Source Software Development"

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to