diff src/test/java/jp/ac/u_ryukyu/ie/cr/shoshi/jungle/impl/clonable/NodePathCompareTest.java @ 138:b998fdc99bc0

add NodePathCompare and Test
author one
date Mon, 27 Oct 2014 19:04:59 +0900
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/test/java/jp/ac/u_ryukyu/ie/cr/shoshi/jungle/impl/clonable/NodePathCompareTest.java	Mon Oct 27 19:04:59 2014 +0900
@@ -0,0 +1,30 @@
+package jp.ac.u_ryukyu.ie.cr.shoshi.jungle.impl.clonable;
+
+import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.store.NodePath;
+import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.store.impl.DefaultNodePath;
+import junit.framework.Assert;
+
+import org.junit.Test;
+
+public class NodePathCompareTest {
+
+	@Test
+	public void NodePathCompare(){
+		NodePath path = new DefaultNodePath();
+		path = path.add(0).add(1).add(2);
+		System.out.println(path.toString());
+		
+		NodePath comparePath1 = new DefaultNodePath();
+		comparePath1 = comparePath1.add(0).add(1).add(2).add(3);
+		
+		NodePath comparePath2 = new DefaultNodePath();
+		comparePath2 = comparePath2.add(0).add(1);
+		
+		NodePath comparePath3 = new DefaultNodePath();
+		comparePath3 = comparePath3.add(1).add(1).add(2).add(3);
+		
+		Assert.assertTrue(path.compare(comparePath1));
+		Assert.assertFalse(path.compare(comparePath2));
+		Assert.assertFalse(path.compare(comparePath3));
+	}
+}