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

Capture and play voice with Asterisk ARI -

c++ - Can not find the "fiostream.h" file -

visual studio - Installing Packages through Nuget - "Central Directory corrupt" -