In my project, I am extracting the test data to some location which needs to be used by junit tests. When I run my test from eclipse they run fine but when I run them from idea they fail because they could not locate the data.
I am extracting data at in my projects root Folder.
I am using following code for locating the data on disk
TestData.class.getProtectionDomain().getCodeSource().getLocation().getFile() In eclipse it returns
F:\dev\shopping\testData
but in Idea it returns
F:\dev\out\test\testData
Can someone explain this behavior?
outis configured as folder for the compiled binaries,testis the sources root for test classes, etc.