*/
public Connection createTestConnection( String name, int port ) throws Exception
{
name = name + "_" + System.currentTimeMillis();
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() );