KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > mockobjects > jms > MockMessageProducer


1 package com.mockobjects.jms;
2
3 import com.mockobjects.*;
4 import javax.jms.*;
5
6 public abstract class MockMessageProducer extends MockObject implements MessageProducer {
7
8   protected final ExpectationCounter myCloseCalls = new ExpectationCounter("MockMessageConsumer.close");
9
10   private JMSException myException;
11
12   public void close() throws JMSException {
13     myCloseCalls.inc();
14   }
15
16   public int getDeliveryMode() throws JMSException {
17     notImplemented();
18     return 0;
19   }
20
21   public boolean getDisableMessageID() throws JMSException {
22     notImplemented();
23     return false;
24   }
25
26   public boolean getDisableMessageTimestamp() throws JMSException {
27     notImplemented();
28     return false;
29   }
30
31   public int getPriority() throws JMSException {
32     notImplemented();
33     return 0;
34   }
35
36   public long getTimeToLive() throws JMSException {
37     notImplemented();
38     return 0l;
39   }
40
41   public void setDeliveryMode(int deliveryMode) throws JMSException {
42     notImplemented();
43   }
44
45   public void setDisableMessageID(boolean value) throws JMSException {
46     notImplemented();
47   }
48
49   public void setDisableMessageTimestamp(boolean value) throws JMSException {
50     notImplemented();
51   }
52
53   public void setPriority(int defaultPriority) throws JMSException {
54     notImplemented();
55   }
56
57   public void setTimeToLive(long timeToLive) throws JMSException {
58     notImplemented();
59   }
60
61   public void setExpectedCloseCalls(int callCount) {
62     myCloseCalls.setExpected(callCount);
63   }
64
65   public void setupThrowException(JMSException e) {
66     myException = e;
67   }
68
69   protected void throwExceptionIfAny() throws JMSException {
70     if (null != myException) {
71       throw myException;
72     }
73   }
74 }
Popular Tags