automated integrated testing with mongodb

Post on 15-Jan-2015

1.142 Views

Category:

Technology

3 Downloads

Preview:

Click to see full reader

DESCRIPTION

 

TRANSCRIPT

Automated integration testing with MongoDB

@tommysdk tommy.tynja@diabol.se

Tommy Tynjä

Agenda

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

Why integration test?

Development today

1. 2. ?

Consequences

Problem

Unit tests aren’t sufficient

Test in the right environment

Test components in their proper context

How to do it in Java EE?

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

Example

Example

Example

Experiences with MongoDB

Environment

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

MongoDB use cases

•  PDF document storage •  Schema-less data structures

MongoDB setup

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

MongoDB experiences

+  Speed, ease of use −  Transactional support

Automated integration testing with MongoDB

Testing use cases

•  Queries •  Inserts •  Transactions •  Web services

Database testing

•  How to test against the database?

Database testing

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

Database testing

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

Embedded MongoDB

Flapdoodle Embedded MongoDB Source code: https://github.com/flapdoodle-oss/embedmongo.flapdoodle.de Authors: https://github.com/flapdoodle-oss?tab=members

Example

Example

Example

Summary

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

Automated integration testing with MongoDB blog.diabol.se arquillian.org @tommysdk tommy.tynja@diabol.se github.com/tommysdk/showcase/tree/master/mongo-in-mem

top related