test connection method