Class ExasolTestcontainerTestSetup
- java.lang.Object
-
- com.exasol.exasoltestsetup.testcontainers.ExasolTestcontainerTestSetup
-
- All Implemented Interfaces:
ExasolTestSetup,AutoCloseable
public class ExasolTestcontainerTestSetup extends Object implements ExasolTestSetup
ExasolTestSetupimplementation using test containers.
-
-
Constructor Summary
Constructors Constructor Description ExasolTestcontainerTestSetup()Test-setup using exasol-testcontainers.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()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.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.exasol.exasoltestsetup.ExasolTestSetup
makeTcpServiceAccessibleFromDatabase
-
-
-
-
Method Detail
-
createConnection
public Connection createConnection() throws SQLException
Description copied from interface:ExasolTestSetupCreate a connection to the Exasol database with default credentials.- Specified by:
createConnectionin interfaceExasolTestSetup- Returns:
- SQL connection
- Throws:
SQLException- if something went wrong
-
getConnectionInfo
public SqlConnectionInfo getConnectionInfo()
Description copied from interface:ExasolTestSetupGet the information required for connection to the Exasol database.- Specified by:
getConnectionInfoin interfaceExasolTestSetup- Returns:
- object containing the connection details
-
getDefaultBucket
public com.exasol.bucketfs.Bucket getDefaultBucket()
Description copied from interface:ExasolTestSetupGet an API object for the default BucketFS bucket.- Specified by:
getDefaultBucketin interfaceExasolTestSetup- Returns:
- API object for the default BucketFS bucket
-
makeLocalTcpServiceAccessibleFromDatabase
public InetSocketAddress makeLocalTcpServiceAccessibleFromDatabase(int localPort)
Description copied from interface:ExasolTestSetupMake 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.
- Specified by:
makeLocalTcpServiceAccessibleFromDatabasein interfaceExasolTestSetup- Parameters:
localPort- port of the service @ localhost- Returns:
- address under which the service is available from within the exasol database (same port)
-
makeDatabaseTcpServiceAccessibleFromLocalhost
public List<Integer> makeDatabaseTcpServiceAccessibleFromLocalhost(int databasePort)
Description copied from interface:ExasolTestSetupMake 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.
- Specified by:
makeDatabaseTcpServiceAccessibleFromLocalhostin interfaceExasolTestSetup- Parameters:
databasePort- database port- Returns:
- list of local port numbers. One entry per cluster node.
-
close
public void close() throws Exception- Specified by:
closein interfaceAutoCloseable- Throws:
Exception
-
-