diff options
author | 2017-05-15 12:53:18 -0400 | |
---|---|---|
committer | 2017-05-15 13:55:23 -0400 | |
commit | 7e547eaa55920dfbc9691eab33bb728395b50cf2 (patch) | |
tree | 5d0d64928b4754f65b427cb79b43718f16019582 /ECOMP-PAP-REST/src/test/java/org | |
parent | dda032f8bb161d54eb1f59de2b4a3efb774fc4d1 (diff) |
Policy TestSuite Enabled
Change-Id: I9f98c7dcdcf98713d73544956d873a84fc82adf7
Signed-off-by: Ravindra Bakkamanthala <rb7147@att.com>
Diffstat (limited to 'ECOMP-PAP-REST/src/test/java/org')
2 files changed, 25 insertions, 25 deletions
diff --git a/ECOMP-PAP-REST/src/test/java/org/openecomp/policy/pap/xacml/rest/components/PolicyDBDaoTest.java b/ECOMP-PAP-REST/src/test/java/org/openecomp/policy/pap/xacml/rest/components/PolicyDBDaoTest.java index 1009e03bc..6cb8e071b 100644 --- a/ECOMP-PAP-REST/src/test/java/org/openecomp/policy/pap/xacml/rest/components/PolicyDBDaoTest.java +++ b/ECOMP-PAP-REST/src/test/java/org/openecomp/policy/pap/xacml/rest/components/PolicyDBDaoTest.java @@ -89,7 +89,7 @@ public class PolicyDBDaoTest { em.getTransaction().commit(); } catch(Exception e){ - e.printStackTrace(); + logger.error("Exception Occured"+e); em.getTransaction().rollback(); } em.close(); @@ -97,7 +97,7 @@ public class PolicyDBDaoTest { dbd = PolicyDBDao.getPolicyDBDaoInstance(emf); dbd2 = PolicyDBDao.getPolicyDBDaoInstance(emf); } catch (Exception e) { - //e.printStackTrace(); + //logger.error("Exception Occured"+e); Assert.fail(); } @@ -217,7 +217,7 @@ public class PolicyDBDaoTest { try{ result = (PolicyEntity)getDataQuery.getSingleResult(); } catch(Exception e){ - e.printStackTrace(); + logger.error("Exception Occured"+e); Assert.fail(); } Assert.assertEquals(xmlFile, result.getPolicyData()); @@ -228,7 +228,7 @@ public class PolicyDBDaoTest { transac = dbd.getNewTransaction(); transac.deletePolicy(filePath); } catch(Exception e){ - e.printStackTrace(); + logger.error("Exception Occured"+e); Assert.fail(); } Assert.assertTrue(transac.isTransactionOpen()); @@ -246,7 +246,7 @@ public class PolicyDBDaoTest { transac = dbd.getNewTransaction(); transac.deletePolicy(filePath); } catch(Exception e){ - e.printStackTrace(); + logger.error("Exception Occured"+e); Assert.fail(); } transac.commitTransaction(); @@ -343,7 +343,7 @@ public class PolicyDBDaoTest { try{ result = (PolicyEntity)getDataQuery.getSingleResult(); } catch(Exception e){ - e.printStackTrace(); + logger.error("Exception Occured"+e); Assert.fail(); } String expectedData; @@ -360,7 +360,7 @@ public class PolicyDBDaoTest { transaction = dbd.getNewTransaction(); transaction.deletePolicy(policyFile.getAbsolutePath()); } catch(Exception e){ - e.printStackTrace(); + logger.error("Exception Occured"+e); Assert.fail(); } Assert.assertTrue(transaction.isTransactionOpen()); @@ -378,7 +378,7 @@ public class PolicyDBDaoTest { transaction = dbd.getNewTransaction(); transaction.deletePolicy(policyFile.getAbsolutePath()); } catch(Exception e){ - e.printStackTrace(); + logger.error("Exception Occured"+e); Assert.fail(); } //Assert.assertFalse(transaction.isTransactionOpen()); @@ -394,7 +394,7 @@ public class PolicyDBDaoTest { group.commitTransaction(); } catch(Exception e){ group.rollbackTransaction(); - e.printStackTrace(); + logger.error("Exception Occured"+e); Assert.fail(); } EntityManager em = emf.createEntityManager(); @@ -416,7 +416,7 @@ public class PolicyDBDaoTest { group.commitTransaction(); } catch(Exception e){ group.rollbackTransaction(); - e.printStackTrace(); + logger.error("Exception Occured"+e); Assert.fail(); } em = emf.createEntityManager(); @@ -436,7 +436,7 @@ public class PolicyDBDaoTest { group.commitTransaction(); } catch(Exception e){ group.rollbackTransaction(); - e.printStackTrace(); + logger.error("Exception Occured"+e); Assert.fail(); } group = dbd.getNewTransaction(); @@ -445,7 +445,7 @@ public class PolicyDBDaoTest { group.commitTransaction(); } catch(Exception e){ group.rollbackTransaction(); - e.printStackTrace(); + logger.error("Exception Occured"+e); Assert.fail(); } em = emf.createEntityManager(); @@ -467,7 +467,7 @@ public class PolicyDBDaoTest { group.commitTransaction(); } catch(Exception e){ group.rollbackTransaction(); - e.printStackTrace(); + logger.error("Exception Occured"+e); Assert.fail(); } em = emf.createEntityManager(); @@ -488,7 +488,7 @@ public class PolicyDBDaoTest { group.commitTransaction(); } catch(Exception e){ group.rollbackTransaction(); - e.printStackTrace(); + logger.error("Exception Occured"+e); Assert.fail(); } group = dbd.getNewTransaction(); @@ -497,7 +497,7 @@ public class PolicyDBDaoTest { group.commitTransaction(); } catch(Exception e){ group.rollbackTransaction(); - e.printStackTrace(); + logger.error("Exception Occured"+e); Assert.fail(); } @@ -507,7 +507,7 @@ public class PolicyDBDaoTest { group.commitTransaction(); } catch(Exception e){ group.rollbackTransaction(); - e.printStackTrace(); + logger.error("Exception Occured"+e); Assert.fail(); } group = dbd.getNewTransaction(); @@ -516,7 +516,7 @@ public class PolicyDBDaoTest { group.commitTransaction(); } catch(Exception e){ group.rollbackTransaction(); - e.printStackTrace(); + logger.error("Exception Occured"+e); Assert.fail(); } em = emf.createEntityManager(); @@ -536,7 +536,7 @@ public class PolicyDBDaoTest { group.commitTransaction(); } catch(Exception e){ group.rollbackTransaction(); - e.printStackTrace(); + logger.error("Exception Occured"+e); Assert.fail(); } em = emf.createEntityManager(); @@ -571,7 +571,7 @@ public class PolicyDBDaoTest { group.rollbackTransaction(); } catch(Exception e){ group.rollbackTransaction(); - e.printStackTrace(); + logger.error("Exception Occured"+e); Assert.fail(); } @@ -585,7 +585,7 @@ public class PolicyDBDaoTest { group.updateGroup(pdpGroup, "testuser"); group.commitTransaction(); }catch (Exception e){ - e.printStackTrace(); + logger.error("Exception Occured"+e); group.rollbackTransaction(); Assert.fail(); } @@ -628,7 +628,7 @@ public class PolicyDBDaoTest { System.out.println("Decrypted password: "+decr); Assert.assertEquals("testpassword", decr); } catch (Exception e) { - e.printStackTrace(); + logger.error("Exception Occured"+e); Assert.fail(); } @@ -662,7 +662,7 @@ public class PolicyDBDaoTest { } Thread.sleep(sleepTime); } catch (InterruptedException e) { - e.printStackTrace(); + logger.error("Exception Occured"+e); } if(logger.isDebugEnabled()){ Date date= new java.util.Date(); @@ -703,7 +703,7 @@ public class PolicyDBDaoTest { } Thread.sleep(sleepTime); } catch (InterruptedException e) { - e.printStackTrace(); + logger.error("Exception Occured"+e); } if(logger.isDebugEnabled()){ Date date= new java.util.Date(); @@ -798,7 +798,7 @@ public class PolicyDBDaoTest { + "\n TimeStamp = " + date.getTime() + "\n\n"); } - e.printStackTrace(); + logger.error("Exception Occured"+e); Assert.fail(); } diff --git a/ECOMP-PAP-REST/src/test/java/org/openecomp/policy/pap/xacml/rest/jpa/PolicyEntityTest.java b/ECOMP-PAP-REST/src/test/java/org/openecomp/policy/pap/xacml/rest/jpa/PolicyEntityTest.java index 046164013..04ddd66e5 100644 --- a/ECOMP-PAP-REST/src/test/java/org/openecomp/policy/pap/xacml/rest/jpa/PolicyEntityTest.java +++ b/ECOMP-PAP-REST/src/test/java/org/openecomp/policy/pap/xacml/rest/jpa/PolicyEntityTest.java @@ -625,7 +625,7 @@ public class PolicyEntityTest { p3.setScope(p1.getScope()); em.flush(); - fail("\n\n***********PolicyEntityTest: PolicyEntity Unique test for policyName and scope********" + 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() |