View Javadoc

1   /*
2    * $Id: VMLoanBrokerSynchronousFunctionalTestCase.java 20321 2010-11-24 15:21:24Z dfeist $
3    * --------------------------------------------------------------------------------------
4    * Copyright (c) MuleSoft, Inc.  All rights reserved.  http://www.mulesoft.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.esn;
12  
13  import org.mule.api.service.Service;
14  import org.mule.example.loanbroker.tests.AbstractLoanBrokerTestCase;
15  import org.mule.model.seda.SedaModel;
16  
17  
18  public class VMLoanBrokerSynchronousFunctionalTestCase extends AbstractLoanBrokerTestCase
19  {
20      @Override
21      protected String getConfigResources()
22      {
23          return "loan-broker-sync-config.xml, loan-broker-vm-endpoints-config.xml";
24      }
25  
26      @Override
27      protected int getNumberOfRequests()
28      {
29          return 1000;
30      }
31  
32      public void testBasicParsing()
33      {
34          Object objModel = muleContext.getRegistry().lookupModel("loan-broker");
35          assertNotNull(objModel);
36          assertTrue(objModel instanceof SedaModel);
37          SedaModel model = (SedaModel)objModel;
38          assertComponent(model, "TheLoanBroker");
39          assertComponent(model, "TheCreditAgencyService");
40          assertComponent(model, "TheLenderService");
41          assertComponent(model, "TheBankGateway");
42      }
43  
44      protected void assertComponent(SedaModel model, String name)
45      {
46          Service service = muleContext.getRegistry().lookupService(name);
47          assertNotNull(name + " missing", service);
48      }
49  
50  }