mirror of https://github.com/apache/openjpa.git
OPENJPA-1177 Preparing for upgrade to newer JSR-303 1.0.CR3 spec level with some extra tracing, as checkCVE() is going to be broken.
git-svn-id: https://svn.apache.org/repos/asf/openjpa/trunk@794412 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
aefd05089d
commit
21fec94f19
|
@ -295,6 +295,7 @@ public class TestValidationGroups extends PersistenceTestCase {
|
||||||
"default-validation-group",
|
"default-validation-group",
|
||||||
"org/apache/openjpa/integration/validation/persistence.xml");
|
"org/apache/openjpa/integration/validation/persistence.xml");
|
||||||
assertNotNull(emf);
|
assertNotNull(emf);
|
||||||
|
getLog(emf).trace("verifyDefaultValidationGroup(" + flush + ")");
|
||||||
// create EM
|
// create EM
|
||||||
OpenJPAEntityManager em = emf.createEntityManager();
|
OpenJPAEntityManager em = emf.createEntityManager();
|
||||||
assertNotNull(em);
|
assertNotNull(em);
|
||||||
|
@ -373,6 +374,7 @@ public class TestValidationGroups extends PersistenceTestCase {
|
||||||
"non-default-validation-group",
|
"non-default-validation-group",
|
||||||
"org/apache/openjpa/integration/validation/persistence.xml");
|
"org/apache/openjpa/integration/validation/persistence.xml");
|
||||||
assertNotNull(emf);
|
assertNotNull(emf);
|
||||||
|
getLog(emf).trace("verifyNonDefaultValidationGroup(" + flush + ")");
|
||||||
// create EM
|
// create EM
|
||||||
OpenJPAEntityManager em = emf.createEntityManager();
|
OpenJPAEntityManager em = emf.createEntityManager();
|
||||||
assertNotNull(em);
|
assertNotNull(em);
|
||||||
|
@ -499,6 +501,7 @@ public class TestValidationGroups extends PersistenceTestCase {
|
||||||
"default-validation-group",
|
"default-validation-group",
|
||||||
"org/apache/openjpa/integration/validation/persistence.xml");
|
"org/apache/openjpa/integration/validation/persistence.xml");
|
||||||
assertNotNull(emf);
|
assertNotNull(emf);
|
||||||
|
getLog(emf).trace("verifyDefaultPreRemove(" + flush + ")");
|
||||||
// create EM
|
// create EM
|
||||||
OpenJPAEntityManager em = emf.createEntityManager();
|
OpenJPAEntityManager em = emf.createEntityManager();
|
||||||
assertNotNull(em);
|
assertNotNull(em);
|
||||||
|
@ -551,6 +554,7 @@ public class TestValidationGroups extends PersistenceTestCase {
|
||||||
"pre-remove-default-validation-group",
|
"pre-remove-default-validation-group",
|
||||||
"org/apache/openjpa/integration/validation/persistence.xml");
|
"org/apache/openjpa/integration/validation/persistence.xml");
|
||||||
assertNotNull(emf);
|
assertNotNull(emf);
|
||||||
|
getLog(emf).trace("verifySpecifiedDefaultPreRemove(" + flush + ")");
|
||||||
// create EM
|
// create EM
|
||||||
OpenJPAEntityManager em = emf.createEntityManager();
|
OpenJPAEntityManager em = emf.createEntityManager();
|
||||||
assertNotNull(em);
|
assertNotNull(em);
|
||||||
|
@ -608,16 +612,18 @@ public class TestValidationGroups extends PersistenceTestCase {
|
||||||
ConstraintViolation<?> v = (ConstraintViolation<?>)i.next();
|
ConstraintViolation<?> v = (ConstraintViolation<?>)i.next();
|
||||||
boolean found = false;
|
boolean found = false;
|
||||||
for (String vio : vioProperties) {
|
for (String vio : vioProperties) {
|
||||||
if (v.getPropertyPath().equals(vio)) {
|
// TODO - getPropertyPath() will return a Path in future APIs
|
||||||
|
if (v.getPropertyPath().compareTo(vio) == 0) {
|
||||||
found = true;
|
found = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!found)
|
if (!found) {
|
||||||
fail("Unexpected ConstraintViolation for: " +
|
fail("Unexpected ConstraintViolation for: " +
|
||||||
v.getPropertyPath());
|
v.getPropertyPath());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Remove entities and close the emf an any open em's.
|
* Remove entities and close the emf an any open em's.
|
||||||
|
@ -631,7 +637,7 @@ public class TestValidationGroups extends PersistenceTestCase {
|
||||||
/**
|
/**
|
||||||
* Internal convenience method for getting the OpenJPA logger
|
* Internal convenience method for getting the OpenJPA logger
|
||||||
*
|
*
|
||||||
* @return
|
* @return Log
|
||||||
*/
|
*/
|
||||||
private Log getLog(OpenJPAEntityManagerFactorySPI emf) {
|
private Log getLog(OpenJPAEntityManagerFactorySPI emf) {
|
||||||
return emf.getConfiguration().getLog("Tests");
|
return emf.getConfiguration().getLog("Tests");
|
||||||
|
|
Loading…
Reference in New Issue