KickJava   Java API By Example, From Geeks To Geeks.

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


1 package com.mockobjects.jms;
2
3 import javax.jms.*;
4 import com.mockobjects.*;
5
6 public class MockTopicPublisher extends MockMessagePublisher
7 implements TopicPublisher{
8
9     private ExpectationValue message = new ExpectationValue("message");
10
11     public void setExpectedMessage(Message message){
12         this.message.setExpected(message);
13     }
14
15     public Topic getTopic() throws JMSException{
16         notImplemented();
17         return null;
18     }
19
20     public void publish(Message message) throws JMSException{
21         this.message.setActual(message);
22     }
23
24     public void publish(Message message, int deliveryMode, int priority,
25     long timeToLive) throws JMSException{
26         this.message.setActual(message);
27     }
28
29     public void publish(Topic topic, Message message) throws JMSException{
30         this.message.setActual(message);
31     }
32
33     public void publish(Topic topic, Message message, int deliveryMode,
34     int priority, long timeToLive) throws JMSException{
35         this.message.setActual(message);
36     }
37
38 }
39
Popular Tags