1   /*
2    * $Id: SedaComponentQueueConfigurationTestCase.java 9301 2007-10-23 13:50:42Z holger $
3    * --------------------------------------------------------------------------------------
4    * Copyright (c) MuleSource, Inc.  All rights reserved.  http://www.mulesource.com
5    *
6    * The software in this package is published under the terms of the CPAL v1.0
7    * license, a copy of which has been included with this distribution in the
8    * LICENSE.txt file.
9    */
10  
11  package org.mule.util.queue;
12  
13  import org.mule.MuleManager;
14  import org.mule.config.QueueProfile;
15  import org.mule.impl.MuleDescriptor;
16  import org.mule.impl.model.seda.SedaComponent;
17  import org.mule.impl.model.seda.SedaModel;
18  import org.mule.tck.AbstractMuleTestCase;
19  import org.mule.tck.MuleTestUtils;
20  
21  public class SedaComponentQueueConfigurationTestCase extends AbstractMuleTestCase
22  {
23  
24      public void testQueueConfiguration() throws Exception
25      {
26          TransactionalQueueManager qm = new TransactionalQueueManager();
27          MuleManager.getInstance().setQueueManager(qm);
28  
29          QueueProfile qp = new QueueProfile();
30          qp.setMaxOutstandingMessages(42);
31  
32          MuleDescriptor descriptor = MuleTestUtils.getTestDescriptor("test", "java.lang.Object");
33          descriptor.setQueueProfile(qp);
34  
35          SedaComponent component = new SedaComponent(descriptor, new SedaModel());
36          component.initialise();
37  
38          assertEquals(42, qm.getQueue("test.component").config.capacity);
39      }
40  
41  }