@@ -573,6 +573,7 @@ public void testPropertiesForTransactionalEntityManager() {
573
573
EntityManager em = (EntityManager ) emC .getMock ();
574
574
emfMc .expectAndReturn (mockEmf .createEntityManager (props ), em );
575
575
emC .expectAndReturn (em .getDelegate (), new Object ());
576
+ emC .expectAndReturn (em .isOpen (), true );
576
577
em .close ();
577
578
578
579
emfMc .replay ();
@@ -602,6 +603,7 @@ public void testPropertiesForSharedEntityManager1() {
602
603
// only one call made - the first EM definition wins (in this case the one w/ the properties)
603
604
emfMc .expectAndReturn (mockEmf .createEntityManager (props ), em );
604
605
emC .expectAndReturn (em .getDelegate (), new Object (), 2 );
606
+ emC .expectAndReturn (em .isOpen (), true );
605
607
em .close ();
606
608
607
609
emfMc .replay ();
@@ -639,6 +641,7 @@ public void testPropertiesForSharedEntityManager2() {
639
641
// only one call made - the first EM definition wins (in this case the one w/o the properties)
640
642
emfMc .expectAndReturn (mockEmf .createEntityManager (), em );
641
643
emC .expectAndReturn (em .getDelegate (), new Object (), 2 );
644
+ emC .expectAndReturn (em .isOpen (), true );
642
645
em .close ();
643
646
644
647
emfMc .replay ();
@@ -832,6 +835,9 @@ private static class DummyInvocationHandler implements InvocationHandler, Serial
832
835
public static boolean closed ;
833
836
834
837
public Object invoke (Object proxy , Method method , Object [] args ) throws Throwable {
838
+ if ("isOpen" .equals (method .getName ())) {
839
+ return true ;
840
+ }
835
841
if ("close" .equals (method .getName ())) {
836
842
closed = true ;
837
843
return null ;
0 commit comments