5051525354555657
List<Something> ds = q.getAllSomethings(); assertNotNull(ds); Iterator<Something> i = ds.iterator(); assertTrue(i.hasNext()); Something s = i.next(); assertEquals("Keith", s.getName()); }
6263646566676869
List<Something> ds = q.findByName("Keith"); assertNotNull(ds); Iterator<Something> i = ds.iterator(); assertTrue(i.hasNext()); Something s = i.next(); assertEquals("Keith", s.getName()); }
727374757677787980
{ handle.insert("insert into something (id, name) values (?, ?)", 1, "Keith"); Iterator<Something> i = q.ittyAll(); assertTrue(i.hasNext()); Something s = i.next(); assertEquals("Keith", s.getName()); assertFalse(i.hasNext()); }
8081828384858687
} public void testSingle() throws Exception { handle.insert("insert into something (id, name) values (?, ?)", 1, "Keith"); Something s = q.findById(1); assertEquals("Keith", s.getName()); }
899091929394959697
public void testInsert() throws Exception { assertEquals(true, q.insert(1, "Keith")); Iterator<Something> as = q.ittyAll(); assertTrue(as.hasNext()); Something s = as.next(); assertEquals("Keith", s.getName()); assertFalse(as.hasNext()); }
9899100101102103104105106
public void testUpdate() throws Exception { q.insert(1, "Keith"); q.updateNameById("Eric", 1); Something s = q.findById(1); assertNotNull(s); assertEquals("Eric", s.getName()); }
112113114115116117118119120121122123124
assertFalse(q.ittyAll().hasNext()); } public void testBeanBinding() throws Exception { Something s = new Something(1, "Keith"); q.insert(s); s = q.findById(1); assertNotNull(s); assertEquals("Keith", s.getName()); }