01: /*
02: * Licensed to the Apache Software Foundation (ASF) under one or more
03: * contributor license agreements. See the NOTICE file distributed with
04: * this work for additional information regarding copyright ownership.
05: * The ASF licenses this file to You under the Apache License, Version 2.0
06: * (the "License"); you may not use this file except in compliance with
07: * the License. You may obtain a copy of the License at
08: *
09: * 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: * @author unascribed
32: * @version $Revision: 493779 $
33: */
34: public class RemoteTestListenerWrapper extends AbstractTestElement
35: implements TestListener, Serializable, NoThreadClone {
36: private static final Logger log = LoggingManager
37: .getLoggerForClass();
38:
39: private RemoteSampleListener listener;
40:
41: public RemoteTestListenerWrapper() {
42: }
43:
44: public RemoteTestListenerWrapper(RemoteSampleListener l) {
45: listener = l;
46: }
47:
48: public void testStarted() {
49: try {
50: listener.testStarted();
51: } catch (Exception ex) {
52: log.error("", ex); // $NON-NLS-1$
53: }
54:
55: }
56:
57: public void testEnded() {
58: try {
59: listener.testEnded();
60: } catch (Exception ex) {
61: log.error("", ex); // $NON-NLS-1$
62: }
63: }
64:
65: public void testStarted(String host) {
66: try {
67: listener.testStarted(host);
68: } catch (Exception ex) {
69: log.error("", ex); // $NON-NLS-1$
70: }
71: }
72:
73: public void testEnded(String host) {
74: try {
75: listener.testEnded(host);
76: } catch (Exception ex) {
77: log.error("", ex); // $NON-NLS-1$
78: }
79: }
80:
81: /*
82: * (non-Javadoc)
83: *
84: * @see TestListener#testIterationStart(LoopIterationEvent)
85: */
86: public void testIterationStart(LoopIterationEvent event) {
87: }
88:
89: }
|