For debugging (and to some extent logging), I have a suggestion based on a little experiment I tried that's letting me do both logging and debugging.
From command line, if I run 'fdb', (flex debugger) and then enter 'run' at the fdb prompt, then fdb is now waiting for the next SWF to initiate. (there are other ways to get fdb to attach to a swf, but this might be the best cross-platform way, because I *think* the mac os fdb only supports this method of connecting to a .swf). Let me show the flow of commands I used to do this, using these arrows (------> <------) to demarcate console out. -----------> > fdb Adobe fdb (Flash Player Debugger) [build 3958] Copyright (c) 2004-2007 Adobe, Inc. All rights reserved. (fdb) run Waiting for Player to connect <----------- Then I run 'mvn test' from another command window..., eventually, the mvn test goal will attempt to run TestRunner.swf, and fdb will attach to this .swf, causing both prompts to hang, since fdb is waiting for user input: -----------> > mvn test [INFO] Scanning for projects... [INFO] ------------------------------------------------------------------------ ... ... ... ... [INFO] Already trust on /Users/seth/workspace/lugiron/typo-ria/target/ test-classes/TestRunner.swf [INFO] [flexmojos:test-run] [INFO] flexmojos 3.1.0 - GNU GPL License (NO WARRANTY) - See COPYRIGHT file [INFO] Starting tests <----------- // MVN TEST HANGS HERE Now take a look at the fdb window: ---------> > Player connected; session starting. > Set breakpoints and then type 'continue' to resume the session. > [SWF] Users:seth:workspace:lugiron:typo-ria:target:test- classes:TestRunner.swf - 1,588,607 bytes after decompression > (fdb) <--------- Now, if I type 'continue' twice in the fdb command line, I can see logging from my app code, but not the test code yet if I use mx.logging. (but I do see any 'trace' commands. I think you have to confiugre mx.logging to write to console you have to configure TestRunner.swf to have a <mx:TraceElement> tag ... or hopefully there is a way to do it programmatically instead). --------> fdb) continue Additional ActionScript code has been loaded from a SWF or a frame. To see all currently loaded files, type 'info files'. Set additional breakpoints as desired, and then type 'continue'. (fdb) continue [trace] accounting for trailing region: region.start: 0, region.end: 100 [trace] accounting for region: region.start: 0, region.end: 20 [trace] accounting for trailing region: region.start: 80, region.end: 100 [trace] dataHandler [trace] data Server Status [trace] replying Player session terminated <---------- The top three traces are from my test code and actual app code. (I think those last 3 traces are from flex-mojos) And then the mvn test goal carries on... On Apr 15, 2009, at 11:33 AM, Marvin Froeder wrote: > I do accept suggestions here too. > > VELO > > On Wed, Apr 15, 2009 at 1:23 PM, seth <[email protected]> wrote: > > Hi all, > > I've written a unit test (using flexunit), and the test is waiting. > > I can open the sure-fire report, and see quite clearly the line of the > failing assertTrue. That's good. > > However, now that I know something is wrong, now I want to see, via > logging or debugger, what the state of the incorrect objects are. > > I have tried 'trace' as well as the flex logger (mx.logging), but no > logging shows up anywhere that I can see. Just as useful would be > attaching the fdb debugger. > > Anyone have any suggestions for debugging a unit test? > > Thanks, > Seth > > > > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Flex Mojos" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/flex-mojos?hl=en?hl=en http://blog.flex-mojos.info/ -~----------~----~----~----~------~----~------~--~---
