automated integrated testing with mongodb
DESCRIPTION
TRANSCRIPT
![Page 1: Automated Integrated Testing with MongoDB](https://reader033.vdocuments.site/reader033/viewer/2022052618/54b716774a7959d5738b45ce/html5/thumbnails/1.jpg)
Automated integration testing with MongoDB
![Page 3: Automated Integrated Testing with MongoDB](https://reader033.vdocuments.site/reader033/viewer/2022052618/54b716774a7959d5738b45ce/html5/thumbnails/3.jpg)
Agenda
• Why integration test? • How to do it in Java EE • Experiences with MongoDB • Automated integration testing with MongoDB
![Page 4: Automated Integrated Testing with MongoDB](https://reader033.vdocuments.site/reader033/viewer/2022052618/54b716774a7959d5738b45ce/html5/thumbnails/4.jpg)
Why integration test?
![Page 5: Automated Integrated Testing with MongoDB](https://reader033.vdocuments.site/reader033/viewer/2022052618/54b716774a7959d5738b45ce/html5/thumbnails/5.jpg)
Development today
1. 2. ?
![Page 6: Automated Integrated Testing with MongoDB](https://reader033.vdocuments.site/reader033/viewer/2022052618/54b716774a7959d5738b45ce/html5/thumbnails/6.jpg)
Consequences
![Page 7: Automated Integrated Testing with MongoDB](https://reader033.vdocuments.site/reader033/viewer/2022052618/54b716774a7959d5738b45ce/html5/thumbnails/7.jpg)
Problem
Unit tests aren’t sufficient
![Page 8: Automated Integrated Testing with MongoDB](https://reader033.vdocuments.site/reader033/viewer/2022052618/54b716774a7959d5738b45ce/html5/thumbnails/8.jpg)
Test in the right environment
Test components in their proper context
![Page 9: Automated Integrated Testing with MongoDB](https://reader033.vdocuments.site/reader033/viewer/2022052618/54b716774a7959d5738b45ce/html5/thumbnails/9.jpg)
How to do it in Java EE?
![Page 10: Automated Integrated Testing with MongoDB](https://reader033.vdocuments.site/reader033/viewer/2022052618/54b716774a7959d5738b45ce/html5/thumbnails/10.jpg)
ShrinkWrap, Arquillian and their logos are trademarks of Red Hat, Inc.
![Page 11: Automated Integrated Testing with MongoDB](https://reader033.vdocuments.site/reader033/viewer/2022052618/54b716774a7959d5738b45ce/html5/thumbnails/11.jpg)
Example
![Page 12: Automated Integrated Testing with MongoDB](https://reader033.vdocuments.site/reader033/viewer/2022052618/54b716774a7959d5738b45ce/html5/thumbnails/12.jpg)
Example
![Page 13: Automated Integrated Testing with MongoDB](https://reader033.vdocuments.site/reader033/viewer/2022052618/54b716774a7959d5738b45ce/html5/thumbnails/13.jpg)
Example
![Page 14: Automated Integrated Testing with MongoDB](https://reader033.vdocuments.site/reader033/viewer/2022052618/54b716774a7959d5738b45ce/html5/thumbnails/14.jpg)
Experiences with MongoDB
![Page 15: Automated Integrated Testing with MongoDB](https://reader033.vdocuments.site/reader033/viewer/2022052618/54b716774a7959d5738b45ce/html5/thumbnails/15.jpg)
Environment
• Java EE 6 • JBoss Application Server 7 • MongoDB 2.0.5 • PostgreSQL • Oracle
![Page 16: Automated Integrated Testing with MongoDB](https://reader033.vdocuments.site/reader033/viewer/2022052618/54b716774a7959d5738b45ce/html5/thumbnails/16.jpg)
MongoDB use cases
• PDF document storage • Schema-less data structures
![Page 17: Automated Integrated Testing with MongoDB](https://reader033.vdocuments.site/reader033/viewer/2022052618/54b716774a7959d5738b45ce/html5/thumbnails/17.jpg)
MongoDB setup
• Replica set with ~ 1 TB / node • Single node with ~ 100 GB
![Page 18: Automated Integrated Testing with MongoDB](https://reader033.vdocuments.site/reader033/viewer/2022052618/54b716774a7959d5738b45ce/html5/thumbnails/18.jpg)
MongoDB experiences
+ Speed, ease of use − Transactional support
![Page 19: Automated Integrated Testing with MongoDB](https://reader033.vdocuments.site/reader033/viewer/2022052618/54b716774a7959d5738b45ce/html5/thumbnails/19.jpg)
Automated integration testing with MongoDB
![Page 20: Automated Integrated Testing with MongoDB](https://reader033.vdocuments.site/reader033/viewer/2022052618/54b716774a7959d5738b45ce/html5/thumbnails/20.jpg)
Testing use cases
• Queries • Inserts • Transactions • Web services
![Page 21: Automated Integrated Testing with MongoDB](https://reader033.vdocuments.site/reader033/viewer/2022052618/54b716774a7959d5738b45ce/html5/thumbnails/21.jpg)
Database testing
• How to test against the database?
![Page 22: Automated Integrated Testing with MongoDB](https://reader033.vdocuments.site/reader033/viewer/2022052618/54b716774a7959d5738b45ce/html5/thumbnails/22.jpg)
Database testing
• How to test against the database? • In-memory/embedded
![Page 23: Automated Integrated Testing with MongoDB](https://reader033.vdocuments.site/reader033/viewer/2022052618/54b716774a7959d5738b45ce/html5/thumbnails/23.jpg)
Database testing
• How to test against the database? • In-memory/embedded • In-memory/embedded, in-container
![Page 24: Automated Integrated Testing with MongoDB](https://reader033.vdocuments.site/reader033/viewer/2022052618/54b716774a7959d5738b45ce/html5/thumbnails/24.jpg)
Embedded MongoDB
Flapdoodle Embedded MongoDB Source code: https://github.com/flapdoodle-oss/embedmongo.flapdoodle.de Authors: https://github.com/flapdoodle-oss?tab=members
![Page 25: Automated Integrated Testing with MongoDB](https://reader033.vdocuments.site/reader033/viewer/2022052618/54b716774a7959d5738b45ce/html5/thumbnails/25.jpg)
Example
![Page 26: Automated Integrated Testing with MongoDB](https://reader033.vdocuments.site/reader033/viewer/2022052618/54b716774a7959d5738b45ce/html5/thumbnails/26.jpg)
Example
![Page 27: Automated Integrated Testing with MongoDB](https://reader033.vdocuments.site/reader033/viewer/2022052618/54b716774a7959d5738b45ce/html5/thumbnails/27.jpg)
Example
![Page 28: Automated Integrated Testing with MongoDB](https://reader033.vdocuments.site/reader033/viewer/2022052618/54b716774a7959d5738b45ce/html5/thumbnails/28.jpg)
Summary
• Why integration test? • How to do it in Java EE • Automated integration testing with MongoDB
![Page 29: Automated Integrated Testing with MongoDB](https://reader033.vdocuments.site/reader033/viewer/2022052618/54b716774a7959d5738b45ce/html5/thumbnails/29.jpg)
Automated integration testing with MongoDB blog.diabol.se arquillian.org @tommysdk [email protected] github.com/tommysdk/showcase/tree/master/mongo-in-mem