com.bm
Class PersistenceXml

java.lang.Object
  extended by com.bm.PersistenceXml

public class PersistenceXml
extends java.lang.Object


Constructor Summary
PersistenceXml()
           
 
Method Summary
static java.lang.Class<?>[] getClasses(java.lang.ClassLoader cl, java.lang.String persitenceUnitName)
          Given a properly configured ejb3unit.properties file this will read a persistence.xml file and will give you back all the classes in that correspond to those in the persistence.xml.
static java.lang.Class<?>[] getClasses(java.lang.String persitenceUnitName)
          Given a properly configured ejb3unit.properties file this will read a persistence.xml file and will give you back all the classes in that correspond to those in the persistence.xml.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PersistenceXml

public PersistenceXml()
Method Detail

getClasses

public static java.lang.Class<?>[] getClasses(java.lang.String persitenceUnitName)
                                       throws java.io.IOException,
                                              java.lang.ClassNotFoundException
Given a properly configured ejb3unit.properties file this will read a persistence.xml file and will give you back all the classes in that correspond to those in the persistence.xml. This allows all known entities to be loaded before you run any tests. Hence your dependencies (within tests) should be satisfied.

Parameters:
persitenceUnitName - the name of the persistence unit
Returns:
the classes
Throws:
java.io.IOException - when there is a problem reading the xml
java.lang.ClassNotFoundException - when the xml points you to a non existant class

getClasses

public static java.lang.Class<?>[] getClasses(java.lang.ClassLoader cl,
                                              java.lang.String persitenceUnitName)
                                       throws java.io.IOException,
                                              java.lang.ClassNotFoundException
Given a properly configured ejb3unit.properties file this will read a persistence.xml file and will give you back all the classes in that correspond to those in the persistence.xml. This allows all known entities to be loaded before you run any tests. Hence your dependencies (within tests) should be satisfied.

Parameters:
cl - the class loader
persitenceUnitName - the name of the persistence unit
Returns:
the classes
Throws:
java.io.IOException - when there is a problem reading the xml
java.lang.ClassNotFoundException - when the xml points you to a non existant class


Copyright © 2008. All Rights Reserved.