Mercurial > hg > Members > shoshi > jungle > jungle-core
changeset 355:173b053379e0
delete createBoard
author | Nozomi Teruya <e125769@ie.u-ryukyu.ac.jp> |
---|---|
date | Tue, 10 Oct 2017 20:06:27 +0900 |
parents | ee69ae1ab1a2 |
children | 97a09cc105d9 |
files | src/test/java/jp/ac/u_ryukyu/ie/cr/jungle/bbs/BBSTest.java src/test/java/jp/ac/u_ryukyu/ie/cr/jungleNetwork/logupdate/LogupdateTestStartCodeSegment.java |
diffstat | 2 files changed, 0 insertions(+), 52 deletions(-) [+] |
line wrap: on
line diff
--- a/src/test/java/jp/ac/u_ryukyu/ie/cr/jungle/bbs/BBSTest.java Mon Sep 25 20:11:49 2017 +0900 +++ b/src/test/java/jp/ac/u_ryukyu/ie/cr/jungle/bbs/BBSTest.java Tue Oct 10 20:06:27 2017 +0900 @@ -55,62 +55,11 @@ public static void main(String args[]){ BBSTest bbs = new BBSTest(); - bbs.createBoard(); bbs.createMessage(); bbs.checkMessage(); } - public void createBoard(){ - - requestCounter.incrementAndGet(); - JungleTree tree = jungle.getTreeByName(_board); - if (tree == null) { - throw new IllegalStateException(); - } - - Either<Error, JungleTreeEditor> either; - final long timestamp = System.currentTimeMillis(); - final ByteBuffer tBuffer = ByteBuffer.allocate(16); - tBuffer.putLong(timestamp); - do { - - TreeNode node = tree.getRootNode(); - int size = node.getChildren().size(); - DefaultNodePath path = new DefaultNodePath(); - - JungleTreeEditor editor = tree.getJungleTreeEditor(); - either = editor.addNewChildAt(path, size); - if (either.isA()) { - throw new IllegalStateException(); - } - editor = either.b(); - - NodeEditor e = new NodeEditor() { - public Either<Error, LoggingNode> edit(TreeNode node) { - LoggingNode logNode = wrap(node, null, new DefaultOperationLog()); - logNode = logNode.getAttributes().put("author", ByteBuffer.wrap(_author.getBytes())).b(); - logNode = logNode.getAttributes().put("mes", ByteBuffer.wrap(_message.getBytes())).b(); - logNode = logNode.getAttributes().put("key", ByteBuffer.wrap(_editKey.getBytes())).b(); - logNode = logNode.getAttributes().put("timestamp", tBuffer).b(); - return DefaultEither.newB(logNode); - } - - @Override - public LoggingNode wrap(TreeNode node,TreeNode node1, OperationLog op) { - return new LoggingNode(node, op); - } - }; - path = path.add(size); - either = editor.edit(path, e); - if (either.isA()) { - throw new IllegalStateException(); - } - editor = either.b(); - either = editor.success(); - } while (either.isA()); - } - public void createMessage(){ requestCounter.incrementAndGet(); JungleTree tree = jungle.getTreeByName(_board);
--- a/src/test/java/jp/ac/u_ryukyu/ie/cr/jungleNetwork/logupdate/LogupdateTestStartCodeSegment.java Mon Sep 25 20:11:49 2017 +0900 +++ b/src/test/java/jp/ac/u_ryukyu/ie/cr/jungleNetwork/logupdate/LogupdateTestStartCodeSegment.java Tue Oct 10 20:06:27 2017 +0900 @@ -50,7 +50,6 @@ new LogUpdateCodeSegment(); if (config.isWriteMode()){ - bbsTest.createBoard(); bbsTest.createMessage(); bbsTest.checkMessage(); }