Package com.exasol.exasoltestsetup
Interface ExasolTestSetup
-
- All Superinterfaces:
AutoCloseable
- All Known Implementing Classes:
ExasolTestcontainerTestSetup,StandaloneExasolTestSetup
public interface ExasolTestSetup extends AutoCloseable
This is an interface for accessing a running Exasol database for testing. It abstracts over the type of installation (cloud / docker, cluster / single-node).
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description ConnectioncreateConnection()Create a connection to the Exasol database with default credentials.SqlConnectionInfogetConnectionInfo()Get the information required for connection to the Exasol database.com.exasol.bucketfs.BucketgetDefaultBucket()Get an API object for the default BucketFS bucket.List<Integer>makeDatabaseTcpServiceAccessibleFromLocalhost(int databasePort)Make the port of a database node available from localhost.InetSocketAddressmakeLocalTcpServiceAccessibleFromDatabase(int localPort)Make a local TCP service available from within the Exasol database.default InetSocketAddressmakeTcpServiceAccessibleFromDatabase(InetSocketAddress serviceAddress)Make a given TCP service available inside of the Exasol database.-
Methods inherited from interface java.lang.AutoCloseable
close
-
-
-
-
Method Detail
-
createConnection
Connection createConnection() throws SQLException
Create a connection to the Exasol database with default credentials.- Returns:
- SQL connection
- Throws:
SQLException- if something went wrong
-
getConnectionInfo
SqlConnectionInfo getConnectionInfo()
Get the information required for connection to the Exasol database.- Returns:
- object containing the connection details
-
getDefaultBucket
com.exasol.bucketfs.Bucket getDefaultBucket()
Get an API object for the default BucketFS bucket.- Returns:
- API object for the default BucketFS bucket
-
makeLocalTcpServiceAccessibleFromDatabase
InetSocketAddress makeLocalTcpServiceAccessibleFromDatabase(int localPort)
Make a local TCP service available from within the Exasol database.You can use this method for example for accessing a local s3 bucket implementation from inside the Exasol database. Another example is to connect from UDFs to a debugger running on the test PC.
- Parameters:
localPort- port of the service @ localhost- Returns:
- address under which the service is available from within the exasol database (same port)
-
makeDatabaseTcpServiceAccessibleFromLocalhost
List<Integer> makeDatabaseTcpServiceAccessibleFromLocalhost(int databasePort)
Make the port of a database node available from localhost. If the target is a cluster, this methods sets up a redirect for each node and returns multiple local port numbers.You can use this method for example to connect from your test PC to a profiling agent that listens on a TCP socket in an UDF.
- Parameters:
databasePort- database port- Returns:
- list of local port numbers. One entry per cluster node.
-
makeTcpServiceAccessibleFromDatabase
default InetSocketAddress makeTcpServiceAccessibleFromDatabase(InetSocketAddress serviceAddress)
Make a given TCP service available inside of the Exasol database.- Parameters:
serviceAddress- service address in the format host:port- Returns:
- modified service address
-
-