1 /* 2 * Licensed to the Apache Software Foundation (ASF) under one or more 3 * contributor license agreements. See the NOTICE file distributed with 4 * this work for additional information regarding copyright ownership. 5 * The ASF licenses this file to You under the Apache License, Version 2.0 6 * (the "License"); you may not use this file except in compliance with 7 * the License. You may obtain a copy of the License at 8 * 9 * http://www.apache.org/licenses/LICENSE-2.0 10 * 11 * Unless required by applicable law or agreed to in writing, software 12 * distributed under the License is distributed on an "AS IS" BASIS, 13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 * See the License for the specific language governing permissions and 15 * limitations under the License. 16 * 17 */ 18 19 package org.apache.jmeter.samplers; 20 21 import java.io.Serializable; 22 23 import org.apache.jmeter.engine.event.LoopIterationEvent; 24 import org.apache.jmeter.engine.util.NoThreadClone; 25 import org.apache.jmeter.testelement.AbstractTestElement; 26 import org.apache.jmeter.testelement.TestListener; 27 import org.apache.jorphan.logging.LoggingManager; 28 import org.apache.log.Logger; 29 30 /** 31 * @version $Revision: 703755 $ 32 */ 33 public class RemoteTestListenerWrapper extends AbstractTestElement implements TestListener, Serializable, NoThreadClone { 34 private static final Logger log = LoggingManager.getLoggerForClass(); 35 36 private final RemoteSampleListener listener; 37 38 public RemoteTestListenerWrapper() { 39 log.warn("Only intended for use in testing"); 40 listener = null; 41 } 42 43 public RemoteTestListenerWrapper(RemoteSampleListener l) { 44 listener = l; 45 } 46 47 public void testStarted() { 48 try { 49 listener.testStarted(); 50 } catch (Exception ex) { 51 log.error("", ex); // $NON-NLS-1$ 52 } 53 54 } 55 56 public void testEnded() { 57 try { 58 listener.testEnded(); 59 } catch (Exception ex) { 60 log.error("", ex); // $NON-NLS-1$ 61 } 62 } 63 64 public void testStarted(String host) { 65 try { 66 listener.testStarted(host); 67 } catch (Exception ex) { 68 log.error("", ex); // $NON-NLS-1$ 69 } 70 } 71 72 public void testEnded(String host) { 73 try { 74 listener.testEnded(host); 75 } catch (Exception ex) { 76 log.error("", ex); // $NON-NLS-1$ 77 } 78 } 79 80 /* 81 * (non-Javadoc) 82 * 83 * @see TestListener#testIterationStart(LoopIterationEvent) 84 */ 85 public void testIterationStart(LoopIterationEvent event) { 86 //listener.testIterationStart(event); 87 } 88 89 }