Your SlideShare is downloading. ×
Flex Unit 4 Feature Overview
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×

Saving this for later?

Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime - even offline.

Text the download link to your phone

Standard text messaging rates apply

Flex Unit 4 Feature Overview

3,794
views

Published on

A quick feature overview on FlexUnit 4

A quick feature overview on FlexUnit 4

Published in: Technology, Business

0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
3,794
On Slideshare
0
From Embeds
0
Number of Embeds
3
Actions
Shares
0
Downloads
46
Comments
0
Likes
1
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. FlexUnit 4 Feature Overview Jeff Tapper Digital Primates [email_address] Twitter: jefftapper
  • 2. Features
    • Support for all JUnit 4 features
    • Metadata driven
    • Exception Handling
    • Async Support
    • Hamcrest Support
    • Runners
    • Theories and Assumptions
    • Now Available
  • 3. Metadata tags
    • [Test]
    • [Suite]
    • [Before]
    • [After]
    • [BeforeClass]
    • [AfterClass]
    • [Ignore]
  • 4. Exception handling
    • When a test expects to throw an error, test code traditionally requires more work (try/catch/assert)
    • New expects attribute of Test metadata allows us to define an expected exception
    • [Test(expects="TypeError")] public function divisionWithException():void {    simpleMath.divide( 11, 0 ); }
  • 5. Async Support
    • [Test(async,timeout="500")]
    • public function doSomethingAsynchronous():void {}
    • Async.proceedOnEvent( testCase, target, eventName );
    • Async.failOnEvent( testCase, target, eventName );
    • Async.handleEvent( testCase, target, eventName, eventHandler );
    • Async.asyncHandler( testCase, eventHandler );
    • Async.asyncResponder( testCase, responder );
  • 6. Hamcrest Support
    • Making use of the HamcrestAS3 project, a new, rich set of asserts are now available
    • [Test]
    • public function isItInHere():void {
    • var someArray:Array = [ 'a', 'b', 'c', 'd', 'e'];
    •    assertThat( someArray, hasItems("b", "c") );
    • }
    • [Test]
    • public function isItClose( num1:Number, num2:Number):void{
    • assertThat ( num1, closeTo(num2,.01));
    • }
  • 7. Runners
    • Suites can be decorated with [RunWith] metadata to define the test runner
    • [RunWith("org.flexunit.runners.Suite")]
    • Allows for running tests written in other testing frameworks to run in FU4
    • Runners currently exist for FlexUnit1,FlexUnit4,Fluint,SLT, and more on the way
  • 8. Theories Datapoints and Assumptions
    • Allows for a single test to be run with several different pieces of data
    • [DataPoints] [ArrayElementType("String")] public static var stringValues:Array = ["one","two","three","four","five"];
    • [DataPoints] [ArrayElementType("int")] public static function provideData():Array {    return [-10, 0, 2, 4, 8, 16 ]; }
    • [Theory] public function testStringIntCombo( value:int, stringValue:String ):void {             //call some method and do something }
  • 9. Now Available
    • Beta 1 went public on opensource.adobe.com on Monday.
    • Feature requests and bugs can be files in Adobe’s JIRA system
    • More Info at:
    • http://opensourece.adobe.com
    • http://blogs.digitalprimates.net