Coverage Report - org.mule.tools.visualizer.processor.MuleConfigProcessor
 
Classes in this File Line Coverage Branch Coverage Complexity
MuleConfigProcessor
17%
5/30
25%
1/4
2.5
 
 1  
 /*
 2  
  * $Id: MuleConfigProcessor.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.tools.visualizer.processor;
 12  
 
 13  
 import org.mule.tools.visualizer.config.ColorRegistry;
 14  
 import org.mule.tools.visualizer.config.GraphEnvironment;
 15  
 import org.mule.tools.visualizer.util.MuleTag;
 16  
 
 17  
 import com.oy.shared.lm.graph.Graph;
 18  
 import com.oy.shared.lm.graph.GraphNode;
 19  
 
 20  
 import org.jdom.Element;
 21  
 
 22  
 public class MuleConfigProcessor extends TagProcessor
 23  
 {
 24  
 
 25  
     public MuleConfigProcessor(GraphEnvironment environment)
 26  
     {
 27  4
         super(environment);
 28  4
     }
 29  
 
 30  
     public void process(Graph graph, Element currentElement, GraphNode parent)
 31  
     {
 32  
 
 33  4
         Element muleConfig = currentElement.getChild(MuleTag.ELEMENT_MULE_ENVIRONMENT_PROPERTIES);
 34  4
         if (muleConfig != null)
 35  
         {
 36  
             // Set whether the event flows are synchronous or not by default. This
 37  
             // controls the style of arrows created
 38  0
             String twoway = muleConfig.getAttributeValue(MuleTag.ATTRIBUTE_SYNCHRONOUS);
 39  0
             getEnvironment().setDefaultTwoWay("true".equalsIgnoreCase(twoway));
 40  0
             if (!getEnvironment().getConfig().isShowConfig())
 41  
             {
 42  0
                 return;
 43  
             }
 44  
 
 45  0
             GraphNode configNode = graph.addNode();
 46  0
             configNode.getInfo().setFillColor(ColorRegistry.COLOR_CONFIG);
 47  0
             configNode.getInfo().setHeader("Mule Config");
 48  
 
 49  0
             StringBuffer caption = new StringBuffer();
 50  0
             appendAttribute(muleConfig, MuleTag.ATTRIBUTE_SYNCHRONOUS, caption);
 51  0
             appendAttribute(muleConfig, "serverUrl", caption);
 52  0
             appendAttribute(muleConfig, "clientMode", caption);
 53  0
             appendAttribute(muleConfig, "embedded", caption);
 54  0
             appendAttribute(muleConfig, "enableMessageEvents", caption);
 55  0
             appendAttribute(muleConfig, "encoding", caption);
 56  0
             appendAttribute(muleConfig, "osEncoding", caption);
 57  0
             appendAttribute(muleConfig, "recoverableMode", caption);
 58  0
             appendAttribute(muleConfig, "remoteSync", caption);
 59  0
             appendAttribute(muleConfig, "synchronousEventTimeout", caption);
 60  0
             appendAttribute(muleConfig, "transactionTimeout", caption);
 61  0
             appendAttribute(muleConfig, "workingDirectory", caption);
 62  
 
 63  0
             ConnectionStrategyProcessor processor = new ConnectionStrategyProcessor(getEnvironment());
 64  0
             processor.process(graph, muleConfig, configNode);
 65  0
             appendProfiles(muleConfig, caption);
 66  0
             appendDescription(muleConfig, caption);
 67  
 
 68  0
             configNode.getInfo().setCaption(caption.toString());
 69  
         }
 70  4
     }
 71  
 }