I was banging my head against a wall trying to do this in a unit test:
var file : File = File.applicationDirectory.resolvePath(“./../src/test/SomeFile.txt”);
Turns out that you can’t get to the relative parent of the applicationDirectory though. Flex/AIR has abstracted that away from you,
presumably to prevent you from looking in places you shouldn’t. (Edit: I no longer believe that, as you can easily get to any arbitrary folder you want via the File constructor.) So, I just told the project to copy non-embedded assets to the output folder, and now as long as the files for my tests are located somewhere in one of my source folders, I can reference the test files I want relative to the applicationDirectory.
UPDATE: Thanks to Jijith chandran for making the following suggestion and spelling out how to use the File constructor:
You can get it using the following