*
* @throws Exception the exception
*/
public static Connection createTestConnection( SWTEclipseBot bot, String name, int port ) throws Exception
{
SWTBotTree connectionsTree = getConnectionsTree( bot );
ConnectionManager connectionManager = ConnectionCorePlugin.getDefault().getConnectionManager();
ConnectionParameter connectionParameter = new ConnectionParameter();
connectionParameter.setName( name );
connectionParameter.setHost( "localhost" );
connectionParameter.setPort( port );
connectionParameter.setEncryptionMethod( EncryptionMethod.NONE );
connectionParameter.setAuthMethod( AuthenticationMethod.SIMPLE );
connectionParameter.setBindPrincipal( "uid=admin,ou=system" );
connectionParameter.setBindPassword( "secret" );
Connection connection = new Connection( connectionParameter );
connectionManager.addConnection( connection );
ConnectionFolderManager connectionFolderManager = ConnectionCorePlugin.getDefault()
.getConnectionFolderManager();
ConnectionFolder rootConnectionFolder = connectionFolderManager.getRootConnectionFolder();
rootConnectionFolder.addConnectionId( connection.getId() );
connectionsTree.select( name );
//new OpenConnectionsJob( connection ).execute();
Thread.sleep( 1000 );
return connection;
}