KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > hibernate > test > connections > CurrentSessionConnectionTest


1 // $Id: CurrentSessionConnectionTest.java,v 1.1 2005/05/31 21:32:56 steveebersole Exp $
2
package org.hibernate.test.connections;
3
4 import org.hibernate.Session;
5 import org.hibernate.test.tm.DummyConnectionProvider;
6 import org.hibernate.test.tm.DummyTransactionManagerLookup;
7 import org.hibernate.cfg.Configuration;
8 import org.hibernate.cfg.Environment;
9 import junit.framework.Test;
10 import junit.framework.TestSuite;
11
12 /**
13  * Implementation of CurrentSessionConnectionTest.
14  *
15  * @author Steve Ebersole
16  */

17 public class CurrentSessionConnectionTest extends AggressiveReleaseTest {
18
19     public CurrentSessionConnectionTest(String JavaDoc name) {
20         super( name );
21     }
22
23     public static Test suite() {
24         return new TestSuite( CurrentSessionConnectionTest.class );
25     }
26
27     protected void configure(Configuration cfg) {
28         cfg.setProperty( Environment.CONNECTION_PROVIDER, DummyConnectionProvider.class.getName() );
29         cfg.setProperty( Environment.TRANSACTION_MANAGER_STRATEGY, DummyTransactionManagerLookup.class.getName() );
30     }
31
32     protected Session getSessionUnderTest() throws Throwable JavaDoc {
33         return getSessions().getCurrentSession();
34     }
35
36     protected void release(Session session) {
37         // do nothing, txn synch should release session as part of current-session definition
38
}
39 }
40
Popular Tags