Permalink
Browse files

[Config] Add some unit tests

  • Loading branch information...
1 parent 35d8161 commit 88c7cdbd18267f1a7d0cbc1fe185ffe955d93c77 @vicb vicb committed Jun 3, 2012
@@ -55,7 +55,7 @@ public function getConfigTreeBuilder()
->scalarNode('connection')->defaultValue('default')->end()
->append($this->getExchangeConfiguration())
->append($this->getQueueConfiguration())
- ->scalarNode('callback')->end()
+ ->scalarNode('callback')->isRequired()->end()
->end()
->end()
->end()
@@ -74,7 +74,7 @@ public function getConfigTreeBuilder()
->prototype('array')
->children()
->scalarNode('connection')->defaultValue('default')->end()
- ->scalarNode('callback')->end()
+ ->scalarNode('callback')->isRequired()->end()
->end()
->end()
->end()
@@ -85,9 +85,10 @@ public function getConfigTreeBuilder()
->children()
->scalarNode('connection')->defaultValue('default')->end()
->append($this->getExchangeConfiguration())
- ->scalarNode('callback')->end()
+ ->scalarNode('callback')->isRequired()->end()
->end()
->end()
+ ->end()
->end()
;
@@ -100,17 +101,17 @@ protected function getExchangeConfiguration()
return $node
->children()
- ->scalarNode('name')->end()
- ->scalarNode('type')->end()
- ->booleanNode('passive')->defaultValue(false)->end()
- ->booleanNode('durable')->defaultValue(true)->end()
- ->booleanNode('auto_delete')->defaultValue(false)->end()
- ->booleanNode('internal')->defaultValue(false)->end()
- ->booleanNode('nowait')->defaultValue(false)->end()
- ->scalarNode('arguments')->defaultNull()->end()
- ->scalarNode('ticket')->defaultNull()->end()
+ ->scalarNode('name')->end()
+ ->scalarNode('type')->end()
+ ->booleanNode('passive')->defaultValue(false)->end()
+ ->booleanNode('durable')->defaultValue(true)->end()
+ ->booleanNode('auto_delete')->defaultValue(false)->end()
+ ->booleanNode('internal')->defaultValue(false)->end()
+ ->booleanNode('nowait')->defaultValue(false)->end()
+ ->scalarNode('arguments')->defaultNull()->end()
+ ->scalarNode('ticket')->defaultNull()->end()
->end()
- ;
+ ;
}
protected function getQueueConfiguration()
@@ -119,16 +120,16 @@ protected function getQueueConfiguration()
return $node
->children()
- ->scalarNode('name')->end()
- ->booleanNode('passive')->defaultFalse()->end()
- ->booleanNode('durable')->defaultTrue()->end()
- ->booleanNode('exclusive')->defaultFalse()->end()
- ->booleanNode('auto_delete')->defaultFalse()->end()
- ->booleanNode('nowait')->defaultFalse()->end()
- ->variableNode('arguments')->end()
- ->scalarNode('ticket')->defaultNull()->end()
+ ->scalarNode('name')->end()
+ ->booleanNode('passive')->defaultFalse()->end()
+ ->booleanNode('durable')->defaultTrue()->end()
+ ->booleanNode('exclusive')->defaultFalse()->end()
+ ->booleanNode('auto_delete')->defaultFalse()->end()
+ ->booleanNode('nowait')->defaultFalse()->end()
+ ->variableNode('arguments')->end()
+ ->scalarNode('ticket')->defaultNull()->end()
->end()
- ;
+ ;
}
}
@@ -0,0 +1,21 @@
+old_sound_rabbit_mq:
+
+ enable_collector: true
+
+ connections:
+ default:
+
+ producers:
+ default_producer:
+ exchange_options:
+ name: default_exchange
+ type: direct
+
+ consumers:
+ default_consumer:
+ exchange_options:
+ name: default_exchange
+ type: direct
+ queue_options:
+ name: default_queue
+ callback: default.callback
@@ -0,0 +1,21 @@
+old_sound_rabbit_mq:
+
+ enable_collector: false
+
+ connections:
+ default:
+
+ producers:
+ default_producer:
+ exchange_options:
+ name: default_exchange
+ type: direct
+
+ consumers:
+ default_consumer:
+ exchange_options:
+ name: default_exchange
+ type: direct
+ queue_options:
+ name: default_queue
+ callback: default.callback
@@ -0,0 +1,6 @@
+old_sound_rabbit_mq:
+
+ enable_collector: true
+
+ connections:
+ default:
@@ -0,0 +1,100 @@
+old_sound_rabbit_mq:
+
+ enable_collector: true
+
+ connections:
+ foo_connection:
+ host: foo_host
+ port: 123
+ user: foo_user
+ password: foo_password
+ vhost: /foo
+
+ default:
+
+ producers:
+ foo_producer:
+ connection: foo_connection
+ exchange_options:
+ name: foo_exchange
+ type: direct
+ passive: true
+ durable: false
+ auto_delete: true
+ internal: true
+ nowait: true
+ arguments: null
+ ticket: null
+
+
+ default_producer:
+ exchange_options:
+ name: default_exchange
+ type: direct
+
+ consumers:
+ foo_consumer:
+ connection: foo_connection
+ exchange_options:
+ name: foo_exchange
+ type: direct
+ passive: true
+ durable: false
+ auto_delete: true
+ internal: true
+ nowait: true
+ arguments: null
+ ticket: null
+ queue_options:
+ name: foo_queue
+ passive: true
+ durable: false
+ exclusive: true
+ auto_delete: true
+ nowait: true
+ arguments: null
+ ticket: null
+ callback: foo.callback
+
+ default_consumer:
+ exchange_options:
+ name: default_exchange
+ type: direct
+ queue_options:
+ name: default_queue
+ callback: default.callback
+
+ anon_consumers:
+ foo_anon_consumer:
+ connection: foo_connection
+ exchange_options:
+ name: foo_anon_exchange
+ type: direct
+ passive: true
+ durable: false
+ auto_delete: true
+ internal: true
+ nowait: true
+ arguments: null
+ ticket: null
+ callback: foo_anon.callback
+
+ default_anon_consumer:
+ exchange_options:
+ name: default_anon_exchange
+ type: direct
+ callback: default_anon.callback
+
+ rpc_clients:
+ foo_client:
+ connection: foo_connection
+
+ default_client:
+
+ rpc_servers:
+ foo_server:
+ connection: foo_connection
+ callback: foo_server.callback
+
+ default_server:
+ callback: default_server.callback
Oops, something went wrong.

0 comments on commit 88c7cdb

Please sign in to comment.