Coverage Report - kg.apc.jmeter.modifiers.FifoPutPostProcessor
 
Classes in this File Line Coverage Branch Coverage Complexity
FifoPutPostProcessor
90%
19/21
N/A
1.111
 
 1  
 package kg.apc.jmeter.modifiers;
 2  
 
 3  
 import org.apache.jmeter.processor.PostProcessor;
 4  
 import org.apache.jmeter.testelement.AbstractTestElement;
 5  
 import org.apache.jmeter.testelement.TestStateListener;
 6  
 import org.apache.jorphan.logging.LoggingManager;
 7  
 import org.apache.log.Logger;
 8  
 
 9  12
 public class FifoPutPostProcessor extends AbstractTestElement
 10  
         implements PostProcessor, TestStateListener {
 11  1
     private static final Logger log = LoggingManager.getLoggerForClass();
 12  
 
 13  
     public static final String QUEUE = "FifoName";
 14  
     public static final String VALUE = "Value";
 15  
 
 16  
     public void testStarted() {
 17  2
         FifoMap.getInstance().clear();
 18  2
     }
 19  
 
 20  
     public void testStarted(String host) {
 21  1
         testStarted();
 22  1
     }
 23  
 
 24  
     public void testEnded() {
 25  2
         FifoMap.getInstance().clear();
 26  2
     }
 27  
 
 28  
     public void testEnded(String host) {
 29  1
         testEnded();
 30  1
     }
 31  
 
 32  
     public void process() {
 33  
         try {
 34  1
             FifoMap.getInstance().put(getQueueName(), getValue());
 35  0
         } catch (InterruptedException ex) {
 36  0
             log.warn("Interrupted put into queue " + getQueueName());
 37  1
         }
 38  1
     }
 39  
 
 40  
     public String getValue() {
 41  2
         return getPropertyAsString(VALUE);
 42  
     }
 43  
 
 44  
     public String getQueueName() {
 45  2
         return getPropertyAsString(QUEUE);
 46  
     }
 47  
 
 48  
     public void setQueueName(String text) {
 49  3
         setProperty(QUEUE, text);
 50  3
     }
 51  
 
 52  
     public void setValue(String text) {
 53  3
         setProperty(VALUE, text);
 54  3
     }
 55  
 }