diff options
author | subhash kumar singh <subhash.kumar.singh@huawei.com> | 2018-01-15 12:12:09 +0000 |
---|---|---|
committer | subhash kumar singh <subhash.kumar.singh@huawei.com> | 2018-01-15 12:12:09 +0000 |
commit | becadde04b85e4d4c7df4a7e957fcff8aa8448a8 (patch) | |
tree | 64e64e6550efd2c9374a62e4b3ac0b931c7a2571 /mso-catalog-db/src/main/java | |
parent | 91293d4807d0f2946971dd066b1a5cb0f1d0e06e (diff) |
Improve test case for catalog database
Improve test case for catalog database.
Change-Id: I9938ca12edf2927368a79bffc21b199651f77879
Issue-ID: SO-360
Signed-off-by: subhash kumar singh <subhash.kumar.singh@huawei.com>
Diffstat (limited to 'mso-catalog-db/src/main/java')
-rw-r--r-- | mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/CatalogDatabase.java | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/CatalogDatabase.java b/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/CatalogDatabase.java index 926c48302f..e7491b7ec7 100644 --- a/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/CatalogDatabase.java +++ b/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/CatalogDatabase.java @@ -314,19 +314,18 @@ public class CatalogDatabase implements Closeable { * @return HeatEnvironment object or null if none found */ public HeatEnvironment getHeatEnvironmentByArtifactUuid(String artifactUuid) { - long startTime = System.currentTimeMillis (); - LOGGER.debug ("Catalog database - get Heat Environment with artifactUuid " + artifactUuid); + long startTime = System.currentTimeMillis(); + LOGGER.debug("Catalog database - get Heat Environment with artifactUuid " + artifactUuid); String hql = "FROM HeatEnvironment WHERE artifactUuid = :artifactUuidValue"; Query query = getSession().createQuery(hql); - query.setParameter ("artifactUuidValue", artifactUuid); + query.setParameter("artifactUuidValue", artifactUuid); HeatEnvironment environment = null; try { - environment = (HeatEnvironment) query.uniqueResult (); + environment = (HeatEnvironment) query.uniqueResult(); } catch (org.hibernate.NonUniqueResultException nure) { LOGGER.debug("Non Unique Result Exception - the Catalog Database does not match a unique row for Envt - data integrity error: artifactUuid='" + artifactUuid +"'", nure); LOGGER.error(MessageEnum.GENERAL_EXCEPTION, " non unique result for heatEnvironment artifactUuid=" + artifactUuid, "", "", MsoLogger.ErrorCode.DataError, "Non unique result for artifactUuid==" + artifactUuid); - environment = null; } catch (org.hibernate.HibernateException he) { LOGGER.debug("Hibernate Exception - while searching for envt: artifactUuid='" + artifactUuid + "' " + he.getMessage()); LOGGER.error(MessageEnum.GENERAL_EXCEPTION, " Hibernate exception searching envt for artifactUuid=" + artifactUuid, "", "", MsoLogger.ErrorCode.DataError, "Hibernate exception searching envt for artifactUuid=" + artifactUuid); |