Author: jgomes Date: Thu Dec 11 13:04:13 2008 New Revision: 725810 URL: http://svn.apache.org/viewvc?rev=725810&view=rev Log: Apply patches submitted by Daniel Ellis. Thanks, Daniel!
Fixes [AMQNET-134]. (See https://issues.apache.org/activemq/browse/AMQNET-134) Added: activemq/activemq-dotnet/Apache.NMS/trunk/src/test/csharp/NmsTracer.cs Modified: activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/Commands/SessionId.cs activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/State/ConnectionState.cs activemq/activemq-dotnet/Apache.NMS/trunk/src/test/csharp/NMSTestSupport.cs activemq/activemq-dotnet/Apache.NMS/trunk/vs2008-nms-test.csproj Modified: activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/Commands/SessionId.cs URL: http://svn.apache.org/viewvc/activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/Commands/SessionId.cs?rev=725810&r1=725809&r2=725810&view=diff ============================================================================== --- activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/Commands/SessionId.cs (original) +++ activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/Commands/SessionId.cs Thu Dec 11 13:04:13 2008 @@ -120,7 +120,7 @@ public SessionId(ProducerId id) { this.connectionId = id.ConnectionId; - this.value = id.Value; + this.value = id.SessionId; } public SessionId(ConsumerId id) Modified: activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/State/ConnectionState.cs URL: http://svn.apache.org/viewvc/activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/State/ConnectionState.cs?rev=725810&r1=725809&r2=725810&view=diff ============================================================================== --- activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/State/ConnectionState.cs (original) +++ activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/State/ConnectionState.cs Thu Dec 11 13:04:13 2008 @@ -110,7 +110,26 @@ { get { - return sessions[id]; + #if DEBUG + try + { + #endif + return sessions[id]; + #if DEBUG + } + catch(System.Collections.Generic.KeyNotFoundException ex) + { + // Useful for dignosing missing session ids + string sessionList = string.Empty; + foreach(SessionId sessionId in sessions.Keys) + { + sessionList += sessionId.ToString() + "\n"; + } + System.Diagnostics.Debug.Assert(false, + string.Format("Session '{0}' did not exist in the sessions collection.\n\nSessions:-\n{1}", id, sessionList)); + throw; + } + #endif } } Modified: activemq/activemq-dotnet/Apache.NMS/trunk/src/test/csharp/NMSTestSupport.cs URL: http://svn.apache.org/viewvc/activemq/activemq-dotnet/Apache.NMS/trunk/src/test/csharp/NMSTestSupport.cs?rev=725810&r1=725809&r2=725810&view=diff ============================================================================== --- activemq/activemq-dotnet/Apache.NMS/trunk/src/test/csharp/NMSTestSupport.cs (original) +++ activemq/activemq-dotnet/Apache.NMS/trunk/src/test/csharp/NMSTestSupport.cs Thu Dec 11 13:04:13 2008 @@ -35,6 +35,11 @@ protected string passWord; protected string userName; + static NMSTestSupport() + { + Apache.NMS.Tracer.Trace = new NmsTracer(); + } + public NMSTestSupport() { } Added: activemq/activemq-dotnet/Apache.NMS/trunk/src/test/csharp/NmsTracer.cs URL: http://svn.apache.org/viewvc/activemq/activemq-dotnet/Apache.NMS/trunk/src/test/csharp/NmsTracer.cs?rev=725810&view=auto ============================================================================== --- activemq/activemq-dotnet/Apache.NMS/trunk/src/test/csharp/NmsTracer.cs (added) +++ activemq/activemq-dotnet/Apache.NMS/trunk/src/test/csharp/NmsTracer.cs Thu Dec 11 13:04:13 2008 @@ -0,0 +1,61 @@ +using System; +using System.Diagnostics; + +namespace Apache.NMS.Test +{ + public class NmsTracer : Apache.NMS.ITrace + { + #region ITrace Members + public void Debug(string message) + { + Trace.WriteLine("DEBUG: " + message); + } + + public void Error(string message) + { + Trace.WriteLine("ERROR: " + message); + } + + public void Fatal(object message) + { + Trace.WriteLine("FATAL: " + message); + } + + public void Info(string message) + { + Trace.WriteLine("INFO: " + message); + } + + public void Warn(string message) + { + Trace.WriteLine("WARN: " + message); + } + + public bool IsDebugEnabled + { + get { return true; } + } + + public bool IsErrorEnabled + { + get { return true; } + } + + public bool IsFatalEnabled + { + get { return true; } + } + + public bool IsInfoEnabled + { + get { return true; } + } + + public bool IsWarnEnabled + { + get { return true; } + } + + #endregion + } +} Modified: activemq/activemq-dotnet/Apache.NMS/trunk/vs2008-nms-test.csproj URL: http://svn.apache.org/viewvc/activemq/activemq-dotnet/Apache.NMS/trunk/vs2008-nms-test.csproj?rev=725810&r1=725809&r2=725810&view=diff ============================================================================== --- activemq/activemq-dotnet/Apache.NMS/trunk/vs2008-nms-test.csproj (original) +++ activemq/activemq-dotnet/Apache.NMS/trunk/vs2008-nms-test.csproj Thu Dec 11 13:04:13 2008 @@ -96,6 +96,7 @@ <SubType>Code</SubType> </Compile> <Compile Include="src\test\csharp\MessageSelectorTest.cs" /> + <Compile Include="src\test\csharp\NmsTracer.cs" /> <Compile Include="src\test\csharp\TempDestinationDeletionTest.cs" /> <Compile Include="src\test\csharp\TextMessage.cs"> <SubType>Code</SubType>
