Skip to main content
Participating Frequently
March 17, 2010
Answered

<flexunit:TestRunnerBase >problem

  • March 17, 2010
  • 4 replies
  • 8202 views

This is the  code I have written for testing in flexcover

------------------------------------------------------------------------------

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
    xmlns:flexunit="http://www.adobe.com/2009/flexUnitUIRunner"
   
               
                creationComplete="runMe()" >

    <mx:Script>
        <![CDATA[
            import mouli.UIListener;
     import myComponents.Greeter;         
    
     import org.flexunit.runner.FlexUnitCore;
     import org.flexunit.listeners.UIListener;
     //import flexunit.runner.BaseTestRunner;
     //import flexunit.flexui.TestRunnerBase;
     //import com.adobe.cairngorm.control.FrontController;
     private var core:FlexUnitCore;

     public function runMe():void {
          core = new FlexUnitCore();
          core.addListener(new UIListener(uiListener));
          core.run( myComponents.Greeter );
     }
        ]]>
    </mx:Script>
   
<flexunit:BaseTestRunner id="uiListener" width="100%" height="100%" />
</mx:Application>

---------------------------------------------------------------------------------

And the error is at  line 26 .. and it is like this

Could not resolve  <flexunit:TestRunnerBase> to a component implementation.         TestFlexcover/src           TestProject.mxml            line 26   1268801906106  25

i am breaking my head on this please help me

This topic has been closed for replies.
Correct answer mlabriola

Change the MXML in your file to this instead

    <flexUnit:TestRunnerBase id="uiListener"
        width="100%" height="100%" />  

Just TestRunnerBase versus BaseTestRunner. Just as an FYI, what is really happening here is that we are instantiating the UI which was originally written for FlexUnit .9. It is then wrapper in our UIListener, which you are doing correctly, to adapt it. Then it is used as a listener.

In the next release or so of FlexUnit this will become easier as this UI is phased out in favor of a simpler model.

Mike

4 replies

Participant
November 29, 2010

to ursaditya :

Compiler can't resolve namespace

you need change it from  "http://www.adobe.com/2009/flexUnitUIRunner"  to  "org.flexunit.flexui.*"

eg find in the begining of your code

xmlns:flexunit="http://www.adobe.com/2009/flexUnitUIRunner"

and replece with

xmlns:flexUnitUIRunner="org.flexunit.flexui.*"

to Michael Labriola;

if I am correct you Adobe Evangelist and write article flexUnit4 in 360 seconds - shame on you that you can't resolve this problem.

But thanks anyway for article!

I really don't like flash/flex documentation since Adobe bye macromedia.

Participating Frequently
November 29, 2010

First, if you note above I did suggest a namespace problem. Second, if you are using this namespace, what it actually means is that you somehow have a library compiled without the proper namespace or things would have worked as expected. Third, I didn't just write the article, I wrote all of FlexUnit.

Mike

Participating Frequently
November 29, 2010

Also, FlexUnit isn't an Adobe project. It is a community project run and documented purely by volunteers, so please feel free to volunteer to help fix any documentation you feel lacking.

Also, as was noted on some of the other posts with the same question, you can take a look here for some additional knowledge base information:

https://flexunit.tenderapp.com/faqs/known-issues/uilistener-not-found-testrunnerbase-errors-and-other-resource-issues

Mike

Participant
May 29, 2010

Thanks you very much

Participant
March 18, 2010

I still have the same problem. "Could not resolve <...TestRunnerBase>. Downloaded the FlexUnit4TurnkeyRC1, running it through FlashDevelop unsing flex framework 4..0.0. Some help please.

Participating Frequently
March 20, 2010

Post your code so we can help you.

I am guessing that your namespace on the top of the file either doesn't point to the correct one for the library or isn't matching the tag but I won't know until I see it.

Mike

Participant
March 22, 2010

I have downloaded the FlexUnit Turnkey RC1 and using it as is, without any changes. I run into a lot of problems, mainly the one stated above. However, I have been able to get it to compile occationally, but then i get another problem. Identifier uiListener is used more than once. I change the name of it and it compiles again, but the problem returns. Please shed some light.

mlabriolaCorrect answer
Participating Frequently
March 17, 2010

Change the MXML in your file to this instead

    <flexUnit:TestRunnerBase id="uiListener"
        width="100%" height="100%" />  

Just TestRunnerBase versus BaseTestRunner. Just as an FYI, what is really happening here is that we are instantiating the UI which was originally written for FlexUnit .9. It is then wrapper in our UIListener, which you are doing correctly, to adapt it. Then it is used as a listener.

In the next release or so of FlexUnit this will become easier as this UI is phased out in favor of a simpler model.

Mike

ursadityaAuthor
Participating Frequently
March 18, 2010

Thanks Mike it is working absolutely fine

with regards

aditya