Permalink
Browse files

revert to java rabbit xsd, fix PropertyConfigurer tests

  • Loading branch information...
1 parent e0ec7cd commit be99ccfdcc53631eca10f4a2e79be420bcd84841 @sbohlen sbohlen committed Dec 29, 2011
View
71 src/Spring.Messaging.Amqp.Rabbit/Config/AbstractExchangeParser.cs
@@ -20,15 +20,17 @@ public abstract class AbstractExchangeParser : AbstractSingleObjectDefinitionPar
{
private static readonly string ARGUMENTS_ELEMENT = "exchange-arguments";
- private static readonly string DURABLE_ATTRIBUTE = "durable";
+ private static readonly string ARGUMENTS_PROPERTY = "Arguments";
- private static readonly string AUTO_DELETE_ATTRIBUTE = "auto-delete";
+ private static readonly string DURABLE_ATTRIBUTE = "durable";
- private static string BINDINGS_ELE = "bindings";
+ private static readonly string AUTO_DELETE_ATTRIBUTE = "auto-delete";
- private static string BINDING_ELE = "binding";
+ private static string BINDINGS_ELE = "bindings";
- protected static readonly string BINDING_QUEUE_ATTR = "queue";
+ private static string BINDING_ELE = "binding";
+
+ protected static readonly string BINDING_QUEUE_ATTR = "queue";
protected override bool ShouldGenerateIdAsFallback
{
@@ -38,45 +40,38 @@ protected override bool ShouldGenerateIdAsFallback
}
}
- protected override void DoParse(XmlElement element, ParserContext parserContext, ObjectDefinitionBuilder builder)
+ protected override void DoParse(XmlElement element, ParserContext parserContext, ObjectDefinitionBuilder builder)
{
- var exchangeName = element.GetAttribute("name");
- builder.AddConstructorArg(new TypedStringValue(exchangeName));
- var bindingsElements = element.GetElementsByTagName(BINDINGS_ELE);
-
- var bindingsElement = (bindingsElements != null && bindingsElements.Count == 1) ? bindingsElements[0] as XmlElement : null;
- if (bindingsElement != null)
- {
- var bindings = bindingsElement.GetElementsByTagName(BINDING_ELE);
- foreach (var binding in bindingsElement)
- {
- var beanDefinition = ParseBinding(exchangeName, binding as XmlElement, parserContext);
- RegisterObjectDefinition(new ObjectDefinitionHolder(beanDefinition, parserContext.ReaderContext.GenerateObjectName(beanDefinition)), parserContext.Registry);
- }
- }
-
- NamespaceUtils.AddConstructorArgBooleanValueIfAttributeDefined(builder, element, DURABLE_ATTRIBUTE, true);
- NamespaceUtils.AddConstructorArgBooleanValueIfAttributeDefined(builder, element, AUTO_DELETE_ATTRIBUTE,false);
+ var exchangeName = element.GetAttribute("name");
+ builder.AddConstructorArg(new TypedStringValue(exchangeName));
+ var bindingsElements = element.GetElementsByTagName(BINDINGS_ELE);
- var argumentsElements = element.GetElementsByTagName(ARGUMENTS_ELEMENT, element.NamespaceURI);
- var argumentsElement = argumentsElements != null && argumentsElements.Count == 1 ? argumentsElements[0] as XmlElement : null;
- if (argumentsElement != null)
+ var bindingsElement = (bindingsElements.Count == 1) ? bindingsElements[0] as XmlElement : null;
+ if (bindingsElement != null)
{
- try
- {
- var parser = new MapEntryElementParser();
-
- var map = parser.ParseArgumentsElement(argumentsElement, parserContext);
- builder.AddConstructorArg(map);
- }
- catch (Exception e)
+ var bindings = bindingsElement.GetElementsByTagName(BINDING_ELE);
+ foreach (var binding in bindingsElement)
{
- throw;
+ var beanDefinition = ParseBinding(exchangeName, binding as XmlElement, parserContext);
+ RegisterObjectDefinition(new ObjectDefinitionHolder(beanDefinition, parserContext.ReaderContext.GenerateObjectName(beanDefinition)), parserContext.Registry);
}
-
- }
+ }
+
+ NamespaceUtils.AddConstructorArgBooleanValueIfAttributeDefined(builder, element, DURABLE_ATTRIBUTE, true);
+ NamespaceUtils.AddConstructorArgBooleanValueIfAttributeDefined(builder, element, AUTO_DELETE_ATTRIBUTE, false);
+
+ var argumentsElements = element.GetElementsByTagName(ARGUMENTS_ELEMENT, element.NamespaceURI);
+ var argumentsElement = argumentsElements.Count == 1 ? argumentsElements[0] as XmlElement : null;
+
+ if (argumentsElement != null)
+ {
+ var parser = new ArgumentEntryElementParser();
+ var map = parser.ParseArgumentsElement(argumentsElement, parserContext);
- }
+ builder.AddPropertyValue(ARGUMENTS_PROPERTY, parser.ConvertToTypedDictionary<string, object>(map));
+ builder.AddConstructorArg(map);
+ }
+ }
protected abstract AbstractObjectDefinition ParseBinding(String exchangeName, XmlElement binding, ParserContext parserContext);
}
View
20 ...qp.Rabbit/Config/MapEntryElementParser.cs → ...bbit/Config/ArgumentEntryElementParser.cs
@@ -1,4 +1,5 @@
using System.Collections;
+using System.Collections.Generic;
using System.Xml;
using Spring.Objects.Factory.Xml;
@@ -11,7 +12,7 @@ namespace Spring.Messaging.Amqp.Rabbit.Config
/// class. Once this is complete (SPRNET-2.0) this class can be eliminated and the parsing responsibility can be returned to the Spring.Core Helper class.
/// </remarks>
/// </summary>
- public class MapEntryElementParser : ObjectsNamespaceParser
+ public class ArgumentEntryElementParser : ObjectsNamespaceParser
{
//TODO: after more of this core functionality is exposed in the Spring.Core ObjectDefintionParserHelper class (in SPRNET-2.0),
// this Rabbit-Argument-specific Dictionary parser can be removed
@@ -21,13 +22,26 @@ public IDictionary ParseArgumentsElement(XmlElement mapEle, ParserContext parser
return ParseDictionaryElement(mapEle, string.Empty, parserContext);
}
+ public Dictionary<TKey, TValue> ConvertToTypedDictionary<TKey, TValue>(IDictionary dictionary)
+ {
+ var result = new Dictionary<TKey, TValue>();
+
+ foreach (DictionaryEntry entry in dictionary)
+ {
+ result.Add((TKey)entry.Key, (TValue)entry.Value);
+ }
+
+ return result;
+ }
+
+
//have to override the SelectNodes method b/c the base class impl. hard-codes the SPRING namespace prefix if none is provided
// (and we need a special-case XPath expression too)
protected override XmlNodeList SelectNodes(XmlElement element, string childElementName)
{
XmlNamespaceManager nsManager = new XmlNamespaceManager(new NameTable());
- nsManager.AddNamespace("rabbit", element.NamespaceURI);
- return element.SelectNodes("descendant::rabbit" + ":" + childElementName, nsManager);
+ nsManager.AddNamespace("objects", "http://www.springframework.net");
+ return element.SelectNodes("objects:" + childElementName, nsManager);
}
}
}
View
23 src/Spring.Messaging.Amqp.Rabbit/Config/QueueParser.cs
@@ -20,6 +20,8 @@ namespace Spring.Messaging.Amqp.Rabbit.Config
public class QueueParser : AbstractSingleObjectDefinitionParser
{
private static readonly string ARGUMENTS_ELEMENT = "queue-arguments";
+
+ private static readonly string ARGUMENTS_PROPERTY = "Arguments";
private static readonly string DURABLE_ATTRIBUTE = "durable";
@@ -78,12 +80,13 @@ protected override void DoParse(XmlElement element, ParserContext parserContext,
var argumentsElement = element.GetElementsByTagName(ARGUMENTS_ELEMENT, element.NamespaceURI);
- if (argumentsElement != null && argumentsElement.Count == 1)
+ if (argumentsElement.Count == 1)
{
- var parser = new MapEntryElementParser();
+ var parser = new ArgumentEntryElementParser();
+ var map = parser.ParseArgumentsElement(argumentsElement[0] as XmlElement, parserContext);
- var map = ConvertToTypedDictionary<string, object>(parser.ParseArgumentsElement(argumentsElement[0] as XmlElement, parserContext));
- builder.AddConstructorArg(map);
+ builder.AddPropertyValue(ARGUMENTS_PROPERTY, map);
+ builder.AddConstructorArg(parser.ConvertToTypedDictionary<string, object>(map));
}
}
@@ -94,17 +97,7 @@ private bool AttributeHasIllegalOverride(XmlElement element, string name, string
return result;
}
- private Dictionary<TKey, TValue> ConvertToTypedDictionary<TKey, TValue>(IDictionary dictionary)
- {
- var result = new Dictionary<TKey, TValue>();
-
- foreach (DictionaryEntry entry in dictionary)
- {
- result.Add((TKey)entry.Key, (TValue)entry.Value);
- }
-
- return result;
- }
+
}
}
View
460 src/Spring.Messaging.Amqp.Rabbit/Config/spring-rabbit.xsd
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema xmlns="http://www.springframework.net/schema/rabbit" xmlns:xsd="http://www.w3.org/2001/XMLSchema"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:vs="http://schemas.microsoft.com/Visual-Studio-Intellisense"
- xmlns:objects="http://www.springframework.net" targetNamespace="http://www.springframework.net/schema/rabbit"
- elementFormDefault="qualified" attributeFormDefault="unqualified"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:vs="http://schemas.microsoft.com/Visual-Studio-Intellisense"
+ xmlns:objects="http://www.springframework.net" targetNamespace="http://www.springframework.net/schema/rabbit"
+ elementFormDefault="qualified" attributeFormDefault="unqualified"
vs:friendlyname="Spring AMQP for .NET Configuration" vs:ishtmlschema="false" vs:iscasesensitive="true" vs:requireattributequotes="true" vs:defaultnamespacequalifier="" vs:defaultnsprefix="">
<xsd:import namespace="http://www.springframework.net"/>
@@ -11,10 +11,10 @@
<xsd:annotation>
<xsd:documentation>
<![CDATA[
- Creates a queue for consumers to retrieve messages. Uses an existing queue
- with the same name if it exists on the broker, or else declares a
- new one. If you want to send a message use an exchange.
- ]]>
+ Creates a queue for consumers to retrieve messages. Uses an existing queue
+ with the same name if it exists on the broker, or else declares a
+ new one. If you want to send a message use an exchange.
+ ]]>
</xsd:documentation>
</xsd:annotation>
<xsd:complexType>
@@ -25,58 +25,58 @@
<xsd:annotation>
<xsd:documentation>
<![CDATA[
- The id of the queue in case it is different than the name. Clients can receive or listen for messages by referring to the
- queue itself, or to its name.
- ]]>
+ The id of the queue in case it is different than the name. Clients can receive or listen for messages by referring to the
+ queue itself, or to its name.
+ ]]>
</xsd:documentation>
</xsd:annotation>
</xsd:attribute>
<xsd:attribute name="name" type="xsd:string">
<xsd:annotation>
<xsd:documentation>
<![CDATA[
- The name of the queue. Clients can receive or listen for messages by referring to the
- queue itself, or to its name.
- ]]>
+ The name of the queue. Clients can receive or listen for messages by referring to the
+ queue itself, or to its name.
+ ]]>
</xsd:documentation>
</xsd:annotation>
</xsd:attribute>
<xsd:attribute name="auto-delete" use="optional" type="xsd:string" default="false">
<xsd:annotation>
<xsd:documentation>
<![CDATA[
- Flag indicating that an queue will be deleted when it is no longer in use, i.e. the connection that declared it is closed. Default is false.
- ]]>
+ Flag indicating that an queue will be deleted when it is no longer in use, i.e. the connection that declared it is closed. Default is false.
+ ]]>
</xsd:documentation>
</xsd:annotation>
</xsd:attribute>
<xsd:attribute name="exclusive" use="optional" type="xsd:string" default="false">
<xsd:annotation>
<xsd:documentation>
<![CDATA[
- Flag indicating that the queue is exclusive to this connection. Default is false.
- ]]>
+ Flag indicating that the queue is exclusive to this connection. Default is false.
+ ]]>
</xsd:documentation>
</xsd:annotation>
</xsd:attribute>
<xsd:attribute name="durable" use="optional" type="xsd:string" default="true">
<xsd:annotation>
<xsd:documentation>
<![CDATA[
- Flag indicating that the queue is durable, meaning that it will survive broker restarts (not that the messages in it will, although they might if they are persistent). Default is true.
- ]]>
+ Flag indicating that the queue is durable, meaning that it will survive broker restarts (not that the messages in it will, although they might if they are persistent). Default is true.
+ ]]>
</xsd:documentation>
</xsd:annotation>
</xsd:attribute>
</xsd:complexType>
</xsd:element>
- <xsd:element name="queue-arguments" type="map">
+ <xsd:element name="queue-arguments" type="mapType">
<xsd:annotation>
<xsd:documentation source="java:java.util.Map">
<![CDATA[
- A Map to pass to the broker when this component is declared.
- ]]>
+ A Map to pass to the broker when this component is declared.
+ ]]>
</xsd:documentation>
</xsd:annotation>
</xsd:element>
@@ -85,13 +85,13 @@
<xsd:annotation>
<xsd:documentation>
<![CDATA[
- Creates a direct exchange for producers to send messages to. Uses an existing exchange
- with the same name if it exists on the broker, or declares a
- new one. A direct exhange routes messages
- to queues that are bound to the exchange when the routing key in the message
- matches that in the binding exactly. You can set up bindings here too, either with
- explicit routing keys, or using the queue name implicitly.
- ]]>
+ Creates a direct exchange for producers to send messages to. Uses an existing exchange
+ with the same name if it exists on the broker, or declares a
+ new one. A direct exhange routes messages
+ to queues that are bound to the exchange when the routing key in the message
+ matches that in the binding exactly. You can set up bindings here too, either with
+ explicit routing keys, or using the queue name implicitly.
+ ]]>
</xsd:documentation>
</xsd:annotation>
<xsd:complexType>
@@ -102,8 +102,8 @@
<xsd:annotation>
<xsd:documentation>
<![CDATA[
- Groups bindings of queues to this exchange.
- ]]>
+ Groups bindings of queues to this exchange.
+ ]]>
</xsd:documentation>
</xsd:annotation>
<xsd:complexType>
@@ -112,9 +112,9 @@
<xsd:annotation>
<xsd:documentation>
<![CDATA[
- Declares a binding of a queue to this exchange either with
- an explicit routing key, or using the queue name implicitly.
- ]]>
+ Declares a binding of a queue to this exchange either with
+ an explicit routing key, or using the queue name implicitly.
+ ]]>
</xsd:documentation>
</xsd:annotation>
</xsd:element>
@@ -131,13 +131,13 @@
<xsd:annotation>
<xsd:documentation>
<![CDATA[
- Creates a topic exchange for producers to send messages to. Uses an existing exchange
- with the same name if it exists on the broker, or declares a
- new one. A topic exhange routes messages
- to queues that are bound to the exchange when the routing key in the message
- matches the routing pattern in the binding of the queue.
- You can set up bindings here too.
- ]]>
+ Creates a topic exchange for producers to send messages to. Uses an existing exchange
+ with the same name if it exists on the broker, or declares a
+ new one. A topic exhange routes messages
+ to queues that are bound to the exchange when the routing key in the message
+ matches the routing pattern in the binding of the queue.
+ You can set up bindings here too.
+ ]]>
</xsd:documentation>
</xsd:annotation>
<xsd:complexType>
@@ -148,8 +148,8 @@
<xsd:annotation>
<xsd:documentation>
<![CDATA[
- Groups bindings of queues to this exchange.
- ]]>
+ Groups bindings of queues to this exchange.
+ ]]>
</xsd:documentation>
</xsd:annotation>
<xsd:complexType>
@@ -158,9 +158,9 @@
<xsd:annotation>
<xsd:documentation>
<![CDATA[
- Declares a binding of a queue to this exchange either with
- a routing pattern, e.g. "uk.weather.*" or "uk.#".
- ]]>
+ Declares a binding of a queue to this exchange either with
+ a routing pattern, e.g. "uk.weather.*" or "uk.#".
+ ]]>
</xsd:documentation>
</xsd:annotation>
</xsd:element>
@@ -177,11 +177,11 @@
<xsd:annotation>
<xsd:documentation>
<![CDATA[
- Creates a fanout exchange for producers to send messages to. Uses an existing exchange
- with the same name if it exists on the broker, or declares a
- new one. A fanout exhange routes messages
- to all queues that are bound to the exchange. You can set up bindings here too.
- ]]>
+ Creates a fanout exchange for producers to send messages to. Uses an existing exchange
+ with the same name if it exists on the broker, or declares a
+ new one. A fanout exhange routes messages
+ to all queues that are bound to the exchange. You can set up bindings here too.
+ ]]>
</xsd:documentation>
</xsd:annotation>
<xsd:complexType>
@@ -192,8 +192,8 @@
<xsd:annotation>
<xsd:documentation>
<![CDATA[
- Groups bindings of queues to this exchange.
- ]]>
+ Groups bindings of queues to this exchange.
+ ]]>
</xsd:documentation>
</xsd:annotation>
<xsd:complexType>
@@ -202,9 +202,9 @@
<xsd:annotation>
<xsd:documentation>
<![CDATA[
- Binds a queue to this exchange. All messages sent to this exchange will be
- placed on this queue by the broker.
- ]]>
+ Binds a queue to this exchange. All messages sent to this exchange will be
+ placed on this queue by the broker.
+ ]]>
</xsd:documentation>
</xsd:annotation>
</xsd:element>
@@ -221,12 +221,12 @@
<xsd:annotation>
<xsd:documentation>
<![CDATA[
- Creates a headers exchange for producers to send messages to. Uses an existing exchange
- with the same name if it exists on the broker, or declares a
- new one. A headers exhange routes messages
- to all queues where a message header matches that specified in the binding of the queue.
- You can set up bindings here too.
- ]]>
+ Creates a headers exchange for producers to send messages to. Uses an existing exchange
+ with the same name if it exists on the broker, or declares a
+ new one. A headers exhange routes messages
+ to all queues where a message header matches that specified in the binding of the queue.
+ You can set up bindings here too.
+ ]]>
</xsd:documentation>
</xsd:annotation>
<xsd:complexType>
@@ -237,8 +237,8 @@
<xsd:annotation>
<xsd:documentation>
<![CDATA[
- Groups bindings of queues to this exchange.
- ]]>
+ Groups bindings of queues to this exchange.
+ ]]>
</xsd:documentation>
</xsd:annotation>
<xsd:complexType>
@@ -247,10 +247,10 @@
<xsd:annotation>
<xsd:documentation>
<![CDATA[
- Binds a queue to this exchange. Messages sent to this exchange will be
- placed on this queue by the broker if they contain a header that matches
- this binding (key-value pair).
- ]]>
+ Binds a queue to this exchange. Messages sent to this exchange will be
+ placed on this queue by the broker if they contain a header that matches
+ this binding (key-value pair).
+ ]]>
</xsd:documentation>
</xsd:annotation>
</xsd:element>
@@ -271,47 +271,47 @@
<xsd:annotation>
<xsd:documentation>
<![CDATA[
- The id of the exchange bean definition in case it is different than the name.
- ]]>
+ The id of the exchange bean definition in case it is different than the name.
+ ]]>
</xsd:documentation>
</xsd:annotation>
</xsd:attribute>
<xsd:attribute name="name" use="required" type="xsd:string">
<xsd:annotation>
<xsd:documentation>
<![CDATA[
- The name of the exchange. Clients can send a message by referring to the
- exchange itself, or to its name.
- ]]>
+ The name of the exchange. Clients can send a message by referring to the
+ exchange itself, or to its name.
+ ]]>
</xsd:documentation>
</xsd:annotation>
</xsd:attribute>
<xsd:attribute name="auto-delete" use="optional" type="xsd:string" default="false">
<xsd:annotation>
<xsd:documentation>
<![CDATA[
- Flag indicating that an exchange will be deleted when no longer in use, i.e. the connection that declared it is closed. Default is false.
- ]]>
+ Flag indicating that an exchange will be deleted when no longer in use, i.e. the connection that declared it is closed. Default is false.
+ ]]>
</xsd:documentation>
</xsd:annotation>
</xsd:attribute>
<xsd:attribute name="durable" use="optional" type="xsd:string " default="true">
<xsd:annotation>
<xsd:documentation>
<![CDATA[
- Flag indicating that the exchange is durable, i.e. will survive broker restart. Default is true.
- ]]>
+ Flag indicating that the exchange is durable, i.e. will survive broker restart. Default is true.
+ ]]>
</xsd:documentation>
</xsd:annotation>
</xsd:attribute>
</xsd:complexType>
- <xsd:element name="exchange-arguments" type="map">
+ <xsd:element name="exchange-arguments" type="mapType">
<xsd:annotation>
<xsd:documentation source="java:java.util.Map">
<![CDATA[
- A Map to pass to the broker when this component is declared.
- ]]>
+ A Map to pass to the broker when this component is declared.
+ ]]>
</xsd:documentation>
</xsd:annotation>
</xsd:element>
@@ -323,9 +323,9 @@
<xsd:annotation>
<xsd:documentation>
<![CDATA[
- An explicit routing key binding the queue to this exchange.
- If not provided defaults to the queue name.
- ]]>
+ An explicit routing key binding the queue to this exchange.
+ If not provided defaults to the queue name.
+ ]]>
</xsd:documentation>
</xsd:annotation>
</xsd:attribute>
@@ -340,11 +340,11 @@
<xsd:annotation>
<xsd:documentation>
<![CDATA[
- An explicit routing pattern binding the queue to this exchange. In the pattern,
- the symbol # matches one or more words and the symbol * matches any single word.
- Typical bindings might be "uk.#" for all items in the uk, "#.weather" for all
- weather items, or "uk.weather" for all uk weather items.
- ]]>
+ An explicit routing pattern binding the queue to this exchange. In the pattern,
+ the symbol # matches one or more words and the symbol * matches any single word.
+ Typical bindings might be "uk.#" for all items in the uk, "#.weather" for all
+ weather items, or "uk.weather" for all uk weather items.
+ ]]>
</xsd:documentation>
</xsd:annotation>
</xsd:attribute>
@@ -369,8 +369,8 @@
<xsd:annotation>
<xsd:documentation source="java:org.springframework.amqp.core.Queue">
<![CDATA[
- The bean name of the Queue to bind to this exchange.
- ]]>
+ The bean name of the Queue to bind to this exchange.
+ ]]>
</xsd:documentation>
<xsd:appinfo>
<!--<tool:annotation kind="ref">
@@ -381,46 +381,46 @@
</xsd:attribute>
</xsd:complexType>
- <xsd:element name="binding-arguments" type="map">
+ <xsd:element name="binding-arguments" type="mapType">
<xsd:annotation>
<xsd:documentation source="java:java.util.Map">
<![CDATA[
- A Map to pass to the broker when this component is declared.
- ]]>
+ A Map to pass to the broker when this component is declared.
+ ]]>
</xsd:documentation>
</xsd:annotation>
</xsd:element>
- <xsd:complexType name="map">
- <xsd:sequence>
- <xsd:element ref="map"/>
- </xsd:sequence>
+ <xsd:complexType name="mapType">
+ <xsd:complexContent>
+ <xsd:extension base="objects:objectMap">
+ <xsd:attribute name="ref" use="optional">
+ <xsd:annotation>
+ <xsd:documentation>
+ <!-- source="java:java.util.Map" -->
+ <![CDATA[
+ The bean name of the Map to pass to the broker when this component is declared.
+ ]]>
+ </xsd:documentation>
+ <xsd:appinfo>
+ <!--<tool:annotation kind="ref">
+ <tool:expected-type type="java.util.Map" />
+ </tool:annotation>-->
+ </xsd:appinfo>
+ </xsd:annotation>
+ </xsd:attribute>
+ </xsd:extension>
+ </xsd:complexContent>
</xsd:complexType>
- <xsd:element name="map">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element maxOccurs="unbounded" ref="entry"/>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
-
- <xsd:element name="entry">
- <xsd:complexType>
- <xsd:attribute name="key" use="required"/>
- <xsd:attribute name="value"/>
- <xsd:attribute name="value-ref" type="xsd:NCName"/>
- </xsd:complexType>
- </xsd:element>
-
<xsd:element name="listener-container">
<xsd:annotation>
<xsd:documentation>
<![CDATA[
- Each listener child element will be hosted by a container whose configuration
- is determined by this parent element. This variant builds RabbitMQ
- listener containers, operating against a specified ConnectionFactory.
- ]]>
+ Each listener child element will be hosted by a container whose configuration
+ is determined by this parent element. This variant builds RabbitMQ
+ listener containers, operating against a specified ConnectionFactory.
+ ]]>
</xsd:documentation>
<xsd:appinfo>
<!--<tool:annotation>
@@ -436,18 +436,18 @@
<xsd:annotation>
<xsd:documentation>
<![CDATA[
- Optional bean id for the container.
- ]]>
+ Optional bean id for the container.
+ ]]>
</xsd:documentation>
</xsd:annotation>
</xsd:attribute>
<xsd:attribute name="connection-factory" type="xsd:string" default="rabbitConnectionFactory">
<xsd:annotation>
<xsd:documentation>
<![CDATA[
- A reference to the org.springframework.amqp.rabbit.connection.ConnectionFactory.
- Default referenced bean name is "rabbitConnectionFactory".
- ]]>
+ A reference to the org.springframework.amqp.rabbit.connection.ConnectionFactory.
+ Default referenced bean name is "rabbitConnectionFactory".
+ ]]>
</xsd:documentation>
<xsd:appinfo>
<!--<tool:annotation kind="ref">
@@ -460,9 +460,9 @@
<xsd:annotation>
<xsd:documentation>
<![CDATA[
- A reference to a Spring TaskExecutor (or standard JDK 1.5 Executor) for executing
- listener invokers. Default is a SimpleAsyncTaskExecutor, using internally managed threads.
- ]]>
+ A reference to a Spring TaskExecutor (or standard JDK 1.5 Executor) for executing
+ listener invokers. Default is a SimpleAsyncTaskExecutor, using internally managed threads.
+ ]]>
</xsd:documentation>
<xsd:appinfo>
<!--<tool:annotation kind="ref">
@@ -475,10 +475,10 @@
<xsd:annotation>
<xsd:documentation>
<![CDATA[
- A reference to the MessageConverter strategy for converting AMQP Messages to
- listener method arguments for any referenced 'listener' that is a POJO.
- Default is a SimpleMessageConverter.
- ]]>
+ A reference to the MessageConverter strategy for converting AMQP Messages to
+ listener method arguments for any referenced 'listener' that is a POJO.
+ Default is a SimpleMessageConverter.
+ ]]>
</xsd:documentation>
<xsd:appinfo>
<!--<tool:annotation kind="ref">
@@ -491,9 +491,9 @@
<xsd:annotation>
<xsd:documentation>
<![CDATA[
- A reference to an ErrorHandler strategy for handling any uncaught Exceptions
- that may occur during the execution of the MessageListener.
- ]]>
+ A reference to an ErrorHandler strategy for handling any uncaught Exceptions
+ that may occur during the execution of the MessageListener.
+ ]]>
</xsd:documentation>
<xsd:appinfo>
<!--<tool:annotation kind="ref">
@@ -506,8 +506,8 @@
<xsd:annotation>
<xsd:documentation>
<![CDATA[
- The acknowledge mode: "auto", "manual", or "none".
- ]]>
+ The acknowledge mode: "auto", "manual", or "none".
+ ]]>
</xsd:documentation>
</xsd:annotation>
<xsd:simpleType>
@@ -522,8 +522,8 @@
<xsd:annotation>
<xsd:documentation>
<![CDATA[
- A reference to an external PlatformTransactionManager.
- ]]>
+ A reference to an external PlatformTransactionManager.
+ ]]>
</xsd:documentation>
<xsd:appinfo>
<!--<tool:annotation kind="ref">
@@ -536,58 +536,58 @@
<xsd:annotation>
<xsd:documentation>
<![CDATA[
- The number of concurrent consumers to start for each listener.
- ]]>
+ The number of concurrent consumers to start for each listener.
+ ]]>
</xsd:documentation>
</xsd:annotation>
</xsd:attribute>
<xsd:attribute name="prefetch" type="xsd:string">
<xsd:annotation>
<xsd:documentation>
<![CDATA[
- Tells the broker how many messages to send to each consumer in a single request. Often this can be set quite high
- to improve throughput. It should be greater than or equal to the transaction size.
- ]]>
+ Tells the broker how many messages to send to each consumer in a single request. Often this can be set quite high
+ to improve throughput. It should be greater than or equal to the transaction size.
+ ]]>
</xsd:documentation>
</xsd:annotation>
</xsd:attribute>
<xsd:attribute name="transaction-size" type="xsd:string">
<xsd:annotation>
<xsd:documentation>
<![CDATA[
- Tells the container how many messages to process in a single transaction (if the channel is transactional). For
- best results it should be less than or equal to the prefetch count.
- ]]>
+ Tells the container how many messages to process in a single transaction (if the channel is transactional). For
+ best results it should be less than or equal to the prefetch count.
+ ]]>
</xsd:documentation>
</xsd:annotation>
</xsd:attribute>
<xsd:attribute name="phase" type="xsd:string">
<xsd:annotation>
<xsd:documentation>
<![CDATA[
- The lifecycle phase within which this container should start and stop. The lower
- the value the earlier this container will start and the later it will stop. The
- default is Integer.MAX_VALUE meaning the container will start as late as possible
- and stop as soon as possible.
- ]]>
+ The lifecycle phase within which this container should start and stop. The lower
+ the value the earlier this container will start and the later it will stop. The
+ default is Integer.MAX_VALUE meaning the container will start as late as possible
+ and stop as soon as possible.
+ ]]>
</xsd:documentation>
</xsd:annotation>
</xsd:attribute>
<xsd:attribute name="auto-startup" type="xsd:string" default="true">
<xsd:annotation>
<xsd:documentation>
<![CDATA[
- Flag to indicate that the container should start up automatically when the enclosing context is refreshed. Default true.
- ]]>
+ Flag to indicate that the container should start up automatically when the enclosing context is refreshed. Default true.
+ ]]>
</xsd:documentation>
</xsd:annotation>
</xsd:attribute>
<xsd:attribute name="advice-chain" type="xsd:string">
<xsd:annotation>
<xsd:documentation>
<![CDATA[
- Reference to a chain of AOP advice to be applied to the listener.
- ]]>
+ Reference to a chain of AOP advice to be applied to the listener.
+ ]]>
</xsd:documentation>
</xsd:annotation>
</xsd:attribute>
@@ -599,37 +599,37 @@
<xsd:annotation>
<xsd:documentation>
<![CDATA[
- The unique identifier for this listener.
- ]]>
+ The unique identifier for this listener.
+ ]]>
</xsd:documentation>
</xsd:annotation>
</xsd:attribute>
<xsd:attribute name="queue-names" type="xsd:string">
<xsd:annotation>
<xsd:documentation>
<![CDATA[
- The queue names for this listener as a comma-separated list. Either this or queues is required.
- ]]>
+ The queue names for this listener as a comma-separated list. Either this or queues is required.
+ ]]>
</xsd:documentation>
</xsd:annotation>
</xsd:attribute>
<xsd:attribute name="queues" type="xsd:string">
<xsd:annotation>
<xsd:documentation>
<![CDATA[
- The queues (bean references) for this listener as a comma-separated list. Either this or queue-names is required.
- ]]>
+ The queues (bean references) for this listener as a comma-separated list. Either this or queue-names is required.
+ ]]>
</xsd:documentation>
</xsd:annotation>
</xsd:attribute>
<xsd:attribute name="ref" type="xsd:string" use="required">
<xsd:annotation>
<xsd:documentation>
<![CDATA[
- The bean name of the listener object, implementing
- the MessageListener/ChannelAwareMessageListener interface
- or defining the specified listener method. Required.
- ]]>
+ The bean name of the listener object, implementing
+ the MessageListener/ChannelAwareMessageListener interface
+ or defining the specified listener method. Required.
+ ]]>
</xsd:documentation>
<xsd:appinfo>
<!--<tool:annotation kind="ref" />-->
@@ -640,36 +640,36 @@
<xsd:annotation>
<xsd:documentation>
<![CDATA[
- The name of the listener method to invoke. If not specified,
- the target bean is supposed to implement the MessageListener
- or ChannelAwareMessageListener interface.
- ]]>
+ The name of the listener method to invoke. If not specified,
+ the target bean is supposed to implement the MessageListener
+ or ChannelAwareMessageListener interface.
+ ]]>
</xsd:documentation>
</xsd:annotation>
</xsd:attribute>
<xsd:attribute name="response-exchange" type="xsd:string">
<xsd:annotation>
<xsd:documentation>
<![CDATA[
- The name of the default response Exchange to send response messages to.
- This will be applied in case of a request message that does not carry
- a "replyTo" property. Note: This only applies to a listener method with
- a return value, for which each result object will be converted into a
- response message.
- ]]>
+ The name of the default response Exchange to send response messages to.
+ This will be applied in case of a request message that does not carry
+ a "replyTo" property. Note: This only applies to a listener method with
+ a return value, for which each result object will be converted into a
+ response message.
+ ]]>
</xsd:documentation>
</xsd:annotation>
</xsd:attribute>
<xsd:attribute name="response-routing-key" type="xsd:string">
<xsd:annotation>
<xsd:documentation>
<![CDATA[
- The routing key to send along with a response message.
- This will be applied in case of a request message that does not carry
- a "replyTo" property. Note: This only applies to a listener method with
- a return value, for which each result object will be converted into a
- response message.
- ]]>
+ The routing key to send along with a response message.
+ This will be applied in case of a request message that does not carry
+ a "replyTo" property. Note: This only applies to a listener method with
+ a return value, for which each result object will be converted into a
+ response message.
+ ]]>
</xsd:documentation>
</xsd:annotation>
</xsd:attribute>
@@ -679,28 +679,28 @@
<xsd:annotation>
<xsd:documentation>
<![CDATA[
- Creates a rabbit admin (org.springframework.amqp.rabbit.core.RabbitAdmin)
- for customers to manage exchanges, queues and bindings.
- ]]>
+ Creates a rabbit admin (org.springframework.amqp.rabbit.core.RabbitAdmin)
+ for customers to manage exchanges, queues and bindings.
+ ]]>
</xsd:documentation>
</xsd:annotation>
<xsd:complexType>
<xsd:attribute name="id" type="xsd:string">
<xsd:annotation>
<xsd:documentation>
<![CDATA[
- Unique name for this rabbit admin used as a bean definition identifier.
- ]]>
+ Unique name for this rabbit admin used as a bean definition identifier.
+ ]]>
</xsd:documentation>
</xsd:annotation>
</xsd:attribute>
<xsd:attribute name="connection-factory" type="xsd:string">
<xsd:annotation>
<xsd:documentation>
<![CDATA[
- Reference to rabbit connection factory. Either 'connection-factory' or
- 'template' attribute can be set.
- ]]>
+ Reference to rabbit connection factory. Either 'connection-factory' or
+ 'template' attribute can be set.
+ ]]>
</xsd:documentation>
<xsd:appinfo>
<!--<tool:annotation kind="ref">
@@ -713,8 +713,8 @@
<xsd:annotation>
<xsd:documentation>
<![CDATA[
- Specifies if the queues, exchanges and bindings in the context should be automatically declared (lazily on first connection to the broker). Default value is 'true'.
- ]]>
+ Specifies if the queues, exchanges and bindings in the context should be automatically declared (lazily on first connection to the broker). Default value is 'true'.
+ ]]>
</xsd:documentation>
</xsd:annotation>
</xsd:attribute>
@@ -725,81 +725,81 @@
<xsd:annotation>
<xsd:documentation>
<![CDATA[
- Creates a rabbit template (org.springframework.amqp.rabbit.core.RabbitTemplate)
- for convenient access to the broker.
- ]]>
+ Creates a rabbit template (org.springframework.amqp.rabbit.core.RabbitTemplate)
+ for convenient access to the broker.
+ ]]>
</xsd:documentation>
</xsd:annotation>
<xsd:complexType>
<xsd:attribute name="id" type="xsd:string" use="optional">
<xsd:annotation>
<xsd:documentation>
<![CDATA[
- Unique name for this rabbit template used as a bean definition identifier.
- ]]>
+ Unique name for this rabbit template used as a bean definition identifier.
+ ]]>
</xsd:documentation>
</xsd:annotation>
</xsd:attribute>
<xsd:attribute name="routing-key" type="xsd:string" use="optional">
<xsd:annotation>
<xsd:documentation>
<![CDATA[
- Default routing key for sending messages. Default is empty.
- ]]>
+ Default routing key for sending messages. Default is empty.
+ ]]>
</xsd:documentation>
</xsd:annotation>
</xsd:attribute>
<xsd:attribute name="exchange" type="xsd:string" use="optional">
<xsd:annotation>
<xsd:documentation>
<![CDATA[
- Default exchange for sending messages. Default is empty (the default exchange).
- ]]>
+ Default exchange for sending messages. Default is empty (the default exchange).
+ ]]>
</xsd:documentation>
</xsd:annotation>
</xsd:attribute>
<xsd:attribute name="queue" type="xsd:string" use="optional">
<xsd:annotation>
<xsd:documentation>
<![CDATA[
- Default queue for receiving messages. Default is empty (non-existent queue).
- ]]>
+ Default queue for receiving messages. Default is empty (non-existent queue).
+ ]]>
</xsd:documentation>
</xsd:annotation>
</xsd:attribute>
<xsd:attribute name="reply-timeout" type="xsd:string" use="optional">
<xsd:annotation>
<xsd:documentation>
<![CDATA[
- Timeout for send and receive in milliseconds. Default is 5000 (5 seconds).
- ]]>
+ Timeout for send and receive in milliseconds. Default is 5000 (5 seconds).
+ ]]>
</xsd:documentation>
</xsd:annotation>
</xsd:attribute>
<xsd:attribute name="channel-transacted" type="xsd:string" use="optional">
<xsd:annotation>
<xsd:documentation>
<![CDATA[
- Flag to indicate that the channel should be used transactionally. Default is false.
- ]]>
+ Flag to indicate that the channel should be used transactionally. Default is false.
+ ]]>
</xsd:documentation>
</xsd:annotation>
</xsd:attribute>
<xsd:attribute name="encoding" type="xsd:string" use="optional">
<xsd:annotation>
<xsd:documentation>
<![CDATA[
- Encoding to use for packing and unpacking MessagePoperties of type String. Default is UTF-8.
- ]]>
+ Encoding to use for packing and unpacking MessagePoperties of type String. Default is UTF-8.
+ ]]>
</xsd:documentation>
</xsd:annotation>
</xsd:attribute>
<xsd:attribute name="message-converter" type="xsd:string" use="optional">
<xsd:annotation>
<xsd:documentation>
<![CDATA[
- MessageConverter to convert between raw bytes and Java objects in the *convert* methods. Defaults to a simple implementation that handles Strings, byte arrays and Serializable.
- ]]>
+ MessageConverter to convert between raw bytes and Java objects in the *convert* methods. Defaults to a simple implementation that handles Strings, byte arrays and Serializable.
+ ]]>
</xsd:documentation>
<xsd:appinfo>
<!--<tool:annotation kind="ref">
@@ -812,8 +812,8 @@
<xsd:annotation>
<xsd:documentation>
<![CDATA[
- Reference to rabbit connection factory.
- ]]>
+ Reference to rabbit connection factory.
+ ]]>
</xsd:documentation>
<xsd:appinfo>
<!--<tool:annotation kind="ref">
@@ -829,81 +829,81 @@
<xsd:annotation>
<xsd:documentation>
<![CDATA[
- Creates a rabbit CachingConnectionFactory with sensible defaults.
- ]]>
+ Creates a rabbit CachingConnectionFactory with sensible defaults.
+ ]]>
</xsd:documentation>
</xsd:annotation>
<xsd:complexType>
<xsd:attribute name="id" type="xsd:string" use="optional">
<xsd:annotation>
<xsd:documentation>
<![CDATA[
- Unique name for this rabbit connection factory used as a bean definition identifier.
- ]]>
+ Unique name for this rabbit connection factory used as a bean definition identifier.
+ ]]>
</xsd:documentation>
</xsd:annotation>
</xsd:attribute>
<xsd:attribute name="host" type="xsd:string" use="optional">
<xsd:annotation>
<xsd:documentation>
<![CDATA[
- Hostname to connect to broker. Default is "localhost".
- ]]>
+ Hostname to connect to broker. Default is "localhost".
+ ]]>
</xsd:documentation>
</xsd:annotation>
</xsd:attribute>
<xsd:attribute name="port" type="xsd:string" use="optional">
<xsd:annotation>
<xsd:documentation>
<![CDATA[
- Port number to connect to broker. Default is 5672.
- ]]>
+ Port number to connect to broker. Default is 5672.
+ ]]>
</xsd:documentation>
</xsd:annotation>
</xsd:attribute>
<xsd:attribute name="username" type="xsd:string" use="optional">
<xsd:annotation>
<xsd:documentation>
<![CDATA[
- Username to connect to broker. Default is "guest".
- ]]>
+ Username to connect to broker. Default is "guest".
+ ]]>
</xsd:documentation>
</xsd:annotation>
</xsd:attribute>
<xsd:attribute name="password" type="xsd:string" use="optional">
<xsd:annotation>
<xsd:documentation>
<![CDATA[
- Password to connect to broker. Default is "guest".
- ]]>
+ Password to connect to broker. Default is "guest".
+ ]]>
</xsd:documentation>
</xsd:annotation>
</xsd:attribute>
<xsd:attribute name="virtual-host" type="xsd:string" use="optional">
<xsd:annotation>
<xsd:documentation>
<![CDATA[
- Virtual host name to connect to broker. Default is "/". Virtual hosts are logical partitions of the broker with separate queues, excchanges, users, etc.
- ]]>
+ Virtual host name to connect to broker. Default is "/". Virtual hosts are logical partitions of the broker with separate queues, excchanges, users, etc.
+ ]]>
</xsd:documentation>
</xsd:annotation>
</xsd:attribute>
<xsd:attribute name="channel-cache-size" type="xsd:string" use="optional">
<xsd:annotation>
<xsd:documentation>
<![CDATA[
- Cache size for channels. More channels can be used by clients, but in excess of this number they will not be cached.
- ]]>
+ Cache size for channels. More channels can be used by clients, but in excess of this number they will not be cached.
+ ]]>
</xsd:documentation>
</xsd:annotation>
</xsd:attribute>
<xsd:attribute name="connection-factory" type="xsd:string" use="optional">
<xsd:annotation>
<xsd:documentation>
<![CDATA[
- Reference to native rabbit connection factory, where you can specify native features like heartbeat. The other properties (host, port) etc. on this element
- override the ones on the native connection factory (which is used as a parent bean definition).
- ]]>
+ Reference to native rabbit connection factory, where you can specify native features like heartbeat. The other properties (host, port) etc. on this element
+ override the ones on the native connection factory (which is used as a parent bean definition).
+ ]]>
</xsd:documentation>
<xsd:appinfo>
<!--<tool:annotation kind="ref">
@@ -915,4 +915,6 @@
</xsd:complexType>
</xsd:element>
+
+
</xsd:schema>
View
2 src/Spring.Messaging.Amqp.Rabbit/Spring.Messaging.Amqp.Rabbit.2010.csproj
@@ -99,7 +99,7 @@
<Compile Include="Config\FanoutExchangeParser.cs" />
<Compile Include="Config\HeadersExchangeParser.cs" />
<Compile Include="Config\ListenerContainerParser.cs" />
- <Compile Include="Config\MapEntryElementParser.cs" />
+ <Compile Include="Config\ArgumentEntryElementParser.cs" />
<Compile Include="Config\NamespaceUtils.cs" />
<Compile Include="Config\QueueParser.cs" />
<Compile Include="Config\RabbitNamespaceHandler.cs" />
View
9 test/Spring.Messaging.Amqp.Rabbit.Tests/Config/ExchangeParserTests-context.xml
@@ -1,7 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<objects xmlns="http://www.springframework.net"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns:rabbit="http://www.springframework.net/schema/rabbit">
+ xmlns:rabbit="http://www.springframework.net/schema/rabbit"
+ xmlns:objects="http://www.springframework.net">
<rabbit:direct-exchange id="direct" name="direct" />
@@ -11,10 +12,8 @@
<direct-exchange id="direct-arguments" name="direct-arguments" xmlns="http://www.springframework.net/schema/rabbit">
<exchange-arguments>
- <map>
- <entry key="foo" value="bar" />
- <entry key="bar" value="baz" />
- </map>
+ <objects:entry key="foo" value="bar" />
+ <objects:entry key="bar" value="baz" />
</exchange-arguments>
</direct-exchange>
View
70 test/Spring.Messaging.Amqp.Rabbit.Tests/Config/QueueParserPlaceholderTests-context.xml
@@ -1,44 +1,48 @@
<?xml version="1.0" encoding="UTF-8"?>
-<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">
- <dictionary>
- <entry key="foo" value="foo" />
- <entry key="true" value="true" />
- <entry key="bar" value="bar" />
- </dictionary>
- </property>
- </object>
+<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 name="${foo}" />
+ <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="baz" value="baz" />
+ </name-values>
+ </property>
+ </object>
- <rabbit:queue id="override" name="override" durable="${true}" auto-delete="${true}" exclusive="${true}" />
+ <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>
+ </object>
- <rabbit:queue id="alias" name="spam" />
+ <rabbit:queue id="foo" name="${foo}" />
- <rabbit:queue id="overrideAlias" name="bar" durable="true" auto-delete="true" exclusive="true" />
+ <rabbit:queue id="override" name="override" durable="${true}" auto-delete="${true}" exclusive="${true}" />
- <rabbit:queue id="anonymous" />
+ <rabbit:queue id="alias" name="spam" />
- <rabbit:queue id="arguments" name="arguments">
- <rabbit:queue-arguments>
- <rabbit:map>
- <rabbit:entry key="foo" value="${bar}" />
- </rabbit:map>
- </rabbit:queue-arguments>
- </rabbit:queue>
+ <rabbit:queue id="overrideAlias" name="bar" durable="true" auto-delete="true" exclusive="true" />
- <rabbit:queue id="anonymousArguments">
- <rabbit:queue-arguments>
- <rabbit:map>
- <rabbit:entry key="foo" value="spam" />
- </rabbit:map>
- </rabbit:queue-arguments>
- </rabbit:queue>
+ <rabbit:queue id="anonymous" />
- <rabbit:queue id="anonymousOverride" durable="false" auto-delete="true" exclusive="true" />
+ <rabbit:queue id="arguments" name="arguments">
+ <rabbit:queue-arguments>
+ <entry key="foo" value="${bar}" />
+ <entry key="bar" value="${baz}" />
+ </rabbit:queue-arguments>
+ </rabbit:queue>
-</objects>
+ <rabbit:queue id="anonymousArguments">
+ <rabbit:queue-arguments>
+ <entry key="foo" value="spam" />
+ <entry key="bar" value="more-spam" />
+ </rabbit:queue-arguments>
+ </rabbit:queue>
+
+ <rabbit:queue id="anonymousOverride" durable="false" auto-delete="true" exclusive="true" />
+
+</objects>
View
32 test/Spring.Messaging.Amqp.Rabbit.Tests/Config/QueueParserPlaceholderTests.cs
@@ -9,8 +9,10 @@
using Spring.Context;
using Spring.Context.Support;
using Spring.Core.IO;
+using Spring.Messaging.Amqp.Core;
using Spring.Messaging.Amqp.Rabbit.Config;
using Spring.Messaging.Amqp.Rabbit.Tests.Test;
+using Spring.Objects.Factory;
using Spring.Objects.Factory.Xml;
namespace Spring.Messaging.Amqp.Rabbit.Tests.Config
@@ -21,7 +23,6 @@ namespace Spring.Messaging.Amqp.Rabbit.Tests.Config
/// </summary>
[TestFixture]
[Category(TestCategory.Unit)]
- [Ignore("Need to fix...")]
public class QueueParserPlaceholderTests : QueueParserTests
{
/// <summary>
@@ -38,13 +39,38 @@ public override void Setup()
beanFactory = new XmlApplicationContext(resourceName);
}
+
+ [Test]
+ public void PropertyPlaceHolderConfigurerCanConfigPropertyOnNonRabbitObject()
+ {
+ var obj = beanFactory.GetObject<PlaceholderSanityCheckTestObject>("placeholder-sanity-check");
+ Assert.That(obj.Name, Is.EqualTo("foo"),"PropertyConfiguration infrastructure is not working as expected.");
+ }
+
+ [Test]
+ public void CanGetRabbitQueue()
+ {
+ var obj = beanFactory.GetObject<Queue>("arguments");
+ Assert.That(obj.Arguments["foo"], Is.EqualTo("bar"));
+ Assert.That(obj.Arguments["bar"], Is.EqualTo("baz"));
+ }
+
+
+
+
[TestFixtureTearDown]
public void closeBeanFactory()
{
if (beanFactory != null)
{
- ((IConfigurableApplicationContext)beanFactory).Dispose();;
- }
+ ((IConfigurableApplicationContext)beanFactory).Dispose();
+ }
}
}
+
+
+ public class PlaceholderSanityCheckTestObject
+ {
+ public string Name { get; set; }
+ }
}
View
12 test/Spring.Messaging.Amqp.Rabbit.Tests/Config/QueueParserTests-context.xml
@@ -15,19 +15,15 @@
<rabbit:queue id="arguments" name="arguments">
<rabbit:queue-arguments>
- <rabbit:map>
- <rabbit:entry key="foo" value="bar" />
- <rabbit:entry key="bar" value="baz" />
- </rabbit:map>
+ <entry key="foo" value="bar" />
+ <entry key="bar" value="baz" />
</rabbit:queue-arguments>
</rabbit:queue>
<rabbit:queue id="anonymousArguments">
<rabbit:queue-arguments>
- <rabbit:map>
- <rabbit:entry key="foo" value="spam"/>
- <rabbit:entry key="bar" value="more-spam"/>
- </rabbit:map>
+ <entry key="foo" value="spam"/>
+ <entry key="bar" value="more-spam"/>
</rabbit:queue-arguments>
</rabbit:queue>

0 comments on commit be99ccf

Please sign in to comment.