-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Skip integration tests with Exasol 8
- Loading branch information
1 parent
ff43070
commit 3f60c9c
Showing
3 changed files
with
44 additions
and
6 deletions.
There are no files selected for viewing
32 changes: 32 additions & 0 deletions
32
src/test/java/com/exasol/adapter/dialects/oracle/ExasolVersionCheck.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
package com.exasol.adapter.dialects.oracle; | ||
|
||
import static org.junit.jupiter.api.Assertions.assertTrue; | ||
import static org.junit.jupiter.api.Assumptions.assumeTrue; | ||
|
||
import java.sql.*; | ||
|
||
class ExasolVersionCheck { | ||
|
||
private ExasolVersionCheck() { | ||
// Not instantiable | ||
} | ||
|
||
/** | ||
* This is a temporary workaround until integration tests work with Exasol 8. | ||
*/ | ||
static void assumeExasolVersion7(final Connection connection) { | ||
final String version = getExasolMajorVersion(connection); | ||
assumeTrue("7".equals(version), "Expected Exasol version 7 but got '" + version + "'"); | ||
} | ||
|
||
static String getExasolMajorVersion(final Connection connection) { | ||
try (Statement stmt = connection.createStatement()) { | ||
final ResultSet result = stmt | ||
.executeQuery("SELECT PARAM_VALUE FROM SYS.EXA_METADATA WHERE PARAM_NAME='databaseMajorVersion'"); | ||
assertTrue(result.next(), "no result"); | ||
return result.getString(1); | ||
} catch (final SQLException exception) { | ||
throw new IllegalStateException("Failed to query Exasol version: " + exception.getMessage(), exception); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters