use of org.pentaho.database.model.DatabaseConnection in project data-access by pentaho.
the class ConnectionServiceImplIT method testAddConnection.
@Test
public void testAddConnection() throws ConnectionServiceException {
DatabaseConnection connection = new DatabaseConnection();
connection.setName(SECOND_CONNECTION);
connectionServiceImpl.addConnection(connection);
IDatabaseConnection actualCnnection = connectionServiceImpl.getConnectionByName(SECOND_CONNECTION);
assertEquals(connection, actualCnnection);
}
use of org.pentaho.database.model.DatabaseConnection in project data-access by pentaho.
the class ConnectionServiceImplIT method testTestConnection.
@Test
public void testTestConnection() throws ConnectionServiceException {
DatabaseConnection connection = new DatabaseConnection();
connection.setName(NON_EXIST_CONNECTION_NAME);
connection.setAccessType(DatabaseAccessType.NATIVE);
connection.setDatabaseType(new DatabaseType("H2", "H2", Arrays.asList(DatabaseAccessType.NATIVE), 0, null));
assertTrue(connectionServiceImpl.testConnection(connection));
}
use of org.pentaho.database.model.DatabaseConnection in project data-access by pentaho.
the class ConnectionServiceImplIT method testDeleteConnectionError.
@Test(expected = ConnectionServiceException.class)
public void testDeleteConnectionError() throws Exception {
DatabaseConnection connection = new DatabaseConnection();
connection.setName(ERROR_CONNECTION_NAME);
connectionServiceImpl.deleteConnection(connection);
}
use of org.pentaho.database.model.DatabaseConnection in project data-access by pentaho.
the class ConnectionServiceImplIT method testAddConnectionError.
@Test(expected = ConnectionServiceException.class)
public void testAddConnectionError() throws ConnectionServiceException {
DatabaseConnection connection = new DatabaseConnection();
connection.setName(ERROR_CONNECTION_NAME);
connectionServiceImpl.addConnection(connection);
}
use of org.pentaho.database.model.DatabaseConnection in project data-access by pentaho.
the class ConnectionServiceImplIT method testDeleteConnectionNONExist.
@Test(expected = ConnectionServiceException.class)
public void testDeleteConnectionNONExist() throws Exception {
DatabaseConnection connection = new DatabaseConnection();
connection.setName(NON_EXIST_CONNECTION_NAME);
connectionServiceImpl.deleteConnection(connection);
}
Aggregations