01: package net.sourceforge.jaxor.example.tests;
02:
03: import junit.framework.TestCase;
04: import net.sourceforge.jaxor.SqlAdapter;
05: import net.sourceforge.jaxor.example.domain.AddressBase;
06: import net.sourceforge.jaxor.example.domain.AddressImpl;
07: import net.sourceforge.jaxor.example.domain.AddressMetaRow;
08:
09: public class SqlAdapterTest extends TestCase {
10:
11: private static final String INSERT = "INSERT INTO address(street, city, state, zip_code, insert_user, insert_date, update_user, update_date, update_count, address_ID) VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?, ?)";
12: private static final String UPDATE = "UPDATE address SET street = ?,city = ?,state = ?,zip_code = ?,insert_user = ?,insert_date = ?,update_user = ?,update_date = ?,update_count = ? WHERE update_count = ? AND address_ID = ?";
13: private SqlAdapter adapter;
14:
15: protected void setUp() throws Exception {
16: super .setUp();
17: AddressBase entity = new AddressImpl();
18: entity.setMetaRow(new AddressMetaRow());
19: adapter = new SqlAdapter(entity);
20: }
21:
22: public void testInsertDebugString() {
23: assertEquals(INSERT, adapter.insertSQL());
24: }
25:
26: public void testUpdateDebugString() {
27: assertEquals(adapter.updateSQL(), UPDATE, adapter.updateSQL());
28: }
29:
30: }
|