Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[eclipselink-dev] running [criteria] server tests on server with JPA 1.0 container

we are attempting to run the JPA server tests on NetWeaver 7.1, which has a  JPA 1.0 container. The container sees JPA 1.0 jars and wraps entity managers with a JPA 1.0 interface.
Now, the criteria tests are failing as they attempt to invoke the getCriteriaBuilder method, which does not exist in JPA 1.0.
There is a check in the CriteriaServerTestSuite.suite method, which should prevent the tests from being executed:
    public static Test suite() {
        TestSuite suite = new TestSuite();
        suite.setName("Criteria ServerTestSuite");
>>>>    if (! JUnitTestCase.isJPA10()) {
        return suite;
However, the check is executed on the client side, which sees JPA 2 and hence JUnitTestCase.isJPA10() returns false on the client. Consequently, the criteria tests are executed and fail on NetWeaver.
The situation raises some questions:
  • How should we deal with the particular case of the criteria queries?
  • Should we alter the JUnitTestCase.isJPA10()method so that it checks on the server side?
  • Should we shift the JUnitTestCase.isJPA10() method to the 200 individual tests?
  • How should we deal with 1.0 containers in general?
  • Should we indicate the JPA container version in the <server>.properties files and check for it (e.g. in build.xml or at runtime)?
  • How can we make visible that tests are not skipped on a server with JPA 1.0 container?
Adrian Görler

Pflichtangaben/Mandatory Disclosure Statements:

Back to the top