Coverage Report - org.mule.example.loanbroker.esb.LoanBrokerApp
 
Classes in this File Line Coverage Branch Coverage Complexity
LoanBrokerApp
0%
0/17
0%
0/6
2.667
 
 1  
 /*
 2  
  * $Id: LoanBrokerApp.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.esb;
 12  
 
 13  
 import org.mule.example.loanbroker.AbstractLoanBrokerApp;
 14  
 import org.mule.example.loanbroker.LocaleMessage;
 15  
 import org.mule.util.StringUtils;
 16  
 
 17  
 import java.io.IOException;
 18  
 
 19  
 /**
 20  
  * Runs the LoanBroker ESB example application.
 21  
  */
 22  
 
 23  
 public class LoanBrokerApp extends AbstractLoanBrokerApp
 24  
 {
 25  
     public LoanBrokerApp(String config) throws Exception
 26  
     {
 27  0
         super(config);
 28  0
     }
 29  
 
 30  
     public static void main(String[] args) throws Exception
 31  
     {
 32  0
         String config = getInteractiveConfig();
 33  0
         if (StringUtils.isNotEmpty(config))
 34  
         {
 35  0
             LoanBrokerApp loanBrokerApp = new LoanBrokerApp(config);
 36  0
             loanBrokerApp.run(false);
 37  
         }
 38  0
     }
 39  
 
 40  
     protected static String getInteractiveConfig() throws IOException
 41  
     {
 42  0
         int response = 0;
 43  
         
 44  0
         System.out.println("******************\n"
 45  
             + LocaleMessage.esbWelcome()
 46  
             + "\n******************");
 47  
         
 48  0
         while (response != 'q')
 49  
         {
 50  0
             response = readCharacter();
 51  0
             if (response == '1')
 52  
             {
 53  0
                 System.out.println(LocaleMessage.loadingEndpointEjb());
 54  0
                 return "loan-broker-esb-mule-config.xml";
 55  
             }
 56  
             else
 57  
             {
 58  0
                 System.out.println(LocaleMessage.loadingManagedEjb());
 59  0
                 return "loan-broker-esb-mule-config-with-ejb-container.xml";
 60  
             }
 61  
         }
 62  
         
 63  0
         return "";
 64  
     }
 65  
 }