Coverage Report - org.mule.tck.testmodels.services.TestComponent
 
Classes in this File Line Coverage Branch Coverage Complexity
TestComponent
0%
0/8
N/A
1.25
 
 1  
 /*
 2  
  * $Id: TestComponent.java 12017 2008-06-12 09:04:04Z rossmason $
 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.tck.testmodels.services;
 12  
 
 13  
 import edu.emory.mathcs.backport.java.util.concurrent.atomic.AtomicInteger;
 14  
 import org.apache.commons.logging.Log;
 15  
 import org.apache.commons.logging.LogFactory;
 16  
 
 17  0
 public class TestComponent implements ITestComponent
 18  
 {
 19  
     public static final String EXCEPTION_MESSAGE = "Test Service fired an Exception";
 20  
 
 21  0
     protected static final Log logger = LogFactory.getLog(TestComponent.class);
 22  
 
 23  0
     protected AtomicInteger count = new AtomicInteger(0);
 24  
 
 25  
     public String receive(String message) throws Exception
 26  
     {
 27  0
         logger.info("Received: " + message + " number: " + inc() + " in thread: "
 28  
                     + Thread.currentThread().getName());
 29  0
         return "Received: " + message;
 30  
     }
 31  
     
 32  
     public String receiveBytes(byte[] message) throws Exception
 33  
     {
 34  0
         return receive(new String(message)); 
 35  
     }
 36  
 
 37  
     public String throwsException(String message) throws Exception
 38  
     {
 39  0
         throw new TestComponentException(EXCEPTION_MESSAGE);
 40  
     }
 41  
 
 42  
     protected int inc()
 43  
     {
 44  0
         return count.incrementAndGet();
 45  
     }
 46  
 
 47  
 }