Beispiel #1
0
  @Test
  public void nullData() {

    Table data = DbServer.create(dbname).query("select * from loan where 1=2");
    lt = ListTable.create().data(data);
    Table rt = lt.result();
    assertEquals(0, rt.rows());
    assertEquals(4, rt.cols());

    lt = ListTable.create().data(new Table());
    rt = lt.result();
    assertEquals(0, rt.rows());
    assertEquals(0, rt.cols());

    lt = ListTable.create().data(null);
    rt = lt.result();
    assertEquals(0, rt.rows());
    assertEquals(0, rt.cols());
  }
Beispiel #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()));
    }
  }