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