Mercurial > hg > Members > tatsuki > bench > jungle-core
view src/test/java/jp/ac/u_ryukyu/ie/cr/shoshi/jungle/core/AttributesTest.java @ 39:7d78bbf4a9cd
added some tests
author | Shoshi TAMAKI |
---|---|
date | Tue, 29 Jan 2013 01:11:17 +0900 |
parents | cb9fabaedfd4 |
children | 0854f9a9e81d |
line wrap: on
line source
package jp.ac.u_ryukyu.ie.cr.shoshi.jungle.core; import org.junit.Ignore; import java.nio.ByteBuffer; import fj.P2; import fj.P; import fj.data.List; import junit.framework.Assert; import junit.framework.TestCase; @Ignore public abstract class AttributesTest extends TestCase { @SuppressWarnings("unchecked") public static List<P2<String,ByteBuffer>> ENTRIES = List.list( P.p("KEY1",ByteBuffer.wrap("VALUE1".getBytes())), P.p("KEY2",ByteBuffer.wrap("VALUE2".getBytes())), P.p("KEY3",ByteBuffer.wrap("VALUE3".getBytes())) ); public abstract Attributes instance(); public void testGet() { Attributes attrs = instance(); for(P2<String,ByteBuffer> entry : ENTRIES){ String key = entry._1(); ByteBuffer expect = entry._2(); ByteBuffer actual = attrs.get(key); Assert.assertNotNull(actual); Assert.assertEquals(0,actual.compareTo(expect)); } } }