Coverage Report - org.mule.util.ApplicationStartupSplashScreen
 
Classes in this File Line Coverage Branch Coverage Complexity
ApplicationStartupSplashScreen
0%
0/15
0%
0/6
2.5
 
 1  
 /*
 2  
  * $Id$
 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.util;
 12  
 
 13  
 import org.mule.api.MuleContext;
 14  
 import org.mule.api.agent.Agent;
 15  
 import org.mule.config.i18n.CoreMessages;
 16  
 
 17  
 import java.util.Collection;
 18  
 import java.util.Iterator;
 19  
 
 20  0
 public class ApplicationStartupSplashScreen extends SplashScreen
 21  
 {
 22  
     protected void doHeader(MuleContext context)
 23  
     {
 24  0
         header.add("Application: " + context.getConfiguration().getId());
 25  0
         header.add(String.format("OS encoding: %s, Mule encoding: %s",
 26  
                                  System.getProperty("file.encoding"),
 27  
                                  context.getConfiguration().getDefaultEncoding()));
 28  0
         header.add(" ");
 29  0
     }
 30  
    
 31  
     protected void doFooter(MuleContext context)
 32  
     {
 33  
         // Mule Agents
 34  0
         if (!body.isEmpty())
 35  
         {
 36  0
             footer.add(" ");
 37  
         }
 38  
         //List agents
 39  0
         Collection agents = context.getRegistry().lookupObjects(Agent.class);
 40  0
         if (agents.size() == 0)
 41  
         {
 42  0
             footer.add(CoreMessages.agentsRunning().getMessage() + " "
 43  
                     + CoreMessages.none().getMessage());
 44  
         }
 45  
         else
 46  
         {
 47  0
             footer.add(CoreMessages.agentsRunning().getMessage());
 48  
             Agent agent;
 49  0
             for (Iterator iterator = agents.iterator(); iterator.hasNext();)
 50  
             {
 51  0
                 agent = (Agent) iterator.next();
 52  0
                 footer.add("  " + agent.getDescription());
 53  
             }
 54  
         }
 55  0
     }    
 56  
 }