Changeset 67 for trunk/src/test


Ignore:
Timestamp:
06/27/13 11:44:54 (11 years ago)
Author:
stoda
Message:

EventTest? added

Location:
trunk/src/test/java/omq/test/event
Files:
1 added
2 edited
2 moved

Legend:

Unmodified
Added
Removed
  • trunk/src/test/java/omq/test/event/EventTrigger.java

    r66 r67  
    11package omq.test.event;
    22
     3import java.io.IOException;
     4
    35import omq.Remote;
     6import omq.client.annotation.AsyncMethod;
    47import omq.client.annotation.RemoteInterface;
     8import omq.exception.SerializerException;
    59
    610@RemoteInterface
    711public interface EventTrigger extends Remote {
    8 
     12        @AsyncMethod
     13        public void triggerEvent(String message) throws IOException, SerializerException;
    914}
  • trunk/src/test/java/omq/test/event/EventTriggerImpl.java

    r66 r67  
    11package omq.test.event;
    22
     3import java.io.IOException;
     4
     5import omq.exception.SerializerException;
    36import omq.server.RemoteObject;
    47
     
    912         */
    1013        private static final long serialVersionUID = 1L;
     14
     15        public void triggerEvent(String message) throws IOException, SerializerException {
     16                MessageEvent event = new MessageEvent(message);
     17                this.notifyEvent(event);
     18        }
    1119       
    1220}
  • trunk/src/test/java/omq/test/event/MessageEvent.java

    r66 r67  
    33import omq.common.event.Event;
    44
    5 public class ZeroEvent extends Event {
     5public class MessageEvent extends Event {
    66        /**
    77         *
     
    99        private static final long serialVersionUID = 1L;
    1010
    11         public ZeroEvent() {
     11        private String message;
     12
     13        public MessageEvent() {
    1214        }
    1315
    14         public ZeroEvent(String corrId, String topic) {
    15                 super(corrId, topic);
     16        public MessageEvent(String message) {
     17                this.message = message;
    1618        }
    1719
    18         public String getZeroMessage() {
    19                 return "divition by 0";
     20        public String getMessage() {
     21                return message;
     22        }
     23
     24        public void setMessage(String message) {
     25                this.message = message;
    2026        }
    2127
  • trunk/src/test/java/omq/test/event/MessageListener.java

    r66 r67  
    33import omq.common.event.EventListener;
    44
    5 public class ZeroListener extends EventListener<ZeroEvent> {
     5public class MessageListener extends EventListener<MessageEvent> {
     6        private String message;
    67
    7         public ZeroListener(String topic) {
    8                 super(topic);
     8        @Override
     9        public void notifyEvent(MessageEvent event) {
     10                message = event.getMessage();
    911        }
    1012
    11         @Override
    12         public void notifyEvent(ZeroEvent event) {
    13                 System.out.println(event.getZeroMessage());
     13        public String getMessage() {
     14                return message;
     15        }
     16
     17        public void setMessage(String message) {
     18                this.message = message;
    1419        }
    1520}
Note: See TracChangeset for help on using the changeset viewer.