Permalink
Browse files

INTDSLGROOVY-12

  • Loading branch information...
1 parent c5b5490 commit 65b581f6b9603596bcd283d00f84d2ea51086197 David Turanski committed Jan 9, 2013
@@ -26,7 +26,7 @@ class RabbitConnectionFactoryFactory extends SpringXmlComponentFactory {
*/
@Override
protected Object doNewInstance(FactoryBuilderSupport builder, Object name, Object value, Map attributes) {
- def id = attributes.name ?:'connectionFactory'
- builder.springXml{"rabbit:connection-factory"(id:id)}
+ attributes.id = attributes.id ?: (attributes.remove('name')?:'connectionFactory')
+ builder.springXml{"rabbit:connection-factory"(attributes)}
}
}
@@ -68,19 +68,22 @@ class AmqpUsageTests {
void testOutboundGateway() {
builder.doWithSpringIntegration {
doWithRabbit {
- connectionFactory()
+ connectionFactory(host: 'localhost', port: '5672', username: 'guest', password: 'guest')
template 'myRabbitTemplate'
}
messageFlow {
amqpSend amqpTemplate:'myRabbitTemplate'
}
}
+
+ //builder.messageFlows[0].send("hello")
}
@Test
//TODO: Not easy to test without running rabbit broker
void testInboundGateway() {
builder.doWithSpringIntegration {
+
doWithRabbit {
connectionFactory()
queue 'q1'
@@ -14,13 +14,21 @@ package org.springframework.integration.dsl.groovy.builder.dom
import static org.junit.Assert.*
import org.junit.*
+import org.springframework.integration.dsl.groovy.builder.IntegrationBuilder
/**
* @author David Turanski
*
*/
class XMLNamespaceSupportTests {
def namespaceSupport = new XMLNamespaceSupport()
+
+ @Test
+ void testMultipleNamespaces () {
+ new IntegrationBuilder().doWithSpringIntegration {
+ namespaces("int-twitter,rabbit")
+ }
+ }
@Test
void testAddIntegrationNamespace() {

0 comments on commit 65b581f

Please sign in to comment.