Changeset 58 for trunk/src/test
- Timestamp:
- 06/25/13 16:38:31 (11 years ago)
- Location:
- trunk/src/test/java/omq/test
- Files:
-
- 1 added
- 1 deleted
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/test/java/omq/test/multiProcess/MultiProcessTest.java
r57 r58 21 21 public class MultiProcessTest { 22 22 public static Broker broker; 23 public static Number remoteNumber;23 public static NumberClient remoteNumber; 24 24 25 25 public MultiProcessTest(String type) throws Exception { … … 44 44 45 45 broker = new Broker(env); 46 remoteNumber = broker.lookup("number", Number .class);46 remoteNumber = broker.lookup("number", NumberClient.class); 47 47 } 48 48 … … 85 85 int x = 10; 86 86 remoteNumber.setNumber(x); 87 int a = remoteNumber.getNum er();87 int a = remoteNumber.getNumber(); 88 88 assertEquals(0, a); 89 int b = remoteNumber.getNum er();89 int b = remoteNumber.getNumber(); 90 90 assertEquals(x, b); 91 91 remoteNumber.setNumber(0); … … 98 98 remoteNumber.setMultiNumber(x); 99 99 Thread.sleep(200); 100 int a = remoteNumber.getNum er();101 int b = remoteNumber.getNum er();100 int a = remoteNumber.getNumber(); 101 int b = remoteNumber.getNumber(); 102 102 assertEquals(x, a); 103 103 assertEquals(x, b); 104 int[] number = remoteNumber.getMultiNumber(); 105 assertEquals(x, number[0]); 106 assertEquals(x, number[1]); 104 107 remoteNumber.setMultiNumber(0); 105 108 Thread.sleep(200); -
trunk/src/test/java/omq/test/multiProcess/Number.java
r54 r58 2 2 3 3 import omq.Remote; 4 import omq.client.annotation.AsyncMethod;5 import omq.client.annotation.MultiMethod;6 import omq.client.annotation.RemoteInterface;7 import omq.client.annotation.SyncMethod;8 4 9 @RemoteInterface10 5 public interface Number extends Remote { 11 @SyncMethod(timeout = 1000)12 6 public void setNumber(int x); 13 7 14 @SyncMethod(timeout = 1000) 15 public int getNumer(); 8 public int getNumber(); 16 9 17 @MultiMethod18 @AsyncMethod19 10 public void setMultiNumber(int x); 11 12 public int getMultiNumber(); 20 13 } -
trunk/src/test/java/omq/test/multiProcess/NumberImpl.java
r54 r58 1 1 package omq.test.multiProcess; 2 2 3 import omq.client.annotation.AsyncMethod;4 import omq.client.annotation.MultiMethod;5 import omq.client.annotation.SyncMethod;6 3 import omq.server.RemoteObject; 7 4 … … 20 17 } 21 18 22 @Override23 @SyncMethod24 19 public void setNumber(int x) { 25 20 this.x = x; 26 21 } 27 22 28 @Override 29 @SyncMethod(timeout = 1000) 30 public int getNumer() { 23 public int getNumber() { 31 24 return x; 32 25 } 33 26 34 @Override35 @MultiMethod36 @AsyncMethod37 27 public void setMultiNumber(int x) { 38 28 this.x = x; 39 29 } 40 30 31 public int getMultiNumber() { 32 return x; 33 } 34 41 35 }
Note: See TracChangeset
for help on using the changeset viewer.