From 3b1d20656f0e881f6db4d4faaa9edf30b4e91f8b Mon Sep 17 00:00:00 2001 From: Robert Greig Date: Mon, 29 Jan 2007 10:46:27 +0000 Subject: (Patch supplied by Tomas Restrepo) QPID-291-2.diff applied. Adds SASL capability to the .Net client. git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk@501001 13f79535-47bb-0310-9956-ffa450edef68 --- .../Security/CallbackHandlerRegistryTests.cs | 55 ++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 qpid/dotnet/Qpid.Client.Tests/Security/CallbackHandlerRegistryTests.cs (limited to 'qpid/dotnet/Qpid.Client.Tests/Security') diff --git a/qpid/dotnet/Qpid.Client.Tests/Security/CallbackHandlerRegistryTests.cs b/qpid/dotnet/Qpid.Client.Tests/Security/CallbackHandlerRegistryTests.cs new file mode 100644 index 0000000000..ec0594263f --- /dev/null +++ b/qpid/dotnet/Qpid.Client.Tests/Security/CallbackHandlerRegistryTests.cs @@ -0,0 +1,55 @@ +/* + * + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + * + */ +using System; +using NUnit.Framework; +using Qpid.Client.Security; + + +namespace Qpid.Client.Tests.Security +{ + [TestFixture] + public class CallbackRegistryHandlerTests + { + [Test] + public void ParsesConfiguration() + { + CallbackHandlerRegistry registry = CallbackHandlerRegistry.Instance; + Assert.AreEqual(3, registry.Mechanisms.Length); + Assert.Contains("TEST", registry.Mechanisms); + + Type handlerType = registry.GetCallbackHandler("TEST"); + Assert.IsNotNull(handlerType); + Assert.AreEqual(typeof(TestCallbackHandler), handlerType); + } + } // class CallbackRegistryHandlerTests + + public class TestCallbackHandler : IAMQCallbackHandler + { + public void Initialize(Qpid.Client.Protocol.AMQProtocolSession session) + { + } + public void Handle(Qpid.Sasl.ISaslCallback[] callbacks) + { + } + + } // class TestCallbackHandler + +} // namespace Qpid.Client.Tests.Connection -- cgit v1.2.1