Mercurial > hg > Members > nobuyasu > jungle-network
comparison src/jungle/test/codesegment/practice/StartJungleCodeSegment.java @ 18:2f1132767af2
implemented TestPutATtributeCodeSegment
author | one |
---|---|
date | Fri, 28 Jun 2013 19:32:52 +0900 |
parents | c767e7af4d88 |
children | 08e283ede7c9 |
comparison
equal
deleted
inserted
replaced
17:c767e7af4d88 | 18:2f1132767af2 |
---|---|
11 import alice.codesegment.CodeSegment; | 11 import alice.codesegment.CodeSegment; |
12 | 12 |
13 public class StartJungleCodeSegment { | 13 public class StartJungleCodeSegment { |
14 | 14 |
15 public static void main(String[] args) { | 15 public static void main(String[] args) { |
16 System.out.println("--StartJungleCodeSegment--"); | |
17 | |
16 JungleManager jm = new JungleManager(); | 18 JungleManager jm = new JungleManager(); |
17 JungleTree tree = jm.createTree("tree"); | 19 JungleTree tree = jm.createNewTree("tree"); |
18 | 20 |
19 /* Create TreeOperation */ | |
20 String key = "hoge"; | |
21 ByteBuffer b = ByteBuffer.wrap("messagepack value".getBytes()); | |
22 PutAttributeOperation op = new PutAttributeOperation(key, b); | |
23 DefaultNodePath p = new DefaultNodePath(); | |
24 p = p.add(1); | |
25 DefaultTreeOperation treeOp = new DefaultTreeOperation(p, op); | |
26 | 21 |
22 TestPutAttributeCodeSegment cs = new TestPutAttributeCodeSegment(); | |
23 DefaultTreeOperation treeOp = cs.getSampleOperation(); | |
24 | |
25 | |
27 DefaultTreeOperationContainer treeOperationContainer = new DefaultTreeOperationContainer(); | 26 DefaultTreeOperationContainer treeOperationContainer = new DefaultTreeOperationContainer(); |
28 try { | 27 try { |
29 treeOperationContainer.unconvert(treeOp); | 28 treeOperationContainer.unconvert(treeOp); |
30 } catch (IOException e) { | 29 } catch (IOException e) { |
31 e.printStackTrace(); | 30 e.printStackTrace(); |
32 } | 31 } |
33 | |
34 TestPutAttributeCodeSegment cs = new TestPutAttributeCodeSegment(); | |
35 cs.ods.update("local", "log", treeOperationContainer); | 32 cs.ods.update("local", "log", treeOperationContainer); |
36 | 33 |
37 | 34 |
38 } | 35 } |
39 | 36 |