SlideShare ist ein Scribd-Unternehmen logo
1 von 22
DAO testing with
                               Spring Test DBUnit


Lightning Talk @ JavaBin Sørlandet
June 8 2012
Spring Test DBUnit



●   Integration between Spring Test and DBUnit

●   http://github.com/springtestdbunit/
The point?

Makes DAO testing with actual data very easy!
Our current solution
Meet Mr. Bean and his DAO
Meet Mr. Bean and his DAO
Meet Mr. Bean and his DAO
Configuration
Configuration




                        B!
                      LD
                HSQ
… and the test case
… and the test case
The data set XML file!
@DatabaseSetup
Test case with @DatabaseSetup
Supports both class and
    method level
Can also be used with
  JUnit @Rules
@DatabaseTearDown
@ExpectedDatabase
Using @Transactional?
No worries – it's just a small modification to
@TestExectutionListener
●




vs
Code examples:
http://github.com/jarannilsen/springtestdbunit-demo
Thank you!

Weitere ähnliche Inhalte

Was ist angesagt?

Entity Framework: Code First and Magic Unicorns
Entity Framework: Code First and Magic UnicornsEntity Framework: Code First and Magic Unicorns
Entity Framework: Code First and Magic UnicornsRichie Rump
 
Document databases
Document databasesDocument databases
Document databasesQframe
 
Entity framework code first
Entity framework code firstEntity framework code first
Entity framework code firstConfiz
 
Dealing with SQL Security from ADO.NET
Dealing with SQL Security from ADO.NETDealing with SQL Security from ADO.NET
Dealing with SQL Security from ADO.NETFernando G. Guerrero
 
Using MongoDB with the .Net Framework
Using MongoDB with the .Net FrameworkUsing MongoDB with the .Net Framework
Using MongoDB with the .Net FrameworkStefano Paluello
 
Hibernate Basic Concepts - Presentation
Hibernate Basic Concepts - PresentationHibernate Basic Concepts - Presentation
Hibernate Basic Concepts - PresentationKhoa Nguyen
 
MongoDB - A next-generation database that lets you create applications never ...
MongoDB - A next-generation database that lets you create applications never ...MongoDB - A next-generation database that lets you create applications never ...
MongoDB - A next-generation database that lets you create applications never ...Ram Murat Sharma
 
SQLite Database Tutorial In Android
SQLite Database Tutorial In AndroidSQLite Database Tutorial In Android
SQLite Database Tutorial In AndroidAndroid 5
 
6.1\9 SSIS 2008R2_Training - DataFlow Transformations
6.1\9 SSIS 2008R2_Training - DataFlow Transformations6.1\9 SSIS 2008R2_Training - DataFlow Transformations
6.1\9 SSIS 2008R2_Training - DataFlow TransformationsPramod Singla
 
Entity Framework Database and Code First
Entity Framework Database and Code FirstEntity Framework Database and Code First
Entity Framework Database and Code FirstJames Johnson
 
SQL Server for Dynamics 365 Finance and Operations (LBD - On Premises)
SQL Server for Dynamics 365 Finance and Operations (LBD - On Premises)SQL Server for Dynamics 365 Finance and Operations (LBD - On Premises)
SQL Server for Dynamics 365 Finance and Operations (LBD - On Premises)Juan Fabian
 
Entity framework 6
Entity framework 6Entity framework 6
Entity framework 6Ken Tucker
 
Database Programming
Database ProgrammingDatabase Programming
Database ProgrammingHenry Osborne
 
Data Abstraction for Large Web Applications
Data Abstraction for Large Web ApplicationsData Abstraction for Large Web Applications
Data Abstraction for Large Web Applicationsbrandonsavage
 
Ember Data Introduction and Basic Concepts
Ember Data Introduction and Basic ConceptsEmber Data Introduction and Basic Concepts
Ember Data Introduction and Basic ConceptsAdam Kloboučník
 

Was ist angesagt? (20)

Entity Framework: Code First and Magic Unicorns
Entity Framework: Code First and Magic UnicornsEntity Framework: Code First and Magic Unicorns
Entity Framework: Code First and Magic Unicorns
 
Document databases
Document databasesDocument databases
Document databases
 
Entity framework code first
Entity framework code firstEntity framework code first
Entity framework code first
 
Dealing with SQL Security from ADO.NET
Dealing with SQL Security from ADO.NETDealing with SQL Security from ADO.NET
Dealing with SQL Security from ADO.NET
 
Introduction to Hibernate
Introduction to HibernateIntroduction to Hibernate
Introduction to Hibernate
 
Using MongoDB with the .Net Framework
Using MongoDB with the .Net FrameworkUsing MongoDB with the .Net Framework
Using MongoDB with the .Net Framework
 
Getting started with entity framework
Getting started with entity framework Getting started with entity framework
Getting started with entity framework
 
Hibernate Basic Concepts - Presentation
Hibernate Basic Concepts - PresentationHibernate Basic Concepts - Presentation
Hibernate Basic Concepts - Presentation
 
Jdbc
JdbcJdbc
Jdbc
 
MongoDB - A next-generation database that lets you create applications never ...
MongoDB - A next-generation database that lets you create applications never ...MongoDB - A next-generation database that lets you create applications never ...
MongoDB - A next-generation database that lets you create applications never ...
 
SQLite Database Tutorial In Android
SQLite Database Tutorial In AndroidSQLite Database Tutorial In Android
SQLite Database Tutorial In Android
 
6.1\9 SSIS 2008R2_Training - DataFlow Transformations
6.1\9 SSIS 2008R2_Training - DataFlow Transformations6.1\9 SSIS 2008R2_Training - DataFlow Transformations
6.1\9 SSIS 2008R2_Training - DataFlow Transformations
 
Entity Framework Database and Code First
Entity Framework Database and Code FirstEntity Framework Database and Code First
Entity Framework Database and Code First
 
Lecture13
Lecture13Lecture13
Lecture13
 
SQL Server for Dynamics 365 Finance and Operations (LBD - On Premises)
SQL Server for Dynamics 365 Finance and Operations (LBD - On Premises)SQL Server for Dynamics 365 Finance and Operations (LBD - On Premises)
SQL Server for Dynamics 365 Finance and Operations (LBD - On Premises)
 
Select query in JDBC
Select query in JDBCSelect query in JDBC
Select query in JDBC
 
Entity framework 6
Entity framework 6Entity framework 6
Entity framework 6
 
Database Programming
Database ProgrammingDatabase Programming
Database Programming
 
Data Abstraction for Large Web Applications
Data Abstraction for Large Web ApplicationsData Abstraction for Large Web Applications
Data Abstraction for Large Web Applications
 
Ember Data Introduction and Basic Concepts
Ember Data Introduction and Basic ConceptsEmber Data Introduction and Basic Concepts
Ember Data Introduction and Basic Concepts
 

Ähnlich wie Spring Test DBUnit

Ride the database in JUnit tests with Database Rider
Ride the database in JUnit tests with Database RiderRide the database in JUnit tests with Database Rider
Ride the database in JUnit tests with Database RiderMikalai Alimenkou
 
Managing Data in Jakarta EE Applications
Managing Data in Jakarta EE ApplicationsManaging Data in Jakarta EE Applications
Managing Data in Jakarta EE ApplicationsBuhake Sindi
 
Building a Testable Data Access Layer
Building a Testable Data Access LayerBuilding a Testable Data Access Layer
Building a Testable Data Access LayerTodd Anglin
 
In Memory Unit Testing with Apache DbUnit
In Memory Unit Testing with Apache DbUnitIn Memory Unit Testing with Apache DbUnit
In Memory Unit Testing with Apache DbUnitMohammad Sabir Khan
 
Do Your Homework! Writing tests for Data Science and Stochastic Code - David ...
Do Your Homework! Writing tests for Data Science and Stochastic Code - David ...Do Your Homework! Writing tests for Data Science and Stochastic Code - David ...
Do Your Homework! Writing tests for Data Science and Stochastic Code - David ...PyData
 
Exploring BigData with Google BigQuery
Exploring BigData with Google BigQueryExploring BigData with Google BigQuery
Exploring BigData with Google BigQueryDharmesh Vaya
 
226 team project-report-manjula kollipara
226 team project-report-manjula kollipara226 team project-report-manjula kollipara
226 team project-report-manjula kolliparaManjula Kollipara
 
Dr.Hadoop- an infinite scalable metadata management for Hadoop-How the baby e...
Dr.Hadoop- an infinite scalable metadata management for Hadoop-How the baby e...Dr.Hadoop- an infinite scalable metadata management for Hadoop-How the baby e...
Dr.Hadoop- an infinite scalable metadata management for Hadoop-How the baby e...Dipayan Dev
 
Java-8-Structured-MongoDB.pptx
Java-8-Structured-MongoDB.pptxJava-8-Structured-MongoDB.pptx
Java-8-Structured-MongoDB.pptxSuKimAnhCTU
 
Introduction to Big data tdd and pig unit
Introduction to Big data tdd and pig unitIntroduction to Big data tdd and pig unit
Introduction to Big data tdd and pig unitEdureka!
 
Unit Testing Back-end Framework and Process
Unit Testing Back-end Framework and ProcessUnit Testing Back-end Framework and Process
Unit Testing Back-end Framework and ProcessPoornima Vijayashanker
 
Automated Testing with Databases
Automated Testing with DatabasesAutomated Testing with Databases
Automated Testing with Databaseselliando dias
 
WEBINAR: Proven Patterns for Loading Test Data for Managed Package Testing
WEBINAR: Proven Patterns for Loading Test Data for Managed Package TestingWEBINAR: Proven Patterns for Loading Test Data for Managed Package Testing
WEBINAR: Proven Patterns for Loading Test Data for Managed Package TestingCodeScience
 

Ähnlich wie Spring Test DBUnit (20)

Ride the database in JUnit tests with Database Rider
Ride the database in JUnit tests with Database RiderRide the database in JUnit tests with Database Rider
Ride the database in JUnit tests with Database Rider
 
Managing Data in Jakarta EE Applications
Managing Data in Jakarta EE ApplicationsManaging Data in Jakarta EE Applications
Managing Data in Jakarta EE Applications
 
Building a Testable Data Access Layer
Building a Testable Data Access LayerBuilding a Testable Data Access Layer
Building a Testable Data Access Layer
 
In Memory Unit Testing with Apache DbUnit
In Memory Unit Testing with Apache DbUnitIn Memory Unit Testing with Apache DbUnit
In Memory Unit Testing with Apache DbUnit
 
Do Your Homework! Writing tests for Data Science and Stochastic Code - David ...
Do Your Homework! Writing tests for Data Science and Stochastic Code - David ...Do Your Homework! Writing tests for Data Science and Stochastic Code - David ...
Do Your Homework! Writing tests for Data Science and Stochastic Code - David ...
 
Exploring BigData with Google BigQuery
Exploring BigData with Google BigQueryExploring BigData with Google BigQuery
Exploring BigData with Google BigQuery
 
Dao example
Dao exampleDao example
Dao example
 
226 team project-report-manjula kollipara
226 team project-report-manjula kollipara226 team project-report-manjula kollipara
226 team project-report-manjula kollipara
 
Django Best Practices
Django Best PracticesDjango Best Practices
Django Best Practices
 
Midao JDBC presentation
Midao JDBC presentationMidao JDBC presentation
Midao JDBC presentation
 
Dr.Hadoop- an infinite scalable metadata management for Hadoop-How the baby e...
Dr.Hadoop- an infinite scalable metadata management for Hadoop-How the baby e...Dr.Hadoop- an infinite scalable metadata management for Hadoop-How the baby e...
Dr.Hadoop- an infinite scalable metadata management for Hadoop-How the baby e...
 
Java-8-Structured-MongoDB.pptx
Java-8-Structured-MongoDB.pptxJava-8-Structured-MongoDB.pptx
Java-8-Structured-MongoDB.pptx
 
Django
DjangoDjango
Django
 
Introduction to Big data tdd and pig unit
Introduction to Big data tdd and pig unitIntroduction to Big data tdd and pig unit
Introduction to Big data tdd and pig unit
 
Sigist Presentation 091208 V2.0
Sigist Presentation 091208 V2.0Sigist Presentation 091208 V2.0
Sigist Presentation 091208 V2.0
 
Unit Testing Back-end Framework and Process
Unit Testing Back-end Framework and ProcessUnit Testing Back-end Framework and Process
Unit Testing Back-end Framework and Process
 
Automated Testing with Databases
Automated Testing with DatabasesAutomated Testing with Databases
Automated Testing with Databases
 
Django
Django Django
Django
 
Impedance Mismatch 2.0
Impedance Mismatch 2.0Impedance Mismatch 2.0
Impedance Mismatch 2.0
 
WEBINAR: Proven Patterns for Loading Test Data for Managed Package Testing
WEBINAR: Proven Patterns for Loading Test Data for Managed Package TestingWEBINAR: Proven Patterns for Loading Test Data for Managed Package Testing
WEBINAR: Proven Patterns for Loading Test Data for Managed Package Testing
 

Mehr von Jaran Flaath

Mehr von Jaran Flaath (10)

Intro to docker
Intro to dockerIntro to docker
Intro to docker
 
SpringBoot
SpringBootSpringBoot
SpringBoot
 
Effective Testing
Effective TestingEffective Testing
Effective Testing
 
Spring Boot
Spring BootSpring Boot
Spring Boot
 
JUnit 5 Alpha
JUnit 5 AlphaJUnit 5 Alpha
JUnit 5 Alpha
 
MyGitBackup
MyGitBackupMyGitBackup
MyGitBackup
 
Delivering Great Software
Delivering Great SoftwareDelivering Great Software
Delivering Great Software
 
Trello
TrelloTrello
Trello
 
Bootstrap lightning talk
Bootstrap lightning talkBootstrap lightning talk
Bootstrap lightning talk
 
Apache Solr - search for everyone!
Apache Solr - search for everyone!Apache Solr - search for everyone!
Apache Solr - search for everyone!
 

Spring Test DBUnit