Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

AMQPNET-6 change parser logic to properly register aliases for name=f…

…oo values in config entries
  • Loading branch information...
commit e44f75b97ea0a7bc92ced17cb6cdeab2d375fcee 1 parent 973786e
@sbohlen sbohlen authored
Showing with 162 additions and 109 deletions.
  1. +1 −1  src/Spring.Messaging.Amqp.Rabbit/Config/AbstractExchangeParser.cs
  2. +58 −0 src/Spring.Messaging.Amqp.Rabbit/Config/AbstractNameAsAliasObjectDefinitionParser.cs
  3. +5 −1 src/Spring.Messaging.Amqp.Rabbit/Config/QueueParser.cs
  4. +1 −0  src/Spring.Messaging.Amqp.Rabbit/Spring.Messaging.Amqp.Rabbit.2010.csproj
  5. +5 −5 test/Spring.Messaging.Amqp.Rabbit.Tests/Config/ExchangeParserIntegrationTests-context.xml
  6. +3 −3 test/Spring.Messaging.Amqp.Rabbit.Tests/Config/ExchangeParserIntegrationTests.cs
  7. +10 −10 test/Spring.Messaging.Amqp.Rabbit.Tests/Config/ExchangeParserTests-context.xml
  8. +6 −6 test/Spring.Messaging.Amqp.Rabbit.Tests/Config/FederatedExchangeParserIntegrationTests-context.xml
  9. +2 −2 test/Spring.Messaging.Amqp.Rabbit.Tests/Config/ListenerContainerParserTests-context.xml
  10. +2 −2 test/Spring.Messaging.Amqp.Rabbit.Tests/Config/ListenerContainerPlaceholderParserTests-context.xml
  11. +58 −54 test/Spring.Messaging.Amqp.Rabbit.Tests/Config/QueueParserPlaceholderTests-context.xml
  12. +0 −14 test/Spring.Messaging.Amqp.Rabbit.Tests/Config/QueueParserTests.cs
  13. +7 −7 test/Spring.Messaging.Amqp.Rabbit.Tests/Config/RabbitNamespaceHandlerTests-context.xml
  14. +2 −2 test/Spring.Messaging.Amqp.Rabbit.Tests/Config/RabbitNamespaceHandlerTests.cs
  15. +1 −1  test/Spring.Messaging.Amqp.Rabbit.Tests/Listener/StopStartIntegrationTests-context.xml
  16. +1 −1  test/Spring.Messaging.Amqp.Rabbit.Tests/Test/XmlObjectFactoryExtensions.cs
View
2  src/Spring.Messaging.Amqp.Rabbit/Config/AbstractExchangeParser.cs
@@ -28,7 +28,7 @@ namespace Spring.Messaging.Amqp.Rabbit.Config
/// </summary>
/// <author>Dave Syer</author>
/// <author>Joe Fitzgerald (.NET)</author>
- public abstract class AbstractExchangeParser : AbstractSingleObjectDefinitionParser
+ public abstract class AbstractExchangeParser : AbstractNameAsAliasObjectDefinitionParser
{
private static readonly string ARGUMENTS_ELEMENT = "exchange-arguments";
View
58 src/Spring.Messaging.Amqp.Rabbit/Config/AbstractNameAsAliasObjectDefinitionParser.cs
@@ -0,0 +1,58 @@
+using System.Xml;
+using Spring.Objects.Factory;
+using Spring.Objects.Factory.Config;
+using Spring.Objects.Factory.Support;
+using Spring.Objects.Factory.Xml;
+using Spring.Util;
+
+namespace Spring.Messaging.Amqp.Rabbit.Config
+{
+ public class AbstractNameAsAliasObjectDefinitionParser : AbstractSingleObjectDefinitionParser
+ {
+ public override IObjectDefinition ParseElement(XmlElement element, ParserContext parserContext)
+ {
+ AbstractObjectDefinition definition = this.ParseInternal(element, parserContext);
+
+ if (!parserContext.IsNested)
+ {
+ string id = null;
+ try
+ {
+ id = this.ResolveId(element, definition, parserContext);
+ if (!StringUtils.HasText(id))
+ {
+ parserContext.ReaderContext.ReportException(element, "null",
+ "Id is required for element '" + element.LocalName + "' when used as a top-level tag", null);
+ }
+
+ string[] name = new string[0];
+
+ if (NamespaceUtils.IsAttributeDefined(element, "name"))
+ {
+ name = new[] { GetAttributeValue(element, "name") };
+ }
+
+ ObjectDefinitionHolder holder;
+
+ if (name.Length == 0)
+ {
+ holder = new ObjectDefinitionHolder(definition, id);
+ }
+ else
+ {
+ holder = new ObjectDefinitionHolder(definition, id, name);
+ }
+
+
+ this.RegisterObjectDefinition(holder, parserContext.Registry);
+ }
+ catch (ObjectDefinitionStoreException ex)
+ {
+ parserContext.ReaderContext.ReportException(element, id, ex.Message);
+ return null;
+ }
+ }
+ return definition;
+ }
+ }
+}
View
6 src/Spring.Messaging.Amqp.Rabbit/Config/QueueParser.cs
@@ -15,11 +15,15 @@
#region Using Directives
using System;
+using System.Collections.Generic;
using System.Xml;
using Spring.Messaging.Amqp.Core;
using Spring.Messaging.Amqp.Rabbit.Support;
+using Spring.Objects.Factory;
+using Spring.Objects.Factory.Config;
using Spring.Objects.Factory.Support;
using Spring.Objects.Factory.Xml;
+using Spring.Util;
#endregion
namespace Spring.Messaging.Amqp.Rabbit.Config
@@ -29,7 +33,7 @@ namespace Spring.Messaging.Amqp.Rabbit.Config
/// </summary>
/// <author>Dave Syer</author>
/// <author>Joe Fitzgerald (.NET)</author>
- public class QueueParser : AbstractSingleObjectDefinitionParser
+ public class QueueParser : AbstractNameAsAliasObjectDefinitionParser
{
private static readonly string ARGUMENTS = "queue-arguments"; // element OR attribute
View
1  src/Spring.Messaging.Amqp.Rabbit/Spring.Messaging.Amqp.Rabbit.2010.csproj
@@ -99,6 +99,7 @@
<Compile Include="Config\FederatedExchangeParser.cs" />
<Compile Include="Config\HeadersExchangeParser.cs" />
<Compile Include="Config\ListenerContainerParser.cs" />
+ <Compile Include="Config\AbstractNameAsAliasObjectDefinitionParser.cs" />
<Compile Include="Config\ObjectDefinitionParserHelper.cs" />
<Compile Include="Config\NamespaceUtils.cs" />
<Compile Include="Config\QueueArgumentsParser.cs" />
View
10 test/Spring.Messaging.Amqp.Rabbit.Tests/Config/ExchangeParserIntegrationTests-context.xml
@@ -2,31 +2,31 @@
<objects xmlns="http://www.springframework.net" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:rabbit="http://www.springframework.net/schema/rabbit">
- <rabbit:direct-exchange id="directTest" name="directTest" xmlns="http://www.springframework.net/schema/rabbit">
+ <rabbit:direct-exchange name="directTest" xmlns="http://www.springframework.net/schema/rabbit">
<bindings>
<binding queue="bucket" />
</bindings>
</rabbit:direct-exchange>
- <rabbit:topic-exchange id="topicTest" name="topicTest" xmlns="http://www.springframework.net/schema/rabbit">
+ <rabbit:topic-exchange name="topicTest" xmlns="http://www.springframework.net/schema/rabbit">
<bindings>
<binding queue="bucket" pattern="bucket.#" />
</bindings>
</rabbit:topic-exchange>
- <rabbit:fanout-exchange id="fanoutTest" name="fanoutTest" xmlns="http://www.springframework.net/schema/rabbit">
+ <rabbit:fanout-exchange name="fanoutTest" xmlns="http://www.springframework.net/schema/rabbit">
<bindings>
<binding queue="bucket" />
</bindings>
</rabbit:fanout-exchange>
- <rabbit:headers-exchange id="headersTest" name="headersTest" xmlns="http://www.springframework.net/schema/rabbit">
+ <rabbit:headers-exchange name="headersTest" xmlns="http://www.springframework.net/schema/rabbit">
<bindings>
<binding queue="bucket" key="type" value="bucket" />
</bindings>
</rabbit:headers-exchange>
- <rabbit:queue id="bucket" name="bucket" />
+ <rabbit:queue name="bucket" />
<rabbit:admin id="admin-test" connection-factory="connectionFactory" auto-startup="true" />
View
6 test/Spring.Messaging.Amqp.Rabbit.Tests/Config/ExchangeParserIntegrationTests.cs
@@ -104,9 +104,9 @@ public void FixtureSetUp()
public void FixtureTearDown()
{
var admin = this.applicationContext.GetObject<RabbitAdmin>();
- var bindings = this.applicationContext.GetObjectsOfType<Binding>();
- var exchanges = this.applicationContext.GetObjectsOfType<IExchange>();
- var queues = this.applicationContext.GetObjectsOfType<Queue>();
+ var bindings = this.applicationContext.GetObjects<Binding>();
+ var exchanges = this.applicationContext.GetObjects<IExchange>();
+ var queues = this.applicationContext.GetObjects<Queue>();
foreach (DictionaryEntry item in bindings)
{
View
20 test/Spring.Messaging.Amqp.Rabbit.Tests/Config/ExchangeParserTests-context.xml
@@ -2,43 +2,43 @@
<objects xmlns="http://www.springframework.net" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:rabbit="http://www.springframework.net/schema/rabbit" xmlns:objects="http://www.springframework.net">
- <rabbit:direct-exchange id="direct" name="direct" />
+ <rabbit:direct-exchange name="direct" />
<rabbit:direct-exchange id="alias" name="direct-alias" />
- <rabbit:direct-exchange id="direct-override" name="direct-override" auto-delete="true" durable="false" />
+ <rabbit:direct-exchange name="direct-override" auto-delete="true" durable="false" />
- <direct-exchange id="direct-arguments" name="direct-arguments" xmlns="http://www.springframework.net/schema/rabbit">
+ <direct-exchange name="direct-arguments" xmlns="http://www.springframework.net/schema/rabbit">
<exchange-arguments>
<objects:entry key="foo" value="bar" />
</exchange-arguments>
</direct-exchange>
- <rabbit:topic-exchange id="topic" name="topic" />
+ <rabbit:topic-exchange name="topic" />
- <rabbit:fanout-exchange id="fanout" name="fanout" />
+ <rabbit:fanout-exchange name="fanout" />
- <rabbit:headers-exchange id="headers" name="headers" xmlns="http://www.springframework.net/schema/rabbit" />
+ <rabbit:headers-exchange name="headers" xmlns="http://www.springframework.net/schema/rabbit" />
- <rabbit:federated-exchange id="fedDirect" name="fedDirect" backing-type="direct" upstream-set="upstream-set1">
+ <rabbit:federated-exchange name="fedDirect" backing-type="direct" upstream-set="upstream-set1">
<rabbit:direct-bindings>
<rabbit:binding key="x" queue="dirQ" />
</rabbit:direct-bindings>
</rabbit:federated-exchange>
- <rabbit:federated-exchange id="fedTopic" name="fedTopic" backing-type="topic" upstream-set="upstream-set2">
+ <rabbit:federated-exchange name="fedTopic" backing-type="topic" upstream-set="upstream-set2">
<rabbit:topic-bindings>
<rabbit:binding pattern="xx.*" queue="topic" />
</rabbit:topic-bindings>
</rabbit:federated-exchange>
- <rabbit:federated-exchange id="fedFanout" name="fedFanout" backing-type="fanout" upstream-set="upstream-set3">
+ <rabbit:federated-exchange name="fedFanout" backing-type="fanout" upstream-set="upstream-set3">
<rabbit:fanout-bindings>
<rabbit:binding queue="fan" />
</rabbit:fanout-bindings>
</rabbit:federated-exchange>
- <rabbit:federated-exchange id="fedHeaders" name="fedHeaders" backing-type="headers" upstream-set="upstream-set4">
+ <rabbit:federated-exchange name="fedHeaders" backing-type="headers" upstream-set="upstream-set4">
<rabbit:headers-bindings>
<rabbit:binding key="head" value="head" queue="head" />
</rabbit:headers-bindings>
View
12 ...ng.Messaging.Amqp.Rabbit.Tests/Config/FederatedExchangeParserIntegrationTests-context.xml
@@ -2,37 +2,37 @@
<objects xmlns="http://www.springframework.net" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:rabbit="http://www.springframework.net/schema/rabbit" xmlns:objects="http://www.springframework.net">
- <federated-exchange id="fedDirectTest" name="fedDirectTest" backing-type="direct" upstream-set="upstream-set" xmlns="http://www.springframework.net/schema/rabbit">
+ <federated-exchange name="fedDirectTest" backing-type="direct" upstream-set="upstream-set" xmlns="http://www.springframework.net/schema/rabbit">
<direct-bindings>
<binding queue="bucket" />
</direct-bindings>
</federated-exchange>
- <federated-exchange id="fedTopicTest" name="fedTopicTest" backing-type="topic" upstream-set="upstream-set" xmlns="http://www.springframework.net/schema/rabbit">
+ <federated-exchange name="fedTopicTest" backing-type="topic" upstream-set="upstream-set" xmlns="http://www.springframework.net/schema/rabbit">
<topic-bindings>
<binding queue="bucket" pattern="bucket.#" />
</topic-bindings>
</federated-exchange>
- <federated-exchange id="fedFanoutTest" name="fedFanoutTest" backing-type="fanout" upstream-set="upstream-set" xmlns="http://www.springframework.net/schema/rabbit">
+ <federated-exchange name="fedFanoutTest" backing-type="fanout" upstream-set="upstream-set" xmlns="http://www.springframework.net/schema/rabbit">
<fanout-bindings>
<binding queue="bucket" />
</fanout-bindings>
</federated-exchange>
- <federated-exchange id="fedHeadersTest" name="fedHeadersTest" backing-type="headers" upstream-set="upstream-set" xmlns="http://www.springframework.net/schema/rabbit">
+ <federated-exchange name="fedHeadersTest" backing-type="headers" upstream-set="upstream-set" xmlns="http://www.springframework.net/schema/rabbit">
<headers-bindings>
<binding queue="bucket" key="type" value="bucket" />
</headers-bindings>
</federated-exchange>
- <fanout-exchange id="fanoutTest" name="fanoutTest" xmlns="http://www.springframework.net/schema/rabbit">
+ <fanout-exchange name="fanoutTest" xmlns="http://www.springframework.net/schema/rabbit">
<bindings>
<binding queue="bucket" />
</bindings>
</fanout-exchange>
- <queue id="bucket" name="bucket" xmlns="http://www.springframework.net/schema/rabbit" />
+ <queue name="bucket" xmlns="http://www.springframework.net/schema/rabbit" />
<admin id="admin" connection-factory="connectionFactory" auto-startup="true" xmlns="http://www.springframework.net/schema/rabbit" />
View
4 test/Spring.Messaging.Amqp.Rabbit.Tests/Config/ListenerContainerParserTests-context.xml
@@ -2,9 +2,9 @@
<objects xmlns="http://www.springframework.net" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:rabbit="http://www.springframework.net/schema/rabbit">
- <rabbit:queue id="foo" name="foo" />
+ <rabbit:queue name="foo" />
- <rabbit:queue id="bar" name="bar" />
+ <rabbit:queue name="bar" />
<rabbit:listener-container id="container1" connection-factory="connectionFactory" acknowledge="manual" concurrency="5">
<rabbit:listener id="testListener" queue-names="foo, bar" ref="testObject" method="Handle" /> <!-- vvvvvvvv - expression -->
View
4 ...ng.Messaging.Amqp.Rabbit.Tests/Config/ListenerContainerPlaceholderParserTests-context.xml
@@ -12,9 +12,9 @@
</property>
</object>
- <rabbit:queue id="foo" name="foo" />
+ <rabbit:queue name="foo" />
- <rabbit:queue id="bar" name="bar" />
+ <rabbit:queue name="bar" />
<rabbit:listener-container id="container1" connection-factory="connectionFactory" acknowledge="manual" concurrency="${five}" transaction-size="${one}" auto-startup="${false}">
<rabbit:listener id="testListener" queue-names="foo, bar" ref="testObject" method="Handle" />
View
112 test/Spring.Messaging.Amqp.Rabbit.Tests/Config/QueueParserPlaceholderTests-context.xml
@@ -2,61 +2,65 @@
<objects xmlns="http://www.springframework.net" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:rabbit="http://www.springframework.net/schema/rabbit">
- <object type="Spring.Objects.Factory.Config.PropertyPlaceholderConfigurer, Spring.Core">
- <property name="properties">
- <name-values>
- <add key="foo" value="foo" />
- <add key="true" value="true" />
- <add key="bar" value="bar" />
- <add key="ttl" value="100" />
- <add key="ha" value="all" />
- </name-values>
- </property>
- </object>
-
- <object id="placeholder-sanity-check" type="Spring.Messaging.Amqp.Rabbit.Tests.Config.PlaceholderSanityCheckTestObject, Spring.Messaging.Amqp.Rabbit.Tests">
- <property name="Name">
- <value>${foo}</value>
- </property>
- <property name="Arguments">
- <dictionary key-type="System.String" value-type="System.Object">
- <entry key="foo" value="${foo}" />
- </dictionary>
- </property>
- </object>
-
- <rabbit:queue id="foo" name="${foo}" />
-
- <rabbit:queue id="override" name="override" durable="${true}" auto-delete="${true}" exclusive="${true}" />
-
- <rabbit:queue id="alias" name="spam" />
-
- <rabbit:queue id="overrideAlias" name="bar" durable="true" auto-delete="true" exclusive="true" />
-
- <rabbit:queue id="anonymous" />
-
- <rabbit:queue id="arguments" name="arguments">
- <rabbit:queue-arguments>
- <entry key="foo" value="${bar}" />
- <entry key="x-message-ttl">
- <value type="System.Int64">${ttl}</value>
- </entry>
- <entry key="x-ha-policy" value="${ha}" />
- </rabbit:queue-arguments>
- </rabbit:queue>
-
- <rabbit:queue id="anonymousArguments">
- <rabbit:queue-arguments>
- <entry key="foo" value="spam" />
- </rabbit:queue-arguments>
- </rabbit:queue>
-
- <rabbit:queue id="anonymousOverride" durable="false" auto-delete="true" exclusive="true" />
-
- <rabbit:queue-arguments id="topLevelArgs">
- <entry key="baz" value="qux" />
+ <object type="Spring.Objects.Factory.Config.PropertyPlaceholderConfigurer, Spring.Core">
+ <property name="properties">
+ <name-values>
+ <add key="foo" value="foo" />
+ <add key="true" value="true" />
+ <add key="bar" value="bar" />
+ <add key="ttl" value="100" />
+ <add key="ha" value="all" />
+ </name-values>
+ </property>
+ </object>
+
+ <object id="placeholder-sanity-check" type="Spring.Messaging.Amqp.Rabbit.Tests.Config.PlaceholderSanityCheckTestObject, Spring.Messaging.Amqp.Rabbit.Tests">
+ <property name="Name">
+ <value>${foo}</value>
+ </property>
+ <property name="Arguments">
+ <dictionary key-type="System.String" value-type="System.Object">
+ <entry key="foo" value="${foo}" />
+ </dictionary>
+ </property>
+ </object>
+
+ <rabbit:queue id="foo" name="${foo}" />
+
+ <rabbit:queue id="override" name="override" durable="${true}" auto-delete="${true}" exclusive="${true}" />
+
+ <rabbit:queue id="alias" name="spam" />
+
+ <rabbit:queue id="overrideAlias" name="bar" durable="true" auto-delete="true" exclusive="true" />
+
+ <rabbit:queue id="anonymous" />
+
+ <rabbit:queue id="arguments" name="arguments">
+ <rabbit:queue-arguments>
+ <entry key="foo" value="${bar}" />
+ <entry key="x-message-ttl">
+ <value type="System.Int64">${ttl}</value>
+ </entry>
+ <entry key="x-ha-policy" value="${ha}" />
+ </rabbit:queue-arguments>
+ </rabbit:queue>
+
+ <rabbit:queue id="anonymousArguments">
+ <rabbit:queue-arguments>
+ <entry key="foo" value="spam" />
</rabbit:queue-arguments>
+ </rabbit:queue>
+
+ <rabbit:queue id="anonymousOverride" durable="false" auto-delete="true" exclusive="true" />
+
+ <rabbit:queue-arguments id="topLevelArgs">
+ <entry key="baz" value="qux" />
+ </rabbit:queue-arguments>
+
+ <rabbit:queue id="referencedArguments" queue-arguments="topLevelArgs" />
- <rabbit:queue id="referencedArguments" queue-arguments="topLevelArgs" />
+ <rabbit:queue id="explicit-id-but-no-explicit-name" />
+ <rabbit:queue name="explicit-name-but-no-explicit-id" />
+ <rabbit:queue id="explicit-id-and-explicit-name" name="the-queue-name" />
</objects>
View
14 test/Spring.Messaging.Amqp.Rabbit.Tests/Config/QueueParserTests.cs
@@ -150,31 +150,18 @@ public void TestIllegalAnonymousQueue()
}
[Test]
- [Ignore("ignored until resolution of SPRNET-1527")]
public void When_ExplicitIdSetWithoutExplicitName_ObjectRegistrationUsesIdAsObjectDefintionName()
{
Assert.That(objectFactory.ContainsObject("explicit-id-but-no-explicit-name"), Is.True);
}
[Test]
- [Ignore("ignored until resolution of SPRNET-1527")]
- public void When_ExplicitIdSetWithoutExplicitName_IdIsUsedAsQueueName()
- {
- const string objectIdentifier = "explicit-id-but-no-explicit-name";
-
- var queue = objectFactory.GetObject<Queue>(objectIdentifier);
- Assert.That(queue.Name, Is.EqualTo(objectIdentifier));
- }
-
- [Test]
- [Ignore("ignored until resolution of SPRNET-1527")]
public void When_ExplicitNameSetWithoutExplicitId_ObjectRegistrationUsesNameAsObjectDefintionName()
{
Assert.That(objectFactory.ContainsObject("explicit-name-but-no-explicit-id"), Is.True);
}
[Test]
- [Ignore("ignored until resolution of SPRNET-1527")]
public void When_ExplicitNameSetWithoutExplicitId_NameIsUsedAsQueueName()
{
const string objectIdentifier = "explicit-name-but-no-explicit-id";
@@ -184,7 +171,6 @@ public void When_ExplicitNameSetWithoutExplicitId_NameIsUsedAsQueueName()
}
[Test]
- [Ignore("ignored until resolution of SPRNET-1527")]
public void When_ExplicitIdAndExplicitNameSet_ObjectRegistrationUsesIdAsObjectDefintionName_and_NameIsUsedAsQueueName()
{
var queue = objectFactory.GetObject<Queue>("explicit-id-and-explicit-name");
View
14 test/Spring.Messaging.Amqp.Rabbit.Tests/Config/RabbitNamespaceHandlerTests-context.xml
@@ -2,7 +2,7 @@
<objects xmlns="http://www.springframework.net" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:rabbit="http://www.springframework.net/schema/rabbit">
- <direct-exchange id="direct-test" name="direct-test" xmlns="http://www.springframework.net/schema/rabbit">
+ <direct-exchange name="direct-test" xmlns="http://www.springframework.net/schema/rabbit">
<bindings>
<binding queue="foo" key="foo" />
<binding queue="bar" />
@@ -11,7 +11,7 @@
</bindings>
</direct-exchange>
- <topic-exchange id="topic-test" name="topic-test" xmlns="http://www.springframework.net/schema/rabbit">
+ <topic-exchange name="topic-test" xmlns="http://www.springframework.net/schema/rabbit">
<bindings>
<binding queue="foo" pattern="foo.#" />
<binding queue="bar" pattern="bar.#" />
@@ -21,7 +21,7 @@
</bindings>
</topic-exchange>
- <fanout-exchange id="fanout-test" name="fanout-test" xmlns="http://www.springframework.net/schema/rabbit">
+ <fanout-exchange name="fanout-test" xmlns="http://www.springframework.net/schema/rabbit">
<bindings>
<binding queue="foo" />
<binding queue="bar" />
@@ -30,7 +30,7 @@
</bindings>
</fanout-exchange>
- <headers-exchange id="headers-test" name="headers-test" xmlns="http://www.springframework.net/schema/rabbit">
+ <headers-exchange name="headers-test" xmlns="http://www.springframework.net/schema/rabbit">
<bindings>
<binding queue="foo" key="type" value="foo" />
<binding queue="bar" key="type" value="bar" />
@@ -39,11 +39,11 @@
</bindings>
</headers-exchange>
- <rabbit:queue id="foo" name="foo" />
+ <rabbit:queue name="foo" />
- <rabbit:queue id="bar" name="bar" /> <!-- TODO: Fix SPRNET 2.0 To Register Objects by ID _OR_ Name -->
+ <rabbit:queue name="bar" />
- <rabbit:queue id="spam" name="bar" />
+ <rabbit:queue id="spam" name="baz" />
<rabbit:queue id="bucket" />
View
4 test/Spring.Messaging.Amqp.Rabbit.Tests/Config/RabbitNamespaceHandlerTests.cs
@@ -64,7 +64,7 @@ public void TestAliasQueue()
var queue = this.objectFactory.GetObject<Queue>("spam");
Assert.IsNotNull(queue);
Assert.AreNotSame("spam", queue.Name);
- Assert.AreEqual("bar", queue.Name);
+ Assert.AreEqual("baz", queue.Name);
}
/// <summary>The test anonymous queue.</summary>
@@ -91,7 +91,7 @@ public void TestExchanges()
[Test]
public void TestBindings()
{
- var bindings = this.objectFactory.GetObjectsOfType<Binding>();
+ var bindings = this.objectFactory.GetObjects<Binding>();
// 4 for each exchange type
Assert.AreEqual(17, bindings.Count);
View
2  test/Spring.Messaging.Amqp.Rabbit.Tests/Listener/StopStartIntegrationTests-context.xml
@@ -10,7 +10,7 @@
<rabbit:queue id="stop.start.queue" name="stop.start.queue" />
- <rabbit:direct-exchange id="stop.start.exchange" name="stop.start.exchange">
+ <rabbit:direct-exchange name="stop.start.exchange">
<rabbit:bindings>
<rabbit:binding queue="stop.start.queue" key="stop.start.binding" />
</rabbit:bindings>
View
2  test/Spring.Messaging.Amqp.Rabbit.Tests/Test/XmlObjectFactoryExtensions.cs
@@ -54,6 +54,6 @@ public static T GetObject<T>(this IListableObjectFactory factory)
/// <param name="factory">The factory.</param>
/// <typeparam name="T"></typeparam>
/// <returns>The System.Collections.IDictionary.</returns>
- public static IDictionary GetObjectsOfType<T>(this IListableObjectFactory factory) { return factory.GetObjectsOfType(typeof(T)); }
+ public static IDictionary GetObjects<T>(this IListableObjectFactory factory) { return factory.GetObjectsOfType(typeof(T)); }
}
}
Please sign in to comment.
Something went wrong with that request. Please try again.