Skip to content

Commit

Permalink
disabled oracle tests
Browse files Browse the repository at this point in the history
  • Loading branch information
wizzardo committed May 16, 2024
1 parent ca8a57f commit 7fe90c1
Showing 1 changed file with 44 additions and 42 deletions.
86 changes: 44 additions & 42 deletions src/test/java/com/wizzardo/tools/sql/OracleTests.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.wizzardo.tools.sql;

import com.wizzardo.tools.misc.Unchecked;
import oracle.jdbc.datasource.impl.OracleDataSource;
//import oracle.jdbc.datasource.impl.OracleDataSource;
import org.junit.After;
import org.junit.Test;
import org.testcontainers.containers.OracleContainer;
Expand All @@ -10,45 +10,47 @@
import javax.sql.DataSource;
import java.sql.SQLException;

public class OracleTests extends DBToolsTest {
{
migrationsListPath = "sql/migrations_oracle.txt";
songLimitQuery = "select * from song fetch next ? rows only";
}

static OracleContainer oracle = new OracleContainer("gvenzl/oracle-xe:21-slim")
.withDatabaseName("testDB");


@Override
protected ConnectionPoolDataSource createDataSource() {
if (!oracle.isCreated())
oracle.start();

DataSource dataSource = Unchecked.call(() -> {
OracleDataSource ds = new OracleDataSource();
ds.setURL(oracle.getJdbcUrl());
ds.setUser(oracle.getUsername());
ds.setPassword(oracle.getPassword());
return ds;
});

return new SimpleConnectionPoolDataSource(dataSource);
}

@After
public void cleanup() {
service.withDB(c -> {
c.prepareCall("delete from artist").executeUpdate();
c.prepareCall("delete from album").executeUpdate();
c.prepareCall("alter table artist modify id generated by default on null as identity(start with 1)").executeUpdate();
c.prepareCall("alter table song modify id generated by default on null as identity(start with 1)").executeUpdate();
c.prepareCall("alter table album modify id generated by default on null as identity(start with 1)").executeUpdate();
return null;
});
}

@Test
public void test_inner_select_2() throws SQLException {
}
public class OracleTests
// extends DBToolsTest
{
// {
// migrationsListPath = "sql/migrations_oracle.txt";
// songLimitQuery = "select * from song fetch next ? rows only";
// }
//
// static OracleContainer oracle = new OracleContainer("gvenzl/oracle-xe:21-slim")
// .withDatabaseName("testDB");
//
//
// @Override
// protected ConnectionPoolDataSource createDataSource() {
// if (!oracle.isCreated())
// oracle.start();
//
// DataSource dataSource = Unchecked.call(() -> {
// OracleDataSource ds = new OracleDataSource();
// ds.setURL(oracle.getJdbcUrl());
// ds.setUser(oracle.getUsername());
// ds.setPassword(oracle.getPassword());
// return ds;
// });
//
// return new SimpleConnectionPoolDataSource(dataSource);
// }
//
// @After
// public void cleanup() {
// service.withDB(c -> {
// c.prepareCall("delete from artist").executeUpdate();
// c.prepareCall("delete from album").executeUpdate();
// c.prepareCall("alter table artist modify id generated by default on null as identity(start with 1)").executeUpdate();
// c.prepareCall("alter table song modify id generated by default on null as identity(start with 1)").executeUpdate();
// c.prepareCall("alter table album modify id generated by default on null as identity(start with 1)").executeUpdate();
// return null;
// });
// }
//
// @Test
// public void test_inner_select_2() throws SQLException {
// }
}

0 comments on commit 7fe90c1

Please sign in to comment.