01: /*
02: * User: Michael Rettig
03: * Date: Sep 1, 2002
04: * Time: 10:55:22 PM
05: */
06: package net.sourceforge.jaxor.example.tests;
07:
08: import net.sourceforge.jaxor.MetaRow;
09: import net.sourceforge.jaxor.example.simple.ContactEntity;
10: import net.sourceforge.jaxor.example.simple.ContactFinder;
11: import net.sourceforge.jaxor.example.simple.ContactMetaRow;
12:
13: public class SelectAllSqlTest extends TableTestCase {
14:
15: protected MetaRow getRow() {
16: return new ContactMetaRow();
17: }
18:
19: public void testSelectAllQuery() {
20: ContactFactory.createContact();
21: this .commit();
22: assertEquals(1, ContactFinder.selectAll().size());
23: assertEquals(1, ContactFinder.query(
24: ContactFinder.getBaseQuerySQL()).size());
25:
26: ContactEntity entity = ContactFactory.createContact();
27: //sql defined in xml def file exludes entities with -1 in select all
28: entity.setContactId(new Long(-1));
29: commit();
30: assertEquals(1, ContactFinder.selectAll().size());
31: assertEquals(2, ContactFinder.query(
32: ContactFinder.getBaseQuerySQL()).size());
33: }
34: }
|