01: package org.apache.ojb.junit;
02:
03: import org.apache.ojb.broker.TestHelper;
04: import org.apache.ojb.odmg.ImplementationExt;
05: import org.apache.ojb.odmg.OJB;
06: import org.odmg.Database;
07: import org.odmg.Transaction;
08:
09: /**
10: *
11: *
12: * @author <a href="mailto:arminw@apache.org">Armin Waibel</a>
13: * @version $Id: ODMGTestCase.java,v 1.1.2.2 2005/05/07 16:02:57 arminw Exp $
14: */
15: public class ODMGTestCase extends OJBTestCase {
16: public ImplementationExt odmg;
17: public Database database;
18:
19: public ODMGTestCase() {
20: }
21:
22: public ODMGTestCase(String name) {
23: super (name);
24: }
25:
26: protected void setUp() throws Exception {
27: super .setUp();
28: odmg = OJB.getInstance();
29: database = odmg.newDatabase();
30: database.open(TestHelper.DEF_DATABASE_NAME,
31: Database.OPEN_READ_WRITE);
32: }
33:
34: protected void tearDown() throws Exception {
35: try {
36: Transaction currentTx = odmg.currentTransaction();
37: if (currentTx != null && currentTx.isOpen()) {
38: currentTx.abort();
39: }
40: } catch (Exception e) {
41: }
42:
43: super.tearDown();
44: }
45: }
|