glassfish
  1. glassfish
  2. GLASSFISH-201

new assertion: only SFSB can use container managed EM with extended PC

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 9.0pe
    • Fix Version/s: 9.0pe
    • Component/s: verifier
    • Labels:
      None
    • Environment:

      Operating System: All
      Platform: All

    • Issuezilla Id:
      201

      Description

      Java Persistence API PFD spec:
      5.6.1.2 Container-managed Extended Persistence Context
      A container-managed extended persistence context exists from the point at which
      the container-managed entity manager has been obtained by dependency injection
      or through JNDI lookup until it is closed by the container. Such an extended
      persistence context can only be initiated within the scope of a stateful session
      bean and is closed by the container when the @Remove method of the stateful
      session bean completes (or the stateful session bean instance is otherwise
      destroyed).

      1. 201.tar
        90 kB
        Bhavanishankar

        Activity

        Hide
        Sanjeeb Sahoo added a comment -

        We can write a test following design of PUMatchingEMRefTest test, where bulk of
        the test logic stays in an abstract class and each container specific test
        provides the list of entity manager references. Some thing like:

        public abstract class AbstractOnlySFSBUsesExtendedEMTest extends VerifierTest
        implements VerifierCheck {
        public Result check(Descriptor d) {
        ...
        for (EntityManagerReference emRef : getEMRefs(d)) {
        if(emRef.getPersistenceContextType() == EXTENDED && !isSFSB(d))

        { report FAILURE; }

        }
        ...
        }
        // these two methods need to be implemented in concrete test.
        protected abstract Collection<EntityManagerReference> getEMRefs(Descriptor d);
        protected boolean isSFSB(Descriptor d);
        }

        Show
        Sanjeeb Sahoo added a comment - We can write a test following design of PUMatchingEMRefTest test, where bulk of the test logic stays in an abstract class and each container specific test provides the list of entity manager references. Some thing like: public abstract class AbstractOnlySFSBUsesExtendedEMTest extends VerifierTest implements VerifierCheck { public Result check(Descriptor d) { ... for (EntityManagerReference emRef : getEMRefs(d)) { if(emRef.getPersistenceContextType() == EXTENDED && !isSFSB(d)) { report FAILURE; } } ... } // these two methods need to be implemented in concrete test. protected abstract Collection<EntityManagerReference> getEMRefs(Descriptor d); protected boolean isSFSB(Descriptor d); }
        Hide
        Bhavanishankar added a comment -

        Checking in LocalStrings.properties;
        /cvs/glassfish/avk/src/tools/com/sun/enterprise/tools/verifier/LocalStrings.properties,v
        <-- LocalStrings.properties
        new revision: 1.67; previous revision: 1.66
        done
        Checking in TestNamesApp.xml;
        /cvs/glassfish/avk/config/verifier/TestNamesApp.xml,v <-- TestNamesApp.xml
        new revision: 1.8; previous revision: 1.7
        done
        Checking in TestNamesAppClient.xml;
        /cvs/glassfish/avk/config/verifier/TestNamesAppClient.xml,v <--
        TestNamesAppClient.xml
        new revision: 1.12; previous revision: 1.11
        done
        Checking in TestNamesEjb.xml;
        /cvs/glassfish/avk/config/verifier/TestNamesEjb.xml,v <-- TestNamesEjb.xml
        new revision: 1.29; previous revision: 1.28
        done
        Checking in TestNamesWeb.xml;
        /cvs/glassfish/avk/config/verifier/TestNamesWeb.xml,v <-- TestNamesWeb.xml
        new revision: 1.12; previous revision: 1.11
        done
        RCS file:
        /cvs/glassfish/avk/src/tools/com/sun/enterprise/tools/verifier/tests/AbstractPersistenceContextType.java,v
        done
        Checking in AbstractPersistenceContextType.java;
        /cvs/glassfish/avk/src/tools/com/sun/enterprise/tools/verifier/tests/AbstractPersistenceContextType.java,v
        <-- AbstractPersistenceContextType.java
        initial revision: 1.1
        done
        RCS file:
        /cvs/glassfish/avk/src/tools/com/sun/enterprise/tools/verifier/tests/ejb/ejb30/PersistenceContextType.java,v
        done
        Checking in ejb/ejb30/PersistenceContextType.java;
        /cvs/glassfish/avk/src/tools/com/sun/enterprise/tools/verifier/tests/ejb/ejb30/PersistenceContextType.java,v
        <-- PersistenceContextType.java
        initial revision: 1.1
        done
        RCS file:
        /cvs/glassfish/avk/src/tools/com/sun/enterprise/tools/verifier/tests/web/PersistenceContextType.java,v
        done
        Checking in web/PersistenceContextType.java;
        /cvs/glassfish/avk/src/tools/com/sun/enterprise/tools/verifier/tests/web/PersistenceContextType.java,v
        <-- PersistenceContextType.java
        initial revision: 1.1
        done

        Show
        Bhavanishankar added a comment - Checking in LocalStrings.properties; /cvs/glassfish/avk/src/tools/com/sun/enterprise/tools/verifier/LocalStrings.properties,v <-- LocalStrings.properties new revision: 1.67; previous revision: 1.66 done Checking in TestNamesApp.xml; /cvs/glassfish/avk/config/verifier/TestNamesApp.xml,v <-- TestNamesApp.xml new revision: 1.8; previous revision: 1.7 done Checking in TestNamesAppClient.xml; /cvs/glassfish/avk/config/verifier/TestNamesAppClient.xml,v <-- TestNamesAppClient.xml new revision: 1.12; previous revision: 1.11 done Checking in TestNamesEjb.xml; /cvs/glassfish/avk/config/verifier/TestNamesEjb.xml,v <-- TestNamesEjb.xml new revision: 1.29; previous revision: 1.28 done Checking in TestNamesWeb.xml; /cvs/glassfish/avk/config/verifier/TestNamesWeb.xml,v <-- TestNamesWeb.xml new revision: 1.12; previous revision: 1.11 done RCS file: /cvs/glassfish/avk/src/tools/com/sun/enterprise/tools/verifier/tests/AbstractPersistenceContextType.java,v done Checking in AbstractPersistenceContextType.java; /cvs/glassfish/avk/src/tools/com/sun/enterprise/tools/verifier/tests/AbstractPersistenceContextType.java,v <-- AbstractPersistenceContextType.java initial revision: 1.1 done RCS file: /cvs/glassfish/avk/src/tools/com/sun/enterprise/tools/verifier/tests/ejb/ejb30/PersistenceContextType.java,v done Checking in ejb/ejb30/PersistenceContextType.java; /cvs/glassfish/avk/src/tools/com/sun/enterprise/tools/verifier/tests/ejb/ejb30/PersistenceContextType.java,v <-- PersistenceContextType.java initial revision: 1.1 done RCS file: /cvs/glassfish/avk/src/tools/com/sun/enterprise/tools/verifier/tests/web/PersistenceContextType.java,v done Checking in web/PersistenceContextType.java; /cvs/glassfish/avk/src/tools/com/sun/enterprise/tools/verifier/tests/web/PersistenceContextType.java,v <-- PersistenceContextType.java initial revision: 1.1 done
        Hide
        Bhavanishankar added a comment -

        Integrated in b40.

        Show
        Bhavanishankar added a comment - Integrated in b40.
        Hide
        Bhavanishankar added a comment -

        Created an attachment (id=106)
        testcase - 201/build/blog5.ear

        Show
        Bhavanishankar added a comment - Created an attachment (id=106) testcase - 201/build/blog5.ear

          People

          • Assignee:
            Bhavanishankar
            Reporter:
            Sanjeeb Sahoo
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: