1. Good to know about these tools. I now made sure that the IntelliJ
project is using the correct SDK (which I have rebuilt before also
rebuilding the mustella SWF), and I get the same problem: I only reach
the constructors of TestCase and mx.modules.ModuleLoader. I think it's
that no one calls UnitTester.runTests() to actually start the test.
So I added "UnitTester.init(o)" in the static init method. This worked.

2. The next problem was an error with the excludes:

TypeError: Error #1009: Cannot access a property or method of a null
object reference.
at 
ExcludeFileLocation$/postProcessData()[C:\Users\evolverine\workspace\flex-sdk\mustella\as3\src\mustella\ExcludeFileLocation.as:210]
at 
ExcludeFileLocation$/completeHandler2()[C:\Users\evolverine\workspace\flex-sdk\mustella\as3\src\mustella\ExcludeFileLocation.as:203]
at flash.events::EventDispatcher/dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at flash.net::URLLoader/onComplete()

This happened because of the logic in
ExcludeFileLocation.loadExcludeFile, in which it assumes that url is a
fully qualified path - but when running it from IntelliJ it's actually
"app:/SF_module_sparkButtonBar.swf". So it can't load the excludes.
Solution: I added "UnitTester.waitForExcludes = false;" in the static
init() method, before the (above) call to UnitTester.init().

3. Next problem: the runTests() method is now executed, but the
UnitTester.includeList has wrong values (e.g.
"spark/collections/Sort/Other/null$SortField_module_sparkButtonBar_localeStyle_global_test1"
- notice the "null").
3.1. At this point I realise that "UnitTester.init(o)" is not needed
because it's called by ScriptRunner. So I remove it and it keeps
working as before.
3.2. I discover mustella/classes/CurrentIncludeList.as, which seems to
be generated by GetExcIncCase.java. Anyone know why the last part of
the includes lines is "null"? Maybe I'm running the mini_run script
with wrong parameters? (It's "$ mini_run.sh
-caseName=SortField_module_sparkButtonBar_localeStyle_global_test1
tests/spark/collections/Sort/Other/SF_module_sparkButtonBar_global_tester.mxml".)
Solution: I manually edit the CurrentIncludeList.as file to contain
correct includes.
Result: didn't work; the includeList still has values with "null" at the end.

Solution 2: hammer the correct test in by adding the line
"includeList["spark/collections/Sort/Other/SF_module_sparkButtonBar_global_tester$SortField_module_sparkButtonBar_localeStyle_global_test1"]
= 1;" in UnitTester.runTests.
Result: works.

4. The DispatchMouseClickEvent TestStep is run, but SetProperty isn't.
>From what I could tell from debugging, the
assets\CustomSparkButtonBarModule.swf module is correctly loaded, and
dispatches the "ready" event that DispatchMouseClickEvent is
instructed to wait for, but for some reason the test run fails before
it's received. At this point my knowledge of mustella as code is
limiting my ability to debug this further without spending hours on
it.

Ideas?

On 19 July 2015 at 07:15, Alex Harui <aha...@adobe.com> wrote:
>
>
> On 7/18/15, 3:05 PM, "Mihai Chira" <mihai.ch...@gmail.com> wrote:
>
>>> The swf should hit breakpoints in the sort code. Is it not doing that?
>>I could only break the app on the constructors of UnitTester and
>>TestCase. Nothing in SortField or Sort (I didn't test the
>>constructors, just other methods that should have been called - even
>>if the bug was still there, that is). But the clue is that I can't get
>>any breakpoint to stop in ResetComponent, DispatchMouseClickEvent or
>>SetProperty.
>
> Makes me think your line numbers aren’t matching up.  If the mustella.swc
> is old or the debugger is looking at sources in a different version of
> Flex SDK, then line numbers won’t match and you will miss hitting
> breakpoints.  Often, the constructors are still at the same line, but more
> important code has moved as lines get added.
>
> If you swfdump -abc  the SWF you can see more about what went into it and
> compare line numbers.
>
> -Alex
>
>

Reply via email to