ru.i-novus.components:otj-pg-embedded-rus

Embedded PostgreSQL driver

Лицензия

Лицензия

Группа

Группа

ru.i-novus.components
Идентификатор

Идентификатор

otj-pg-embedded-rus
Последняя версия

Последняя версия

0.13.2-alpha.1
Дата

Дата

Тип

Тип

jar
Описание

Описание

Embedded PostgreSQL driver
Система контроля версий

Система контроля версий

http://github.com/i-novus-llc/otj-pg-embedded

Скачать otj-pg-embedded-rus

Как подключить последнюю версию

<!-- https://jarcasting.com/artifacts/ru.i-novus.components/otj-pg-embedded-rus/ -->
<dependency>
    <groupId>ru.i-novus.components</groupId>
    <artifactId>otj-pg-embedded-rus</artifactId>
    <version>0.13.2-alpha.1</version>
</dependency>
// https://jarcasting.com/artifacts/ru.i-novus.components/otj-pg-embedded-rus/
implementation 'ru.i-novus.components:otj-pg-embedded-rus:0.13.2-alpha.1'
// https://jarcasting.com/artifacts/ru.i-novus.components/otj-pg-embedded-rus/
implementation ("ru.i-novus.components:otj-pg-embedded-rus:0.13.2-alpha.1")
'ru.i-novus.components:otj-pg-embedded-rus:jar:0.13.2-alpha.1'
<dependency org="ru.i-novus.components" name="otj-pg-embedded-rus" rev="0.13.2-alpha.1">
  <artifact name="otj-pg-embedded-rus" type="jar" />
</dependency>
@Grapes(
@Grab(group='ru.i-novus.components', module='otj-pg-embedded-rus', version='0.13.2-alpha.1')
)
libraryDependencies += "ru.i-novus.components" % "otj-pg-embedded-rus" % "0.13.2-alpha.1"
[ru.i-novus.components/otj-pg-embedded-rus "0.13.2-alpha.1"]

Зависимости

compile (10)

Идентификатор библиотеки Тип Версия
org.slf4j : slf4j-api jar 1.7.25
org.apache.commons : commons-lang3 jar 3.7
org.apache.commons : commons-compress jar 1.18
org.tukaani : xz jar 1.5
commons-io : commons-io jar 2.6
commons-codec : commons-codec jar 1.11
org.flywaydb : flyway-core Необязательный jar 5.0.7
org.liquibase : liquibase-core Необязательный jar
org.postgresql : postgresql jar 42.2.4
com.github.spotbugs : spotbugs-annotations jar 3.1.7

provided (2)

Идентификатор библиотеки Тип Версия
junit : junit Необязательный jar 4.12
org.junit.jupiter : junit-jupiter-api Необязательный jar

runtime (1)

Идентификатор библиотеки Тип Версия
org.slf4j : jcl-over-slf4j jar 1.7.25

test (3)

Идентификатор библиотеки Тип Версия
org.slf4j : slf4j-simple jar 1.7.25
org.objenesis : objenesis jar 2.6
org.mockito : mockito-core jar 2.19.0

Модули Проекта

Данный проект не имеет модулей.

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" PostgreSQL without requiring end users to install and set up a database cluster.

Build Status

Basic Usage

In your JUnit test just add:

@Rule
public SingleInstancePostgresRule pg = EmbeddedPostgresRules.singleInstance();

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

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

Default username/password is: postgres/postgres and the default database is 'postgres'

Migrators (Flyway or Liquibase)

You can easily integrate Flyway or Liquibase database schema migration:

Flyway
@Rule 
public PreparedDbRule db =
    EmbeddedPostgresRules.preparedDatabase(
        FlywayPreparer.forClasspathLocation("db/my-db-schema"));
Liquibase
@Rule
public PreparedDbRule db = 
    EmbeddedPostgresRules.preparedDatabase(
            LiquibasePreparer.forClasspathLocation("liqui/master.xml"));

This will create an independent database for every test with the given schema loaded from the classpath. Database templates are used so the time cost is relatively small, given the superior isolation truly independent databases gives you.

PostgreSQL version

The JAR file contains bundled version of PostgreSQL. You can pass different PostgreSQL version by implementing PgBinaryResolver.

Example:

class ClasspathBinaryResolver implements PgBinaryResolver {
    public InputStream getPgBinary(String system, String machineHardware) throws IOException {
        ClassPathResource resource = new ClassPathResource(format("postgresql-%s-%s.txz", system, machineHardware));
        return resource.getInputStream();
    }
}

EmbeddedPostgreSQL
            .builder()
            .setPgBinaryResolver(new ClasspathBinaryResolver())
            .start();

Windows

If you experience difficulty running otj-pg-embedded tests on Windows, make sure you've installed the appropriate MFC redistributables.


Copyright (C) 2017 OpenTable, Inc

ru.i-novus.components

I-Novus (Ай-Новус)

We design complex and huge software solutions

Версии библиотеки

Версия
0.13.2-alpha.1