Mercurial > hg > Database > Alice
comparison 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 |
parents | 8f71c3e6f11d |
children | 145c425db88d |
comparison
equal
deleted
inserted
replaced
418:a269a019f5f8 | 419:aefbe41fcf12 |
---|---|
4 import alice.datasegment.CommandType; | 4 import alice.datasegment.CommandType; |
5 import alice.datasegment.Receiver; | 5 import alice.datasegment.Receiver; |
6 import org.msgpack.type.Value; | 6 import org.msgpack.type.Value; |
7 | 7 |
8 public class TestCodeSegment extends CodeSegment { | 8 public class TestCodeSegment extends CodeSegment { |
9 | 9 |
10 // create input datasegment arg1 | 10 // create input datasegment arg1 |
11 Receiver arg1 = ids.create(CommandType.PEEK); | 11 Receiver arg1 = ids.create(CommandType.PEEK); |
12 | 12 |
13 @Override | 13 @Override |
14 public void run() { | 14 public void run() { |
15 System.out.println("type = " + arg1.type); | 15 System.out.println("type = " + arg1.type); |
16 System.out.println("index = " + arg1.index); | 16 System.out.println("index = " + arg1.index); |
17 System.out.println("data = " + arg1.getVal()); | 17 System.out.println("data = " + arg1.getVal()); |
18 System.out.println(((Value)arg1.getVal()).getType()); | 18 System.out.println(((Value)arg1.getVal()).getType()); |
19 | 19 |
20 if (arg1.index == 10) { | 20 if (arg1.index == 10) { |
21 System.exit(0); | 21 System.exit(0); |
22 return; | 22 return; |
23 } | 23 } |
24 | 24 |
25 TestCodeSegment cs = new TestCodeSegment(); | 25 TestCodeSegment cs = new TestCodeSegment(); |
26 cs.arg1.setKey("key1", arg1.index); | 26 cs.arg1.setKey("key1", arg1.index); |
27 | 27 |
28 // DataSegment.get("local").update | 28 // DataSegment.get("local").update |
29 ods.update("local", "key1", "String data"); | 29 ods.update("local", "key1", "String data"); |
30 } | 30 } |
31 | 31 |
32 } | 32 } |