testing-mysql-server

Embedded MySQL server for use in tests

Лицензия

Лицензия

Категории

Категории

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

Группа

io.airlift
Идентификатор

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

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

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

8.0.12-5
Дата

Дата

Тип

Тип

jar
Описание

Описание

testing-mysql-server
Embedded MySQL server for use in tests
Ссылка на сайт

Ссылка на сайт

https://github.com/airlift/testing-mysql-server
Система контроля версий

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

https://github.com/airlift/testing-mysql-server

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

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

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

Зависимости

compile (5)

Идентификатор библиотеки Тип Версия
io.airlift : concurrent jar 0.149
io.airlift : log jar 0.149
io.airlift : units jar 1.0
io.airlift : command jar 0.3
com.google.guava : guava jar 21.0

runtime (1)

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

test (1)

Идентификатор библиотеки Тип Версия
org.testng : testng jar 6.9.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>io.airlift</groupId>
    <artifactId>testing-mysql-server</artifactId>
    <version>8.0.12-2</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.

io.airlift

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

Версия
8.0.12-5
8.0.12-4
8.0.12-3
8.0.12-2
8.0.12-1
5.7.22-1
5.7.19-3
5.7.19-2
5.7.19-1
5.5.9-1
0.1