public void MessageQueueNameNotInContext()
        {
            MessageQueueTemplate q = new MessageQueueTemplate("noqueuename");

            q.ApplicationContext = applicationContext;
            q.AfterPropertiesSet();
        }
        public void MessageQueueNameNotInContext()
        {
            MessageQueueTemplate q = new MessageQueueTemplate("noqueuename");

            q.ApplicationContext = applicationContext;
            Assert.Throws <ArgumentException>(() => q.AfterPropertiesSet(), "No object named noqueuename is defined in the Spring container");
        }
 public void NoMessageQueueNameSpecified()
 {
     MessageQueueTemplate mqt = new MessageQueueTemplate();
     mqt.AfterPropertiesSet();
 }
 public void MessageQueueNameNotInContext()
 {
     MessageQueueTemplate q = new MessageQueueTemplate("noqueuename");
     q.ApplicationContext = applicationContext;
     q.AfterPropertiesSet();
 }
        public void NoMessageQueueNameSpecified()
        {
            MessageQueueTemplate mqt = new MessageQueueTemplate();

            mqt.AfterPropertiesSet();
        }
Ejemplo n.º 6
0
 /// <summary>
 /// Invoked by an <see cref="Spring.Objects.Factory.IObjectFactory"/>
 /// after it has injected all of an object's dependencies.
 /// </summary>
 /// <remarks>
 /// 	<p>
 /// This method allows the object instance to perform the kind of
 /// initialization only possible when all of it's dependencies have
 /// been injected (set), and to throw an appropriate exception in the
 /// event of misconfiguration.
 /// </p>
 /// 	<p>
 /// Please do consult the class level documentation for the
 /// <see cref="Spring.Objects.Factory.IObjectFactory"/> interface for a
 /// description of exactly <i>when</i> this method is invoked. In
 /// particular, it is worth noting that the
 /// <see cref="Spring.Objects.Factory.IObjectFactoryAware"/>
 /// and <see cref="Spring.Context.IApplicationContextAware"/>
 /// callbacks will have been invoked <i>prior</i> to this method being
 /// called.
 /// </p>
 /// </remarks>
 /// <exception cref="System.Exception">
 /// In the event of misconfiguration (such as the failure to set a
 /// required property) or if initialization fails.
 /// </exception>
 public void AfterPropertiesSet()
 {
     if (messageQueueFactory == null)
     {
         DefaultMessageQueueFactory mqf = new DefaultMessageQueueFactory();
         mqf.ApplicationContext = applicationContext;
         messageQueueFactory = mqf;
     }
     if (messageConverterObjectName == null)
     {
         messageConverterObjectName = QueueUtils.RegisterDefaultMessageConverter(applicationContext);
     }
     if (messageQueueTemplate == null)
     {
         messageQueueTemplate = new MessageQueueTemplate();
         messageQueueTemplate.ApplicationContext = ApplicationContext;
         messageQueueTemplate.AfterPropertiesSet();
     }
 }
 public void MessageQueueNameNotInContext()
 {
     MessageQueueTemplate q = new MessageQueueTemplate("noqueuename");
     q.ApplicationContext = applicationContext;
     Assert.Throws<ArgumentException>(() => q.AfterPropertiesSet(), "No object named noqueuename is defined in the Spring container");
 }
 public void NoMessageQueueNameSpecified()
 {
     MessageQueueTemplate mqt = new MessageQueueTemplate();
     Assert.Throws<ArgumentNullException>(() => mqt.AfterPropertiesSet());
 }
        public void NoMessageQueueNameSpecified()
        {
            MessageQueueTemplate mqt = new MessageQueueTemplate();

            Assert.Throws <ArgumentNullException>(() => mqt.AfterPropertiesSet());
        }