示例#1
0
  @Before
  public void init() {

    DataGen.create(dbname);
    DbServer dbs = DbServer.create(dbname);

    Table data = dbs.query("select top 15 * from loan -- where 1=2");
    List<Object> meta =
        Tablex.asList(dbs.query("select nam from sys_infolder where cod like 'loan.%'"));
    Map<Object, Object> dd = Tablex.asMap(dbs.query("select * from dd_org"));

    lt.data(data).meta(meta).dd("orgid", dd);
  }
示例#2
0
  @Test
  public void result() {

    Table rt = lt.result();
    assertEquals(4, rt.cols());
    assertEquals(15, rt.rows());

    assertEquals(Row.createByTypes("月份", "机构代码", "客户名", "贷款额"), rt.head());
    List<?> L = Tablex.asList(DbServer.create(dbname).query("select name from dd_org"));
    for (int i = 0; i < rt.rows(); i++) {
      assertTrue(L.contains(rt.cell(i, 1).value()));
    }
  }