Example #1
0
  @Test
  public void entityMap() {
    Entities map = new Entities();

    map.addEntity("foo", 1);
    assertEquals(1, map.getEntityValue("foo"));
    assertEquals("foo", map.getEntityName(1));

    // 查找表将被更新
    map.addEntity("bar", 2);
    map.addEntity("baz", 3);
    assertEquals(3, map.getEntityValue("baz"));
    assertEquals("baz", map.getEntityName(3));
  }
Example #2
0
 @Before
 public void init() {
   entities = new Entities();
   entities.addEntity("foo", 161);
   entities.addEntity("bar", 162);
 }