Security.addProvider(testProvider);
assertSame("Test provider should be registered", testProvider, DynamicSaslRegistrar.findProvider(JCAProvider.QPID_CLIENT_SASL_PROVIDER_NAME));
//Try to register the default provider now that another with the same name etc (but different factories)
//is already registered, expect it not to be registered as a result.
ProviderRegistrationResult result = DynamicSaslRegistrar.registerSaslProviders();
assertEquals("Unexpected registration result", ProviderRegistrationResult.DIFFERENT_ALREADY_REGISTERED, result);
//Verify the test provider is still registered
assertSame("Test provider should still be registered", testProvider, DynamicSaslRegistrar.findProvider(JCAProvider.QPID_CLIENT_SASL_PROVIDER_NAME));
}