Mercurial > hg > Members > nobuyasu > jungle-network
comparison src/jungle/test/codesegment/practice/StartCodeSegment.java @ 13:f3c0a65c3f12
TestCodeSegment use asClass
author | one |
---|---|
date | Thu, 27 Jun 2013 21:02:58 +0900 |
parents | 5376ac62ac08 |
children |
comparison
equal
deleted
inserted
replaced
12:80680cfcfd3b | 13:f3c0a65c3f12 |
---|---|
24 | 24 |
25 TestCodeSegment cs = new TestCodeSegment(); | 25 TestCodeSegment cs = new TestCodeSegment(); |
26 cs.arg1.setKey("log"); | 26 cs.arg1.setKey("log"); |
27 System.out.println("create TestCodeSegment"); | 27 System.out.println("create TestCodeSegment"); |
28 | 28 |
29 DefaultTreeOperationLog log = getSampleOperationLog(); | |
30 DefaultTreeOperationLogContainer logContainer = new DefaultTreeOperationLogContainer(); | |
31 try { | |
32 logContainer.unconvert(log); | |
33 ods.update("local", "log", logContainer); | |
34 } catch (IOException e) { | |
35 e.printStackTrace(); | |
36 } | |
37 } | |
38 | |
39 public DefaultTreeOperationLog getSampleOperationLog() { | |
29 String key = "hoge"; | 40 String key = "hoge"; |
30 ByteBuffer b = ByteBuffer.wrap("messagepack value".getBytes()); | 41 ByteBuffer b = ByteBuffer.wrap("messagepack value".getBytes()); |
31 DefaultNodePath nodePath1 = new DefaultNodePath(); | 42 DefaultNodePath nodePath1 = new DefaultNodePath(); |
32 nodePath1 = nodePath1.add(1); | 43 nodePath1 = nodePath1.add(1); |
33 DefaultNodePath nodePath2 = nodePath1.add(2); | 44 DefaultNodePath nodePath2 = nodePath1.add(2); |
41 list.add(new DefaultTreeOperation(nodePath1, appendChildOp2)); | 52 list.add(new DefaultTreeOperation(nodePath1, appendChildOp2)); |
42 list.add(new DefaultTreeOperation(nodePath2, putOp)); | 53 list.add(new DefaultTreeOperation(nodePath2, putOp)); |
43 list.add(new DefaultTreeOperation(nodePath2, deleteOp)); | 54 list.add(new DefaultTreeOperation(nodePath2, deleteOp)); |
44 list.add(new DefaultTreeOperation(nodePath1, deleteChild)); | 55 list.add(new DefaultTreeOperation(nodePath1, deleteChild)); |
45 DefaultTreeOperationLog log = new DefaultTreeOperationLog(list, list.size()); | 56 DefaultTreeOperationLog log = new DefaultTreeOperationLog(list, list.size()); |
46 | 57 return log; |
47 DefaultTreeOperationLogContainer logContainer = new DefaultTreeOperationLogContainer(); | 58 } |
48 try { | |
49 logContainer.unconvert(log); | |
50 ods.update("local", "log", logContainer); | |
51 } catch (IOException e) { | |
52 e.printStackTrace(); | |
53 } | |
54 } | |
55 | 59 |
56 } | 60 } |