13 Replies Latest reply on Dec 16, 2011 11:52 AM by markdemi

    Eclipse update site for FlexUnit 4.1?

    Wrataxas

      Is there an update site that I can point Eclipse at to update the FlexUnit plugin to FlexUnit 4.1?

       

      If not, then how are people updating Eclipse?

        • 1. Re: Eclipse update site for FlexUnit 4.1?
          mlabriola Level 4

          Hi FlexUnit does not have an eclipse plugin. The eclipse plugin that you are likely thinking of is part of Flash Builder, not part of FlexUnit.

           

          So, any updates to that will be provided by Adobe if it is ever updated.

           

          FlexUnit is just an actionscript library,

          Mike

          • 2. Re: Eclipse update site for FlexUnit 4.1?
            Wrataxas Level 2

            I have this directory in my Eclipse directory: plugins/com.adobe.flexbuilder.flexunit_4.0.0.272416/

             

            In installation details, under the Plugins tab, I have:

            FlexUnitPlugins.png

            And you are saying this is part of Flash Builder and not separately updatable?  This is what I need to update to be using FlexUnit 4.1 right?  Is the only way to copy files in there by hand?

            • 3. Re: Eclipse update site for FlexUnit 4.1?
              mlabriola Level 4

              Hi-

               

              Okay, so, you are looking at the eclipse pieces in Flash Builder for FlexUnit. A few things you need to understand. First, that code is part of Flash Builder. It is produced by Adobe. It is not open source. It is not part of the FlexUnit project. Anyone is free to write an eclipse plugin that calls the FlexUnit library. That is what Adobe did in this case. There is no update available for the FlexUnit window in Flash Builder that I know of. If there were an update, it would likely be sold as part of the next Flash Builder.

               

              FlexUnit is an actionscript library. So, it is not Java and it doesn't live in Eclipse. It is really just a SWC file. The FlexUnit view inside of Flash Builder just shows the result information produced by FlexUnit and provides a semi-convenient way to launch FlexUnit in a web browser.

               

              In the 4.0 version of Flash Builder, Adobe did provide an easy mechanism to update the FlexUnit library. They changed this in the beta for the next version, but if you are running 4.0, there is no automated way.The easiest mechanism is just to grab the latest flexunit library and drop it in your library path and all will work.

               

              If you want to update it across all projects, you can  hunt in the Flash Builder installed files, you will eventually find a file named flexunit-(version info).swc. Just replace this file with an updated one from the flexunit site and all will work.

               

              I hope that clarifies things and I am trying to help, but these pieces aren't maintained by the FlexUnit team, so it really comes down to Flash Builder questions.

               

              Thanks,

              Mike

              • 4. Re: Eclipse update site for FlexUnit 4.1?
                Wrataxas Level 2

                Thank you very much.

                • 5. Re: Eclipse update site for FlexUnit 4.1?
                  markdemi

                  Thanks for the description.  Maybe you can answer this as well since it's related. I'm currently using Flash Builder 4.0 with the built-in Flex Unit 4.0.  I'm using the eclipse plugin which I find very convenient to easily control what tests are run and to run them again. I find myself focusing on individual or groups of tests when things go bad and I rather not run all the other ones while debugging.  Prior to Flash Builder 4, I was using the stand alone for Flex Unit 4.0 and the only way I could figure out how to just run individual tests were to comment my code which wasn't optimal.

                   

                  My problem right now is that I would really love to use the Parameterized Testing feature, but that's not part of 4.0.  Does anyone know of a hack to get the 4.1 version of Flex Unit to work in this environment?  This way I can take advantage of the plugin, but still have the latest Flex Unit features.

                   

                  If not, is there an easy way to control which tests get run when using Flex Unit 4.1 stand alone?

                  • 6. Re: Eclipse update site for FlexUnit 4.1?
                    mlabriola Level 4

                    All you need to do is add the FlexUnit 4.1 swc to your library path. So, if your project already has a libs folder, you can drop the flexunit swc in there, or from the projet properies add the swc to the library path regardless of where it is at on your drive.

                     

                    You will then be using the 4.1 library

                    • 7. Re: Eclipse update site for FlexUnit 4.1?
                      markdemi Level 1

                      I had tried that with no luck.  Just in case I made a mistake I tried again and still no luck.  Here's what I did.

                       

                      1.  I dropped all SWCs from flexunit 4.1 distribution into my libs folder.  This includes the following files.

                       

                      flexunit-cilistener-4.1.0-8-4.1.0.16076.swc

                      flexunit-flexcoverlistener-4.1.0-8-4.1.0.16076.swc

                      flexunit-4.1.0-8-as3_4.1.0.16076.swc

                      flexunit-4.1.0-8-flex_4.1.0.16076.swc

                      flexunit-aircilistener-4.1.0-8-4.1.0.16076.swc

                      fluint-extensions-4.1.0-8-4.1.0.16076.swc

                      flexunit-uilistener-4.1.0-8-4.1.0.16076.swc

                       

                      When I right-click on the Project and select "Execute Flex Unit Tests".  I get the following errors.

                       

                      DescriptionResourcePathLocationType
                      1046: Type was not found or was not a compile-time constant: [flash.events]::IEventDispatcher.UnitTestsUnknownFlex Problem
                      1046: Type was not found or was not a compile-time constant: [org.flexunit.internals.runners.statements]::IAsyncHandlingStatement.UnitTestsUnknownFlex Problem
                      1046: Type was not found or was not a compile-time constant: [org.flexunit.internals.runners.statements]::IAsyncStatement.UnitTestsUnknown

                      Flex Problem

                       

                      On top of this, I noticed that inside FlexUnitApplication.mxml, it adds another <flexui:FlexUnitTestRunnerUI> tag.  I'm not sure why.

                       

                      Keep in mind that flashbuilder 4.0 keeps on adding back the old library references as well.  So technically, I have both of them in there.  THe old ones are in the project settings and the new ones are in the libs folder.

                       

                      If you can help me sort this out, I would really appreciate it.

                      • 8. Re: Eclipse update site for FlexUnit 4.1?
                        mlabriola Level 4

                        yes, there are different options in that zip and you put mutually exclusive ones together

                         

                        see the names:

                        flexunit-4.1.0-8-as3_4.1.0.16076.swc and flexunit-4.1.0-8-flex_4.1.0.16076.swc

                         

                        One of those is if you want a Flex version, one of those if you want an AS version. Given the errors, you probably want to delete the -as3 version for your particular setup. You really don't need the rest of those.

                         

                        Basically, just put flexunit-4.1.0-8-flex_4.1.0.16076.swc in that path and I think you will be good.

                         

                        Mike

                        • 9. Re: Eclipse update site for FlexUnit 4.1?
                          markdemi Level 1

                          Still not good (sorry).  I tried the flex one alone, and when that didn't work, I add the following.

                           

                          fluint-extensions-4.1.0-8-4.1.0.16076.swc

                          flexunit-uilistener-4.1.0-8-4.1.0.16076.swc

                           

                          To be honest, I'm a bit confused as to how this all fits together.  I'm assuming that when I run "Execute FlexUnit Tests" from the Navigator, that the Adobe plugin will interrogate the code and set up the main test application called FlexUnitApplication.mxml.  Then it just runs that.

                           

                          To normalize my results I did this.

                           

                          1.  Cleaned Unit Test project.

                          2.  Ran Execute Flex Unit Test from navigator.  This time it ran, but the Test method I had using a dataProvider, similar to the example on the website, gave the following error.

                               "Error: Method badFormTest should have no parameters.

                           

                          Here's a portion of the code.

                           

                          public static function badFormTests():Array {

                                      return [

                                          /* Testing comment 17110 */

                                          ["-9*r+27*s+63*t","-9*r--27*s--63*t"],

                                          ["-9*r+27*s+63*t","-9*r+--27*s+--63*t"],

                                          ["x+3","x--3"],

                                          ["x+3","x++3"],

                                          ["x+3","x+--3"] ,

                                          ["x+3","++3+x"],

                                          ["x-3","x---3"],

                                          ["5x-3","--5x+-3"],

                                          ["5x-3","-3--5x"],

                                          ["5x+3","5x--3"],

                                          ["5x+3","5x++3"],

                                          ["5x+3","5x+--3"],

                                          ["5x+3","++3+5x"],

                                          ["5x-3","5x---3"],

                                          ["5x-3","--5x+-3"],

                                          ["5x-3","-3--5x"],

                                          ["5x-3","--5x+-3"],

                                          ["5x-3","-3--x5"],

                                          ["5x+3","x5--3"],

                                          ["5x+3","x5++3"],

                                          ["5x+3","x5+--3"],

                                          ["5x+3","++3+x5"],

                                          ["5x-3","x5---3"],

                                          ["5x-3","--x5+-3"],

                                          ["5x-3","-3--x5"],

                                          ["x+3","x-(-3)"]

                                          /* End comment 17110 */

                                      ];

                                     

                                  }       

                                 

                                  [Test(dataProvider="badFormTests")]

                                  public function badFormTest(correctExpr:String, responseExpr:String ):void

                                  {

                                      Assert.assertEquals(

                                          TDXEvaluatorStatus.NAMES[TDXEvaluatorStatus.BADFORM],

                                          evaluate(TDXAnswerRules.ACCEPTSIMILARFORM,

                                              correctExpr,

                                              responseExpr

                                          )

                                      )

                                  }

                           

                          On top of this, if edit any one of my source files (i.e., add and remove a space and save it) and build the project again, I get many errors.  Here they are.

                           

                          DescriptionResourcePathLocationType
                          1046: Type was not found or was not a compile-time constant: [flash.events]::IEventDispatcher.UnitTestsUnknownFlex Problem
                          1046: Type was not found or was not a compile-time constant: [org.flexunit.async]::IAsyncTestResponder.UnitTestsUnknownFlex Problem
                          1046: Type was not found or was not a compile-time constant: [org.flexunit.internals.runners.statements]::IAsyncHandlingStatement.UnitTestsUnknownFlex Problem
                          1046: Type was not found or was not a compile-time constant: [org.flexunit.internals.runners.statements]::IAsyncStatement.UnitTestsUnknownFlex Problem
                          1046: Type was not found or was not a compile-time constant: AsyncResponseEvent.UnitTestsUnknownFlex Problem
                          1046: Type was not found or was not a compile-time constant: AsyncTestResponder.UnitTestsUnknownFlex Problem
                          1046: Type was not found or was not a compile-time constant: FlexEnvironmentBuilder.UnitTestsUnknownFlex Problem
                          1046: Type was not found or was not a compile-time constant: FlexMXVisualTestEnvironment.UnitTestsUnknownFlex Problem
                          1046: Type was not found or was not a compile-time constant: ISequenceAction.UnitTestsUnknownFlex Problem
                          1046: Type was not found or was not a compile-time constant: ISequencePend.UnitTestsUnknownFlex Problem
                          1046: Type was not found or was not a compile-time constant: ISequenceStep.UnitTestsUnknownFlex Problem
                          1046: Type was not found or was not a compile-time constant: SequenceBindingWaiter.UnitTestsUnknownFlex Problem
                          1046: Type was not found or was not a compile-time constant: SequenceCaller.UnitTestsUnknownFlex Problem
                          1046: Type was not found or was not a compile-time constant: SequenceDelay.UnitTestsUnknownFlex Problem
                          1046: Type was not found or was not a compile-time constant: SequenceEventDispatcher.UnitTestsUnknownFlex Problem
                          1046: Type was not found or was not a compile-time constant: SequenceRunner.UnitTestsUnknownFlex Problem
                          1046: Type was not found or was not a compile-time constant: SequenceSetter.UnitTestsUnknownFlex Problem
                          1046: Type was not found or was not a compile-time constant: SequenceWaiter.UnitTestsUnknownFlex Problem
                          1046: Type was not found or was not a compile-time constant: TextListener.UnitTestsUnknownFlex Problem
                          1046: Type was not found or was not a compile-time constant: VisualTestEnvironmentBuilder.UnitTestsUnknownFlex Problem

                           

                          I appologize if I'm doing something bad. I really appreciate your help.

                          • 10. Re: Eclipse update site for FlexUnit 4.1?
                            mlabriola Level 4

                            No problem, I am glad to help. It seems FlashBuilder is in a weird state, but lets try to work through it. There have been some other reports in the forums of issues like yours, however, I don't know if there were resolutions as of yet.

                             

                            I would like to try to start by simplifying things, so, first, lets make sure you have just that flexunit-4.1.0-8-flex_4.1.0.16076.swc in the library path.

                             

                            Here is an overview of the others:

                             

                            flexunit-cilistener-4.1.0-8-4.1.0.16076.swc

                            -for use with continuous integration servers... not needed now

                             

                            flexunit-flexcoverlistener-4.1.0-8-4.1.0.16076.swc

                            -for us with code coverage, not needed now

                             

                            flexunit-4.1.0-8-as3_4.1.0.16076.swc

                            -flexunit but specifically compiled without any flex extensions

                             

                            flexunit-4.1.0-8-flex_4.1.0.16076.swc

                            -flexunit but compiled with flex extensions

                             

                            flexunit-aircilistener-4.1.0-8-4.1.0.16076.swc

                            -for use with continuous integration servers when testing air apps

                             

                            fluint-extensions-4.1.0-8-4.1.0.16076.swc

                            -for use by people using sequences and other concepts originally from fluint. This may or may not be needed by you, can't tell yet but we will get there

                             

                            flexunit-uilistener-4.1.0-8-4.1.0.16076.swc

                            -for us when you need a UI to see test results. not needed with flash builder

                             

                            After that, I would delete the two files in the main package that Flash Builder creates. They get out of sync sometimes. Then just choose one test in your package explorer. Right click on it and choose Execute FlexUnit Test. Let's see the result from that and then we can debug more.

                             

                            Mike

                            • 11. Re: Eclipse update site for FlexUnit 4.1?
                              markdemi Level 1

                              Ok, as a first step in simplifying things, I created a new project with a  single test class with a single test and got it working with the built-in stuff.

                               

                              I then added flexunit-4.1.0-8-flex_4.1.0.16076.swc to the libs folder and right-clicked on the Test Class and selected Execute FlexUnit Test and it seemed to work.

                               

                              Now here's something odd, I went to the Project node in the Navigator and selected Execute FlexUnit Test and got all those errors from my previous post.  Then I noticed something very interesting.  If I modify any file (in this case my Test Class by adding a space, removing it and saving the file), then I select Project Builder (my automatic build is turned off), it will compile with errror every other time.  It's very repeatable.

                               

                              Then I noticed that my prject had an option checked to "Automatically determine library ordering based on dependencies".  For the heck of it I turned that off and tried again.  Same response.  Then I moved the libs folder reference to the end of the list (after the Flash Bulder 4 flex unit folders) and tried again and still the same response.

                               

                              Since my project is small, I could package it up in a zip if that helps?

                              • 12. Re: Eclipse update site for FlexUnit 4.1?
                                mlabriola Level 4

                                Sure. If you can post it somewhere and give me a link else, email it to me.

                                 

                                I will send you a private forum message with my email address.

                                 

                                Mike

                                • 13. Re: Eclipse update site for FlexUnit 4.1?
                                  markdemi Level 1

                                  Mike,

                                   

                                  I'm still unable to get the latest Flex Unit 4.1 working with Flash Builder 4.  Any chance on getting any info on this.  I searched around and couldn't find any new info.  I did find this explanation for Flashbuilder 4.5 (http://workflowflash.com/105879/flash-builder-4-5-tip-use-a-custom-flexunit-sdk.php), but i'm using Flash builder 4.0, with flex sdk 4.1.

                                   

                                  I've created a simple test project and can attempt to isolate the issue with a little guidance if you have time.

                                   

                                  Thanks,

                                  Mark