testing-mysql-server-5

Embedded MySQL server for use in tests

Лицензия

Лицензия

Категории

Категории

MySQL Данные Базы данных
Группа

Группа

com.facebook.presto
Идентификатор

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

testing-mysql-server-5
Последняя версия

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

0.6
Дата

Дата

Тип

Тип

jar
Описание

Описание

testing-mysql-server-5
Embedded MySQL server for use in tests

Скачать testing-mysql-server-5

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

<!-- https://jarcasting.com/artifacts/com.facebook.presto/testing-mysql-server-5/ -->
<dependency>
    <groupId>com.facebook.presto</groupId>
    <artifactId>testing-mysql-server-5</artifactId>
    <version>0.6</version>
</dependency>
// https://jarcasting.com/artifacts/com.facebook.presto/testing-mysql-server-5/
implementation 'com.facebook.presto:testing-mysql-server-5:0.6'
// https://jarcasting.com/artifacts/com.facebook.presto/testing-mysql-server-5/
implementation ("com.facebook.presto:testing-mysql-server-5:0.6")
'com.facebook.presto:testing-mysql-server-5:jar:0.6'
<dependency org="com.facebook.presto" name="testing-mysql-server-5" rev="0.6">
  <artifact name="testing-mysql-server-5" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.facebook.presto', module='testing-mysql-server-5', version='0.6')
)
libraryDependencies += "com.facebook.presto" % "testing-mysql-server-5" % "0.6"
[com.facebook.presto/testing-mysql-server-5 "0.6"]

Зависимости

compile (2)

Идентификатор библиотеки Тип Версия
com.facebook.presto : testing-mysql-server-base jar 0.6
com.google.guava : guava jar 26.0-jre

runtime (1)

Идентификатор библиотеки Тип Версия
mysql : mysql-connector-java jar 5.1.48

test (2)

Идентификатор библиотеки Тип Версия
org.testng : testng jar 6.9.6
com.facebook.presto : testing-mysql-server-base test-jar 0.6

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

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

Testing MySQL Server

Maven Central Build Status

Embedded MySQL server for use in tests. It allows testing your Java or other JVM based application against a real MySQL server with no external dependencies to deploy or manage.

Usage

Add the library as a test dependency:

<dependency>
    <groupId>com.facebook.presto</groupId>
    <artifactId>testing-mysql-server</artifactId>
    <version>0.1</version>
    <scope>test</scope>
</dependency>

Use it in your tests:

@Test
public void testDatabase()
        throws Exception
{
    try (TestingMySqlServer server = new TestingMySqlServer("testuser", "testpass", "testdb");
            Connection connection = DriverManager.getConnection(server.getJdbcUrl("testdb"));
            Statement statement = connection.createStatement()) {
        statement.execute("CREATE TABLE test_table (id bigint PRIMARY KEY)");
        statement.execute("INSERT INTO test_table (id) VALUES (123)");
    }
}

The server takes a few seconds to startup, so you will likely want to leave it running between tests. Make sure the server is always shutdown (by calling the close() method or using try-with-resources), otherwise the mysqld process will stay running after the JVM exits.

License

The code in this project is licensed under the Apache License, Version 2.0. The bundled MySQL server is licensed under the GNU General Public License (GPL), Version 2.0.

com.facebook.presto

Presto

Distributed SQL query engine for big data

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

Версия
0.6
0.4
0.3
0.2
0.1