1 package ch.qos.logback.classic.net.mock; 2 3 import java.util.ArrayList; 4 import java.util.List; 5 6 import javax.jms.Destination; 7 import javax.jms.JMSException; 8 import javax.jms.Message; 9 import javax.jms.Topic; 10 import javax.jms.TopicPublisher; 11 12 public class MockTopicPublisher implements TopicPublisher { 13 14 List<Message> messageList = new ArrayList<Message>(); 15 Topic topic; 16 17 public MockTopicPublisher(Topic topic) { 18 this.topic = topic; 19 } 20 21 public void publish(Message message) throws JMSException { 22 messageList.add(message); 23 } 24 25 public List<Message> getMessageList() { 26 return messageList; 27 } 28 29 public Topic getTopic() throws JMSException { 30 return topic; 31 } 32 33 public void publish(Message arg0, int arg1, int arg2, long arg3) throws JMSException { 34 35 } 36 37 public void publish(Topic arg0, Message arg1, int arg2, int arg3, long arg4) throws JMSException { 38 39 40 } 41 42 public void publish(Topic arg0, Message arg1) throws JMSException { 43 44 45 } 46 47 public void close() throws JMSException { 48 49 50 } 51 52 public int getDeliveryMode() throws JMSException { 53 54 return 0; 55 } 56 57 public Destination getDestination() throws JMSException { 58 59 return null; 60 } 61 62 public boolean getDisableMessageID() throws JMSException { 63 64 return false; 65 } 66 67 public boolean getDisableMessageTimestamp() throws JMSException { 68 69 return false; 70 } 71 72 public int getPriority() throws JMSException { 73 74 return 0; 75 } 76 77 public long getTimeToLive() throws JMSException { 78 79 return 0; 80 } 81 82 public void send(Destination arg0, Message arg1, int arg2, int arg3, long arg4) throws JMSException { 83 84 85 } 86 87 public void send(Destination arg0, Message arg1) throws JMSException { 88 89 90 } 91 92 public void send(Message arg0, int arg1, int arg2, long arg3) throws JMSException { 93 94 95 } 96 97 public void send(Message arg0) throws JMSException { 98 99 100 } 101 102 public void setDeliveryMode(int arg0) throws JMSException { 103 104 105 } 106 107 public void setDisableMessageID(boolean arg0) throws JMSException { 108 109 110 } 111 112 public void setDisableMessageTimestamp(boolean arg0) throws JMSException { 113 114 115 } 116 117 public void setPriority(int arg0) throws JMSException { 118 119 120 } 121 122 public void setTimeToLive(long arg0) throws JMSException { 123 124 125 } 126 127 }