use of com.amazonaws.athena.connectors.jdbc.manager.JDBCUtil in project aws-athena-query-federation by awslabs.
the class SaphanaCompositeHandlerTest method SaphanaCompositeHandlerTest.
@Test
public void SaphanaCompositeHandlerTest() {
Exception ex = null;
try {
DatabaseConnectionConfig databaseConnectionConfig = new DatabaseConnectionConfig("testCatalog", SaphanaConstants.SAPHANA_NAME, "saphana://jdbc:sap://hostname/?${trianz-saphana-athena-jdbc}");
PowerMockito.mockStatic(JDBCUtil.class);
JDBCUtil tested = PowerMockito.mock(JDBCUtil.class);
PowerMockito.when(tested.getSingleDatabaseConfigFromEnv(SaphanaConstants.SAPHANA_NAME)).thenReturn(databaseConnectionConfig);
saphanaCompositeHandler = new SaphanaCompositeHandler();
assertEquals(saphanaCompositeHandler.getClass(), SaphanaCompositeHandler.class);
} catch (Exception e) {
ex = e;
}
assertEquals(null, ex);
}
use of com.amazonaws.athena.connectors.jdbc.manager.JDBCUtil in project aws-athena-query-federation by awslabs.
the class SynapseCompositeHandlerTest method synapseCompositeHandlerTest.
@Test
public void synapseCompositeHandlerTest() {
Exception ex = null;
try {
DatabaseConnectionConfig databaseConnectionConfig = new DatabaseConnectionConfig("testCatalog1", SynapseConstants.NAME, "synapse://jdbc:sqlserver://hostname;databaseName=fakedatabase;");
PowerMockito.mockStatic(JDBCUtil.class);
JDBCUtil tested = PowerMockito.mock(JDBCUtil.class);
PowerMockito.when(tested.getSingleDatabaseConfigFromEnv(SynapseConstants.NAME)).thenReturn(databaseConnectionConfig);
synapseCompositeHandler = new SynapseCompositeHandler();
logger.info("synapseCompositeHandler: {}", synapseCompositeHandler);
} catch (Exception e) {
ex = e;
}
Assert.assertEquals(null, ex);
}
use of com.amazonaws.athena.connectors.jdbc.manager.JDBCUtil in project aws-athena-query-federation by awslabs.
the class SqlServerCompositeHandlerTest method sqlserverCompositeHandlerTest.
@Test
public void sqlserverCompositeHandlerTest() {
Exception ex = null;
try {
DatabaseConnectionConfig databaseConnectionConfig = new DatabaseConnectionConfig("testCatalog1", SqlServerConstants.NAME, "sqlserver://jdbc:sqlserver://hostname;databaseName=fakedatabase;");
PowerMockito.mockStatic(JDBCUtil.class);
JDBCUtil tested = PowerMockito.mock(JDBCUtil.class);
PowerMockito.when(tested.getSingleDatabaseConfigFromEnv(SqlServerConstants.NAME)).thenReturn(databaseConnectionConfig);
sqlServerCompositeHandler = new SqlServerCompositeHandler();
logger.info("sqlServerCompositeHandler: {}", sqlServerCompositeHandler);
} catch (Exception e) {
ex = e;
}
Assert.assertEquals(null, ex);
}
use of com.amazonaws.athena.connectors.jdbc.manager.JDBCUtil in project aws-athena-query-federation by awslabs.
the class HiveCompositeHandlerTest method HiveCompositeHandlerTest.
@Test
public void HiveCompositeHandlerTest() {
Exception ex = null;
try {
DatabaseConnectionConfig databaseConnectionConfig = new DatabaseConnectionConfig("testCatalog1", HiveConstants.HIVE_NAME, "hdphive2://jdbc:hive2://54.89.6.2:10000/authena;AuthMech=3;${testSecret}", "testSecret");
PowerMockito.mockStatic(JDBCUtil.class);
JDBCUtil tested = PowerMockito.mock(JDBCUtil.class);
PowerMockito.when(tested.getSingleDatabaseConfigFromEnv(HiveConstants.HIVE_NAME)).thenReturn(databaseConnectionConfig);
new HiveCompositeHandler();
} catch (Exception e) {
ex = e;
}
Assert.assertEquals(null, ex);
}
use of com.amazonaws.athena.connectors.jdbc.manager.JDBCUtil in project aws-athena-query-federation by awslabs.
the class ImpalaCompositeHandlerTest method ImpalaCompositeHandlerTest.
@Test
public void ImpalaCompositeHandlerTest() {
Exception ex = null;
try {
DatabaseConnectionConfig databaseConnectionConfig = new DatabaseConnectionConfig("testCatalog1", ImpalaConstants.IMPALA_NAME, "impala://jdbc:impala://54.89.6.2:10000/authena;AuthMech=3;${testSecret}", "testSecret");
PowerMockito.mockStatic(JDBCUtil.class);
JDBCUtil tested = PowerMockito.mock(JDBCUtil.class);
PowerMockito.when(tested.getSingleDatabaseConfigFromEnv(ImpalaConstants.IMPALA_NAME)).thenReturn(databaseConnectionConfig);
new ImpalaCompositeHandler();
} catch (Exception e) {
ex = e;
}
Assert.assertEquals(null, ex);
}
Aggregations