Skip to content

Commit

Permalink
MariaDB test
Browse files Browse the repository at this point in the history
  • Loading branch information
lukas-krecan committed Nov 18, 2022
1 parent f1f0fde commit 808468c
Show file tree
Hide file tree
Showing 4 changed files with 51 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
*/
package net.javacrumbs.shedlock.provider.jooq;

import net.javacrumbs.shedlock.test.support.jdbc.DbConfig;
import net.javacrumbs.shedlock.test.support.jdbc.HsqlConfig;
import org.jooq.SQLDialect;
import org.jooq.conf.RenderNameCase;
Expand All @@ -24,7 +25,7 @@
import org.junit.jupiter.api.BeforeAll;

public class HsqlJooqLockProviderIntegrationTest extends AbstractJooqLockProviderIntegrationTest {
private static final HsqlConfig dbConfig = new HsqlConfig();
private static final DbConfig dbConfig = new HsqlConfig();

public HsqlJooqLockProviderIntegrationTest() {
super(dbConfig, DSL.using(dbConfig.getDataSource(), SQLDialect.HSQLDB, new Settings().withRenderNameCase(RenderNameCase.UPPER)));
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
/**
* Copyright 2009 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package net.javacrumbs.shedlock.provider.jooq;

import net.javacrumbs.shedlock.test.support.jdbc.DbConfig;
import net.javacrumbs.shedlock.test.support.jdbc.MariaDbConfig;
import org.jooq.SQLDialect;
import org.jooq.impl.DSL;
import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.BeforeAll;

public class MariaDbJooqLockProviderIntegrationTest extends AbstractJooqLockProviderIntegrationTest {
private static final DbConfig dbConfig = new MariaDbConfig() {
@Override
public String nowExpression() {
return "current_timestamp(6)";
}
};

protected MariaDbJooqLockProviderIntegrationTest() {
super(dbConfig, DSL.using(dbConfig.getDataSource(), SQLDialect.MYSQL));
}

@BeforeAll
public static void startDb() {
dbConfig.startDb();
}

@AfterAll
public static void shutdownDb() {
dbConfig.shutdownDb();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,15 @@
*/
package net.javacrumbs.shedlock.provider.jooq;

import net.javacrumbs.shedlock.test.support.jdbc.DbConfig;
import net.javacrumbs.shedlock.test.support.jdbc.MySqlConfig;
import org.jooq.SQLDialect;
import org.jooq.impl.DSL;
import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.BeforeAll;

public class MySqlJooqLockProviderIntegrationTest extends AbstractJooqLockProviderIntegrationTest {
private static final MySqlConfig dbConfig = new MySqlConfig() {
private static final DbConfig dbConfig = new MySqlConfig() {
@Override
public String nowExpression() {
return "current_timestamp(6)";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

import org.testcontainers.containers.MariaDBContainer;

public final class MariaDbConfig extends AbstractContainerBasedDbConfig<MariaDbConfig.MyMariaDbContainer> {
public class MariaDbConfig extends AbstractContainerBasedDbConfig<MariaDbConfig.MyMariaDbContainer> {
public MariaDbConfig() {
super(new MyMariaDbContainer()
.withDatabaseName(TEST_SCHEMA_NAME)
Expand Down

0 comments on commit 808468c

Please sign in to comment.