01: package com.mockrunner.mock.jms;
02:
03: import java.util.Enumeration;
04: import java.util.Vector;
05:
06: import javax.jms.ConnectionMetaData;
07: import javax.jms.JMSException;
08:
09: /**
10: * Mock implementation of JMS <code>ConnectionMetaData</code>.
11: */
12: public class MockConnectionMetaData implements ConnectionMetaData {
13: private Vector properties;
14: private int jmsMajorVersion;
15: private int jmsMinorVersion;
16: private String jmsProviderName;
17: private String jmsVersion;
18: private int providerMajorVersion;
19: private int providerMinorVersion;
20: private String providerVersion;
21:
22: public MockConnectionMetaData() {
23: properties = new Vector();
24: jmsMajorVersion = 1;
25: jmsMinorVersion = 1;
26: jmsProviderName = "Mockrunner";
27: jmsVersion = "1.1";
28: providerMajorVersion = 1;
29: providerMinorVersion = 0;
30: providerVersion = "1.0";
31: }
32:
33: public void addJMSXPropertyName(String name) {
34: properties.add(name);
35: }
36:
37: public void setJMSMajorVersion(int jmsMajorVersion) {
38: this .jmsMajorVersion = jmsMajorVersion;
39: }
40:
41: public void setJMSMinorVersion(int jmsMinorVersion) {
42: this .jmsMinorVersion = jmsMinorVersion;
43: }
44:
45: public void setJMSProviderName(String jmsProviderName) {
46: this .jmsProviderName = jmsProviderName;
47: }
48:
49: public void setJMSVersion(String jmsVersion) {
50: this .jmsVersion = jmsVersion;
51: }
52:
53: public void setProviderMajorVersion(int providerMajorVersion) {
54: this .providerMajorVersion = providerMajorVersion;
55: }
56:
57: public void setProviderMinorVersion(int providerMinorVersion) {
58: this .providerMinorVersion = providerMinorVersion;
59: }
60:
61: public void setProviderVersion(String providerVersion) {
62: this .providerVersion = providerVersion;
63: }
64:
65: public int getJMSMajorVersion() throws JMSException {
66: return jmsMajorVersion;
67: }
68:
69: public int getJMSMinorVersion() throws JMSException {
70: return jmsMinorVersion;
71: }
72:
73: public String getJMSProviderName() throws JMSException {
74: return jmsProviderName;
75: }
76:
77: public String getJMSVersion() throws JMSException {
78: return jmsVersion;
79: }
80:
81: public Enumeration getJMSXPropertyNames() throws JMSException {
82: return properties.elements();
83: }
84:
85: public int getProviderMajorVersion() throws JMSException {
86: return providerMajorVersion;
87: }
88:
89: public int getProviderMinorVersion() throws JMSException {
90: return providerMinorVersion;
91: }
92:
93: public String getProviderVersion() throws JMSException {
94: return providerVersion;
95: }
96: }
|