Class 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 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 of ExtensionManagerSetup. Usually you call this in a BeforeAll method. Make sure to close this by calling close() in an AfterAll method.
        Parameters:
        exasolTestSetup - exasol test setup to use for the tests
        extensionBuilder - 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 like SCRIPTs or CONNECTIONs.
        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 calling close().
        Parameters:
        name - the virtual schema to drop
      • addConnectionToCleanupQueue

        public void addConnectionToCleanupQueue​(String name)
        Drop the connection with the given name when calling close().
        Parameters:
        name - the connection to drop
      • cleanup

        public void cleanup()
        Cleanup resources after each test in order to have a clean state. Usually you call this in an AfterEach method.

        Don't mix this up with close() which must be called in AfterAll.

      • close

        public void close()
        Cleanup resources after running all tests. Call this in a AfterAll method.

        Don't mix this up with cleanup() which must be called in AfterEach.

        Specified by:
        close in interface AutoCloseable