Class ExtensionManagerSetup
- java.lang.Object
-
- com.exasol.extensionmanager.itest.ExtensionManagerSetup
-
- All Implemented Interfaces:
AutoCloseable
public class ExtensionManagerSetup extends Object implements AutoCloseable
Main class responsible for setting up the environment required for testing extensions using the extension manager.
-
-
Field Summary
Fields Modifier and Type Field Description static StringEXTENSION_SCHEMA_NAMEThe name of the schema containing all extensions.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddConnectionToCleanupQueue(String name)Drop the connection with the given name when callingclose().voidaddVirtualSchemaToCleanupQueue(String name)Drop the virtual schema with the given name when callingclose().voidcleanup()Cleanup resources after a test in order to have a clean state.ExtensionManagerClientclient()Get the client for accessing the extension manager via its REST API.voidclose()Cleanup resources after running tests.static ExtensionManagerSetupcreate(com.exasol.exasoltestsetup.ExasolTestSetup exasolTestSetup, ExtensionBuilder extensionBuilder)Prepare and create a new instance ofExtensionManagerSetup.com.exasol.dbbuilder.dialects.exasol.ExasolSchemacreateExtensionSchema()Create the extension schema used by extension manager.ExasolMetadataexasolMetadata()Get access to Exasol's metadata tables.
-
-
-
Field Detail
-
EXTENSION_SCHEMA_NAME
public static final String EXTENSION_SCHEMA_NAME
The name of the schema containing all extensions.- See Also:
- Constant Field Values
-
-
Method Detail
-
create
public static ExtensionManagerSetup create(com.exasol.exasoltestsetup.ExasolTestSetup exasolTestSetup, ExtensionBuilder extensionBuilder)
Prepare and create a new instance ofExtensionManagerSetup. Usually you call this in aBeforeAllmethod. Make sure to close this by callingclose()in anAfterAllmethod.- Parameters:
exasolTestSetup- exasol test setup to use for the testsextensionBuilder- builder for building the extension under test- Returns:
- a new instance
-
client
public ExtensionManagerClient client()
Get the client for accessing the extension manager via its REST API. Use this for calling and testing methods of the extension under test.- Returns:
- extension manager client
-
exasolMetadata
public ExasolMetadata exasolMetadata()
Get access to Exasol's metadata tables. This is useful for verifying that the extension under test created expected objects likeSCRIPTs orCONNECTIONs.- Returns:
- exasol metadata
-
createExtensionSchema
public com.exasol.dbbuilder.dialects.exasol.ExasolSchema createExtensionSchema()
Create the extension schema used by extension manager. This is useful for testing if the extension under test can handle existing database objects.- Returns:
- new extension schema.
-
addVirtualSchemaToCleanupQueue
public void addVirtualSchemaToCleanupQueue(String name)
Drop the virtual schema with the given name when callingclose().- Parameters:
name- the virtual schema to drop
-
addConnectionToCleanupQueue
public void addConnectionToCleanupQueue(String name)
Drop the connection with the given name when callingclose().- Parameters:
name- the connection to drop
-
close
public void close()
Cleanup resources after running tests. Call this in aAfterAllmethod.- Specified by:
closein interfaceAutoCloseable
-
cleanup
public void cleanup()
Cleanup resources after a test in order to have a clean state. Usually you call this in anAfterEachmethod.
-
-