1 18 19 package org.apache.jmeter.reporters; 20 21 import java.io.Serializable ; 22 23 import org.apache.jmeter.samplers.Clearable; 24 import org.apache.jmeter.samplers.SampleEvent; 25 import org.apache.jmeter.samplers.SampleListener; 26 import org.apache.jmeter.samplers.SampleResult; 27 import org.apache.jmeter.testelement.OnErrorTestElement; 28 import org.apache.jorphan.logging.LoggingManager; 29 import org.apache.log.Logger; 30 31 36 public class ResultAction 37 extends OnErrorTestElement 38 implements Serializable , 39 SampleListener, 40 Clearable 41 { 42 private static final Logger log = LoggingManager.getLoggerForClass(); 43 44 51 public ResultAction(){ 52 super(); 53 } 56 57 62 public void clear() 63 { 64 super.clear(); 66 } 67 68 73 public void sampleOccurred(SampleEvent e) { 74 SampleResult s = e.getResult(); 75 log.debug(s.getSampleLabel()+" OK? "+s.isSuccessful()); 76 if (!s.isSuccessful()) { 77 if (isStopTest()) { 78 s.setStopTest(true); 79 } 80 if (isStopThread()) { 81 s.setStopThread(true); 82 } 83 } 84 } 85 86 89 public void sampleStarted(SampleEvent e) 90 { 91 } 93 94 97 public void sampleStopped(SampleEvent e) 98 { 99 } 101 } 102 | Popular Tags |