Mercurial > hg > Database > jungle-network
diff 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 |
line wrap: on
line diff
--- a/src/jungle/test/codesegment/practice/StartCodeSegment.java Wed Jun 26 19:03:19 2013 +0900 +++ b/src/jungle/test/codesegment/practice/StartCodeSegment.java Thu Jun 27 21:02:58 2013 +0900 @@ -26,6 +26,17 @@ cs.arg1.setKey("log"); System.out.println("create TestCodeSegment"); + DefaultTreeOperationLog log = getSampleOperationLog(); + DefaultTreeOperationLogContainer logContainer = new DefaultTreeOperationLogContainer(); + try { + logContainer.unconvert(log); + ods.update("local", "log", logContainer); + } catch (IOException e) { + e.printStackTrace(); + } + } + + public DefaultTreeOperationLog getSampleOperationLog() { String key = "hoge"; ByteBuffer b = ByteBuffer.wrap("messagepack value".getBytes()); DefaultNodePath nodePath1 = new DefaultNodePath(); @@ -43,14 +54,7 @@ list.add(new DefaultTreeOperation(nodePath2, deleteOp)); list.add(new DefaultTreeOperation(nodePath1, deleteChild)); DefaultTreeOperationLog log = new DefaultTreeOperationLog(list, list.size()); - - DefaultTreeOperationLogContainer logContainer = new DefaultTreeOperationLogContainer(); - try { - logContainer.unconvert(log); - ods.update("local", "log", logContainer); - } catch (IOException e) { - e.printStackTrace(); - } - } + return log; + } }