Easy-to-follow video tutorials help you learn software, creative, and business skills.Become a member

Using FlexUnit on WiFi

From: Flex 4.6 and AIR 3.0 New Features for Mobile Apps

Video: Using FlexUnit on WiFi

FlexUnit is a unit-testing framework for Flex and ActionScript 3 applications and libraries. It mimics the functionality of JUnit, which is a Java unit-testing framework, and it comes with a graphical test runner. Now Flash Builder 4.6 includes complete support for FlexUnit, so it's actually integrated directly into our development environment so we can run our tests directly from Flash Builder. If you browse out to flexunit.org, you can get more information on the framework. So for example, I can see all of the features, I can contribute if I like, I can access all of the docs, and you will see the docs are very neatly organized, and you could see everything that's going on.

Using FlexUnit on WiFi

FlexUnit is a unit-testing framework for Flex and ActionScript 3 applications and libraries. It mimics the functionality of JUnit, which is a Java unit-testing framework, and it comes with a graphical test runner. Now Flash Builder 4.6 includes complete support for FlexUnit, so it's actually integrated directly into our development environment so we can run our tests directly from Flash Builder. If you browse out to flexunit.org, you can get more information on the framework. So for example, I can see all of the features, I can contribute if I like, I can access all of the docs, and you will see the docs are very neatly organized, and you could see everything that's going on.

I can also access a wiki, and of course I can download everything as well. So I can download all of the different tests that I want to use and be able to access that all from flexunit.org. What I've done is I have actually created a project for you inside of Flash Builder that contains all of the FlexUnit tests, so we can actually see how it's integrated directly inside a Flash Builder. So open up Flash Builder, click File, choose Import Flash Builder Project, and go and import your FlexUnit tests right here. Go ahead and click Finish, and you'll see we have my FlexUnitTurnkey.sdk here. And here's my project and I can indicate the source and I can see all of my different FlexUnit, so here's my actual application.

You can see that I've included the unit tests here. So the FlexUnitTests, I have included a math package, a suite package, and that sort of thing. So, it'll run this utilizing the AIR Debug Launcher and I can set up of course different device configurations. Now FlexUnit does fully support mobile as well, and you can actually test it right on the device, which can be very useful for debugging, and all you have to do is connect it to your USB port, or you can connect it over the network via WiFi. And you can utilize a socket connection and the computer's IP address to communicate between Flash Builder and the FlexUnit application running on the device.

Now all of this setup is actually detailed in the original Flex course, but again, you can do this debugging over WiFi. Before we do any of the testing, we actually need to generate a SWF file that will be located in the bin-debug folder here. So what I am going to do is I'm just going to run the tests and you are going to see the first time you do it, it's not going to run. So if I click on Run and I choose Run As, and then I choose FlexUnit Tests--it might take just a second here-- you're going to see the first time since we've imported this it's not going to run.

Okay, it's going to update the build path. Let's just choose a couple of tests here. You also see there are some errors, but that's okay. We are testing our project here. Probably expect some errors. So again, we are going to get an error because that SWF file is not actually located in the bin-debug. So I am going to go ahead and proceed, and you'll see it says file not found, right. It can't actually find the SWF file. So I am going to need to run it one more time to actually get these results. So here I'll just again run the tests again, so I will say Run As > FlexUnitTests, go ahead and choose some of the tests here, don't need to choose them all, and you should see this time it will run, and we should see that our Flash Builder tests are being run.

So you can see the execution is in process, and we can get some basic information directly from this file. So again, I can rerun tests, I can cancel running tests, and I can see all of that. You will see that in this case, if I look at the different tests, I could see 72 different tests have been run. It passed 62, it failed 1, and there's been 9 errors, and nothing has been ignored. Okay great! So now I can close this window once all those tests have actually run, and you'll see I can see the results of the tests directly inside of Flash Builder under the FlexUunit Results.

So this panel lists all the tests within the test run, indicating whether the test has passed or failed. So I can actually double-click right on the test and it will jump me to that ActionScript, so I can see what's going on. And again, if there was a failure, it would jump me right there and I can also filter the results. I can see all of that directly from my panel here in terms of a FlexUnit result testing. So now this is integrated directly into Flash Builder 4.6 and makes testing our applications much, much easier.

Show transcript

This video is part of

Image for Flex 4.6 and AIR 3.0 New Features for Mobile Apps
Flex 4.6 and AIR 3.0 New Features for Mobile Apps

21 video lessons · 4229 viewers

James Talbot
Author

 

Start learning today

Get unlimited access to all courses for just $25/month.

Become a member
Sometimes @lynda teaches me how to use a program and sometimes Lynda.com changes my life forever. @JosefShutter
@lynda lynda.com is an absolute life saver when it comes to learning todays software. Definitely recommend it! #higherlearning @Michael_Caraway
@lynda The best thing online! Your database of courses is great! To the mark and very helpful. Thanks! @ru22more
Got to create something yesterday I never thought I could do. #thanks @lynda @Ngventurella
I really do love @lynda as a learning platform. Never stop learning and developing, it’s probably our greatest gift as a species! @soundslikedavid
@lynda just subscribed to lynda.com all I can say its brilliant join now trust me @ButchSamurai
@lynda is an awesome resource. The membership is priceless if you take advantage of it. @diabetic_techie
One of the best decision I made this year. Buy a 1yr subscription to @lynda @cybercaptive
guys lynda.com (@lynda) is the best. So far I’ve learned Java, principles of OO programming, and now learning about MS project @lucasmitchell
Signed back up to @lynda dot com. I’ve missed it!! Proper geeking out right now! #timetolearn #geek @JayGodbold
Share a link to this course

What are exercise files?

Exercise files are the same files the author uses in the course. Save time by downloading the author's files instead of setting up your own files, and learn by following along with the instructor.

Can I take this course without the exercise files?

Yes! If you decide you would like the exercise files later, you can upgrade to a premium account any time.

Become a member Download sample files See plans and pricing

Please wait... please wait ...
Upgrade to get access to exercise files.

Exercise files video

How to use exercise files.

Learn by watching, listening, and doing, Exercise files are the same files the author uses in the course, so you can download them and follow along Premium memberships include access to all exercise files in the library.


Exercise files

Exercise files video

How to use exercise files.

For additional information on downloading and using exercise files, watch our instructional video or read the instructions in the FAQ.

This course includes free exercise files, so you can practice while you watch the course. To access all the exercise files in our library, become a Premium Member.

Join now "Already a member? Log in

Are you sure you want to mark all the videos in this course as unwatched?

This will not affect your course history, your reports, or your certificates of completion for this course.


Mark all as unwatched Cancel

Congratulations

You have completed Flex 4.6 and AIR 3.0 New Features for Mobile Apps.

Return to your organization's learning portal to continue training, or close this page.


OK
Become a member to add this course to a playlist

Join today and get unlimited access to the entire library of video courses—and create as many playlists as you like.

Get started

Already a member?

Become a member to like this course.

Join today and get unlimited access to the entire library of video courses.

Get started

Already a member?

Exercise files

Learn by watching, listening, and doing! Exercise files are the same files the author uses in the course, so you can download them and follow along. Exercise files are available with all Premium memberships. Learn more

Get started

Already a Premium member?

Exercise files video

How to use exercise files.

Ask a question

Thanks for contacting us.
You’ll hear from our Customer Service team within 24 hours.

Please enter the text shown below:

The classic layout automatically defaults to the latest Flash Player.

To choose a different player, hold the cursor over your name at the top right of any lynda.com page and choose Site preferencesfrom the dropdown menu.

Continue to classic layout Stay on new layout
Exercise files

Access exercise files from a button right under the course name.

Mark videos as unwatched

Remove icons showing you already watched videos if you want to start over.

Control your viewing experience

Make the video wide, narrow, full-screen, or pop the player out of the page into its own window.

Interactive transcripts

Click on text in the transcript to jump to that spot in the video. As the video plays, the relevant spot in the transcript will be highlighted.

Are you sure you want to delete this note?

No

Your file was successfully uploaded.

Thanks for signing up.

We’ll send you a confirmation email shortly.


Sign up and receive emails about lynda.com and our online training library:

Here’s our privacy policy with more details about how we handle your information.

Keep up with news, tips, and latest courses with emails from lynda.com.

Sign up and receive emails about lynda.com and our online training library:

Here’s our privacy policy with more details about how we handle your information.

   
submit Lightbox submit clicked
Terms and conditions of use

We've updated our terms and conditions (now called terms of service).Go
Review and accept our updated terms of service.