changeset 289:9ebe0ca360be

add differenceTree ParentIndex Test
author tatsuki
date Sat, 31 Dec 2016 02:20:14 +0900
parents fae289fa5f6c
children 9975e10187e8
files src/test/java/jp/ac/u_ryukyu/ie/cr/jungle/index/difference/ParentIndexPutTest.java
diffstat 1 files changed, 6 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/src/test/java/jp/ac/u_ryukyu/ie/cr/jungle/index/difference/ParentIndexPutTest.java	Sat Dec 31 01:48:22 2016 +0900
+++ b/src/test/java/jp/ac/u_ryukyu/ie/cr/jungle/index/difference/ParentIndexPutTest.java	Sat Dec 31 02:20:14 2016 +0900
@@ -3,7 +3,6 @@
 import jp.ac.u_ryukyu.ie.cr.jungle.DefaultJungle;
 import jp.ac.u_ryukyu.ie.cr.jungle.Jungle;
 import jp.ac.u_ryukyu.ie.cr.jungle.core.Children;
-import jp.ac.u_ryukyu.ie.cr.jungle.store.index.Index;
 import jp.ac.u_ryukyu.ie.cr.jungle.store.index.ParentIndex;
 import jp.ac.u_ryukyu.ie.cr.jungle.store.nodepath.DefaultNodePath;
 import jp.ac.u_ryukyu.ie.cr.jungle.store.nodepath.NodePath;
@@ -21,7 +20,6 @@
 
 
 public class ParentIndexPutTest {
-    private Index index;
     private ParentIndex parentIndex;
 
     @Test
@@ -45,7 +43,6 @@
         editor = either.b();
 
         parentIndex = tree.getParentIndex();
-        index = tree.getIndex();
         TreeNode root = tree.getRootNode();
         checkIndex(root);//indexが張られているかを調べる
         Assert.assertTrue(parentIndex.isEmpty());
@@ -65,12 +62,16 @@
 
         //更新後にちゃんとIndexが貼れているかを調べる
         parentIndex = tree.getParentIndex();
-        index = tree.getIndex();
         root = tree.getRootNode();
         checkIndex(root);
         Assert.assertTrue(parentIndex.isEmpty());
 
-    System.out.println("asdfasdfa");
+        Either<Error, JungleTree> oldTreeEither = tree.getOldTree(1);
+        Assert.assertFalse(oldTreeEither.isA());
+        JungleTree oldTree = oldTreeEither.b(); //過去のTreeのIndexが上書きされてないかを調べる
+        ParentIndex oldTreeParentIndex = oldTree.getParentIndex();
+        parentIndex = tree.getParentIndex();
+        Assert.assertNotEquals(oldTreeParentIndex,parentIndex);
     }
 
     public void checkIndex(TreeNode currentNode) {