mirror of
https://github.com/Kingsrook/qqq.git
synced 2025-07-18 13:10:44 +00:00
Update tests to run w/ h2 instead of mysql
This commit is contained in:
@ -45,11 +45,11 @@ import com.kingsrook.qqq.backend.module.rdbms.jdbc.ConnectionManager;
|
|||||||
import com.kingsrook.qqq.backend.module.rdbms.jdbc.QueryManager;
|
import com.kingsrook.qqq.backend.module.rdbms.jdbc.QueryManager;
|
||||||
import org.apache.commons.io.FileUtils;
|
import org.apache.commons.io.FileUtils;
|
||||||
import org.apache.commons.io.IOUtils;
|
import org.apache.commons.io.IOUtils;
|
||||||
|
import org.junit.jupiter.api.AfterAll;
|
||||||
import org.junit.jupiter.api.Assertions;
|
import org.junit.jupiter.api.Assertions;
|
||||||
|
import org.junit.jupiter.api.BeforeAll;
|
||||||
import org.junit.jupiter.api.BeforeEach;
|
import org.junit.jupiter.api.BeforeEach;
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
import org.junit.jupiter.api.condition.DisabledOnOs;
|
|
||||||
import org.junit.jupiter.api.condition.OS;
|
|
||||||
import static org.junit.jupiter.api.Assertions.assertNotNull;
|
import static org.junit.jupiter.api.Assertions.assertNotNull;
|
||||||
import static org.junit.jupiter.api.Assertions.assertThrows;
|
import static org.junit.jupiter.api.Assertions.assertThrows;
|
||||||
import static org.junit.jupiter.api.Assertions.assertTrue;
|
import static org.junit.jupiter.api.Assertions.assertTrue;
|
||||||
@ -58,9 +58,11 @@ import static org.junit.jupiter.api.Assertions.assertTrue;
|
|||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
**
|
**
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
@DisabledOnOs(OS.LINUX) // uses database; not available in CI at this time...
|
public class SampleMetaDataProviderTest
|
||||||
class SampleMetaDataProviderTest
|
|
||||||
{
|
{
|
||||||
|
private static boolean originalUseMysqlValue = false;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
**
|
**
|
||||||
@ -73,11 +75,35 @@ class SampleMetaDataProviderTest
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/*******************************************************************************
|
||||||
|
**
|
||||||
|
*******************************************************************************/
|
||||||
|
@BeforeAll
|
||||||
|
static void beforeAll() throws Exception
|
||||||
|
{
|
||||||
|
originalUseMysqlValue = SampleMetaDataProvider.USE_MYSQL;
|
||||||
|
SampleMetaDataProvider.USE_MYSQL = false;
|
||||||
|
SampleMetaDataProviderTest.primeTestDatabase("prime-test-database.sql");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/*******************************************************************************
|
||||||
|
**
|
||||||
|
*******************************************************************************/
|
||||||
|
@AfterAll
|
||||||
|
static void afterAll()
|
||||||
|
{
|
||||||
|
SampleMetaDataProvider.USE_MYSQL = originalUseMysqlValue;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
**
|
**
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
private void primeTestDatabase(String sqlFileName) throws Exception
|
public static void primeTestDatabase(String sqlFileName) throws Exception
|
||||||
{
|
{
|
||||||
ConnectionManager connectionManager = new ConnectionManager();
|
ConnectionManager connectionManager = new ConnectionManager();
|
||||||
try(Connection connection = connectionManager.getConnection(SampleMetaDataProvider.defineRdbmsBackend()))
|
try(Connection connection = connectionManager.getConnection(SampleMetaDataProvider.defineRdbmsBackend()))
|
||||||
|
@ -13,6 +13,9 @@ import com.kingsrook.qqq.backend.core.model.actions.tables.query.QueryOutput;
|
|||||||
import com.kingsrook.qqq.backend.core.model.metadata.QInstance;
|
import com.kingsrook.qqq.backend.core.model.metadata.QInstance;
|
||||||
import com.kingsrook.qqq.backend.core.model.session.QSession;
|
import com.kingsrook.qqq.backend.core.model.session.QSession;
|
||||||
import com.kingsrook.sampleapp.SampleMetaDataProvider;
|
import com.kingsrook.sampleapp.SampleMetaDataProvider;
|
||||||
|
import com.kingsrook.sampleapp.SampleMetaDataProviderTest;
|
||||||
|
import org.junit.jupiter.api.AfterAll;
|
||||||
|
import org.junit.jupiter.api.BeforeAll;
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
import static org.assertj.core.api.Assertions.assertThat;
|
import static org.assertj.core.api.Assertions.assertThat;
|
||||||
|
|
||||||
@ -22,6 +25,33 @@ import static org.assertj.core.api.Assertions.assertThat;
|
|||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
class ClonePeopleTransformStepTest
|
class ClonePeopleTransformStepTest
|
||||||
{
|
{
|
||||||
|
private static boolean originalUseMysqlValue = false;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/*******************************************************************************
|
||||||
|
**
|
||||||
|
*******************************************************************************/
|
||||||
|
@BeforeAll
|
||||||
|
static void beforeAll() throws Exception
|
||||||
|
{
|
||||||
|
originalUseMysqlValue = SampleMetaDataProvider.USE_MYSQL;
|
||||||
|
SampleMetaDataProvider.USE_MYSQL = false;
|
||||||
|
SampleMetaDataProviderTest.primeTestDatabase("prime-test-database.sql");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/*******************************************************************************
|
||||||
|
**
|
||||||
|
*******************************************************************************/
|
||||||
|
@AfterAll
|
||||||
|
static void afterAll()
|
||||||
|
{
|
||||||
|
SampleMetaDataProvider.USE_MYSQL = originalUseMysqlValue;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
**
|
**
|
||||||
|
Reference in New Issue
Block a user