public void testConvert() throws Exception { Result result = makeResult("1"); TestUserBean bean = (TestUserBean) proc.convert("tableName", TestUserBean.class, result); assertEquals(Bytes.toString(bean.getRow()), "1"); assertEquals(bean.getId(), "value-id-1"); assertEquals(bean.getName(), "value-name-1"); }
public void testProperties() throws Exception { TestUserBean bean = new TestUserBean(); bean.setId("id-value"); bean.setName("name-value"); Properties p = proc.toProperties(bean, ANT_TYPE.COLUMN); assertEquals(p.get("id"), "id-value"); assertEquals(p.get("name"), "name-value"); }
public void testConvertList() throws Exception { Result result1 = makeResult("key1"); Result result2 = makeResult("key2"); Result result3 = makeResult("key3"); List<TestUserBean> list = (List<TestUserBean>) proc.convert("tableName", TestUserBean.class, result1, result2, result3); for (TestUserBean bean : list) { System.out.println("family=" + bean.getFamily()); System.out.println("id=" + bean.getId()); System.out.println("name=" + bean.getName()); } }