Mercurial > hg > Members > tatsuki > bench > jungle-core
annotate src/test/java/jp/ac/u_ryukyu/ie/cr/shoshi/jungle/core/AttributesTest.java @ 190:a01507a9f826 default tip
change TreeMapBenchMark
author | tatsuki |
---|---|
date | Tue, 21 Apr 2015 17:28:20 +0900 |
parents | 8a0aa8fc137c |
children |
rev | line source |
---|---|
38
cb9fabaedfd4
added tests and changed testing provider to junit47
Shoshi TAMAKI
parents:
diff
changeset
|
1 package jp.ac.u_ryukyu.ie.cr.shoshi.jungle.core; |
cb9fabaedfd4
added tests and changed testing provider to junit47
Shoshi TAMAKI
parents:
diff
changeset
|
2 |
cb9fabaedfd4
added tests and changed testing provider to junit47
Shoshi TAMAKI
parents:
diff
changeset
|
3 import org.junit.Ignore; |
cb9fabaedfd4
added tests and changed testing provider to junit47
Shoshi TAMAKI
parents:
diff
changeset
|
4 import java.nio.ByteBuffer; |
cb9fabaedfd4
added tests and changed testing provider to junit47
Shoshi TAMAKI
parents:
diff
changeset
|
5 import fj.P2; |
cb9fabaedfd4
added tests and changed testing provider to junit47
Shoshi TAMAKI
parents:
diff
changeset
|
6 import fj.P; |
cb9fabaedfd4
added tests and changed testing provider to junit47
Shoshi TAMAKI
parents:
diff
changeset
|
7 import fj.data.List; |
cb9fabaedfd4
added tests and changed testing provider to junit47
Shoshi TAMAKI
parents:
diff
changeset
|
8 import junit.framework.Assert; |
cb9fabaedfd4
added tests and changed testing provider to junit47
Shoshi TAMAKI
parents:
diff
changeset
|
9 import junit.framework.TestCase; |
cb9fabaedfd4
added tests and changed testing provider to junit47
Shoshi TAMAKI
parents:
diff
changeset
|
10 |
cb9fabaedfd4
added tests and changed testing provider to junit47
Shoshi TAMAKI
parents:
diff
changeset
|
11 @Ignore |
cb9fabaedfd4
added tests and changed testing provider to junit47
Shoshi TAMAKI
parents:
diff
changeset
|
12 public abstract class AttributesTest extends TestCase |
cb9fabaedfd4
added tests and changed testing provider to junit47
Shoshi TAMAKI
parents:
diff
changeset
|
13 { |
cb9fabaedfd4
added tests and changed testing provider to junit47
Shoshi TAMAKI
parents:
diff
changeset
|
14 @SuppressWarnings("unchecked") |
152 | 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())) | |
38
cb9fabaedfd4
added tests and changed testing provider to junit47
Shoshi TAMAKI
parents:
diff
changeset
|
19 ); |
cb9fabaedfd4
added tests and changed testing provider to junit47
Shoshi TAMAKI
parents:
diff
changeset
|
20 |
cb9fabaedfd4
added tests and changed testing provider to junit47
Shoshi TAMAKI
parents:
diff
changeset
|
21 public abstract Attributes instance(); |
cb9fabaedfd4
added tests and changed testing provider to junit47
Shoshi TAMAKI
parents:
diff
changeset
|
22 |
cb9fabaedfd4
added tests and changed testing provider to junit47
Shoshi TAMAKI
parents:
diff
changeset
|
23 public void testGet() |
cb9fabaedfd4
added tests and changed testing provider to junit47
Shoshi TAMAKI
parents:
diff
changeset
|
24 { |
cb9fabaedfd4
added tests and changed testing provider to junit47
Shoshi TAMAKI
parents:
diff
changeset
|
25 Attributes attrs = instance(); |
cb9fabaedfd4
added tests and changed testing provider to junit47
Shoshi TAMAKI
parents:
diff
changeset
|
26 |
152 | 27 for(P2<String,ByteBuffer> entry : ENTRIES){ |
38
cb9fabaedfd4
added tests and changed testing provider to junit47
Shoshi TAMAKI
parents:
diff
changeset
|
28 String key = entry._1(); |
152 | 29 ByteBuffer expect = entry._2(); |
30 ByteBuffer actual = attrs.get(key); | |
39 | 31 Assert.assertNotNull(actual); |
38
cb9fabaedfd4
added tests and changed testing provider to junit47
Shoshi TAMAKI
parents:
diff
changeset
|
32 Assert.assertEquals(0,actual.compareTo(expect)); |
cb9fabaedfd4
added tests and changed testing provider to junit47
Shoshi TAMAKI
parents:
diff
changeset
|
33 } |
cb9fabaedfd4
added tests and changed testing provider to junit47
Shoshi TAMAKI
parents:
diff
changeset
|
34 } |
cb9fabaedfd4
added tests and changed testing provider to junit47
Shoshi TAMAKI
parents:
diff
changeset
|
35 } |