View Javadoc
1   /*
2    * Copyright 2002-2012 the original author or authors.
3    *
4    * Licensed under the Apache License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    *
8    *      http://www.apache.org/licenses/LICENSE-2.0
9    *
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   */
16  
17  package org.springframework.jms.connection;
18  
19  import javax.jms.Connection;
20  import javax.jms.ConnectionConsumer;
21  import javax.jms.ConnectionMetaData;
22  import javax.jms.Destination;
23  import javax.jms.ExceptionListener;
24  import javax.jms.JMSException;
25  import javax.jms.ServerSessionPool;
26  import javax.jms.Session;
27  import javax.jms.Topic;
28  
29  /**
30   * @author Juergen Hoeller
31   */
32  public class TestConnection implements Connection {
33  
34  	private ExceptionListener exceptionListener;
35  
36  	private int startCount;
37  
38  	private int closeCount;
39  
40  
41  	@Override
42  	public Session createSession(boolean b, int i) throws JMSException {
43  		return null;
44  	}
45  
46  	@Override
47  	public String getClientID() throws JMSException {
48  		return null;
49  	}
50  
51  	@Override
52  	public void setClientID(String paramName) throws JMSException {
53  	}
54  
55  	@Override
56  	public ConnectionMetaData getMetaData() throws JMSException {
57  		return null;
58  	}
59  
60  	@Override
61  	public ExceptionListener getExceptionListener() throws JMSException {
62  		return exceptionListener;
63  	}
64  
65  	@Override
66  	public void setExceptionListener(ExceptionListener exceptionListener) throws JMSException {
67  		this.exceptionListener = exceptionListener;
68  	}
69  
70  	@Override
71  	public void start() throws JMSException {
72  		this.startCount++;
73  	}
74  
75  	@Override
76  	public void stop() throws JMSException {
77  	}
78  
79  	@Override
80  	public void close() throws JMSException {
81  		this.closeCount++;
82  	}
83  
84  	@Override
85  	public ConnectionConsumer createConnectionConsumer(Destination destination, String paramName, ServerSessionPool serverSessionPool, int i) throws JMSException {
86  		return null;
87  	}
88  
89  	@Override
90  	public ConnectionConsumer createDurableConnectionConsumer(Topic topic, String paramName, String paramName1, ServerSessionPool serverSessionPool, int i) throws JMSException {
91  		return null;
92  	}
93  
94  
95  	public int getStartCount() {
96  		return startCount;
97  	}
98  
99  	public int getCloseCount() {
100 		return closeCount;
101 	}
102 
103 }