01: package com.mockrunner.jms;
02:
03: /**
04: * The <code>ConfigurationManager</code> is used
05: * for global settings of the JMS test framework.
06: */
07: public class ConfigurationManager {
08: private boolean doCloneOnSend;
09: private boolean useMessageSelectors;
10:
11: public ConfigurationManager() {
12: doCloneOnSend = false;
13: useMessageSelectors = true;
14: }
15:
16: /**
17: * Get the clone on send flag, see {@link #setDoCloneOnSend}
18: * for a description of this option.
19: * @return the clone on send flag
20: */
21: public boolean getDoCloneOnSend() {
22: return doCloneOnSend;
23: }
24:
25: /**
26: * Set if a message should be cloned before sending it.
27: * Default is <code>false</code>, i.e. the message is not
28: * cloned. This has the advantage that the sent message can
29: * be examined afterwards (e.g. if it is acknowledged).
30: * If you set this to <code>true</code>, the message will
31: * be cloned, i.e. the sent message will not be altered
32: * and you have to obtain the received message in order
33: * to examine it. However, the <code>true</code> option
34: * is closer to a real JMS server, where you can send
35: * the same message multiple times and the messages do
36: * not influence each other.
37: * @param doCloneOnSend the clone on send flag,
38: * default is <code>false</code>
39: */
40: public void setDoCloneOnSend(boolean doCloneOnSend) {
41: this .doCloneOnSend = doCloneOnSend;
42: }
43:
44: /**
45: * Get if message selectors should be used.
46: * @return <code>true</code> use message selectors,
47: * <code>false</code> ignore message selectors
48: */
49: public boolean getUseMessageSelectors() {
50: return useMessageSelectors;
51: }
52:
53: /**
54: * Set if message selectors should be used or simply
55: * ignored while testing. Default is <code>true</code>,
56: * i.e. message selectors are used. Message selector support
57: * of Mockrunner is based on a modified version of the
58: * selector parser of the open source JMS implementation
59: * ActiveMQ. It is a bit experimental at the moment. If there
60: * are problems with the parsing or if you don't need message
61: * selectors at all, turn them off. Disabling selector parsing also
62: * results in a better test performance.
63: * @param useMessageSelectors <code>true</code> use message selectors,
64: * <code>false</code> ignore message selectors
65: */
66: public void setUseMessageSelectors(boolean useMessageSelectors) {
67: this.useMessageSelectors = useMessageSelectors;
68: }
69: }
|