annotate src/main/java/alice/test/codesegment/local/TestCodeSegment.java @ 419:aefbe41fcf12 dispose

change tab to space
author sugi
date Tue, 15 Jul 2014 16:00:22 +0900 (2014-07-15)
parents 8f71c3e6f11d
children 145c425db88d
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
345
8f71c3e6f11d Change directory structure Maven standard
sugi
parents:
diff changeset
1 package alice.test.codesegment.local;
8f71c3e6f11d Change directory structure Maven standard
sugi
parents:
diff changeset
2
8f71c3e6f11d Change directory structure Maven standard
sugi
parents:
diff changeset
3 import alice.codesegment.CodeSegment;
8f71c3e6f11d Change directory structure Maven standard
sugi
parents:
diff changeset
4 import alice.datasegment.CommandType;
8f71c3e6f11d Change directory structure Maven standard
sugi
parents:
diff changeset
5 import alice.datasegment.Receiver;
8f71c3e6f11d Change directory structure Maven standard
sugi
parents:
diff changeset
6 import org.msgpack.type.Value;
8f71c3e6f11d Change directory structure Maven standard
sugi
parents:
diff changeset
7
8f71c3e6f11d Change directory structure Maven standard
sugi
parents:
diff changeset
8 public class TestCodeSegment extends CodeSegment {
419
aefbe41fcf12 change tab to space
sugi
parents: 345
diff changeset
9
aefbe41fcf12 change tab to space
sugi
parents: 345
diff changeset
10 // create input datasegment arg1
aefbe41fcf12 change tab to space
sugi
parents: 345
diff changeset
11 Receiver arg1 = ids.create(CommandType.PEEK);
aefbe41fcf12 change tab to space
sugi
parents: 345
diff changeset
12
aefbe41fcf12 change tab to space
sugi
parents: 345
diff changeset
13 @Override
aefbe41fcf12 change tab to space
sugi
parents: 345
diff changeset
14 public void run() {
aefbe41fcf12 change tab to space
sugi
parents: 345
diff changeset
15 System.out.println("type = " + arg1.type);
aefbe41fcf12 change tab to space
sugi
parents: 345
diff changeset
16 System.out.println("index = " + arg1.index);
aefbe41fcf12 change tab to space
sugi
parents: 345
diff changeset
17 System.out.println("data = " + arg1.getVal());
aefbe41fcf12 change tab to space
sugi
parents: 345
diff changeset
18 System.out.println(((Value)arg1.getVal()).getType());
aefbe41fcf12 change tab to space
sugi
parents: 345
diff changeset
19
aefbe41fcf12 change tab to space
sugi
parents: 345
diff changeset
20 if (arg1.index == 10) {
aefbe41fcf12 change tab to space
sugi
parents: 345
diff changeset
21 System.exit(0);
aefbe41fcf12 change tab to space
sugi
parents: 345
diff changeset
22 return;
aefbe41fcf12 change tab to space
sugi
parents: 345
diff changeset
23 }
aefbe41fcf12 change tab to space
sugi
parents: 345
diff changeset
24
aefbe41fcf12 change tab to space
sugi
parents: 345
diff changeset
25 TestCodeSegment cs = new TestCodeSegment();
aefbe41fcf12 change tab to space
sugi
parents: 345
diff changeset
26 cs.arg1.setKey("key1", arg1.index);
aefbe41fcf12 change tab to space
sugi
parents: 345
diff changeset
27
aefbe41fcf12 change tab to space
sugi
parents: 345
diff changeset
28 // DataSegment.get("local").update
aefbe41fcf12 change tab to space
sugi
parents: 345
diff changeset
29 ods.update("local", "key1", "String data");
aefbe41fcf12 change tab to space
sugi
parents: 345
diff changeset
30 }
345
8f71c3e6f11d Change directory structure Maven standard
sugi
parents:
diff changeset
31
8f71c3e6f11d Change directory structure Maven standard
sugi
parents:
diff changeset
32 }