Your SlideShare is downloading. ×
0
Flex Unit 4 Feature Overview
Flex Unit 4 Feature Overview
Flex Unit 4 Feature Overview
Flex Unit 4 Feature Overview
Flex Unit 4 Feature Overview
Flex Unit 4 Feature Overview
Flex Unit 4 Feature Overview
Flex Unit 4 Feature Overview
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,838

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

×