Mercurial > hg > Members > tatsuki > bench > jungle-core
view src/test/java/jp/ac/u_ryukyu/ie/cr/shoshi/jungle/core/AttributesTest.java @ 38:cb9fabaedfd4
added tests and changed testing provider to junit47
author | Shoshi TAMAKI |
---|---|
date | Mon, 28 Jan 2013 18:52:52 +0900 |
parents | |
children | 7d78bbf4a9cd |
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.assertEquals(0,actual.compareTo(expect)); } } }