Changeset 38 for trunk/objectmq/test
- Timestamp:
- 06/13/13 17:19:52 (12 years ago)
- Location:
- trunk/objectmq/test
- Files:
-
- 7 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/objectmq/test/calculatorTest/Calculator.java
r34 r38 21 21 22 22 @AsyncMethod 23 public void divideByZero() throws IOException, SerializerException; 23 public void asyncDivideByZero() throws IOException, SerializerException; 24 25 @SyncMethod 26 public int divideByZero(); 24 27 25 28 } -
trunk/objectmq/test/calculatorTest/CalculatorImpl.java
r34 r38 3 3 import java.io.IOException; 4 4 5 import omq.client.annotation.AsyncMethod;6 5 import omq.common.broker.Broker; 7 6 import omq.exception.SerializerException; … … 17 16 private static final long serialVersionUID = 1L; 18 17 18 @Override 19 19 public int add(int x, int y) { 20 20 return x + y; 21 21 } 22 22 23 @Override 23 24 public void mult(int x, int y) { 24 25 mult = x * y; … … 33 34 } 34 35 35 public void divideByZero() throws IOException, SerializerException { 36 @Override 37 public void asyncDivideByZero() throws IOException, SerializerException { 36 38 ZeroEvent ze = new ZeroEvent("my zero event", "zero-event"); 37 39 Broker.trigger(ze); … … 40 42 41 43 @Override 42 @AsyncMethod43 44 public void sendMessage(Message m) { 44 45 System.out.println("Code = "+m.getCode()); 45 46 System.out.println("Message = "+m.getMessage()); 46 47 } 47 48 48 49 @Override 50 public int divideByZero() { 51 int x = 2 / 0; 52 return x; 53 } 49 54 50 55 } -
trunk/objectmq/test/calculatorTest/ClientTest.java
r35 r38 26 26 env.setProperty(ParameterQueue.SERVER_PORT, "5672"); 27 27 env.setProperty(ParameterQueue.DURABLE_QUEUES, "false"); 28 env.setProperty(ParameterQueue.SERIALIZER_NAME, Serializer. kryo);28 env.setProperty(ParameterQueue.SERIALIZER_NAME, Serializer.java); 29 29 env.setProperty(ParameterQueue.ENABLECOMPRESSION, "false"); 30 30 … … 80 80 remoteCalc.addListener(zL); 81 81 82 remoteCalc. divideByZero();82 remoteCalc.asyncDivideByZero(); 83 83 84 84 Thread.sleep(200); … … 90 90 remoteCalc.sendMessage(m); 91 91 } 92 93 @Test(expected = ArithmeticException.class) 94 public void divideByZero() { 95 remoteCalc.divideByZero(); 96 } 92 97 } -
trunk/objectmq/test/calculatorTest/ServerTest.java
r35 r38 20 20 env.setProperty(ParameterQueue.SERVER_PORT, "5672"); 21 21 env.setProperty(ParameterQueue.DURABLE_QUEUES, "true"); 22 env.setProperty(ParameterQueue.SERIALIZER_NAME, Serializer. kryo);22 env.setProperty(ParameterQueue.SERIALIZER_NAME, Serializer.java); 23 23 env.setProperty(ParameterQueue.ENABLECOMPRESSION, "false"); 24 24
Note: See TracChangeset
for help on using the changeset viewer.