I am using FlexUnit heavily, and appreciate it mightily.
However, there is one very powerful annoyance in the Failure Trace window in Eclipse/FlashBuilder. When I double-click on a stack frame, FlexUnit attempts to open the source file using the wrong path.
For instance, my assert is thrown on the following stack frame:
**[ at my.package::MyTestCase/myTestFunction(MyTestCase.as:127) ]
When I double-click the stack frame, it commands the editor to open file:
Which the editor complais that 'does not exist'.
When I inspect the properties of the actual file resource, Eclipse/FlashBuilder shows mee that the path is:
Note the lack of '/RootFolder'. I'm not sure why FlexUnit is tacking that on there, but it is causing the Editor View to choke. /RootFolder is the folder that my project folders _happen to be in_, but I think it is irrelevant as far as my workspace is concerned. My workspace folder is somewhere else entirely, if that is important (actually in /RootFolder/../workspaces/something/ FWIW)
Okay, a couple of things. FlexUnit is the actual unit testing framework which is an open source project. Adobe Flash Builder, IntelliJ, Flash Develop and other IDEs integrate with FlexUnit to provide a user interface.
So, based on the fact that you said eclipse, I am guessing it is Flash Builder. Unfortunately that is maintained as part of FlexUnit (we don't even have the code) it is part of Adobe's Flash Builder product. I am forwarding your post to the appropriate people on the team and hopefully they will post back or reach out for some additional information.
Sorry, wish there was more I could do to help,
I filed a bug for this issue here. Take a look and make sure I captured everything correctly.
Thanks for the heads up. I'll see if we can get this fixed in an upcoming build.
Adam Wayne Lehman
Product Manager · Flash Builder · Adobe Systems Inc
Thank you, this well help smooth things out if it gets fixed.
The bug itself is a bit incorrect though -- the bug says:
"Flash Builder does not seem to have the full path to the file. For example, when I file is located at '/RootFolder/ProjectFolder/src/test/flex/my/package/MyTestCase.as', Flash Builder attempts to open '/ProjectFolder/src/test/flex/my/package/MyTestCase.as'. Note the omission of <RootFolder>."
However, the reverse is true -- FlexUnit is prepending the path with <RootFolder>, which is causing the error. Either it should not prepend <RootFolder>, or Flash Builder should know how to deal with file paths that are prepended thusly. When one opens a file from Package Explorer, Open Resource, or Open Type, the <RootPath> is _not_ prepended.
Just to clarify again, I promise you that FlexUnit is not prepending anything. FlexUnit doesn't know or care about the path and has no idea what a project is let alone that your files might be in one.
I believe you -- but somewhere along the line double-clicking a line in the FlexUnit View stack trace is trying to open a different file path than opening the same file with Package Explorer, Open Resource, or Open Type. And the path resulting from the FlexUnit stack trace has extra information at the beginning. I don't know what's going on under the hood, or where the difference is coming from, but that's the end result in the Flash Builder editor view.
Maybe FlexUnit is being passed incorrect source paths at the start of the test run? Maybe the stack trace view itself is just getting a little confused?
I'm unable to reproduce this issue on the latest Flash Builder.
Here's what i did.
1. On Mac, I copied a Project Folder to my Root Folder.
2. I opened FB and imported this project folder.
3. I added a test case to this project and executed it.
4. When I clicked on the failure trace, the correct line was opened in the editor.
Am I missing something?