-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9a02e20
commit 148f1dc
Showing
24 changed files
with
329 additions
and
251 deletions.
There are no files selected for viewing
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
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,33 @@ | ||
# Extension Manager 0.5.4, released 2023-10-20 | ||
|
||
Code name: Migrate to Exasol 8 | ||
|
||
## Summary | ||
|
||
Starting with this release, Extension Manager requires Exasol 8. Also integration tests for extension definitions must run with Exasol 8. | ||
|
||
To skip tests on non v8 versions, you can use the following new method: | ||
|
||
```java | ||
import com.exasol.extensionmanager.itest; | ||
// ... | ||
ExasolVersionCheck.assumeExasolVersion8(exasolTestSetup) | ||
``` | ||
|
||
## Features | ||
|
||
* #152: Migrated tests to Exasol 8 | ||
|
||
## Dependency Updates | ||
|
||
### Extension-manager | ||
|
||
#### Compile Dependency Updates | ||
|
||
* Updated `github.com/exasol/exasol-test-setup-abstraction-server/go-client:v0.3.3` to `v0.3.4` | ||
|
||
### Extension Integration Tests Library | ||
|
||
#### Compile Dependency Updates | ||
|
||
* Updated `com.exasol:extension-manager-client-java:0.5.3` to `0.5.4` |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
# Embedding Extension Manager in Another Application | ||
|
||
This page describes how to integrate Extension Manager functionality into another Go application. | ||
|
||
## Embedding the REST API | ||
|
||
You can embed the Extension Manager's REST API in another Go application that uses the [Nightapes/go-rest](https://github.com/Nightapes/go-rest) library: | ||
|
||
```go | ||
// Create an instance of `openapi.API` | ||
api := openapi.NewOpenAPI() | ||
// Create a new configuration | ||
config := extensionController.ExtensionManagerConfig{ | ||
ExtensionRegistryURL: "https://example.com/registry.json", | ||
BucketFSBasePath: "/buckets/bfsdefault/default/", | ||
ExtensionSchema: "EXA_EXTENSIONS", | ||
} | ||
// Add endpoints | ||
err := restAPI.AddPublicEndpoints(api, config) | ||
if err != nil { | ||
return err | ||
} | ||
// Start the server | ||
``` | ||
|
||
## Embedding the Extension Controller | ||
|
||
If you want to directly use the extension controller in your Go application you can use the following code as an example: | ||
|
||
```go | ||
// Create a new configuration | ||
config := extensionController.ExtensionManagerConfig{ | ||
ExtensionRegistryURL: "https://example.com/registry.json", | ||
BucketFSBasePath: "/buckets/bfsdefault/default/", | ||
ExtensionSchema: "EXA_EXTENSIONS", | ||
} | ||
// Create controller and handle configuration validation error | ||
ctrl, err := extensionController.CreateWithValidatedConfig(config) | ||
if err != nil { | ||
return err | ||
} | ||
|
||
// Create database connection (required as an argument for all controller methods) | ||
var db *sql.DB = createDBConnection() | ||
|
||
// Call controller method and process result. Use a custom context if available. | ||
extensions, err := ctrl.GetAllExtensions(context.Background(), db) | ||
// ... | ||
``` |
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
55 changes: 55 additions & 0 deletions
55
...gration-test-java/src/main/java/com/exasol/extensionmanager/itest/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,55 @@ | ||
package com.exasol.extensionmanager.itest; | ||
|
||
import static org.junit.jupiter.api.Assertions.assertEquals; | ||
import static org.junit.jupiter.api.Assertions.assertTrue; | ||
import static org.junit.jupiter.api.Assumptions.assumeTrue; | ||
|
||
import java.sql.*; | ||
|
||
import com.exasol.exasoltestsetup.ExasolTestSetup; | ||
|
||
/** | ||
* This class contains static methods for checking the Exasol DB version. | ||
*/ | ||
public class ExasolVersionCheck { | ||
private ExasolVersionCheck() { | ||
// Not instantiable | ||
} | ||
|
||
/** | ||
* Ensures that the given test setup is connected to a Exasol DB in version 8. | ||
* <p> | ||
* This executes a SQL query using the given test setup to determine the major version of the database. | ||
* | ||
* @param testSetup test setup to check | ||
* @throws AssertionError if the major version number is not {@code 8} | ||
*/ | ||
public static void assertExasolVersion8(final ExasolTestSetup testSetup) { | ||
final String version = getExasolMajorVersion(testSetup); | ||
assertEquals("8", version, "Exasol version"); | ||
} | ||
|
||
/** | ||
* Assumes that the given test setup is connected to a Exasol DB in version 8. * | ||
* <p> | ||
* This executes a SQL query using the given test setup to determine the major version of the database. | ||
* | ||
* @param testSetup test setup to check | ||
* @throws org.opentest4j.TestAbortedException if the major version number is not {@code 8} | ||
*/ | ||
public static void assumeExasolVersion8(final ExasolTestSetup testSetup) { | ||
final String version = getExasolMajorVersion(testSetup); | ||
assumeTrue("8".equals(version), "Expected Exasol version 8 but got '" + version + "'"); | ||
} | ||
|
||
static String getExasolMajorVersion(final ExasolTestSetup testSetup) { | ||
try (Statement stmt = testSetup.createConnection().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
Oops, something went wrong.