java - JUnit test fails because of user home directory syntax -


i using junit unit test, want test created file created on requested location, on case location tmp folder. test fails because user home directory got 'tmpfile.getparent()' not same got system.getproperty("user.home") :

tmpfile= file.createtempfile("tmpfile", ".tmp"); string actualfolder = tmpfile.getparent();/* tmp file directory */    string expectedfolder= system.getproperty("user.home")+"\\appdata\\local\\temp" 

the junit tests fails , in consol, got:

actualfolder = c:\users\[user_~1\]appdata\local\temp expectedfolder = c:\users\[user_000]appdata\local\temp> 

how can same syntax of user directory 'tmpfile.getparent()' ? in advance help!

the strings trying compare representation of underlying file in filesystem. yole suggested, should compare filehandles respectively absolute or canonical path.


Comments

Popular posts from this blog

c# - Can I intercept a SOAP response in .NET before a content type binding mismatch ProtocolException? -

python - Terminate a gnome-terminal opened with subprocess -

c - Unrecognised emulation mode: elf_i386 on MinGW32 -