Skip to main content
Participant
June 25, 2009
Question

Problem with failed asserts in FlexUnit4

  • June 25, 2009
  • 1 reply
  • 1520 views

Hello,

I'm trying out the FlexUnit4 Beta 1 using FlexBuilder 3 on a Mac OS X Leopard, executing the tests that come with the TurnKey release everything seems to be OK, but when I modify a test so it fails and try to execute the tests again and I get the following screen:

The progress bar does not move forward regardless of how long I leave the tests to run. It appears that the tests execution is halting on the first failed assertion regardless of which assertion it is. I tried several times with different assertions (ussing Assert static methods and Hamcrest-as3 assertThat) always with the same result.

One of the tests I made was to change the method testEnsureSetupComplete in flexUnitTests.flexUnit4.suites.frameworkSuite.cases.TestAsynchronousSetUpTearDown for the following:

[Test]
public function testEnsureSetupComplete() : void {
     Assert.assertTrue(false); //Added line
     Assert.assertEquals( 1, simpleValueOne );
     Assert.assertEquals( 2, simpleValueTwo );
     Assert.assertEquals( 3, simpleValueThree );
     Assert.assertNull( unitializedBySetup );              
}

I wonder if someone has experience something similar or has any suggestion on how to handle this problem. Let me know if you need more information.

Javier

This topic has been closed for replies.

1 reply

Participating Frequently
June 26, 2009

Javier,

If I modify my test just as you indicate below to make a failed assertion, all works as expected and I received one failed test.

I am guessing you must have changed more than just this. If you can provide me a reproducible test case, I will be more than happy to take a look at it, but the info below works. So you know the procedure I used, I downloaded a fresh copy of the code, added the one line indicated in your message and ran it.

Mike

Participant
June 26, 2009

Hello Mike,

Thanks for your answer. I tried again with a fresh install of FlexBuilder 3 (trial version) and a fresh download of FlexUnit 4 Beta 1.0 from http://opensource.adobe.com/wiki/display/flexunit/Downloads on Windows XP and just adding the same line posted in my previous message causes the issue again. I did not change anything else besides adding Assert.assertTrue(false);

I wonder, do you use FlexBuilder as well or are you ussing FlashBuilder already?, additionally, do you belive the SDK version or Flash Player version might be caussing the problem?

Thanks,

Javier

Participating Frequently
June 26, 2009

Various member of the team here are using FlexBuilder 3 and Flash Builder 4. We also have a few thousand of tests running against it (which I wish I could say were all passing at the moment ), so I don't think it could just be the assert false.

We saw an issue similar to this in previous versions when the test was actually being garbage collected while an async timer was pending, which caused the circumstance similar to what you were seeing. Since the test never finished in any way, things would seem to hang forever. We solved this by changing our timers to strong references during the tests, hence the reason I asked about changing anything else.

We will certainly take a further look into this but you are the only person reporting any issue like this from both the public and internal beta programs. If you can, please post this test case so that I can use yours exactly and rule out that I am doing something slightly different in my effort to recereate the issue. Also, let me know which version of the SDK and player you have so I can replicate the environment precisely.

Thanks for taking the time to post this. If you are familiar with the bug base, http://bugs.adobe.com/jira/browse/FXU, I would like to collect all of this information there. If not, just post here and I will create the issue and move things over.

Cheers,

Mike