0 Replies Latest reply on Feb 1, 2011 3:19 PM by bKartik.b

    Question related to FLexUnit4

    bKartik.b Level 1

      I am currently using flexUnit4 writing test cases for our flex project.Here is the problem

       

      i am testing the remoteOBject service calls.I have eventListeners for the ResultEvent and FaultEvent.What i want is the when a fault occurs in the service call i want the test to fail,but that doesn'e happen.Here is my code.

       

      [Test(async)]


              public function testGetPartyEditorSettingByPartyId():void
              {
                  var channelSet:ChannelSet;
                  var testService:RemoteObject = new RemoteObject();
                  var testPartyId:int = 0;
                 
                  channelSet = new ChannelSet();
                  channelSet.addChannel(new AMFChannel("smbamf", "http://localhost-www/messagebroker/amf"));
                  testService.destination = "snapFishService";
                  model.channelSet = channelSet;
                  testService.channelSet = model.channelSet;
                 
                  model.partyToken = "f3542fa156371192c39b1b620488bd6a539ee9600d5c1141dff7b38aa0ce01e9e97dcd18dc714964cbd7adc8 032c4151";
                 
                  testService.getPartyEditorSettingByPartyId(testPartyId, model.partyToken);
                  testService.addEventListener(FaultEvent.FAULT,faultHandler);
                  testService.addEventListener(ResultEvent.RESULT,getPartyEditorSettingByPartyIdHandler);
              }
             
             
              protected function faultHandler(event:FaultEvent):void
              {
                  Assert.fail(event.fault.faultString);
              }
             
              protected function getPartyEditorSettingByPartyIdHandler(event:ResultEvent):void
              {
                  assertTrue(true);
              }

       

       

      I don't know if i am doing something wrong or there is a bug in the framework.Any help on this?

       

      Thanks

       

      KB