EmpireBatchItemDao extends EmpireDao implements BatchItemDao { @Override public BatchItem create() { return new BatchItem(); } EmpireBatchItemDao(ProarcDatabase db); @Override BatchItem create(); @Override void update(BatchItem item); @Override BatchItem find(int id); @Override List<BatchItem> find(int batchId, String pid, String dsId, String state, String type); @Override void removeItems(int batchId);  }
@Test public void testCreate() throws Exception { IDataSet db = database( support.loadFlatXmlDataStream(getClass(), "user.xml"), support.loadFlatXmlDataStream(getClass(), "batch.xml") ); final IDatabaseConnection dbcon = support.getConnection(tx); support.cleanInsert(dbcon, db); support.initSequences(tx, 1, schema.tableBatchItem.id.getSequenceName() ); tx.commit(); int batchId = 1; BatchItem item = dao.create(); item.setBatchId(batchId); item.setFile("file1.xml"); item.setLog("log"); item.setPid("uuid:4a7c2e50-af36-11dd-9643-000d606f5dc6"); item.setState(ObjectState.LOADED.name()); item.setType(Type.OBJECT); dao.update(item); tx.commit(); ReplacementTable expected = new ReplacementTable( support.loadFlatXmlDataStream(getClass(), "batch_item.xml") .getTable(schema.tableBatchItem.getName())); expected.addReplacementObject("{$now}", item.getTimestamp()); Assertion.assertEquals(expected, dbcon.createTable(schema.tableBatchItem.getName())); }