[jboss-cvs] JBossAS SVN: r60758 - in branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/jacc: unit and 1 other directory.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Wed Feb 21 06:37:11 EST 2007


Author: wolfc
Date: 2007-02-21 06:37:10 -0500 (Wed, 21 Feb 2007)
New Revision: 60758

Modified:
   branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/jacc/StatelessBean.java
   branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/jacc/unit/JaccTestCase.java
Log:
Fixed some jacc tests

Modified: branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/jacc/StatelessBean.java
===================================================================
--- branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/jacc/StatelessBean.java	2007-02-21 11:36:07 UTC (rev 60757)
+++ branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/jacc/StatelessBean.java	2007-02-21 11:37:10 UTC (rev 60758)
@@ -28,6 +28,8 @@
 import javax.persistence.EntityManager;
 import javax.persistence.PersistenceContext;
 
+import org.hibernate.LockMode;
+import org.hibernate.ejb.HibernateEntityManager;
 import org.jboss.annotation.security.SecurityDomain;
 import org.jboss.annotation.ejb.AspectDomain;
 
@@ -45,7 +47,7 @@
    //TODO: put this in again once we update the hibernate jars (changes already made to hibernate)
    //@PersistenceContext(unitName="jacc-test")
    @PersistenceContext
-   EntityManager em;
+   HibernateEntityManager em;
 
    @PermitAll
    public int unchecked(int i)
@@ -86,6 +88,7 @@
    @PermitAll
    public void deleteAllEntity(AllEntity e)
    {
+      e = em.merge(e);
       em.remove(e);
    }
 
@@ -114,6 +117,7 @@
    @PermitAll
    public void deleteStarEntity(StarEntity e)
    {
+      e = em.merge(e);
       em.remove(e);
    }
 
@@ -143,6 +147,9 @@
    @PermitAll
    public void deleteSomeEntity(SomeEntity e)
    {
+      // If we follow specs we need to merge first, but that requires read permission
+      //e = em.merge(e);
+      em.getSession().lock(e, LockMode.NONE);
       em.remove(e);
    }
 }

Modified: branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/jacc/unit/JaccTestCase.java
===================================================================
--- branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/jacc/unit/JaccTestCase.java	2007-02-21 11:36:07 UTC (rev 60757)
+++ branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/jacc/unit/JaccTestCase.java	2007-02-21 11:37:10 UTC (rev 60758)
@@ -426,7 +426,7 @@
          t = t.getCause();
       }
 
-      throw new FailedException("EJBAccessException not thrown");
+      throw new FailedException("EJBAccessException not thrown", e);
    }
 
 
@@ -443,5 +443,10 @@
       {
          super(msg);
       }
+      
+      public FailedException(String msg, Throwable t)
+      {
+         super(msg, t);
+      }
    }
 }
\ No newline at end of file




More information about the jboss-cvs-commits mailing list