-
- //first let's assure that you can save with the same name but a different scope
- p3.setPolicyName(p1.getPolicyName());
- p3.setScope("mckiou.kevin.kory");
- em.flush();
- logger.debug("\n\n***********PolicyEntityTest: PolicyEntity Unique test for policyName and scope********"
- + "\nSuccess! PolicyEntity uniqueness constraint allowed "
- + "\n policyId1 " + p1.getPolicyId()
- + "\n policyName1 " + p1.getPolicyName()
- + "\n scope1 = " + p1.getScope()
- + "\n policyId3 " + p3.getPolicyId()
- + "\n policyName3 " + p3.getPolicyName()
- + "\n scope3 = " + p3.getScope());
-
- //Assert that the policyIds are NOT the same to show that the automatic sequencing is working
- assert(p1.getPolicyId() != p3.getPolicyId());
-
- try{
- //Now set the scope the same to verify the uniqueness constraint will be enforced
- p3.setScope(p1.getScope());
-
- em.flush();
- logger.debug("\n\n***********PolicyEntityTest: PolicyEntity Unique test for policyName and scope********"
- + "\nFailed! PolicyEntity Uniqueness constraint FAILED and DID allow "
- + "\n policyId1 " + p1.getPolicyId()
- + "\n policyName1 " + p1.getPolicyName()
- + "\n scope1 = " + p1.getScope()
- + "\n policyId3 " + p3.getPolicyId()
- + "\n policyName3 " + p3.getPolicyName()
- + "\n scope3 = " + p3.getScope());;
+
+ //first let's assure that you can save with the same name but a different scope
+ p3.setPolicyName(p1.getPolicyName());
+ p3.setScope("mckiou.kevin.kory");
+ em.flush();
+ logger.debug("\n\n***********PolicyEntityTest: PolicyEntity Unique test for policyName and scope********"
+ + "\nSuccess! PolicyEntity uniqueness constraint allowed "
+ + "\n policyId1 " + p1.getPolicyId()
+ + "\n policyName1 " + p1.getPolicyName()
+ + "\n scope1 = " + p1.getScope()
+ + "\n policyId3 " + p3.getPolicyId()
+ + "\n policyName3 " + p3.getPolicyName()
+ + "\n scope3 = " + p3.getScope());
+
+ //Assert that the policyIds are NOT the same to show that the automatic sequencing is working
+ assert(p1.getPolicyId() != p3.getPolicyId());
+
+ try{
+ //Now set the scope the same to verify the uniqueness constraint will be enforced
+ p3.setScope(p1.getScope());
+
+ em.flush();
+ logger.debug("\n\n***********PolicyEntityTest: PolicyEntity Unique test for policyName and scope********"
+ + "\nFailed! PolicyEntity Uniqueness constraint FAILED and DID allow "
+ + "\n policyId1 " + p1.getPolicyId()
+ + "\n policyName1 " + p1.getPolicyName()
+ + "\n scope1 = " + p1.getScope()
+ + "\n policyId3 " + p3.getPolicyId()
+ + "\n policyName3 " + p3.getPolicyName()
+ + "\n scope3 = " + p3.getScope());;