automated integrated testing with mongodb

29
Automated integration testing with MongoDB

Upload: mongodb

Post on 15-Jan-2015

1.142 views

Category:

Technology


3 download

DESCRIPTION

 

TRANSCRIPT

Page 1: Automated Integrated Testing with MongoDB

Automated integration testing with MongoDB

Page 2: Automated Integrated Testing with MongoDB

@tommysdk [email protected]

Tommy Tynjä

Page 3: Automated Integrated Testing with MongoDB

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

Why integration test?

Page 5: Automated Integrated Testing with MongoDB

Development today

1. 2. ?

Page 6: Automated Integrated Testing with MongoDB

Consequences

Page 7: Automated Integrated Testing with MongoDB

Problem

Unit tests aren’t sufficient

Page 8: Automated Integrated Testing with MongoDB

Test in the right environment

Test components in their proper context

Page 9: Automated Integrated Testing with MongoDB

How to do it in Java EE?

Page 10: Automated Integrated Testing with MongoDB

ShrinkWrap, Arquillian and their logos are trademarks of Red Hat, Inc.

Page 11: Automated Integrated Testing with MongoDB

Example

Page 12: Automated Integrated Testing with MongoDB

Example

Page 13: Automated Integrated Testing with MongoDB

Example

Page 14: Automated Integrated Testing with MongoDB

Experiences with MongoDB

Page 15: Automated Integrated Testing with MongoDB

Environment

•  Java EE 6 •  JBoss Application Server 7 •  MongoDB 2.0.5 •  PostgreSQL •  Oracle

Page 16: Automated Integrated Testing with MongoDB

MongoDB use cases

•  PDF document storage •  Schema-less data structures

Page 17: Automated Integrated Testing with MongoDB

MongoDB setup

•  Replica set with ~ 1 TB / node •  Single node with ~ 100 GB

Page 18: Automated Integrated Testing with MongoDB

MongoDB experiences

+  Speed, ease of use −  Transactional support

Page 19: Automated Integrated Testing with MongoDB

Automated integration testing with MongoDB

Page 20: Automated Integrated Testing with MongoDB

Testing use cases

•  Queries •  Inserts •  Transactions •  Web services

Page 21: Automated Integrated Testing with MongoDB

Database testing

•  How to test against the database?

Page 22: Automated Integrated Testing with MongoDB

Database testing

•  How to test against the database? •  In-memory/embedded

Page 23: Automated Integrated Testing with MongoDB

Database testing

•  How to test against the database? •  In-memory/embedded •  In-memory/embedded, in-container

Page 24: Automated Integrated Testing with MongoDB

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

Example

Page 26: Automated Integrated Testing with MongoDB

Example

Page 27: Automated Integrated Testing with MongoDB

Example

Page 28: Automated Integrated Testing with MongoDB

Summary

•  Why integration test? •  How to do it in Java EE •  Automated integration testing with MongoDB

Page 29: Automated Integrated Testing with MongoDB

Automated integration testing with MongoDB blog.diabol.se arquillian.org @tommysdk [email protected] github.com/tommysdk/showcase/tree/master/mongo-in-mem