xUnit Test Patterns
                        Chapter 22
                Fixture Teardown Patterns
                          2010/7/24




2010   7   24
Garbage-Collected
                    Teardown


2010   7   24
Garbage-Collected
                         Teardown
                •                              fixture
                        tear down
                                             →Fresh Fixture

                •   Garbage Collection(GC)




2010   7   24
How it Works
                •
                                  transient


                    (         )

                • GC

2010   7   24
•

                •                                         global
                    (static)                       GC



                •                            Test Automation
                    Framework     Testcase Class        Test
                    Methods          Testcase Object

2010   7   24
                         Test suite Object
•
                            suite
                    suite




2010   7   24
When to Use it
                • Garbage-Collected Teardown

                • GC                           GC
                                       (
                           DB              )



2010   7   24
• Shared Fixture
                                       fixture
                                                fixture
                                           Garbage-
                  Collected Teardown




2010   7   24
•
                             In-line Teardown (page 509),
                    Implicit Teardown (page 516),
                    Automated Teardown (page 503) to




2010   7   24
Implementation Notes

                • xUnit family   IDE        test sutie




                •                      Reload
                    Classes


2010   7   24
• fixture
                  Garbage-Collected Teardown
                               IDE




2010   7   24
Motivating Example
                •                  fixture
                                            In-line
                    Teardown



                •
                               proposedFlight
                                     	


2010   7   24
• Garbage-Collected Teardown


                •


                      Shared Fixture    Fresh Fixture

2010   7   24

Garbage collected teardown

  • 1.
    xUnit Test Patterns Chapter 22 Fixture Teardown Patterns 2010/7/24 2010 7 24
  • 2.
    Garbage-Collected Teardown 2010 7 24
  • 3.
    Garbage-Collected Teardown • fixture tear down →Fresh Fixture • Garbage Collection(GC) 2010 7 24
  • 4.
    How it Works • transient ( ) • GC 2010 7 24
  • 5.
    • global (static) GC • Test Automation Framework Testcase Class Test Methods Testcase Object 2010 7 24 Test suite Object
  • 6.
    suite suite 2010 7 24
  • 7.
    When to Useit • Garbage-Collected Teardown • GC GC ( DB ) 2010 7 24
  • 8.
    • Shared Fixture fixture fixture Garbage- Collected Teardown 2010 7 24
  • 9.
    In-line Teardown (page 509), Implicit Teardown (page 516), Automated Teardown (page 503) to 2010 7 24
  • 10.
    Implementation Notes • xUnit family IDE test sutie • Reload Classes 2010 7 24
  • 11.
    • fixture Garbage-Collected Teardown IDE 2010 7 24
  • 12.
    Motivating Example • fixture In-line Teardown • proposedFlight 2010 7 24
  • 13.
    • Garbage-Collected Teardown • Shared Fixture Fresh Fixture 2010 7 24