Mercurial > hg > Members > tatsuki > bench > jungle-core
comparison 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 |
comparison
equal
deleted
inserted
replaced
37:35e327577b58 | 38:cb9fabaedfd4 |
---|---|
1 package jp.ac.u_ryukyu.ie.cr.shoshi.jungle.core; | |
2 | |
3 import org.junit.Ignore; | |
4 import java.nio.ByteBuffer; | |
5 import fj.P2; | |
6 import fj.P; | |
7 import fj.data.List; | |
8 import junit.framework.Assert; | |
9 import junit.framework.TestCase; | |
10 | |
11 @Ignore | |
12 public abstract class AttributesTest extends TestCase | |
13 { | |
14 @SuppressWarnings("unchecked") | |
15 public static List<P2<String,ByteBuffer>> ENTRIES = List.list( | |
16 P.p("KEY1",ByteBuffer.wrap("VALUE1".getBytes())), | |
17 P.p("KEY2",ByteBuffer.wrap("VALUE2".getBytes())), | |
18 P.p("KEY3",ByteBuffer.wrap("VALUE3".getBytes())) | |
19 ); | |
20 | |
21 public abstract Attributes instance(); | |
22 | |
23 public void testGet() | |
24 { | |
25 Attributes attrs = instance(); | |
26 | |
27 for(P2<String,ByteBuffer> entry : ENTRIES){ | |
28 String key = entry._1(); | |
29 ByteBuffer expect = entry._2(); | |
30 ByteBuffer actual = attrs.get(key); | |
31 Assert.assertEquals(0,actual.compareTo(expect)); | |
32 } | |
33 } | |
34 } |