annotate src/alice/test/codesegment/local/TestCodeSegment.java @ 103:37f3483a869b working

remove bug from "CheckParentIndex" and "CheckLocalIndex"
author sugi
date Mon, 02 Jul 2012 11:16:01 +0900
parents df786bf8f036
children a8f77957a477
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
22
2ca2d961a8d2 implements outline of TopologyManager
kazz <kazz@cr.ie.u-ryukyu.ac.jp>
parents: 19
diff changeset
1 package alice.test.codesegment.local;
3
91057e15065f add DataSegment API and CodeSegment
one
parents:
diff changeset
2
91057e15065f add DataSegment API and CodeSegment
one
parents:
diff changeset
3 import alice.codesegment.CodeSegment;
18
72dd27d952b0 change InputDataSegment API
kazz <kazz@cr.ie.u-ryukyu.ac.jp>
parents: 16
diff changeset
4 import alice.datasegment.CommandType;
33
20c67f673224 change name of DataSegmentReceiver
kazz <kazz@cr.ie.u-ryukyu.ac.jp>
parents: 32
diff changeset
5 import alice.datasegment.Receiver;
97
df786bf8f036 add FishPoint.java and Test
sugi
parents: 71
diff changeset
6 import alice.test.topology.movement.FishPoint;
3
91057e15065f add DataSegment API and CodeSegment
one
parents:
diff changeset
7
91057e15065f add DataSegment API and CodeSegment
one
parents:
diff changeset
8 public class TestCodeSegment extends CodeSegment {
91057e15065f add DataSegment API and CodeSegment
one
parents:
diff changeset
9
57
7fa9ddb31f64 add comment
one
parents: 34
diff changeset
10 // create input datasegment arg1
33
20c67f673224 change name of DataSegmentReceiver
kazz <kazz@cr.ie.u-ryukyu.ac.jp>
parents: 32
diff changeset
11 Receiver arg1 = ids.create(CommandType.PEEK);
97
df786bf8f036 add FishPoint.java and Test
sugi
parents: 71
diff changeset
12 public TestCodeSegment(){
df786bf8f036 add FishPoint.java and Test
sugi
parents: 71
diff changeset
13 arg1.setKey("key1");
df786bf8f036 add FishPoint.java and Test
sugi
parents: 71
diff changeset
14 }
df786bf8f036 add FishPoint.java and Test
sugi
parents: 71
diff changeset
15 public TestCodeSegment(int index){
df786bf8f036 add FishPoint.java and Test
sugi
parents: 71
diff changeset
16 arg1.setKey("key1",index);
df786bf8f036 add FishPoint.java and Test
sugi
parents: 71
diff changeset
17 }
16
433e601a8e28 network bug fix
kazz <kazz@cr.ie.u-ryukyu.ac.jp>
parents: 13
diff changeset
18
3
91057e15065f add DataSegment API and CodeSegment
one
parents:
diff changeset
19 @Override
91057e15065f add DataSegment API and CodeSegment
one
parents:
diff changeset
20 public void run() {
18
72dd27d952b0 change InputDataSegment API
kazz <kazz@cr.ie.u-ryukyu.ac.jp>
parents: 16
diff changeset
21 System.out.println("index = " + arg1.index);
72dd27d952b0 change InputDataSegment API
kazz <kazz@cr.ie.u-ryukyu.ac.jp>
parents: 16
diff changeset
22 System.out.println("data = " + arg1.val);
103
37f3483a869b remove bug from "CheckParentIndex" and "CheckLocalIndex"
sugi
parents: 97
diff changeset
23 System.out.println("data = " + arg1.asClass(FishPoint.class));
18
72dd27d952b0 change InputDataSegment API
kazz <kazz@cr.ie.u-ryukyu.ac.jp>
parents: 16
diff changeset
24 System.out.println(arg1.val.getType());
103
37f3483a869b remove bug from "CheckParentIndex" and "CheckLocalIndex"
sugi
parents: 97
diff changeset
25 /*
97
df786bf8f036 add FishPoint.java and Test
sugi
parents: 71
diff changeset
26 FishPoint PD = this.arg1.asClass(FishPoint.class);
df786bf8f036 add FishPoint.java and Test
sugi
parents: 71
diff changeset
27
df786bf8f036 add FishPoint.java and Test
sugi
parents: 71
diff changeset
28 PD.setXY(PD.getX()+1,PD.getY()+1);
103
37f3483a869b remove bug from "CheckParentIndex" and "CheckLocalIndex"
sugi
parents: 97
diff changeset
29 */
18
72dd27d952b0 change InputDataSegment API
kazz <kazz@cr.ie.u-ryukyu.ac.jp>
parents: 16
diff changeset
30 if (arg1.index == 10) {
12
c4d6ff56b9bf unite Command and Reply
one
parents: 11
diff changeset
31 System.exit(0);
c4d6ff56b9bf unite Command and Reply
one
parents: 11
diff changeset
32 return;
c4d6ff56b9bf unite Command and Reply
one
parents: 11
diff changeset
33 }
97
df786bf8f036 add FishPoint.java and Test
sugi
parents: 71
diff changeset
34 /*
18
72dd27d952b0 change InputDataSegment API
kazz <kazz@cr.ie.u-ryukyu.ac.jp>
parents: 16
diff changeset
35 TestCodeSegment cs = new TestCodeSegment();
71
a3a2605e16a2 change checking debug mode of logger
kazz <kazz@cr.ie.u-ryukyu.ac.jp>
parents: 57
diff changeset
36 cs.arg1.setKey("key1", arg1.index);
97
df786bf8f036 add FishPoint.java and Test
sugi
parents: 71
diff changeset
37 */
df786bf8f036 add FishPoint.java and Test
sugi
parents: 71
diff changeset
38 new TestCodeSegment(arg1.index);
57
7fa9ddb31f64 add comment
one
parents: 34
diff changeset
39 // DataSegment.get("local").update
103
37f3483a869b remove bug from "CheckParentIndex" and "CheckLocalIndex"
sugi
parents: 97
diff changeset
40 ods.update("local", "key1", this.arg1.asClass(FishPoint.class));
3
91057e15065f add DataSegment API and CodeSegment
one
parents:
diff changeset
41 }
91057e15065f add DataSegment API and CodeSegment
one
parents:
diff changeset
42
91057e15065f add DataSegment API and CodeSegment
one
parents:
diff changeset
43 }