    1   /*
    2    * Created on 2005-8-21
    3    *
    4    * TODO To change the template for this generated file go to
    5    * Window - Preferences - Java - Code Style - Code Templates
    6    */
    7   package org.huihoo.jfox.soaf.services.persistence;
    8
    9   import javax.jdo.PersistenceManagerFactory;
    10
    11  import junit.framework.TestCase;
    12
    13  import org.huihoo.jfox.soaf.container.ServiceFactory;
    14  import org.huihoo.jfox.soaf.container.ServiceLoader;
    15
    16  /***
    17   * @author peter.cheng
    18   *
    19   * TODO To change the template for this generated type comment go to
    20   * Window - Preferences - Java - Code Style - Code Templates
    21   */
    22  public class PersistenceManagerFactoryServiceImplTest extends TestCase {
    23
    24  	private PersistenceManagerFactoryService pmfService = null;
    25      private ServiceLoader sl = ServiceLoader.getInstance();
    26      private ServiceFactory sf = ServiceFactory.getInstance();
    27
    28      /***
    29       * @see TestCase#setUp()
    30       */
    31      protected void setUp() throws Exception {
    32          super.setUp();
    33          if (!sl.isServiceLoaded()) {
    34              sl.initService("jfoxsoaf-config.xml");
    35          }
    36          pmfService = (PersistenceManagerFactoryService)sf.getService(PersistenceManagerFactoryService.class);
    37      }
    38
    39  	/***
    40  	 * @see TestCase#tearDown()
    41  	 */
    42  	protected void tearDown() throws Exception {
    43  		super.tearDown();
    44  	}
    45
    46  	/***
    47       * Test for PersistenceManagerFactory getPersistenceManagerFactory()
    48       */
    49  	public void testGetPersistenceManagerFactory() {
    50  		PersistenceManagerFactory pmFactory = pmfService.getPersistenceManagerFactory(null);
    51  		assertNotNull(pmFactory);
    52  	}
    53
    54  }