コード例 #1
0
  @Test
  public void addOrderBy_table_shouldReorderResults() throws SQLException {
    // Ville, Kalle, Pelle, Börje
    assertEquals("Ville", container.getContainerProperty(container.firstItemId(), NAME).getValue());
    assertEquals("Börje", container.getContainerProperty(container.lastItemId(), NAME).getValue());

    container.addOrderBy(new OrderBy(NAME, true));
    // Börje, Kalle, Pelle, Ville
    assertEquals("Börje", container.getContainerProperty(container.firstItemId(), NAME).getValue());
    assertEquals("Ville", container.getContainerProperty(container.lastItemId(), NAME).getValue());
  }
コード例 #2
0
 @Test(expected = IllegalArgumentException.class)
 public void addOrderBy_tableIllegalColumn_shouldFail() throws SQLException {
   container.addOrderBy(new OrderBy("asdf", true));
 }