@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()); }
@Test(expected = IllegalArgumentException.class) public void addOrderBy_tableIllegalColumn_shouldFail() throws SQLException { container.addOrderBy(new OrderBy("asdf", true)); }