Author: stliu
Date: 2010-05-08 02:46:00 -0400 (Sat, 08 May 2010)
New Revision: 19417
Modified:
entitymanager/branches/v3_4_0_GA_CP/src/test/java/org/hibernate/ejb/test/TestCase.java
Log:
JBPAPP-4235 HHH-4822 Add @FailureExpected annotation to annotations and entitymananger
modules to allow the skipping of tests
Modified:
entitymanager/branches/v3_4_0_GA_CP/src/test/java/org/hibernate/ejb/test/TestCase.java
===================================================================
---
entitymanager/branches/v3_4_0_GA_CP/src/test/java/org/hibernate/ejb/test/TestCase.java 2010-05-08
06:11:23 UTC (rev 19416)
+++
entitymanager/branches/v3_4_0_GA_CP/src/test/java/org/hibernate/ejb/test/TestCase.java 2010-05-08
06:46:00 UTC (rev 19417)
@@ -98,20 +98,33 @@
em.close();
log.warn( "The EntityManager is not closed. Closing it." );
}
+ em = null;
}
protected void handleUnclosedResources() {
- cleanUnclosed( this.em );
+ try {
+ cleanUnclosed( this.em );
+ } catch ( Exception ignore ) {
+ }
for ( Iterator iter = isolatedEms.iterator(); iter.hasNext(); ) {
- cleanUnclosed( ( EntityManager ) iter.next() );
+
+ try {
+ cleanUnclosed( ( EntityManager ) iter.next() );
+ } catch ( Exception ignore ) {
+ }
}
cfg = null;
}
protected void closeResources() {
- if ( factory != null ) {
- factory.close();
+ handleUnclosedResources();
+ try {
+ if ( factory != null ) {
+ factory.close();
+ factory = null;
+ }
+ } catch ( Exception ignore ) {
}
}
Show replies by date