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?
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:
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?
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
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?
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
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.
| Description | Resource | Path | Location | Type |
| 1046: Type was not found or was not a compile-time constant: [flash.events]::IEventDispatcher. | UnitTests | Unknown | Flex Problem | |
| 1046: Type was not found or was not a compile-time constant: [org.flexunit.internals.runners.statements]::IAsyncHandlingStatement. | UnitTests | Unknown | Flex Problem | |
| 1046: Type was not found or was not a compile-time constant: [org.flexunit.internals.runners.statements]::IAsyncStatement. | UnitTests | Unknown | 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.
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
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.
| Description | Resource | Path | Location | Type |
| 1046: Type was not found or was not a compile-time constant: [flash.events]::IEventDispatcher. | UnitTests | Unknown | Flex Problem | |
| 1046: Type was not found or was not a compile-time constant: [org.flexunit.async]::IAsyncTestResponder. | UnitTests | Unknown | Flex Problem | |
| 1046: Type was not found or was not a compile-time constant: [org.flexunit.internals.runners.statements]::IAsyncHandlingStatement. | UnitTests | Unknown | Flex Problem | |
| 1046: Type was not found or was not a compile-time constant: [org.flexunit.internals.runners.statements]::IAsyncStatement. | UnitTests | Unknown | Flex Problem | |
| 1046: Type was not found or was not a compile-time constant: AsyncResponseEvent. | UnitTests | Unknown | Flex Problem | |
| 1046: Type was not found or was not a compile-time constant: AsyncTestResponder. | UnitTests | Unknown | Flex Problem | |
| 1046: Type was not found or was not a compile-time constant: FlexEnvironmentBuilder. | UnitTests | Unknown | Flex Problem | |
| 1046: Type was not found or was not a compile-time constant: FlexMXVisualTestEnvironment. | UnitTests | Unknown | Flex Problem | |
| 1046: Type was not found or was not a compile-time constant: ISequenceAction. | UnitTests | Unknown | Flex Problem | |
| 1046: Type was not found or was not a compile-time constant: ISequencePend. | UnitTests | Unknown | Flex Problem | |
| 1046: Type was not found or was not a compile-time constant: ISequenceStep. | UnitTests | Unknown | Flex Problem | |
| 1046: Type was not found or was not a compile-time constant: SequenceBindingWaiter. | UnitTests | Unknown | Flex Problem | |
| 1046: Type was not found or was not a compile-time constant: SequenceCaller. | UnitTests | Unknown | Flex Problem | |
| 1046: Type was not found or was not a compile-time constant: SequenceDelay. | UnitTests | Unknown | Flex Problem | |
| 1046: Type was not found or was not a compile-time constant: SequenceEventDispatcher. | UnitTests | Unknown | Flex Problem | |
| 1046: Type was not found or was not a compile-time constant: SequenceRunner. | UnitTests | Unknown | Flex Problem | |
| 1046: Type was not found or was not a compile-time constant: SequenceSetter. | UnitTests | Unknown | Flex Problem | |
| 1046: Type was not found or was not a compile-time constant: SequenceWaiter. | UnitTests | Unknown | Flex Problem | |
| 1046: Type was not found or was not a compile-time constant: TextListener. | UnitTests | Unknown | Flex Problem | |
| 1046: Type was not found or was not a compile-time constant: VisualTestEnvironmentBuilder. | UnitTests | Unknown | Flex Problem |
I appologize if I'm doing something bad. I really appreciate your help.
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
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?
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-fle xunit-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
North America
Europe, Middle East and Africa
Asia Pacific