Mercurial > hg > Members > shoshi > jungle > jungle-core
changeset 261:55df1607dc0b Implementation_of_communication
add FilteringKeyTest
author | tatsuki |
---|---|
date | Sat, 19 Nov 2016 22:43:28 +0900 |
parents | 0e8172bc9d6c |
children | 741297b630f8 |
files | src/test/java/jp/ac/u_ryukyu/ie/cr/jungle/impl/node/FilteringKeyTest.java |
diffstat | 1 files changed, 41 insertions(+), 0 deletions(-) [+] |
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/jungle/impl/node/FilteringKeyTest.java Sat Nov 19 22:43:28 2016 +0900 @@ -0,0 +1,41 @@ +package jp.ac.u_ryukyu.ie.cr.jungle.impl.node; + +import jp.ac.u_ryukyu.ie.cr.jungle.store.impl.TreeNode; +import jp.ac.u_ryukyu.ie.cr.jungle.store.impl.TreeNodeAttributes; +import jp.ac.u_ryukyu.ie.cr.jungle.transaction.DefaultTreeNode; +import org.junit.Assert; +import org.junit.Test; + +import java.nio.ByteBuffer; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; + +/** + * Created by e115731 on 2016/11/19. + */ +public class FilteringKeyTest { + @Test + public void FilteringKeyTest(){ + TreeNode node = new DefaultTreeNode(); + TreeNodeAttributes attribute = node.getAttributes(); + node = attribute.put("1", ByteBuffer.wrap("1".getBytes())).b(); + attribute = node.getAttributes(); + node = attribute.put("2", ByteBuffer.wrap("2".getBytes())).b(); + attribute = node.getAttributes(); + node = attribute.put("3", ByteBuffer.wrap("3".getBytes())).b(); + attribute = node.getAttributes(); + node = attribute.put("4", ByteBuffer.wrap("4".getBytes())).b(); + attribute = node.getAttributes(); + List<String> filter = new ArrayList<>(); + filter.add("1"); + filter.add("2"); + Iterator<String> keys = attribute.getFilteringKey(filter); + while (keys.hasNext()) { + String key = keys.next(); + System.out.println(key); + Assert.assertNotEquals(key,"1"); + Assert.assertNotEquals(key,"2"); + } + } +}