diff src/jungle/test/bbs/codesegment/ChildLogCheckCodeSegment.java @ 58:4851344e120e

fix bug LogUpdateCodeSegment and ChildLogCheckCodeSegment
author one
date Mon, 15 Jul 2013 10:13:34 +0900
parents 1bfd13f831ea
children 8a532ca5df80
line wrap: on
line diff
--- a/src/jungle/test/bbs/codesegment/ChildLogCheckCodeSegment.java	Sun Jul 14 21:46:40 2013 +0900
+++ b/src/jungle/test/bbs/codesegment/ChildLogCheckCodeSegment.java	Mon Jul 15 10:13:34 2013 +0900
@@ -32,9 +32,18 @@
 		childLog.setKey("local","childLog");
 		hashLog.setKey("hashLog");
 	}
+
+	public ChildLogCheckCodeSegment(int index) {
+		host.setKey("host");
+		childLog.setKey("local","childLog", index);
+		hashLog.setKey("hashLog");
+	}
+	
 	
 	public void run() {
 		System.out.println("--ChildLogCheckCodeSegment--");
+		int index = childLog.index;
+		HashSetDataSegment ds = hashLog.asClass(HashSetDataSegment.class);
 		String hostName = host.asString();
 		DefaultTreeOperationLogContainer container = childLog.asClass(DefaultTreeOperationLogContainer.class);		
 		DefaultTreeOperationLog log = null;
@@ -53,12 +62,11 @@
 		JungleTreeEditor editor = tree.getTreeEditor();
 		Either<DefaultError, Integer> e = checkTimeStamp(tree.getRootNode(), container.getTimeStamp());
 		Either<Error, JungleTreeEditor> either; 
-		if(e.isB()) {	
+		if(e.isA()) {	
 			either = JungleManager.edit(editor, log, container.getPosition());
 		} else {
-			either = JungleManager.edit(editor, log);
+			either = JungleManager.edit(editor, log, e.b());
 		}
-//		Either<Error, JungleTreeEditor> either = JungleManager.edit(editor, log);
 		if(either.isA()) {
 			throw new IllegalStateException();
 		}
@@ -67,11 +75,10 @@
 		if(either.isA()) {
 			throw new IllegalStateException();			
 		}
-		HashSetDataSegment ds = hashLog.asClass(HashSetDataSegment.class);
 		ds.hash.add(container.getHashLogString());
 		ods.update("hashLog", ds);
 		ods.put("log", container);
-		new ChildLogCheckCodeSegment();
+		new ChildLogCheckCodeSegment(index);
 		if(!hostName.equals("node0")) {
 			ods.put("parent", "childLog", container);
 		}