KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > genimen > djeneric > test > strong > impl > TestPersistenceManager


1 package com.genimen.djeneric.test.strong.impl;
2
3 import com.genimen.djeneric.repository.DjMessenger;
4 import com.genimen.djeneric.repository.DjRepositoryDescriptor;
5 import com.genimen.djeneric.repository.DjSession;
6 import com.genimen.djeneric.repository.exceptions.DjenericException;
7 import com.genimen.djeneric.repository.rdbms.RdbmsPersistenceManager;
8 import com.genimen.djeneric.test.strong.TestException;
9 import com.genimen.djeneric.test.strong.TestSession;
10
11 // Place your custom code BETWEEN the following tags
12
//<DjenericManualCode id="1">
13
//</DjenericManualCode>
14

15 public class TestPersistenceManager extends RdbmsPersistenceManager
16 {
17   public TestPersistenceManager(DjRepositoryDescriptor rdesc) throws DjenericException
18   {
19     super(null, rdesc);
20   }
21
22   public TestPersistenceManager(DjMessenger msg, DjRepositoryDescriptor rdesc, String JavaDoc repositoryUser,
23                                 String JavaDoc repositoryPassword) throws DjenericException
24   {
25     super(msg, rdesc, repositoryUser, repositoryPassword);
26   }
27
28   public DjSession createSession() throws TestException
29   {
30     try
31     {
32       TestSessionImpl ses = new TestSessionImpl(this);
33       ses.setCommitAllowed(isCommitAllowed());
34
35       return ses;
36     }
37     catch (Exception JavaDoc x)
38     {
39       throw new TestException(x);
40     }
41   }
42
43   public TestSession createTestSession() throws TestException
44   {
45     return (TestSessionImpl) createSession();
46   }
47
48   // Place your custom code BETWEEN the following tags
49
//<DjenericManualCode>
50
//</DjenericManualCode>
51
}
Popular Tags