1   /*
2    * $Id: TransformersMule2669TestCase.java 10789 2008-02-12 20:04:43Z dfeist $
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.example.loanbroker.issues;
12  
13  import org.mule.api.MuleException;
14  import org.mule.api.MuleMessage;
15  import org.mule.example.loanbroker.bank.Bank;
16  import org.mule.example.loanbroker.messages.LoanBrokerQuoteRequest;
17  import org.mule.module.client.MuleClient;
18  import org.mule.tck.FunctionalTestCase;
19  
20  import java.util.Iterator;
21  import java.util.Set;
22  
23  public class TransformersMule2669TestCase extends FunctionalTestCase
24  {
25  
26      protected String getConfigResources()
27      {
28          return "transformers-mule-2669.xml";
29      }
30  
31      public void testTransformers() throws MuleException
32      {
33          MuleClient client = new MuleClient();
34          LoanBrokerQuoteRequest request = new LoanBrokerQuoteRequest();
35          request.setLenders(new Bank[0]);
36          MuleMessage response = client.send("jms://in?connector=default", request, null);
37          assertNotNull(response);
38          assertNull(response.getExceptionPayload());
39          Set propertyNames = response.getPropertyNames();
40          assertTrue(propertyNames.size() > 0);
41          Iterator names = propertyNames.iterator();
42          while (names.hasNext())
43          {
44              logger.debug(names.next());
45          }
46          assertTrue(propertyNames.contains("recipients"));
47      }
48  
49  }