Mercurial > hg > Members > nobuyasu > jungle-network
diff src/jungle/test/codesegment/practice/TestPutAttributeCodeSegment.java @ 20:506388c02b4b
fix using edit method
author | one |
---|---|
date | Sun, 30 Jun 2013 04:11:23 +0900 |
parents | 08e283ede7c9 |
children | 2a378b94cc55 |
line wrap: on
line diff
--- a/src/jungle/test/codesegment/practice/TestPutAttributeCodeSegment.java Fri Jun 28 19:44:05 2013 +0900 +++ b/src/jungle/test/codesegment/practice/TestPutAttributeCodeSegment.java Sun Jun 30 04:11:23 2013 +0900 @@ -43,10 +43,6 @@ System.out.println("data = " + arg1.getVal()); System.out.println(((Value)arg1.getVal()).getType()); - if (arg1.index >= 10) { - System.exit(0); - } - DefaultTreeOperationContainer convertedOpContainer = arg1.asClass(DefaultTreeOperationContainer.class); TreeOperation convertedOp = null; try { @@ -56,25 +52,29 @@ } Jungle jungle = new JungleManager().getJungle(); JungleTree tree = jungle.getTreeByName("tree"); - NetworkDefaultJungleTreeEditor editor = (NetworkDefaultJungleTreeEditor) tree.getTreeEditor(); - edit(editor, convertedOp); +// NetworkDefaultJungleTreeEditor editor = (NetworkDefaultJungleTreeEditor) tree.getTreeEditor(); +// edit(editor, convertedOp); + JungleTreeEditor editor = tree.getTreeEditor(); editor.success(); - - TestPutAttributeCodeSegment cs = new TestPutAttributeCodeSegment(); - DefaultTreeOperation treeOp = cs.getSampleOperation("message"+arg1.index); - DefaultTreeOperationContainer treeOperationContainer = new DefaultTreeOperationContainer(); - try { - treeOperationContainer.unconvert(treeOp); - } catch (IOException e) { - e.printStackTrace(); - } - cs.ods.update("local", "log", treeOperationContainer); - + if (arg1.index >= 10) { + new ShowAttribute(); + ods.update("local","show",1); + } else { + TestPutAttributeCodeSegment cs = new TestPutAttributeCodeSegment(); + DefaultTreeOperation treeOp = cs.getSampleOperation("message"+arg1.index); + DefaultTreeOperationContainer treeOperationContainer = new DefaultTreeOperationContainer(); + try { + treeOperationContainer.unconvert(treeOp); + } catch (IOException e) { + e.printStackTrace(); + } + ods.update("local", "log", treeOperationContainer); + } } public DefaultTreeOperation getSampleOperation(String message) { /* Create TreeOperation */ - String key = "hoge"; + String key = "key1"; ByteBuffer b = ByteBuffer.wrap(message.getBytes()); PutAttributeOperation op = new PutAttributeOperation(key, b); DefaultNodePath p = new DefaultNodePath();