Skip to content

papirosko/otj-pg-embedded

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

OpenTable Embedded PostgreSQL Component

Allows embedding PostgreSQL into Java application code with no external dependencies. Excellent for allowing you to unit test with a "real" Postgres without requiring end users to install and set up a database cluster.

Build Status

Basic Usage

In your JUnit test just add:

@Rule
public EmbeddedPostgreSQLRule pg = new EmbeddedPostgreSQLRule();

This simply has JUnit manage an instance of EmbeddedPostgreSQLRule (start, stop). You can then use this to get a DataSource with: pg.getEmbeddedPostgreSQL().getPostgresDatabase();

Additionally you may use the EmbeddedPostgreSQL class directly by manually starting and stopping the instance; see EmbeddedPostgreSQLTest for an example.


Copyright (C) 2014 OpenTable, Inc

About

Java embedded PostgreSQL component for testing

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Java 57.5%
  • SQLPL 40.7%
  • Shell 1.8%