HHH-6772 org.hibernate.ejb.test.BaseEntityManagerFunctionalTestCase overrides system properties
This commit is contained in:
parent
2bbb3074d4
commit
a9064790e3
|
@ -139,7 +139,7 @@ public abstract class BaseEntityManagerFunctionalTestCase extends BaseUnitTestCa
|
||||||
}
|
}
|
||||||
|
|
||||||
protected Map getConfig() {
|
protected Map getConfig() {
|
||||||
Map<Object, Object> config = loadProperties();
|
Map<Object, Object> config = new HashMap<Object, Object>( );
|
||||||
ArrayList<Class> classes = new ArrayList<Class>();
|
ArrayList<Class> classes = new ArrayList<Class>();
|
||||||
|
|
||||||
classes.addAll( Arrays.asList( getAnnotatedClasses() ) );
|
classes.addAll( Arrays.asList( getAnnotatedClasses() ) );
|
||||||
|
@ -163,27 +163,6 @@ public abstract class BaseEntityManagerFunctionalTestCase extends BaseUnitTestCa
|
||||||
protected void addConfigOptions(Map options) {
|
protected void addConfigOptions(Map options) {
|
||||||
}
|
}
|
||||||
|
|
||||||
private Properties loadProperties() {
|
|
||||||
Properties props = new Properties();
|
|
||||||
InputStream stream = Persistence.class.getResourceAsStream( "/hibernate.properties" );
|
|
||||||
if ( stream != null ) {
|
|
||||||
try {
|
|
||||||
props.load( stream );
|
|
||||||
}
|
|
||||||
catch ( Exception e ) {
|
|
||||||
throw new RuntimeException( "could not load hibernate.properties" );
|
|
||||||
}
|
|
||||||
finally {
|
|
||||||
try {
|
|
||||||
stream.close();
|
|
||||||
}
|
|
||||||
catch ( IOException ignored ) {
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return props;
|
|
||||||
}
|
|
||||||
|
|
||||||
protected static final Class<?>[] NO_CLASSES = new Class[0];
|
protected static final Class<?>[] NO_CLASSES = new Class[0];
|
||||||
|
|
||||||
protected Class<?>[] getAnnotatedClasses() {
|
protected Class<?>[] getAnnotatedClasses() {
|
||||||
|
|
Loading…
Reference in New Issue