use of org.pentaho.database.model.DatabaseType in project data-access by pentaho.
the class DSWDatasourceServiceImplTest method testSqlQueries_AreNotSupported_PentahoDataServices.
@Test(expected = SqlQueriesNotSupportedException.class)
public void testSqlQueries_AreNotSupported_PentahoDataServices() throws Exception {
String connNameDataService = "connToDataService";
String dbTypeIdDataService = "Pentaho Data Services";
DatabaseType dbtype = new DatabaseType(dbTypeIdDataService, STRING_DEFAULT, null, 0, STRING_DEFAULT);
IDatabaseConnection connDataService = new DatabaseConnection();
connDataService.setDatabaseType(dbtype);
ConnectionServiceImpl connService = mock(ConnectionServiceImpl.class);
doReturn(connDataService).when(connService).getConnectionByName(eq(connNameDataService));
DSWDatasourceServiceImpl service = new DSWDatasourceServiceImpl(connService);
service.checkSqlQueriesSupported(connNameDataService);
}
use of org.pentaho.database.model.DatabaseType in project data-access by pentaho.
the class DSWDatasourceServiceImplTest method testSqlQueries_Supported_PostgresDb.
@Test
public void testSqlQueries_Supported_PostgresDb() throws Exception {
String connNamePostgres = "connToPostgresDb";
String dbTypeIdPostgres = "PostgresDb";
IDatabaseConnection connDataService = new DatabaseConnection();
connDataService.setDatabaseType(new DatabaseType(dbTypeIdPostgres, STRING_DEFAULT, null, 0, STRING_DEFAULT));
ConnectionServiceImpl connService = mock(ConnectionServiceImpl.class);
doReturn(connDataService).when(connService).getConnectionByName(eq(connNamePostgres));
DSWDatasourceServiceImpl service = new DSWDatasourceServiceImpl(connService);
service.checkSqlQueriesSupported(connNamePostgres);
}
use of org.pentaho.database.model.DatabaseType in project data-access by pentaho.
the class AutobeanUtilitiesTest method testDbTypeBeanToImpl.
@Test
public void testDbTypeBeanToImpl() {
List<DatabaseAccessType> accessTypes = new LinkedList<DatabaseAccessType>();
accessTypes.add(DatabaseAccessType.NATIVE);
DatabaseType dbType1 = new DatabaseType("name", "short name", accessTypes, 100500, "helpUri");
IDatabaseType dbType = AutobeanUtilities.dbTypeBeanToImpl(dbType1);
assertEquals(dbType.getName(), "name");
assertEquals(dbType.getShortName(), "short name");
assertEquals(dbType.getDefaultDatabasePort(), 100500);
assertEquals(dbType.getExtraOptionsHelpUrl(), "helpUri");
assertEquals(dbType.getSupportedAccessTypes().size(), 1);
}
Aggregations