FEST-SwingSwing          @hakurai
Java, C, C++, Scala, GroovySwing
FEST-Swing• Swing• JUnit
Swing• Java GUI•       AWT SWT
FEST-Swing  1.robot  2.  3. 4.  5.assert
1.robotrobot = BasicRobot.robotWithNewAwtHierarchy();
2.//mainApplicationLauncher.application( SampleFrame.class ).start();//JFrame myJFrame = new MyJFrame();myJFrame.setVisibl...
3.//JFrameFrameFixture frame = WindowFinder.findFrame( MyJFrame.class ).using( robot );//FrameFixture frame = new FrameFixt...
4.//JTextComponentFixture accountField = frame.textBox( “accountField” );accountField.enterText( “root” );//OKJButtonFixtu...
Fixture• Swing• Fixture••
Fixture•                     Fixture• Finder         (              )• Fixture
Swing                            JFrame             JPanel                  JPanelJTextField        JButton            JBu...
Fixture•                name• GenericTypeMatcher
name//name   accountField textBoxframe.textBox( “accountField” ).                               “accountField”            ...
name• ComponentLookupException•          name••          GenericTypeMatcher•          Fixture
JFrame             JPanel                   JPanelJTextField        JButton             JButton                okButton   ...
• Fixture                    click()                doubleClick()            enterText( String text )                    d...
• Fixture• require• JUnit assert                 requireText( String text )                 requireEditable()             ...
• FEST-Swing EDT•
• Timeout• Pause        ConditionrequireEnabled(Timeout timeout)Pausepause( Condition condition, Timeout timeout)
Pause•      Condition• Timeout•                          WaitTimedOutError
Upcoming SlideShare
Loading in …5
×

Automate the Swing application testing

2,089 views
2,001 views

Published on

0 Comments
2 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
2,089
On SlideShare
0
From Embeds
0
Number of Embeds
26
Actions
Shares
0
Downloads
9
Comments
0
Likes
2
Embeds 0
No embeds

No notes for slide
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • Automate the Swing application testing

    1. 1. FEST-SwingSwing @hakurai
    2. 2. Java, C, C++, Scala, GroovySwing
    3. 3. FEST-Swing• Swing• JUnit
    4. 4. Swing• Java GUI• AWT SWT
    5. 5. FEST-Swing 1.robot 2. 3. 4. 5.assert
    6. 6. 1.robotrobot = BasicRobot.robotWithNewAwtHierarchy();
    7. 7. 2.//mainApplicationLauncher.application( SampleFrame.class ).start();//JFrame myJFrame = new MyJFrame();myJFrame.setVisible( true ); MyJFrame
    8. 8. 3.//JFrameFrameFixture frame = WindowFinder.findFrame( MyJFrame.class ).using( robot );//FrameFixture frame = new FrameFixture( robot, myJFrame ); JFrameFixture
    9. 9. 4.//JTextComponentFixture accountField = frame.textBox( “accountField” );accountField.enterText( “root” );//OKJButtonFixture okButton = frame.button( “okButton” );okButton.click(); “root” “accountField” “okButton” click JFrameFixture
    10. 10. Fixture• Swing• Fixture••
    11. 11. Fixture• Fixture• Finder ( )• Fixture
    12. 12. Swing JFrame JPanel JPanelJTextField JButton JButton
    13. 13. Fixture• name• GenericTypeMatcher
    14. 14. name//name accountField textBoxframe.textBox( “accountField” ). “accountField” JFrameFixture
    15. 15. name• ComponentLookupException• name•• GenericTypeMatcher• Fixture
    16. 16. JFrame JPanel JPanelJTextField JButton JButton okButton okButton
    17. 17. • Fixture click() doubleClick() enterText( String text ) drag() etc
    18. 18. • Fixture• require• JUnit assert requireText( String text ) requireEditable() requireEnabled() requireVisible() etc
    19. 19. • FEST-Swing EDT•
    20. 20. • Timeout• Pause ConditionrequireEnabled(Timeout timeout)Pausepause( Condition condition, Timeout timeout)
    21. 21. Pause• Condition• Timeout• WaitTimedOutError

    ×