0 Replies Latest reply on Feb 4, 2011 12:21 AM by datsuns7

    don't execute NetConnection:close() until closing FlexUnitApplication.html


      hi all. I'm a beginner of AS3 and FlexUnit. I use Eclipse Helios Service Release 1 and Adobe Flash Builder.


      i made a application on Red5 server, and made tests in FlexUnit such as connecting, publishing,,,, and more.

      I made a test as "connection test" like followings:



      public class ConnectTest
           private var _conn:NetConnection;
           public function setUp():void{
                _conn = null;
           public function tearDown():void{
                if( _conn != null ){
                     _conn = null;
           public function test_NormalConnect():void{
                _conn = new NetConnection();
                Async.handleEvent(this, _conn, NetStatusEvent.NET_STATUS, netStatusHandler, 1000, null, timeoutHandler);
                _conn.connect( "/test/target/url/", "abc" );     /* 2nd parameter is user-name */
           private function nnetStatusHandler(event:NetStatusEvent, passThroughData:Object):void
                trace( event.info.code );
                switch( event.info.code ){
                     case "NetConnection.Connect.Success":
                     case "NetConnection.Connect.Closed":
           private function timeoutHandler( passThroughData:Object ):void{
                assertEquals(0, 1);


      After running that test a browser wake up and show "FlexUnitApplication.html".

      But in the server's log, there is no operation of  "_conn.close();" even though a breakpoint on that code is hit !

      After close the "FlexUnitApplication.html", close() operation is appeared in that log.


      my application on the server will reject connection when the same user-name is found.

      so I want close() will be running soon.


      I think i have a mistake in that code, but i can't find. Please give me any ideas.