1   /*
2    * $Id: JmsMessageAdapterTestCase.java 7963 2007-08-21 08:53:15Z dirk.olmes $
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.providers.jms;
12  
13  import org.mule.tck.providers.AbstractMessageAdapterTestCase;
14  import org.mule.umo.MessagingException;
15  import org.mule.umo.provider.UMOMessageAdapter;
16  
17  public class JmsMessageAdapterTestCase extends AbstractMessageAdapterTestCase
18  {
19  
20      /*
21       * (non-Javadoc)
22       * 
23       * @see org.mule.tck.providers.AbstractMessageAdapterTestCase#createAdapter()
24       */
25      public UMOMessageAdapter createAdapter(Object payload) throws MessagingException
26      {
27          return new JmsMessageAdapter(payload);
28      }
29  
30      /*
31       * (non-Javadoc)
32       * 
33       * @see org.mule.tck.providers.AbstractMessageAdapterTestCase#getValidMessage()
34       */
35      public Object getValidMessage() throws Exception
36      {
37          return JmsConnectorTestCase.getMessage();
38      }
39  
40      public void testIllegalSpecification() throws Exception
41      {
42          JmsMessageAdapter a = (JmsMessageAdapter)this.createAdapter(this.getValidMessage());
43  
44          // these will work
45          a.setSpecification(JmsConstants.JMS_SPECIFICATION_102B);
46          a.setSpecification(JmsConstants.JMS_SPECIFICATION_11);
47  
48          try
49          {
50              // this will not :)
51              a.setSpecification("1.2");
52          }
53          catch (IllegalArgumentException iax)
54          {
55              // OK
56          }
57      }
58  
59  }