Tim Ellison wrote:
The File.getCanonicalPath() should always return singular file path for same underlying file even the j.i.File instances are constructed by different parameters, and the 8.3 file name is one of case to be tested, i.e, if new File("longfi~1.tst").getCanonicalPath() return same value with new File("longfilename.tst").getCanonicalPath(), other similar cases to be tested includes "./longfilename.tst" or "<absolute path>/longfilename.tst". These tests are trying to verify Harmony has same behavior on these cases(including 8.3 filename) with RI.Paulex Yang wrote:Tim,Are you looking at this FileTest now?I have not had time, so if you can fix them then please go ahead.I've looked over this test, and basically I think it's the test itself can be improved. If 8.3 filename is disabled, the test_getCanonicalPath and test_getCanonicalFile fails on both RI and Harmony. Look inside the tests, it creates a file "longfilename.tst" and "longfi~`.tst", and try to assert these two file returns same canonical path. My suggestions on this test are: 1. About platform issue, these two tests are windows specific, and there are quite a few other test cases in FileTest written like "if(onWindows) blabla", they should be separated to another platform dependent test cases, according to our test convention proposal 2. About long file name issue, I think these 8.3 file name tests are still valuable, I suggest to check the workstation's status at first, and if it supports 8.3 filename, go on the tests, otherwise just skip over this block, the status can be easily get by codes below: (suppose we got a resource test file named as "longfilename.res") private boolean support8Dot3Filename(){ return new File(basedir+"longfi~1.res").exists(); } your comments?Just wondering if that is something we should be able to answer in the general case from the IFileSystem ? I guess no impl code takes notice of that support, in which case what is the test testing?
Moreover, stepping into the getCanonicalPath() implementation, there IS some special process for Windows on this issue - a method named platformCanonicalPath which locates in native-src/win.IA32/luni/helpers.c, I guess(before looking more inside to really understand what happens in this method ;-) ) this is the codes taking care of this kind of supports.
So I think the only evil is the tests should be more accommodate to the OS configuration. That's why I proposed the fix.
Regards, TimTim Ellison wrote:Can you stick it into a JIRA? I may have time to look into it. Regards, Tim Richard Liang wrote:Hello Nathan, Yes. When I disable 8.3 filename support on my WinXP, I get the same error. IMHO, our test case cannot assume whether the 8.3 filename is disabled or not. Richard. Nathan Beyer wrote:I'm running them through the Ant scripts. ant -f make/build.xml test I do have the 8.3 filename support disabled on my laptop, so I'm wondering if that's it. -Nathan-----Original Message----- From: Richard Liang [mailto:[EMAIL PROTECTED] Sent: Sunday, June 18, 2006 12:14 AM To: harmony-dev@incubator.apache.org Subject: Re: [classlib] tests.api.java.io.FileTest failures on Windows XP Hello Nathan , The test just pass on my eclipse. How do you execute this test? Nathan Beyer wrote:Does anyone else get the following failures when running the classlibtestsuite on Windows XP? I've been getting these for months and justignoringthem while I worked on other stuff, because they always happened. BeforeIstart digging into I wanted to see if anyone else is getting thesereports.test_getCanonicalFileFailureTest 5: Incorrect File Returned: C:\dev\harmony\classlib\modules\luni\bin\test\long-JDK2-3\longdi~1\longfi~1.tst junit.framework.AssertionFailedError: Test 5: Incorrect File Returned: C:\dev\harmony\classlib\modules\luni\bin\test\long-JDK2-3\longdi~1\longfi~1.tst attests.api.java.io.FileTest.test_getCanonicalFile(FileTest.java:783)atjava.lang.reflect.AccessibleObject.invokeV(AccessibleObject.java:205)0.171test_getCanonicalPathFailureTest 6: Incorrect Path Returned. (C:\dev\harmony\classlib\modules\luni\bin\test\long-JDK2-3\longfi~1.tst insteadof C:\dev\harmony\classlib\modules\luni\bin\test\long-JDK2-3\longfilenameJDK2-3.tst) junit.framework.AssertionFailedError: Test 6: Incorrect Path Returned. (C:\dev\harmony\classlib\modules\luni\bin\test\long-JDK2-3\longfi~1.tst insteadof C:\dev\harmony\classlib\modules\luni\bin\test\long-JDK2-3\longfilenameJDK2-3.tst) attests.api.java.io.FileTest.test_getCanonicalPath(FileTest.java:867)at java.lang.reflect.AccessibleObject.invokeV(AccessibleObject.java:205)-- Richard Liang China Software Development Lab, IBM --------------------------------------------------------------------- Terms of use : http://incubator.apache.org/harmony/mailing.html To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]--------------------------------------------------------------------- Terms of use : http://incubator.apache.org/harmony/mailing.html To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
-- Paulex Yang China Software Development Lab IBM --------------------------------------------------------------------- Terms of use : http://incubator.apache.org/harmony/mailing.html To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]