Skip to content

Commit

Permalink
SPRNET-1002 - Object name generation when no name specified produces …
Browse files Browse the repository at this point in the history
…duplicate names
  • Loading branch information
markpollack committed Aug 14, 2008
1 parent 09065f9 commit 5e37960
Showing 1 changed file with 5 additions and 2 deletions.
Expand Up @@ -30,6 +30,7 @@
using Spring.Messaging.Nms.Connections;
using Spring.Messaging.Nms.Listener;
using Spring.Objects;
using Spring.Objects.Factory.Support;
using Spring.Objects.Factory.Xml;

#endregion
Expand Down Expand Up @@ -137,8 +138,10 @@ public void Listeners()
ITextMessage message3 = (ITextMessage)mocks.CreateMock(typeof(ITextMessage));
mocks.Replay(message3);

//Default naming strategy is to use full type name.
IMessageListener listener3 = GetListener(typeof (SimpleMessageListenerContainer).FullName);
//Default naming strategy is to use full type name + # + number
string className = typeof(SimpleMessageListenerContainer).FullName;
string targetName = className + ObjectDefinitionReaderUtils.GENERATED_OBJECT_NAME_SEPARATOR + "0";
IMessageListener listener3 = GetListener(targetName);
listener3.OnMessage(message3);
Assert.AreSame(message3, testObject3.Message);
mocks.Verify(message3);
Expand Down

0 comments on commit 5e37960

Please sign in to comment.