BT

Facilitating the Spread of Knowledge and Innovation in Professional Software Development

Write for InfoQ

Topics

Choose your language

InfoQ Homepage News Presentation: System Integration Testing with Spring

Presentation: System Integration Testing with Spring

Not only does Spring provide you an application configuration framework, it provides a holistic solution that makes your application's use cases and subsystems easier to test.  The emphasis is on testing outside a JEE server or container, thus greatly improving productivity.   In this presentation, recorded at The Spring Experience, Spring Creator Rod Johnson discusses integration testing and the support that Spring provides for it, issues around testing the persistence layer, and how to test web apps.

Watch System Integration Testing with Spring (82 min)

The presentation will include a demo showing how an application can be tested as it is developed without developers needing to wait for JEE container startup and deployment.   In the presentation Rod presents some of the unique features Spring has to facilitate testing:
  • Dependency Injection
  • Data access and transaction management
    • Automatic transaction creation and rollback
  • No need for setup/teardown scripts
    • Automatic rollback after each test method
    • Can be run directly from IDE
  • Context Caching + Auto-rollback = Rapid performance for better productivity
    • 100s of tests per minute
  • Integrated with other data access code and testing Spring configuration and other Spring code
    • Enables validation of triggers, sequences, stored procedures and JDBC code
  • Context caching between many test cases
    • Particularly important with Hibernate due to the cost of SessionFactory creation
    • Uses static Map to prevent loss of built configuration when JUnit destroys and reinstantiates test classes
  • Dependency injection of test cases to avoid the need for any glue code in tests
    • Focus on testing your mappings and queries, with minimal distraction from test setup
  • Zero changes required in DAOs or other application Java code between test and deployment

Rate this Article

Adoption
Style

BT