1   /***
2    * @(#)HibernateServiceImplTest.java
3    * 
4    * JFoxSOAF, Service-Oriented Application Framework
5    * 
6    * Copyright(c) JFoxSOAF Team
7    * 
8    * Licensed under the GNU LGPL, Version 2.1 (the "License"); 
9    * you may not use this file except in compliance with the License. 
10   * You may obtain a copy of the License at  
11   * 
12   * http://www.gnu.org/copyleft/lesser.html
13   * 
14   * Unless required by applicable law or agreed to in writing, software
15   * distributed under the License is distributed on an "AS IS" BASIS, 
16   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
17   * See the License for the specific language governing permissions and 
18   * limitations under the License. 
19   * 
20   * For more information, please visit:
21   * http://www.jfox.cn/confluence/display/JFoxSOAF/Home
22   * http://www.huihoo.org/jfox/jfoxsoaf
23   */
24  
25  package org.huihoo.jfox.soaf.services.persistence;
26  
27  import junit.framework.TestCase;
28  import net.sf.hibernate.HibernateException;
29  
30  /***
31   * JUnit test case for the
32   * {@link org.huihoo.jfox.soaf.services.persistence.HibernateService).
33   * 
34   * @author <a href="mailto:founder_chen@yahoo.com">Peter Cheng </a>
35   * @version $Revision: 1.5 $ $Date: 2005/04/27 08:08:25 $
36   * @version Revision: 1.0
37   */
38  
39  public class HibernateServiceImplTest extends TestCase {
40  
41      private HibernateService hService = null;
42      
43      /***
44       * @see TestCase#setUp()
45       */
46      protected void setUp() throws Exception {
47          super.setUp();
48          hService = new HibernateServiceImpl();
49      }
50  
51      /***
52       * @see TestCase#tearDown()
53       */
54      protected void tearDown() throws Exception {
55          super.tearDown();
56      }
57  
58      /***
59       * Test for Session openSession()
60       */
61      /*
62      public void testOpenSession() {
63          try {
64              assertNotNull(hService.openSession());
65          } catch (HibernateException e) {
66              e.printStackTrace();
67          }
68      }*/
69  
70      /***
71       * Test for Configuration getConfiguration()
72       */
73      public void testGetConfiguration() {
74          try {
75              assertNotNull(hService.getConfiguration());
76          } catch (HibernateException e) {
77              e.printStackTrace();
78          }
79      }
80  
81      /***
82       * Test for SessionFactory getSessionFactory()
83       */
84      public void testGetSessionFactory() {
85          try {
86              assertNotNull(hService.getSessionFactory());
87          } catch (HibernateException e) {
88              e.printStackTrace();
89          }
90      }
91  
92  }