SPRNET-1268 - Exceptions in Spring should pass tests to ensure compliance with .NET framework guidelines.

This commit is contained in:
markpollack
2010-11-16 16:56:47 +00:00
parent 32aa99ff87
commit 388234c2c0
6 changed files with 96 additions and 5 deletions

View File

@@ -19,6 +19,7 @@
#endregion
using System;
using System.Runtime.Serialization;
using Apache.NMS;
namespace Spring.Messaging.Nms.Connections
@@ -33,6 +34,13 @@ namespace Spring.Messaging.Nms.Connections
{
#region Constructor (s) / Destructor
/// <summary>
/// Initializes a new instance of the <see cref="SynchedLocalTransactionFailedException"/> class.
/// </summary>
public SynchedLocalTransactionFailedException()
{
}
/// <summary>
/// Creates a new instance of the SynchedLocalTransactionFailedException class. with the specified message.
/// </summary>
@@ -58,6 +66,16 @@ namespace Spring.Messaging.Nms.Connections
{
}
/// <summary>
/// Initializes a new instance of the <see cref="SynchedLocalTransactionFailedException"/> class.
/// </summary>
/// <param name="info">The SerializationInfo that holds the serialized object data about the exception being thrown.</param>
/// <param name="context">The StreamingContext that contains contextual information about the source or destination.</param>
protected SynchedLocalTransactionFailedException(SerializationInfo info, StreamingContext context)
: base(info, context)
{
}
#endregion
}
}

View File

@@ -19,6 +19,7 @@
#endregion
using System;
using System.Runtime.Serialization;
using Apache.NMS;
using Common.Logging;
using Spring.Context;
@@ -532,14 +533,42 @@ namespace Spring.Messaging.Nms.Listener
/// shared Connection failed. This is indicating to invokers that they need
/// to establish the shared Connection themselves on first access.
/// </summary>
[Serializable]
public class SharedConnectionNotInitializedException : NMSException
{
/// <summary>
/// Initializes a new instance of the <see cref="SharedConnectionNotInitializedException"/> class.
/// </summary>
public SharedConnectionNotInitializedException()
{
}
/// <summary>
/// Initializes a new instance of the <see cref="SharedConnectionNotInitializedException"/> class.
/// </summary>
/// <param name="message">The message.</param>
public SharedConnectionNotInitializedException(string message) : base(message)
{
}
/// <summary>
/// Initializes a new instance of the <see cref="SharedConnectionNotInitializedException"/> class, with the specified message
/// and root cause exception
/// </summary>
/// <param name="message">The message.</param>
/// <param name="innerException">The inner exception.</param>
public SharedConnectionNotInitializedException(string message, Exception innerException)
: base(message, innerException)
{
}
/// <summary>
/// Initializes a new instance of the <see cref="SharedConnectionNotInitializedException"/> class.
/// </summary>
/// <param name="info">The SerializationInfo that holds the serialized object data about the exception being thrown.</param>
/// <param name="context">The StreamingContext that contains contextual information about the source or destination.</param>
protected SharedConnectionNotInitializedException(SerializationInfo info, StreamingContext context) : base(info, context)
{
}
}
}

View File

@@ -19,6 +19,7 @@
#endregion
using System;
using System.Runtime.Serialization;
using Apache.NMS;
namespace Spring.Messaging.Nms.Listener.Adapter
@@ -28,8 +29,15 @@ namespace Spring.Messaging.Nms.Listener.Adapter
/// </summary>
/// <author>Juergen Hoeller</author>
/// <author>Mark Pollack (.NET)</author>
[Serializable]
public class ListenerExecutionFailedException : NMSException
{
/// <summary>
/// Initializes a new instance of the <see cref="ListenerExecutionFailedException"/> class.
/// </summary>
public ListenerExecutionFailedException()
{
}
/// <summary>
/// Initializes a new instance of the <see cref="ListenerExecutionFailedException"/> class, with the specified message
@@ -49,5 +57,15 @@ namespace Spring.Messaging.Nms.Listener.Adapter
: base(message, innerException)
{
}
/// <summary>
/// Initializes a new instance of the <see cref="ListenerExecutionFailedException"/> class.
/// </summary>
/// <param name="info">The SerializationInfo that holds the serialized object data about the exception being thrown.</param>
/// <param name="context">The StreamingContext that contains contextual information about the source or destination.</param>
protected ListenerExecutionFailedException(SerializationInfo info, StreamingContext context)
: base(info, context)
{
}
}
}

View File

@@ -18,10 +18,14 @@
#endregion
#region
using System;
using System.Runtime.Serialization;
using Apache.NMS;
#endregion
namespace Spring.Messaging.Nms.Listener
{
/// <summary>
@@ -31,11 +35,10 @@ namespace Spring.Messaging.Nms.Listener
[Serializable]
public class RecoveryTimeExceededException : NMSException
{
/// <summary>
/// Initializes a new instance of the <see cref="RecoveryTimeExceededException"/> class.
/// </summary>
public RecoveryTimeExceededException(): base()
public RecoveryTimeExceededException()
{
}
@@ -59,7 +62,13 @@ namespace Spring.Messaging.Nms.Listener
{
}
/* Note, can not add this exception since the signature is not present in the base class.
protected RecoveryTimeExceededException(SerializationInfo info, StreamingContext context ) : base( info, context ) {} */
/// <summary>
/// Initializes a new instance of the <see cref="RecoveryTimeExceededException"/> class.
/// </summary>
/// <param name="info">The SerializationInfo that holds the serialized object data about the exception being thrown.</param>
/// <param name="context">The StreamingContext that contains contextual information about the source or destination.</param>
protected RecoveryTimeExceededException(SerializationInfo info, StreamingContext context) : base(info, context)
{
}
}
}

View File

@@ -19,6 +19,7 @@
#endregion
using System;
using System.Runtime.Serialization;
using Apache.NMS;
namespace Spring.Messaging.Nms.Support.Converter
@@ -27,10 +28,17 @@ namespace Spring.Messaging.Nms.Support.Converter
/// of an object to/from a Message fails.
/// </summary>
/// <author>Mark Pollack</author>
[Serializable]
public class MessageConversionException : NMSException
{
#region Constructor (s) / Destructor
/// <summary>
/// Initializes a new instance of the <see cref="MessageConversionException"/> class.
/// </summary>
public MessageConversionException()
{
}
/// <summary>
/// Creates a new instance of the IMessageConverterException class. with the specified message.
@@ -58,6 +66,15 @@ namespace Spring.Messaging.Nms.Support.Converter
{
}
/// <summary>
/// Initializes a new instance of the <see cref="MessageConversionException"/> class.
/// </summary>
/// <param name="info">The SerializationInfo that holds the serialized object data about the exception being thrown.</param>
/// <param name="context">The StreamingContext that contains contextual information about the source or destination.</param>
protected MessageConversionException(SerializationInfo info, StreamingContext context) : base(info, context)
{
}
#endregion
}
}

View File

@@ -33,7 +33,7 @@ namespace Spring
/// </summary>
/// <author>Rick Evans</author>
[TestFixture]
[Ignore("Spring inherits from NMS Exceptions which do not ")]
//[Ignore("Spring inherits from NMS Exceptions which do not ")]
public sealed class NmsExceptionTests : ExceptionsTest
{
[TestFixtureSetUp]