Test Super classes still get run and fail
Some of the early chapters use a super class for the Unit Test Cases, mainly to configure the Entity Manager. Because the super class has no tests though, the test process will fail.
Making the AbstractPersistentTest class abstract fixes this.
Making the AbstractPersistentTest class abstract fixes this.
1
person likes this idea
I like this idea!
Tell me when this idea gets some attention.
The more people who like this idea, the more it gets noticed.
The more people who like this idea, the more it gets noticed.
Create a customer community for your own organization
Plans starting at $19/month
-
Inappropriate?Making AbstractPersistentTest class abstract will have to be done in each module where it is used, it is not in a common module.
Also, there seems to be a strange query in a test for Chapter 4.
In the JPQLTest class, on line 303, the following line bears no resemblance any classes in that module so it will fail:
query = em.createQuery("select new org.javaee6.chapter06.jpql.CustomerDTO(c.firstName, c.lastName, c.address.country) from Customer03 c where c.firstName = 'Vincent'");
I think the line should be:
query = em.createQuery("select new com.apress.javaee6.chapter04.jpql.CustomerDTO(c.firstName, c.lastName, c.address.country) from Customer03 c where c.firstName = 'Vincent'"); -
Inappropriate?You are right. AbstractPersistentTest should be abstract and the JPQL query was wrong. I'm trying to fix all these little bugs in a new version of the code. I'll let you know.
Loading Profile...



EMPLOYEE