summaryrefslogtreecommitdiffstats
path: root/mso-catalog-db/src
diff options
context:
space:
mode:
authorxg353y <xg353y@intl.att.com>2017-04-11 13:30:42 +0200
committerxg353y <xg353y@intl.att.com>2017-04-11 15:34:19 +0200
commitb6b7bef8bdcad15af01ac88a038dd763ce59f68f (patch)
tree399d39da23aaa37701e487df064e3e0c27709ef3 /mso-catalog-db/src
parent19340cad94eeaa1b580f7c0c99531de499e8ca14 (diff)
[MSO-8] Update the maven dependency
Update the maven depenency for sdc-distribution-client to cooperate with the sdc changes. Change-Id: I2da936e5c40cb68c7181bb78307192dd5655b5dc Signed-off-by: xg353y <xg353y@intl.att.com>
Diffstat (limited to 'mso-catalog-db/src')
-rw-r--r--mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/CatalogDatabase.java1372
-rw-r--r--mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/HibernateUtilsCatalogDb.java45
-rw-r--r--mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/AllottedResourceCustomization.java123
-rw-r--r--mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/HeatEnvironment.java18
-rw-r--r--mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/HeatFiles.java29
-rw-r--r--mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/HeatTemplate.java28
-rw-r--r--mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/Model.java198
-rw-r--r--mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/ModelRecipe.java180
-rw-r--r--mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/NetworkResourceCustomization.java140
-rw-r--r--mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/ServiceMacroHolder.java141
-rw-r--r--mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/ServiceRecipe.java42
-rw-r--r--mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/ServiceToAllottedResources.java67
-rw-r--r--mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/ServiceToNetworks.java68
-rw-r--r--mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/VfModule.java89
-rw-r--r--mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/VnfResource.java82
-rw-r--r--mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/utils/MavenLikeVersioning.java9
-rw-r--r--mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/utils/RecordNotFoundException.java49
-rw-r--r--mso-catalog-db/src/main/resources/AllottedResourceCustomization.hbm.xml59
-rw-r--r--mso-catalog-db/src/main/resources/HeatEnvironment.hbm.xml17
-rw-r--r--mso-catalog-db/src/main/resources/HeatTemplate.hbm.xml26
-rw-r--r--mso-catalog-db/src/main/resources/ModelRecipe.hbm.xml87
-rw-r--r--mso-catalog-db/src/main/resources/NetworkRecipe.hbm.xml18
-rw-r--r--mso-catalog-db/src/main/resources/NetworkResource.hbm.xml16
-rw-r--r--mso-catalog-db/src/main/resources/NetworkResourceCustomization.hbm.xml59
-rw-r--r--mso-catalog-db/src/main/resources/Service.hbm.xml35
-rw-r--r--mso-catalog-db/src/main/resources/ServiceToAllottedResources.hbm.xml41
-rw-r--r--mso-catalog-db/src/main/resources/ServiceToNetworks.hbm.xml41
-rw-r--r--mso-catalog-db/src/main/resources/VfModule.hbm.xml57
-rw-r--r--mso-catalog-db/src/main/resources/VnfComponentsRecipe.hbm.xml14
-rw-r--r--mso-catalog-db/src/main/resources/VnfRecipe.hbm.xml22
-rw-r--r--mso-catalog-db/src/main/resources/VnfResource.hbm.xml64
-rw-r--r--mso-catalog-db/src/main/resources/hibernate-catalog-core-mysql.cfg.xml (renamed from mso-catalog-db/src/main/resources/hibernate-catalog-mysql.cfg.xml)0
-rw-r--r--mso-catalog-db/src/test/java/org/openecomp/mso/db/catalog/CatalogDatabaseESTest.java246
-rw-r--r--mso-catalog-db/src/test/java/org/openecomp/mso/db/catalog/beans/AllottedResourceCustomizationESTest.java214
-rw-r--r--mso-catalog-db/src/test/java/org/openecomp/mso/db/catalog/beans/AllottedResourceCustomizationESTestscaffolding.java77
-rw-r--r--mso-catalog-db/src/test/java/org/openecomp/mso/db/catalog/beans/ModelESTest.java271
-rw-r--r--mso-catalog-db/src/test/java/org/openecomp/mso/db/catalog/beans/ModelESTestscaffolding.java106
-rw-r--r--mso-catalog-db/src/test/java/org/openecomp/mso/db/catalog/beans/ModelRecipeESTest.java287
-rw-r--r--mso-catalog-db/src/test/java/org/openecomp/mso/db/catalog/beans/ModelRecipeESTestscaffolding.java77
-rw-r--r--mso-catalog-db/src/test/java/org/openecomp/mso/db/catalog/beans/ServiceMacroHolderESTest.java261
-rw-r--r--mso-catalog-db/src/test/java/org/openecomp/mso/db/catalog/beans/ServiceMacroHolderESTestscaffolding.java97
-rw-r--r--mso-catalog-db/src/test/java/org/openecomp/mso/db/catalog/beans/ServiceToAllottedResourcesESTest.java95
-rw-r--r--mso-catalog-db/src/test/java/org/openecomp/mso/db/catalog/beans/ServiceToAllottedResourcesESTestscaffolding.java81
-rw-r--r--mso-catalog-db/src/test/java/org/openecomp/mso/db/catalog/beans/ServiceToNetworksESTest.java95
-rw-r--r--mso-catalog-db/src/test/java/org/openecomp/mso/db/catalog/beans/ServiceToNetworksESTestscaffolding.java81
-rw-r--r--mso-catalog-db/src/test/java/org/openecomp/mso/db/catalog/beans/VfModuleESTest.java1662
-rw-r--r--mso-catalog-db/src/test/java/org/openecomp/mso/db/catalog/utils/RecordNotFoundExceptionESTest.java23
-rw-r--r--mso-catalog-db/src/test/java/org/openecomp/mso/db/catalog/utils/RecordNotFoundExceptionESTestscaffolding.java81
48 files changed, 5860 insertions, 1130 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 70b9618265..38e711eb16 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
@@ -21,6 +21,7 @@
package org.openecomp.mso.db.catalog;
import java.io.Closeable;
+import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
@@ -35,7 +36,9 @@ import org.hibernate.cfg.Configuration;
import org.hibernate.service.ServiceRegistry;
import org.hibernate.service.ServiceRegistryBuilder;
+import org.openecomp.mso.db.HibernateUtils;
import org.openecomp.mso.db.catalog.utils.MavenLikeVersioningComparator;
+import org.openecomp.mso.db.catalog.utils.RecordNotFoundException;
import org.openecomp.mso.logger.MessageEnum;
import org.openecomp.mso.logger.MsoLogger;
@@ -48,18 +51,21 @@ import org.openecomp.mso.logger.MsoLogger;
*/
public class CatalogDatabase implements Closeable {
- protected static final String NETWORK_TYPE = "networkType";
- protected static final String ACTION = "action";
- protected static final String VNF_TYPE = "vnfType";
- protected static final String SERVICE_TYPE = "serviceType";
- protected static final String VNF_COMPONENT_TYPE = "vnfComponentType";
- protected static final String MODEL_NAME = "modelName";
- protected static final String TYPE = "type";
- protected static final String VF_MODULE_ID = "vfModuleId";
- protected static boolean initialized = false;
- protected static SessionFactory sessionFactory;
- protected static ServiceRegistry serviceRegistry;
- protected static final String SERVICE_NAME_VERSION_ID= "serviceNameVersionId";
+ protected static HibernateUtils hibernateUtils = new HibernateUtilsCatalogDb ();
+
+ private static final String NETWORK_TYPE = "networkType";
+ private static final String ACTION = "action";
+ private static final String VNF_TYPE = "vnfType";
+ private static final String SERVICE_TYPE = "serviceType";
+ private static final String VNF_COMPONENT_TYPE = "vnfComponentType";
+ private static final String MODEL_ID = "modelId";
+ private static final String MODEL_NAME = "modelName";
+ private static final String TYPE = "type";
+ private static final String MODEL_TYPE = "modelType";
+ private static final String MODEL_VERSION_ID = "modelVersionId";
+ private static final String MODEL_CUSTOMIZATION_UUID = "modelCustomizationUuid";
+ private static final String VF_MODULE_ID = "vfModuleId";
+ private static final String SERVICE_NAME_VERSION_ID= "serviceNameVersionId";
protected static final MsoLogger LOGGER = MsoLogger.getMsoLogger (MsoLogger.Catalog.GENERAL);
@@ -70,33 +76,10 @@ public class CatalogDatabase implements Closeable {
private Session getSession () {
- if (!initialized) {
- LOGGER.debug ("Initializing Catalog Database in Hibernate");
- Configuration configuration = null;
- try {
- if ("MYSQL".equals (System.getProperty ("mso.db"))
- || "MARIADB".equals (System.getProperty ("mso.db"))) {
- configuration = new Configuration ().configure ("hibernate-catalog-mysql.cfg.xml");
-
- serviceRegistry = new ServiceRegistryBuilder ().applySettings (configuration.getProperties ()).buildServiceRegistry ();
-
- sessionFactory = configuration.buildSessionFactory (serviceRegistry);
- } else {
- LOGGER.error (MessageEnum.APIH_DB_ACCESS_EXC_REASON, "DB Connection not specified to the JVM,choose either:-Dmso.db=MARIADB, -Dmso.db=MYSQL or -Dmso.container=AJSC", "", "", MsoLogger.ErrorCode.DataError, "DB Connection not specified to the JVM,choose either:-Dmso.db=MARIADB, -Dmso.db=MYSQL or -Dmso.container=AJSC");
- }
- } catch (Exception e) {
- LOGGER.error (MessageEnum.GENERAL_EXCEPTION_ARG,
- "Catalog DB initialization issue: " + e.getMessage (), "", "", MsoLogger.ErrorCode.DataError, "Catalog DB initialization issue: " + e.getMessage (), e);
- throw e;
- }
- initialized = true;
-
- LOGGER.debug ("Catalog Database initialization complete");
- }
-
- if (session == null) {
+
+ if (session == null) {
try {
- session = sessionFactory.openSession ();
+ session = hibernateUtils.getSessionFactory ().openSession ();
session.beginTransaction ();
} catch (HibernateException he) {
LOGGER.error (MessageEnum.GENERAL_EXCEPTION_ARG, "Error creating Hibernate Session: " + he, "", "", MsoLogger.ErrorCode.DataError, "Error creating Hibernate Session: " + he);
@@ -231,6 +214,33 @@ public class CatalogDatabase implements Closeable {
}
/**
+ * Fetch a Service definition by InvariantUUID
+ */
+ public Service getServiceByInvariantUUID (String modelInvariantUUID) {
+
+ long startTime = System.currentTimeMillis ();
+ LOGGER.debug ("Catalog database - get service with Invariant UUID " + modelInvariantUUID);
+
+ String hql = "FROM Service WHERE modelInvariantUUID = :model_invariant_uuid";
+ Query query = getSession ().createQuery (hql);
+ query.setParameter ("model_invariant_uuid", modelInvariantUUID);
+
+ @SuppressWarnings("unchecked")
+ List <Service> resultList = query.list ();
+
+ // See if something came back.
+ if (resultList.isEmpty ()) {
+ LOGGER.recordMetricEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully. Service not found", "CatalogDB", "getServiceByName", null);
+ return null;
+ }
+ Collections.sort (resultList, new MavenLikeVersioningComparator ());
+ Collections.reverse (resultList);
+
+ LOGGER.recordMetricEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully", "CatalogDB", "getServiceByName", null);
+ return resultList.get (0);
+ }
+
+ /**
* Fetch a Service definition
*/
public Service getService (String serviceName) {
@@ -388,6 +398,33 @@ public class CatalogDatabase implements Closeable {
return resultList.get (0);
}
+ public Service getServiceByVersionAndInvariantId(String modelInvariantId, String modelVersion) throws Exception {
+ long startTime = System.currentTimeMillis ();
+ LOGGER.debug ("Catalog database - get service with modelInvariantId: " + modelInvariantId + " and modelVersion: " + modelVersion);
+
+ String hql = "FROM Service WHERE modelInvariantUUID = :MODEL_INVARIANT_UUID AND version = :VERSION_STR";
+ Query query = getSession ().createQuery (hql);
+ query.setParameter ("MODEL_INVARIANT_UUID", modelInvariantId);
+ query.setParameter("VERSION_STR", modelVersion);
+
+ Service result = null;
+ try {
+ result = (Service) query.uniqueResult();
+ } catch (org.hibernate.NonUniqueResultException nure) {
+ LOGGER.debug("Non Unique Result Exception - the Catalog Database does not match a unique row - data integrity error: modelInvariantId='" + modelInvariantId + "', modelVersion='" + modelVersion + "'");
+ LOGGER.error(MessageEnum.GENERAL_EXCEPTION, " non unique result for modelInvariantId=" + modelInvariantId + " and modelVersion=" + modelVersion, "", "", MsoLogger.ErrorCode.DataError, "Non unique result for modelInvariantId=" + modelInvariantId);
+ throw new Exception("Non Unique Result Exception - the Catalog Database does not match a unique row - data integrity error: modelInvariantId='" + modelInvariantId + "', modelVersion='" + modelVersion + "'");
+ }
+ // See if something came back.
+ if (result==null) {
+ LOGGER.recordMetricEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully. Service not found", "CatalogDB", "getServiceByVersionAndInvariantId", null);
+ return null;
+ }
+
+ LOGGER.recordMetricEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully", "CatalogDB", "getServiceByVersionAndInvariantId", null);
+ return result;
+ }
+
/**
* Return a Service recipe that matches a given SERVICE_NAME_VERSION_ID
* (MODEL_VERSION_ID) and ACTION
@@ -439,10 +476,15 @@ public class CatalogDatabase implements Closeable {
* @return ServiceRecipe object or null if none found
*/
public ServiceRecipe getServiceRecipe (int serviceId, String action) {
-
- StringBuilder hql = new StringBuilder ("FROM ServiceRecipe WHERE serviceId = :serviceId AND action = :action ");
-
-
+
+ StringBuilder hql = null;
+
+ if(action == null){
+ hql = new StringBuilder ("FROM ServiceRecipe WHERE serviceId = :serviceId");
+ }else {
+ hql = new StringBuilder ("FROM ServiceRecipe WHERE serviceId = :serviceId AND action = :action ");
+ }
+
long startTime = System.currentTimeMillis ();
LOGGER.debug ("Catalog database - get Service recipe with serviceId " + Integer.toString(serviceId)
+ " and action "
@@ -452,7 +494,10 @@ public class CatalogDatabase implements Closeable {
Query query = getSession ().createQuery (hql.toString ());
query.setParameter ("serviceId", serviceId);
query.setParameter (ACTION, action);
-
+ if(action != null){
+ query.setParameter (ACTION, action);
+ }
+
@SuppressWarnings("unchecked")
List <ServiceRecipe> resultList = query.list ();
@@ -468,7 +513,33 @@ public class CatalogDatabase implements Closeable {
return resultList.get (0);
}
-
+ public List<ServiceRecipe> getServiceRecipes (int serviceId) {
+
+ StringBuilder hql = null;
+
+ hql = new StringBuilder ("FROM ServiceRecipe WHERE serviceId = :serviceId");
+
+ long startTime = System.currentTimeMillis ();
+ LOGGER.debug ("Catalog database - get Service recipe with serviceId " + Integer.toString(serviceId));
+
+ Query query = getSession ().createQuery (hql.toString ());
+ query.setParameter ("serviceId", serviceId);
+
+ @SuppressWarnings("unchecked")
+ List <ServiceRecipe> resultList = query.list ();
+
+ if (resultList.isEmpty ()) {
+ LOGGER.recordMetricEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully. Service recipe not found", "CatalogDB", "getServiceRecipes", null);
+ return null;
+ }
+
+ Collections.sort (resultList, new MavenLikeVersioningComparator ());
+ Collections.reverse (resultList);
+
+ LOGGER.recordMetricEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully", "CatalogDB", "getServiceRecipes", null);
+ return resultList;
+ }
+
/**
* Return the VNF component data - queried by the VNFs ID and the component type.
*
@@ -477,10 +548,10 @@ public class CatalogDatabase implements Closeable {
* @return VnfComponent object or null if none found
*/
public VnfComponent getVnfComponent (int vnfId, String type) {
-
+
long startTime = System.currentTimeMillis();
LOGGER.debug ("Catalog database - get VnfComponent where vnfId="+ vnfId+ " AND componentType="+ type);
-
+
String hql = "FROM VnfComponent WHERE vnfId = :vnf_id AND componentType = :type";
Query query = getSession ().createQuery (hql);
query.setParameter ("vnf_id", vnfId);
@@ -488,7 +559,7 @@ public class CatalogDatabase implements Closeable {
VnfComponent result = null;
try {
- result = (VnfComponent) query.uniqueResult();
+ result = (VnfComponent) query.uniqueResult();
} catch (org.hibernate.NonUniqueResultException nure) {
LOGGER.debug("Non Unique Result Exception - the Catalog Database does not match a unique row - data integrity error: vnf_id='" + vnfId + "', componentType='" + type + "'");
LOGGER.error(MessageEnum.GENERAL_EXCEPTION, " non unique result for vnf_id=" + vnfId + " and componentType=" + type, "", "", MsoLogger.ErrorCode.DataError, "Non unique result for vnf_id=" + vnfId);
@@ -584,6 +655,47 @@ public class CatalogDatabase implements Closeable {
}
/**
+ * Return the newest version of a specific VNF resource (queried by modelCustomizationId).
+ *
+ * @param vnfType
+ * @param version
+ * @return VnfResource object or null if none found
+ */
+ public VnfResource getVnfResourceByModelCustomizationId (String modelCustomizationId, String serviceVersion) {
+
+ long startTime = System.currentTimeMillis ();
+ LOGGER.debug ("Catalog database - get VNF resource with modelCustomizationId " + modelCustomizationId);
+
+ String hql = "FROM VnfResource WHERE modelCustomizationUuid = :modelCustomizationId and version = :serviceVersion";
+ Query query = getSession ().createQuery (hql);
+ query.setParameter ("modelCustomizationId", modelCustomizationId);
+ query.setParameter ("serviceVersion", serviceVersion);
+
+ VnfResource resource = null;
+ try {
+ resource = (VnfResource) query.uniqueResult ();
+ } catch (org.hibernate.NonUniqueResultException nure) {
+ LOGGER.debug("Non Unique Result Exception - the Catalog Database does not match a unique row - data integrity error: modelCustomizationUuid='" + modelCustomizationId + "', serviceVersion='" + serviceVersion + "'");
+ LOGGER.error(MessageEnum.GENERAL_EXCEPTION, " non unique result for modelCustomizationUuid=" + modelCustomizationId + " and serviceVersion=" + serviceVersion, "", "", MsoLogger.ErrorCode.DataError, "Non unique result for modelCustomizationId=" + modelCustomizationId);
+ resource = null;
+ } catch (org.hibernate.HibernateException he) {
+ LOGGER.debug("Hibernate Exception - while searching for: modelCustomizationId='" + modelCustomizationId + "', asdc_service_model_version='" + serviceVersion + "'");
+ LOGGER.error(MessageEnum.GENERAL_EXCEPTION, " Hibernate exception searching for modelCustomizationId=" + modelCustomizationId + " and serviceVersion=" + serviceVersion, "", "", MsoLogger.ErrorCode.DataError, "Hibernate exception searching for modelCustomizationId=" + modelCustomizationId);
+ resource = null;
+ } catch (Exception e) {
+ LOGGER.debug("Generic Exception - while searching for: modelCustomizationId='" + modelCustomizationId + "', serviceVersion='" + serviceVersion + "'");
+ LOGGER.error(MessageEnum.GENERAL_EXCEPTION, " Generic exception searching for modelCustomizationId=" + modelCustomizationId + " and serviceVersion=" + serviceVersion, "", "", MsoLogger.ErrorCode.DataError, "Generic exception searching for modelCustomizationId=" + modelCustomizationId);
+ resource = null;
+ }
+ if (resource == null) {
+ LOGGER.recordMetricEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "NotFound", "CatalogDB", "getVnfResource", null);
+ } else {
+ LOGGER.recordMetricEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully", "CatalogDB", "getVnfResource", null);
+ }
+ return resource;
+ }
+
+ /**
* Return the newest version of a specific VNF resource (queried by ID).
*
* @param id The vnf id
@@ -791,7 +903,7 @@ public class CatalogDatabase implements Closeable {
* Return a VNF recipe that matches a given VF_MODULE_ID and ACTION
*
* @param vfModuleId
- * @param action
+ * @param action
* @return VnfRecipe object or null if none found
*/
public VnfRecipe getVnfRecipeByVfModuleId (String vnfType, String vfModuleId, String action) {
@@ -819,7 +931,39 @@ public class CatalogDatabase implements Closeable {
LOGGER.recordMetricEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully. VNF Recipe Entry found", "CatalogDB", "getVnfRecipeByVfModuleId", null);
return resultList.get (0);
}
-
+
+ public VfModule getVfModuleTypeByUuid(String modelCustomizationUuid) {
+ long startTime = System.currentTimeMillis();
+ LOGGER.debug("Catalog database - get vfModuleTypeByUuid with uuid=" + modelCustomizationUuid);
+
+ String hql = "FROM VfModule WHERE modelCustomizationUuid = :modelCustomizationUuid";
+ Query query = getSession().createQuery(hql);
+ query.setParameter("modelCustomizationUuid", modelCustomizationUuid);
+
+ VfModule module = null;
+ try {
+ module = (VfModule) query.uniqueResult();
+ } catch (org.hibernate.NonUniqueResultException nure) {
+ LOGGER.debug("Non Unique Result Exception - the Catalog Database does not match a unique row - data integrity error: modelCustomizationUuid='" + modelCustomizationUuid + "'");
+ LOGGER.error(MessageEnum.GENERAL_EXCEPTION, " non unique result for modelCustomizationUuid=" + modelCustomizationUuid, "", "", MsoLogger.ErrorCode.DataError, "Non unique result for modelCustomizationUuid==" + modelCustomizationUuid);
+ module = null;
+ } catch (org.hibernate.HibernateException he) {
+ LOGGER.debug("Hibernate Exception - while searching for: modelCustomizationUuid='" + modelCustomizationUuid + "'");
+ LOGGER.error(MessageEnum.GENERAL_EXCEPTION, " Hibernate exception searching for modelCustomizationUuid=" + modelCustomizationUuid, "", "", MsoLogger.ErrorCode.DataError, "Hibernate exception searching for modelCustomizationUuid=" + modelCustomizationUuid);
+ module = null;
+ } catch (Exception e) {
+ LOGGER.debug("Generic Exception - while searching for: modelCustomizationUuid='" + modelCustomizationUuid + "'");
+ LOGGER.error(MessageEnum.GENERAL_EXCEPTION, " Generic exception searching for modelCustomizationUuid=" + modelCustomizationUuid, "", "", MsoLogger.ErrorCode.DataError, "Generic exception searching for modelCustomizationUuid=" + modelCustomizationUuid);
+ module = null;
+ }
+ if (module == null) {
+ LOGGER.recordMetricEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "NotFound", "CatalogDB", "getVfModuleTypeByUuid", null);
+ } else {
+ LOGGER.recordMetricEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully", "CatalogDB", "getVfModuleTypeByUuid", null);
+ }
+ return module;
+ }
+
public VfModule getVfModuleType(String type) {
long startTime = System.currentTimeMillis();
LOGGER.debug("Catalog database - get vfModuleType with type " + type);
@@ -873,8 +1017,745 @@ public class CatalogDatabase implements Closeable {
}
return module;
}
-
-
+
+ public VnfResource getVnfResourceByServiceUuid(String serviceModelInvariantUuid) {
+ long startTime = System.currentTimeMillis();
+ LOGGER.debug ("Catalog database - get vfModuleType with serviceModelInvariantUuid " + serviceModelInvariantUuid);
+
+ String hql = "FROM VnfResource WHERE serviceModelInvariantUuid = :serviceModelInvariantUuid";
+ Query query = getSession().createQuery(hql);
+ query.setParameter ("serviceModelInvariantUuid", serviceModelInvariantUuid);
+ VnfResource vnfResource = null;
+ try {
+ vnfResource = (VnfResource) query.uniqueResult ();
+ } catch (org.hibernate.NonUniqueResultException nure) {
+ LOGGER.debug("Non Unique Result Exception - the Catalog Database does not match a unique row - data integrity error: serviceModelInvariantUuid='" + serviceModelInvariantUuid);
+ LOGGER.error(MessageEnum.GENERAL_EXCEPTION, " non unique result for serviceModelInvariantUuid=" + serviceModelInvariantUuid, "", "", MsoLogger.ErrorCode.DataError, "Non unique result for serviceModelInvariantUuid==" + serviceModelInvariantUuid);
+ vnfResource = null;
+ } catch (org.hibernate.HibernateException he) {
+ LOGGER.debug("Hibernate Exception - while searching for: serviceModelInvariantUuid='" + serviceModelInvariantUuid + "'");
+ LOGGER.error(MessageEnum.GENERAL_EXCEPTION, " Hibernate exception searching for serviceModelInvariantUuid=" + serviceModelInvariantUuid, "", "", MsoLogger.ErrorCode.DataError, "Hibernate exception searching for serviceModelInvariantUuid=" + serviceModelInvariantUuid);
+ vnfResource = null;
+ } catch (Exception e) {
+ LOGGER.debug("Generic Exception - while searching for: serviceModelInvariantUuid='" + serviceModelInvariantUuid + "'");
+ LOGGER.error(MessageEnum.GENERAL_EXCEPTION, " Generic exception searching for serviceModelInvariantUuid=" + serviceModelInvariantUuid, "", "", MsoLogger.ErrorCode.DataError, "Generic exception searching for serviceModelInvariantUuid=" + serviceModelInvariantUuid);
+ vnfResource = null;
+ }
+ if (vnfResource == null) {
+ LOGGER.recordMetricEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "NotFound", "CatalogDB", "getVfModuleType", null);
+ } else {
+ LOGGER.recordMetricEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully", "CatalogDB", "getVfModuleType", null);
+ }
+ return vnfResource;
+ }
+
+ public VnfResource getVnfResourceByVnfUuid(String vnfResourceModelInvariantUuid) {
+ long startTime = System.currentTimeMillis();
+ LOGGER.debug ("Catalog database - get vfModuleType with vnfResourceModelInvariantUuid " + vnfResourceModelInvariantUuid);
+
+ String hql = "FROM VnfResource WHERE vnfResourceModelInvariantUuid = :vnfResourceModelInvariantUuid";
+ Query query = getSession().createQuery(hql);
+ query.setParameter ("vnfResourceModelInvariantUuid", vnfResourceModelInvariantUuid);
+ VnfResource vnfResource = null;
+ try {
+ vnfResource = (VnfResource) query.uniqueResult ();
+ } catch (org.hibernate.NonUniqueResultException nure) {
+ LOGGER.debug("Non Unique Result Exception - the Catalog Database does not match a unique row - data integrity error: vnfResourceModelInvariantUuid='" + vnfResourceModelInvariantUuid);
+ LOGGER.error(MessageEnum.GENERAL_EXCEPTION, " non unique result for vnfResourceModelInvariantUuid=" + vnfResourceModelInvariantUuid, "", "", MsoLogger.ErrorCode.DataError, "Non unique result for vnfResourceModelInvariantUuid==" + vnfResourceModelInvariantUuid);
+ vnfResource = null;
+ } catch (org.hibernate.HibernateException he) {
+ LOGGER.debug("Hibernate Exception - while searching for: vnfResourceModelInvariantUuid='" + vnfResourceModelInvariantUuid + "'");
+ LOGGER.error(MessageEnum.GENERAL_EXCEPTION, " Hibernate exception searching for vnfResourceModelInvariantUuid=" + vnfResourceModelInvariantUuid, "", "", MsoLogger.ErrorCode.DataError, "Hibernate exception searching for vnfResourceModelInvariantUuid=" + vnfResourceModelInvariantUuid);
+ vnfResource = null;
+ } catch (Exception e) {
+ LOGGER.debug("Generic Exception - while searching for: vnfResourceModelInvariantUuid='" + vnfResourceModelInvariantUuid + "'");
+ LOGGER.error(MessageEnum.GENERAL_EXCEPTION, " Generic exception searching for vnfResourceModelInvariantUuid=" + vnfResourceModelInvariantUuid, "", "", MsoLogger.ErrorCode.DataError, "Generic exception searching for vnfResourceModelInvariantUuid=" + vnfResourceModelInvariantUuid);
+ vnfResource = null;
+ }
+ if (vnfResource == null) {
+ LOGGER.recordMetricEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "NotFound", "CatalogDB", "getVfModuleType", null);
+ } else {
+ LOGGER.recordMetricEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully", "CatalogDB", "getVfModuleType", null);
+ }
+ return vnfResource;
+ }
+
+ public VnfResource getVnfResourceByType(String vnfType) {
+ return this.getVnfResource(vnfType);
+ }
+
+ public VfModule getVfModuleByModelInvariantUuid(String vfModuleModelInvariantUuid) {
+ long startTime = System.currentTimeMillis();
+ LOGGER.debug ("Catalog database - get vfModuleTypeByUuid with uuid " + vfModuleModelInvariantUuid);
+
+ String hql = "FROM VfModule WHERE vfModuleModelInvariantUuid = :vfModuleModelInvariantUuid ";
+ Query query = getSession().createQuery(hql);
+ query.setParameter ("vfModuleModelInvariantUuid", vfModuleModelInvariantUuid);
+ VfModule module = null;
+ try {
+ module = (VfModule) query.uniqueResult ();
+ } catch (org.hibernate.NonUniqueResultException nure) {
+ LOGGER.debug("Non Unique Result Exception - the Catalog Database does not match a unique row - data integrity error: vfModuleModelInvariantUuid='" + vfModuleModelInvariantUuid + "'");
+ LOGGER.error(MessageEnum.GENERAL_EXCEPTION, " non unique result for vfModuleModelInvariantUuid=" + vfModuleModelInvariantUuid , "", "", MsoLogger.ErrorCode.DataError, "Non unique result for vfModuleModelInvariantUuid==" + vfModuleModelInvariantUuid);
+ module = null;
+ } catch (org.hibernate.HibernateException he) {
+ LOGGER.debug("Hibernate Exception - while searching for: vfModuleModelInvariantUuid='" + vfModuleModelInvariantUuid + "'");
+ LOGGER.error(MessageEnum.GENERAL_EXCEPTION, " Hibernate exception searching for vfModuleModelInvariantUuid=" + vfModuleModelInvariantUuid, "", "", MsoLogger.ErrorCode.DataError, "Hibernate exception searching for vfModuleModelInvariantUuid=" + vfModuleModelInvariantUuid);
+ module = null;
+ } catch (Exception e) {
+ LOGGER.debug("Generic Exception - while searching for: vfModuleModelInvariantUuid='" + vfModuleModelInvariantUuid + "'");
+ LOGGER.error(MessageEnum.GENERAL_EXCEPTION, " Generic exception searching for vfModuleModelInvariantUuid=" + vfModuleModelInvariantUuid, "", "", MsoLogger.ErrorCode.DataError, "Generic exception searching for vfModuleModelInvariantUuid=" + vfModuleModelInvariantUuid);
+ module = null;
+ }
+ if (module == null) {
+ LOGGER.recordMetricEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "NotFound", "CatalogDB", "getVfModuleByModelInvariantUuid", null);
+ } else {
+ LOGGER.recordMetricEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully", "CatalogDB", "getVfModuleByModelInvariantUuid", null);
+ }
+ return module;
+ }
+
+ public VfModule getVfModuleByModelCustomizationUuid(String modelCustomizationUuid) {
+ long startTime = System.currentTimeMillis();
+ LOGGER.debug ("Catalog database - get vfModuleTypeByModelCustomizationUuid with uuid " + modelCustomizationUuid);
+
+ String hql = "FROM VfModule WHERE modelCustomizationUuid = :modelCustomizationUuid ";
+ Query query = getSession().createQuery(hql);
+ query.setParameter ("modelCustomizationUuid", modelCustomizationUuid);
+ VfModule module = null;
+ try {
+ module = (VfModule) query.uniqueResult ();
+ } catch (org.hibernate.NonUniqueResultException nure) {
+ LOGGER.debug("Non Unique Result Exception - the Catalog Database does not match a unique row - data integrity error: modelCustomizationUuid='" + modelCustomizationUuid + "'");
+ LOGGER.error(MessageEnum.GENERAL_EXCEPTION, " non unique result for vfModuleModelInvariantUuid=" + modelCustomizationUuid , "", "", MsoLogger.ErrorCode.DataError, "Non unique result for modelCustomizationUuid==" + modelCustomizationUuid);
+ module = null;
+ } catch (org.hibernate.HibernateException he) {
+ LOGGER.debug("Hibernate Exception - while searching for: modelCustomizationUuid='" + modelCustomizationUuid + "'");
+ LOGGER.error(MessageEnum.GENERAL_EXCEPTION, " Hibernate exception searching for modelCustomizationUuid=" + modelCustomizationUuid, "", "", MsoLogger.ErrorCode.DataError, "Hibernate exception searching for modelCustomizationUuid=" + modelCustomizationUuid);
+ module = null;
+ } catch (Exception e) {
+ LOGGER.debug("Generic Exception - while searching for: modelCustomizationUuid='" + modelCustomizationUuid + "'");
+ LOGGER.error(MessageEnum.GENERAL_EXCEPTION, " Generic exception searching for modelCustomizationUuid=" + modelCustomizationUuid, "", "", MsoLogger.ErrorCode.DataError, "Generic exception searching for modelCustomizationUuid=" + modelCustomizationUuid);
+ module = null;
+ }
+ if (module == null) {
+ LOGGER.recordMetricEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "NotFound", "CatalogDB", "getVfModuleByModelCustomizationUuid", null);
+ } else {
+ LOGGER.recordMetricEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully", "CatalogDB", "getVfModuleByModelCustomizationUuid", null);
+ }
+ return module;
+ }
+
+ public VfModule getVfModuleByType(String vfModuleType) {
+ return this.getVfModuleType(vfModuleType);
+ }
+
+ public List<VfModule> getVfModulesForVnfResource(VnfResource vnfResource) {
+ if (vnfResource == null)
+ return null;
+ int vnfResourceId = vnfResource.getId();
+
+ long startTime = System.currentTimeMillis();
+ LOGGER.debug("Catalog database - getVfModulesForVnfResource - vnfResource: " + vnfResource.toString());
+
+ return this.getVfModulesForVnfResource(vnfResourceId);
+
+ }
+
+ public List<VfModule> getVfModulesForVnfResource(int vnfResourceId) {
+ long startTime = System.currentTimeMillis();
+ LOGGER.debug("Catalog database - getVfModulesForVnfResource - vnfResourceId: " + vnfResourceId);
+ StringBuilder hql = new StringBuilder("FROM VfModule where vnfResourceId = :vnfResourceId");
+ Query query = getSession().createQuery(hql.toString());
+ query.setParameter("vnfResourceId", vnfResourceId);
+ List<VfModule> resultList = null;
+ try {
+ resultList = query.list();
+ if (resultList != null)
+ LOGGER.debug("\tQuery found " + resultList.size() + " records.");
+ else
+ LOGGER.debug("\tQuery found no records.");
+ } catch (org.hibernate.HibernateException he) {
+ LOGGER.debug("Hibernate Exception - getVfModulesForVnfResource - while searching for: vnfResourceId='" + vnfResourceId + " " + he.getMessage());
+ LOGGER.error(MessageEnum.GENERAL_EXCEPTION, " Hibernate exception - getVfModulesForVnfResource - searching for vnfResourceId=" + vnfResourceId, "", "", MsoLogger.ErrorCode.DataError, "Hibernate exception searching for vnfResourceId=" + vnfResourceId);
+ } catch (Exception e) {
+ LOGGER.debug("Exception - getVfModulesForVnfResource - while searching for: vnfResourceId='" + vnfResourceId + " " + e.getMessage());
+ LOGGER.error(MessageEnum.GENERAL_EXCEPTION, " Hibernate exception - getVfModulesForVnfResource - searching for vnfResourceId=" + vnfResourceId, "", "", MsoLogger.ErrorCode.DataError, "Hibernate exception searching for vnfResourceId=" + vnfResourceId);
+ }
+ if (resultList == null) {
+ resultList = new ArrayList<VfModule>();
+ }
+ LOGGER.recordMetricEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully", "CatalogDB", "getVfModulesForVnfResource", null);
+ return resultList;
+ }
+
+ public Service getServiceByUuid (String serviceModelInvariantUuid) {
+
+ long startTime = System.currentTimeMillis ();
+ LOGGER.debug ("Catalog database - get service with ModelInvariantUuid " + serviceModelInvariantUuid);
+
+ String hql = "FROM Service WHERE modelInvariantUUID = :serviceModelInvariantUuid";
+ Query query = getSession ().createQuery (hql);
+ query.setParameter ("serviceModelInvariantUuid", serviceModelInvariantUuid);
+
+ Service service = null;
+ try {
+ service = (Service) query.uniqueResult ();
+ } catch (org.hibernate.NonUniqueResultException nure) {
+ LOGGER.debug("Non Unique Result Exception - the Catalog Database does not match a unique row - data integrity error: serviceModelInvariantUuid='" + serviceModelInvariantUuid + "'");
+ LOGGER.error(MessageEnum.GENERAL_EXCEPTION, " non unique result for serviceModelInvariantUuid=" + serviceModelInvariantUuid, "", "", MsoLogger.ErrorCode.DataError, "Non unique result for serviceModelInvariantUuid=" + serviceModelInvariantUuid);
+ return null;
+ } catch (org.hibernate.HibernateException he) {
+ LOGGER.debug("Hibernate Exception - while searching for: serviceName='" + serviceModelInvariantUuid + "'");
+ LOGGER.error(MessageEnum.GENERAL_EXCEPTION, " Hibernate exception searching for serviceModelInvariantUuid=" + serviceModelInvariantUuid, "", "", MsoLogger.ErrorCode.DataError, "Hibernate exception searching for serviceModelInvariantUuid=" + serviceModelInvariantUuid);
+ return null;
+ } catch (Exception e) {
+ LOGGER.debug("Generic Exception - while searching for: serviceModelInvariantUuid='" + serviceModelInvariantUuid);
+ LOGGER.error(MessageEnum.GENERAL_EXCEPTION, " Generic exception searching for serviceModelInvariantUuid=" + serviceModelInvariantUuid, "", "", MsoLogger.ErrorCode.DataError, "Generic exception searching for serviceModelInvariantUuid=" + serviceModelInvariantUuid);
+ return null;
+ }
+ if (service == null) {
+ LOGGER.recordMetricEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "NotFound", "CatalogDB", "getService", null);
+ } else {
+ LOGGER.recordMetricEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully", "CatalogDB", "getService", null);
+ }
+
+ return service;
+ }
+
+ public NetworkResource getNetworkResourceById(Integer id) {
+ long startTime = System.currentTimeMillis ();
+ LOGGER.debug ("Catalog database - getNetworkResource with id " + id);
+
+ String hql = "FROM NetworkResource WHERE id = :id";
+ Query query = getSession ().createQuery (hql);
+ query.setParameter ("id", id);
+
+ NetworkResource networkResource = null;
+ try {
+ networkResource = (NetworkResource) query.uniqueResult ();
+ } catch (org.hibernate.NonUniqueResultException nure) {
+ LOGGER.debug("Non Unique Result Exception - the Catalog Database does not match a unique row - data integrity error: NETWORK_RESOURCE.id='" + id + "'");
+ LOGGER.error(MessageEnum.GENERAL_EXCEPTION, " non unique result for NETWORK_RESOURCE.id=" + id, "", "", MsoLogger.ErrorCode.DataError, "Non unique result for NETWORK_RESOURCE.id=" + id);
+ return null;
+ } catch (org.hibernate.HibernateException he) {
+ LOGGER.debug("Hibernate Exception - while searching for: NETWORK_RESOURCE.id='" + id + "'");
+ LOGGER.error(MessageEnum.GENERAL_EXCEPTION, " Hibernate exception searching for NETWORK_RESOURCE.id=" + id, "", "", MsoLogger.ErrorCode.DataError, "Hibernate exception searching for NETWORK_RESOURCE.id=" + id);
+ return null;
+ } catch (Exception e) {
+ LOGGER.debug("Generic Exception - while searching for: NETWORK_RESOURCE.id='" + id);
+ LOGGER.error(MessageEnum.GENERAL_EXCEPTION, " Generic exception searching for NETWORK_RESOURCE.id=" + id, "", "", MsoLogger.ErrorCode.DataError, "Generic exception searching for NETWORK_RESOURCE.id=" + id);
+ return null;
+ }
+
+ LOGGER.recordMetricEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully", "CatalogDB", "getNetworkResourceById", null);
+ return networkResource;
+
+ }
+
+ // 1702 API Spec - Query for all networks in a Service:
+ public List<NetworkResourceCustomization> getAllNetworksByServiceModelUuid(String serviceModelUuid) {
+ long startTime = System.currentTimeMillis();
+ LOGGER.debug("Catalog database: getServiceNetworksByServiceModelUuid - " + serviceModelUuid);
+
+ // This is a 2-step process (3 really) - 1) query ServiceToNetworks, 2) query NetworkResourceCustomization, 3) populate the networkType
+
+ StringBuilder hql1 = new StringBuilder("FROM ServiceToNetworks WHERE serviceModelUuid = :serviceModelUuid");
+ Query query = getSession().createQuery(hql1.toString());
+ query.setParameter("serviceModelUuid", serviceModelUuid);
+ @SuppressWarnings("unchecked")
+ List<ServiceToNetworks> resultList1 = query.list();
+ if (resultList1 == null || resultList1.size() < 1) {
+ LOGGER.debug("Found no matches to the query - FROM ServiceToNetworks WHERE serviceModelUuid = " + serviceModelUuid);
+ return null;
+ }
+ LOGGER.debug("Found " + resultList1.size() + " entries in ServiceToNetworks with smu=" + serviceModelUuid);
+
+ ArrayList<NetworkResourceCustomization> masterList = new ArrayList<NetworkResourceCustomization>();
+ for (ServiceToNetworks stn : resultList1) {
+ String networkModelCustomizationUuid = stn.getNetworkModelCustomizationUuid();
+ LOGGER.debug("Now searching for NetworkResourceCustomization for " + networkModelCustomizationUuid);
+ List<NetworkResourceCustomization> resultSet = this.getAllNetworksByNetworkModelCustomizationUuid(networkModelCustomizationUuid);
+ for (NetworkResourceCustomization nrc : resultSet) {
+ masterList.add(nrc);
+ }
+ }
+ LOGGER.debug("Returning " + masterList.size() + " NRC records");
+ LOGGER.recordMetricEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully", "CatalogDB", "getAllNetworksByServiceModelUuid", null);
+ return masterList;
+
+ }
+ public List<NetworkResourceCustomization> getAllNetworksByServiceModelInvariantUuid(String serviceModelInvariantUuid) {
+ long startTime = System.currentTimeMillis();
+ LOGGER.debug("Catalog database: getServiceNetworksByServiceModelInvariantUuid - " + serviceModelInvariantUuid);
+
+ StringBuilder hql = new StringBuilder("FROM Service WHERE modelInvariantUUID = :serviceModelInvariantUuid");
+ Query query = getSession().createQuery(hql.toString());
+ query.setParameter("serviceModelInvariantUuid", serviceModelInvariantUuid);
+ @SuppressWarnings("unchecked")
+ List<Service> serviceList = query.list();
+
+ if (serviceList.isEmpty()) {
+ LOGGER.debug("Could not find Service for " + serviceModelInvariantUuid);
+ return null;
+ }
+
+ Collections.sort (serviceList, new MavenLikeVersioningComparator ());
+ Collections.reverse (serviceList);
+ Service service = serviceList.get(0);
+
+ String serviceNameVersionId = service.getServiceNameVersionId();
+ LOGGER.debug("The highest version for the Service " + serviceModelInvariantUuid + " is " + serviceNameVersionId);
+
+ // Service.serviceNameVersionId == ServiceToNetworks.serviceModelUuid
+ return this.getAllNetworksByServiceModelUuid(serviceNameVersionId);
+ }
+ public List<NetworkResourceCustomization> getAllNetworksByServiceModelInvariantUuid(String serviceModelInvariantUuid, String serviceModelVersion) {
+ long startTime = System.currentTimeMillis();
+ LOGGER.debug("Catalog database: getServiceNetworksByServiceModelInvariantUuid - " + serviceModelInvariantUuid + ", version=" + serviceModelVersion);
+
+ StringBuilder hql = new StringBuilder("FROM Service WHERE modelInvariantUUID = :serviceModelInvariantUuid and version = :serviceModelVersion");
+ Query query = getSession().createQuery(hql.toString());
+ query.setParameter("serviceModelInvariantUuid", serviceModelInvariantUuid);
+ query.setParameter("serviceModelVersion", serviceModelVersion);
+
+ //TODO
+ //can fix this later - no time - could do a unique query here - but this should work
+ @SuppressWarnings("unchecked")
+ List<Service> serviceList = query.list();
+
+ if (serviceList.isEmpty()) {
+ LOGGER.debug("No Service found with smu=" + serviceModelInvariantUuid + " and smv=" + serviceModelVersion);
+ return null;
+ }
+
+ Collections.sort (serviceList, new MavenLikeVersioningComparator ());
+ Collections.reverse (serviceList);
+ Service service = serviceList.get(0);
+
+ String serviceNameVersionId = service.getServiceNameVersionId();
+
+ // Service.serviceNameVersionId == ServiceToNetworks.serviceModelUuid
+ return this.getAllNetworksByServiceModelUuid(serviceNameVersionId);
+
+ }
+ public List<NetworkResourceCustomization> getAllNetworksByNetworkModelCustomizationUuid(String networkModelCustomizationUuid) {
+ long startTime = System.currentTimeMillis();
+ LOGGER.debug("Catalog database: getAllNetworksByNetworkModelCustomizationUuid - " + networkModelCustomizationUuid);
+
+ StringBuilder hql = new StringBuilder("FROM NetworkResourceCustomization WHERE modelCustomizationUuid = :networkModelCustomizationUuid");
+ Query query = getSession().createQuery(hql.toString());
+ query.setParameter("networkModelCustomizationUuid", networkModelCustomizationUuid);
+
+ @SuppressWarnings("unchecked")
+ List<NetworkResourceCustomization> resultList = query.list();
+
+ this.populateNetworkResourceType(resultList);
+
+ LOGGER.recordMetricEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully", "CatalogDB", "getAllNetworksByNetworkModelCustomizationUuid", null);
+ return resultList;
+ }
+ public List<NetworkResourceCustomization> getAllNetworksByNetworkType(String networkType) {
+ long startTime = System.currentTimeMillis();
+ LOGGER.debug("Catalog database: getServiceNetworksByNetworkType - " + networkType);
+
+ NetworkResource nr = this.getNetworkResource(networkType);
+ if (nr == null) {
+ return new ArrayList<NetworkResourceCustomization>();
+ }
+ Integer networkResourceId = nr.getId();
+
+ LOGGER.debug("Now searching for NRC's with networkResourceId = " + networkResourceId);
+ StringBuilder hql = new StringBuilder("FROM NetworkResourceCustomization WHERE networkResourceId = :networkResourceId");
+
+ Query query = getSession().createQuery(hql.toString());
+ query.setParameter("networkResourceId", networkResourceId);
+
+ @SuppressWarnings("unchecked")
+ List<NetworkResourceCustomization> resultList = query.list();
+
+ if (resultList != null && resultList.size() > 0) {
+ LOGGER.debug("Found " + resultList.size() + " results");
+ for (NetworkResourceCustomization nrc : resultList) {
+ nrc.setNetworkType(networkType);
+ nrc.setNetworkResource(nr);
+ }
+ }
+ LOGGER.recordMetricEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully", "CatalogDB", "getAllNetworksByNetworkType", null);
+
+ return resultList;
+ }
+
+ //1702 API Spec cont'd - Query for all VnfResources in a Service:
+ public List<VnfResource> getAllVnfsByServiceModelUuid(String serviceModelUuid) {
+ long startTime = System.currentTimeMillis();
+ LOGGER.debug("Catalog database: getAllVnfsByServiceModelUuid - " + serviceModelUuid);
+
+ StringBuilder hql = new StringBuilder("FROM Service WHERE serviceNameVersionId = :serviceModelUuid");
+ Query query = getSession().createQuery(hql.toString());
+ query.setParameter("serviceModelUuid", serviceModelUuid);
+ @SuppressWarnings("unchecked")
+ List<Service> serviceList = query.list();
+
+ if (serviceList.isEmpty()) {
+ return null;
+ }
+
+ Collections.sort (serviceList, new MavenLikeVersioningComparator ());
+ Collections.reverse (serviceList);
+ Service service = serviceList.get(0);
+
+ String serviceModelInvariantUuid = service.getModelInvariantUUID();
+ String serviceModelVersion = service.getVersion();
+
+ return this.getAllVnfsByServiceModelInvariantUuid(serviceModelInvariantUuid, serviceModelVersion);
+
+ }
+ public List<VnfResource> getAllVnfsByServiceModelInvariantUuid(String serviceModelInvariantUuid) {
+ long startTime = System.currentTimeMillis();
+ LOGGER.debug("Catalog database: getAllVnfsByServiceModelInvariantUuid - " + serviceModelInvariantUuid);
+
+ StringBuilder hqlService = new StringBuilder("FROM Service WHERE modelInvariantUUID = :serviceModelInvariantUuid");
+ Query query = getSession().createQuery(hqlService.toString());
+ query.setParameter("serviceModelInvariantUuid", serviceModelInvariantUuid);
+ @SuppressWarnings("unchecked")
+ List<Service> resultList = query.list();
+
+ if (resultList.isEmpty()) {
+ return null;
+ }
+ Collections.sort (resultList, new MavenLikeVersioningComparator ());
+ Collections.reverse (resultList);
+ Service service = resultList.get(0);
+ //now just call the method that takes the version - the service object will have the highest version
+ return this.getAllVnfsByServiceModelInvariantUuid(serviceModelInvariantUuid, service.getVersion());
+ }
+ public List<VnfResource> getAllVnfsByServiceModelInvariantUuid(String serviceModelInvariantUuid, String serviceModelVersion) {
+ long startTime = System.currentTimeMillis();
+ LOGGER.debug("Catalog database: getAllVnfsByServiceModelInvariantUuid - " + serviceModelInvariantUuid + ", version=" + serviceModelVersion);
+
+ StringBuilder hql = new StringBuilder("FROM VnfResource WHERE serviceModelInvariantUUID = :serviceModelInvariantUuid and version = :serviceModelVersion");
+ Query query = getSession().createQuery(hql.toString());
+ query.setParameter("serviceModelInvariantUuid", serviceModelInvariantUuid);
+ query.setParameter("serviceModelVersion", serviceModelVersion);
+
+ @SuppressWarnings("unchecked")
+ List<VnfResource> resultList = query.list();
+
+ if (resultList.isEmpty()) {
+ return null;
+ }
+ // so we have a list of VnfResource objects - but we need to add each one's VfModule objects
+ for (VnfResource vnfResource : resultList) {
+ List<VfModule> vfModules = this.getVfModulesForVnfResource(vnfResource);
+ if (vfModules != null && !vfModules.isEmpty()) {
+ for (VfModule vfm : vfModules) {
+ vnfResource.addVfModule(vfm);
+ }
+ }
+ }
+ LOGGER.recordMetricEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully", "CatalogDB", "getAllVnfsByServiceModelInvariantUuid", null);
+ return resultList;
+
+ }
+ public List<VnfResource> getAllVnfsByServiceName(String serviceName, String serviceVersion) {
+ long startTime = System.currentTimeMillis();
+ LOGGER.debug("Catalog database: getAllVnfsByServiceName - " + serviceName + ", version=" + serviceVersion);
+ if (serviceVersion == null || serviceVersion.equals("")) {
+ return this.getAllVnfsByServiceName(serviceName);
+ }
+
+ StringBuilder hql = new StringBuilder("FROM Service WHERE serviceName = :serviceName and version = :serviceVersion");
+ Query query = getSession().createQuery(hql.toString());
+ query.setParameter("serviceName", serviceName);
+ query.setParameter("serviceVersion", serviceVersion);
+
+ @SuppressWarnings("unchecked")
+ List<Service> resultList = query.list();
+
+ if (resultList.isEmpty()) {
+ return null;
+ }
+
+ Service service = resultList.get(0);
+
+ return this.getAllVnfsByServiceModelInvariantUuid(service.getModelInvariantUUID(), service.getVersion());
+ }
+ public List<VnfResource> getAllVnfsByServiceName(String serviceName) {
+ long startTime = System.currentTimeMillis();
+ LOGGER.debug("Catalog database: getAllVnfsByServiceName - " + serviceName);
+
+ StringBuilder hql = new StringBuilder("FROM Service WHERE serviceName = :serviceName");
+ Query query = getSession().createQuery(hql.toString());
+ query.setParameter("serviceName", serviceName);
+
+ @SuppressWarnings("unchecked")
+ List<Service> resultList = query.list();
+
+ if (resultList.isEmpty()) {
+ return null;
+ }
+ Collections.sort (resultList, new MavenLikeVersioningComparator ());
+ Collections.reverse (resultList);
+ Service service = resultList.get(0);
+
+ return this.getAllVnfsByServiceModelInvariantUuid(service.getModelInvariantUUID(), service.getVersion());
+ }
+ public List<VnfResource> getAllVnfsByVnfModelCustomizationUuid(String vnfModelCustomizationUuid) {
+ long startTime = System.currentTimeMillis();
+ LOGGER.debug("Catalog database: getAllVnfsByVnfModelCustomizationUuid - " + vnfModelCustomizationUuid);
+
+ StringBuilder hql = new StringBuilder("FROM VnfResource WHERE modelCustomizationUuid = :vnfModelCustomizationUuid");
+ Query query = getSession().createQuery(hql.toString());
+ query.setParameter("vnfModelCustomizationUuid", vnfModelCustomizationUuid);
+
+ @SuppressWarnings("unchecked")
+ List<VnfResource> resultList = query.list();
+
+ if (resultList.isEmpty()) {
+ LOGGER.debug("Found no records matching " + vnfModelCustomizationUuid);
+ return null;
+ }
+ // so we have a list of VnfResource objects - but we need to add each one's VfModule objects
+ for (VnfResource vnfResource : resultList) {
+ LOGGER.debug("Finding vfModules for vnfResource.id=" + vnfResource.getId());
+ List<VfModule> vfModules = this.getVfModulesForVnfResource(vnfResource);
+ if (vfModules != null && !vfModules.isEmpty()) {
+ LOGGER.debug("\tFound " + vfModules.size() + " vf modules");
+ for (VfModule vfm : vfModules) {
+ vnfResource.addVfModule(vfm);
+ }
+ }
+ }
+ LOGGER.debug("Returning " + resultList + " vnf modules");
+ LOGGER.recordMetricEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully", "CatalogDB", "getAllVnfsByVnfModelCustomizationUuid", null);
+ return resultList;
+ }
+
+ //1702 API Spec cont'd - Query for all allotted resources in a Service
+
+ public List<AllottedResourceCustomization> getAllAllottedResourcesByServiceModelUuid(String serviceModelUuid) {
+ long startTime = System.currentTimeMillis();
+ LOGGER.debug("Catalog database: getAllAllottedResourcesByServiceModelUuid - " + serviceModelUuid);
+
+ // This is a 2-step process (3 really) - 1) query ServiceToAllottedResources, 2) query AllottedResourceCustomization
+
+ StringBuilder hql1 = new StringBuilder("FROM ServiceToAllottedResources WHERE serviceModelUuid = :serviceModelUuid");
+ Query query = getSession().createQuery(hql1.toString());
+ query.setParameter("serviceModelUuid", serviceModelUuid);
+ @SuppressWarnings("unchecked")
+ List<ServiceToAllottedResources> resultList1 = query.list();
+ if (resultList1 == null || resultList1.size() < 1) {
+ LOGGER.debug("Found no matches to the query " + hql1.toString());
+ return null;
+ }
+ LOGGER.debug("Found " + resultList1.size() + " entries in ServiceToAllottedResources with smu=" + serviceModelUuid);
+
+ ArrayList<AllottedResourceCustomization> masterList = new ArrayList<AllottedResourceCustomization>();
+ for (ServiceToAllottedResources star : resultList1) {
+ String arModelCustomizationUuid = star.getArModelCustomizationUuid();
+ LOGGER.debug("Now searching for AllottedResourceCustomization for " + arModelCustomizationUuid);
+ List<AllottedResourceCustomization> resultSet = this.getAllAllottedResourcesByArModelCustomizationUuid(arModelCustomizationUuid);
+ for (AllottedResourceCustomization arc : resultSet) {
+ masterList.add(arc);
+ }
+ }
+ LOGGER.debug("Returning " + masterList.size() + " ARC records");
+ LOGGER.recordMetricEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully", "CatalogDB", "getAllAllottedResourcesByServiceModelUuid", null);
+ return masterList;
+ }
+
+ public List<AllottedResourceCustomization> getAllAllottedResourcesByServiceModelInvariantUuid(String serviceModelInvariantUuid) {
+ long startTime = System.currentTimeMillis();
+ LOGGER.debug("Catalog database: getAllAllottedResourcesByServiceModelInvariantUuid - " + serviceModelInvariantUuid);
+
+ StringBuilder hql = new StringBuilder("FROM Service WHERE modelInvariantUUID = :serviceModelInvariantUuid");
+ Query query = getSession().createQuery(hql.toString());
+ query.setParameter("serviceModelInvariantUuid", serviceModelInvariantUuid);
+ @SuppressWarnings("unchecked")
+ List<Service> serviceList = query.list();
+
+ if (serviceList.isEmpty()) {
+ LOGGER.debug("Could not find Service for " + serviceModelInvariantUuid);
+ return null;
+ }
+
+ Collections.sort (serviceList, new MavenLikeVersioningComparator ());
+ Collections.reverse (serviceList);
+ Service service = serviceList.get(0);
+
+ String serviceNameVersionId = service.getServiceNameVersionId();
+ LOGGER.debug("The highest version for the Service " + serviceModelInvariantUuid + " is " + serviceNameVersionId);
+
+ // Service.serviceNameVersionId == ServiceToAllottedResources.serviceModelUuid
+ return this.getAllAllottedResourcesByServiceModelUuid(serviceNameVersionId);
+ }
+
+ public List<AllottedResourceCustomization> getAllAllottedResourcesByServiceModelInvariantUuid(String serviceModelInvariantUuid, String serviceModelVersion) {
+ long startTime = System.currentTimeMillis();
+ LOGGER.debug("Catalog database: getAllAllottedResourcesByServiceModelInvariantUuid - " + serviceModelInvariantUuid + ", version=" + serviceModelVersion);
+
+ StringBuilder hql = new StringBuilder("FROM Service WHERE modelInvariantUUID = :serviceModelInvariantUuid and version = :serviceModelVersion");
+ Query query = getSession().createQuery(hql.toString());
+ query.setParameter("serviceModelInvariantUuid", serviceModelInvariantUuid);
+ query.setParameter("serviceModelVersion", serviceModelVersion);
+
+ //TODO
+ //can fix this later - no time - could do a unique query here - but this should work
+ @SuppressWarnings("unchecked")
+ List<Service> serviceList = query.list();
+
+ if (serviceList.isEmpty()) {
+ LOGGER.debug("No Service found with smu=" + serviceModelInvariantUuid + " and smv=" + serviceModelVersion);
+ return null;
+ }
+
+ Collections.sort (serviceList, new MavenLikeVersioningComparator ());
+ Collections.reverse (serviceList);
+ Service service = serviceList.get(0);
+
+ String serviceNameVersionId = service.getServiceNameVersionId();
+
+ // Service.serviceNameVersionId == ServiceToNetworks.serviceModelUuid
+ return this.getAllAllottedResourcesByServiceModelUuid(serviceNameVersionId);
+ }
+
+ public List<AllottedResourceCustomization> getAllAllottedResourcesByArModelCustomizationUuid(String arModelCustomizationUuid) {
+ long startTime = System.currentTimeMillis();
+ LOGGER.debug("Catalog database: getAllAllottedResourcesByArModelCustomizationUuid - " + arModelCustomizationUuid);
+
+ StringBuilder hql = new StringBuilder("FROM AllottedResourceCustomization WHERE modelCustomizationUuid = :arModelCustomizationUuid");
+ Query query = getSession().createQuery(hql.toString());
+ query.setParameter("arModelCustomizationUuid", arModelCustomizationUuid);
+
+ @SuppressWarnings("unchecked")
+ List<AllottedResourceCustomization> resultList = query.list();
+
+ LOGGER.recordMetricEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully", "CatalogDB", "getAllAllottedResourcesByArModelCustomizationUuid", null);
+ return resultList;
+ }
+
+ //1702 API Spec cont'd - Query for all resources in a Service:
+ public ServiceMacroHolder getAllResourcesByServiceModelUuid(String serviceModelUuid) {
+ long startTime = System.currentTimeMillis();
+ LOGGER.debug("Catalog database: getAllResourcesByServiceModelUuid - " + serviceModelUuid);
+
+ StringBuilder hql = new StringBuilder("FROM Service WHERE serviceNameVersionId = :serviceModelUuid");
+ Query query = getSession().createQuery(hql.toString());
+ query.setParameter("serviceModelUuid", serviceModelUuid);
+ @SuppressWarnings("unchecked")
+ List<Service> serviceList = query.list();
+
+ if (serviceList.isEmpty()) {
+ LOGGER.debug("Unable to find a Service with serviceModelUuid=" + serviceModelUuid);
+ return null;
+ }
+
+ Collections.sort (serviceList, new MavenLikeVersioningComparator ());
+ Collections.reverse (serviceList);
+ Service service = serviceList.get(0);
+
+ ServiceMacroHolder smh = new ServiceMacroHolder(service);
+ ArrayList<NetworkResourceCustomization> nrcList = (ArrayList<NetworkResourceCustomization>) this.getAllNetworksByServiceModelUuid(serviceModelUuid);
+ smh.setNetworkResourceCustomization(nrcList);
+ ArrayList<AllottedResourceCustomization> arcList = (ArrayList<AllottedResourceCustomization>) this.getAllAllottedResourcesByServiceModelUuid(serviceModelUuid);
+ smh.setAllottedResourceCustomization(arcList);
+ ArrayList<VnfResource> vnfList = (ArrayList<VnfResource>) this.getAllVnfsByServiceModelInvariantUuid(service.getModelInvariantUUID(), service.getVersion());
+ smh.setVnfResources(vnfList);
+
+ LOGGER.recordMetricEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully", "CatalogDB", "getAllResourcesByServiceModelUuid", null);
+ return smh;
+ }
+ public ServiceMacroHolder getAllResourcesByServiceModelInvariantUuid(String serviceModelInvariantUuid) {
+ long startTime = System.currentTimeMillis();
+ LOGGER.debug("Catalog database: getAllResourcesByServiceModelInvariantUuid - " + serviceModelInvariantUuid);
+
+ StringBuilder hql = new StringBuilder("FROM Service WHERE modelInvariantUUID = :serviceModelInvariantUuid");
+ Query query = getSession().createQuery(hql.toString());
+ query.setParameter("serviceModelInvariantUuid", serviceModelInvariantUuid);
+ @SuppressWarnings("unchecked")
+ List<Service> serviceList = query.list();
+
+ if (serviceList.isEmpty()) {
+ LOGGER.debug("Unable to find a Service with serviceModelInvariantUuid=" + serviceModelInvariantUuid);
+ return null;
+ }
+
+ Collections.sort (serviceList, new MavenLikeVersioningComparator ());
+ Collections.reverse (serviceList);
+ Service service = serviceList.get(0);
+
+ ServiceMacroHolder smh = new ServiceMacroHolder(service);
+ ArrayList<NetworkResourceCustomization> nrcList = (ArrayList<NetworkResourceCustomization>) this.getAllNetworksByServiceModelUuid(service.getServiceNameVersionId());
+ smh.setNetworkResourceCustomization(nrcList);
+ ArrayList<AllottedResourceCustomization> arcList = (ArrayList<AllottedResourceCustomization>) this.getAllAllottedResourcesByServiceModelUuid(service.getServiceNameVersionId());
+ smh.setAllottedResourceCustomization(arcList);
+ ArrayList<VnfResource> vnfList = (ArrayList<VnfResource>) this.getAllVnfsByServiceModelInvariantUuid(service.getModelInvariantUUID(), service.getVersion());
+ smh.setVnfResources(vnfList);
+
+ LOGGER.recordMetricEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully", "CatalogDB", "getAllResourcesByServiceModelInvariantUuid", null);
+ return smh;
+
+ }
+ public ServiceMacroHolder getAllResourcesByServiceModelInvariantUuid(String serviceModelInvariantUuid, String serviceModelVersion) {
+ long startTime = System.currentTimeMillis();
+ LOGGER.debug("Catalog database: getAllResourcesByServiceModelInvariantUuid - " + serviceModelInvariantUuid + ", version=" + serviceModelVersion);
+
+ StringBuilder hql = new StringBuilder("FROM Service WHERE modelInvariantUUID = :serviceModelInvariantUuid and version = :serviceModelVersion");
+ Query query = getSession().createQuery(hql.toString());
+ query.setParameter("serviceModelInvariantUuid", serviceModelInvariantUuid);
+ query.setParameter("serviceModelVersion", serviceModelVersion);
+ //TODO make this a unique query
+ @SuppressWarnings("unchecked")
+ List<Service> serviceList = query.list();
+
+ if (serviceList.isEmpty()) {
+ LOGGER.debug("Unable to find a Service with serviceModelInvariantUuid=" + serviceModelInvariantUuid + " and serviceModelVersion=" + serviceModelVersion);
+ return null;
+ }
+
+ Collections.sort (serviceList, new MavenLikeVersioningComparator ());
+ Collections.reverse (serviceList);
+ Service service = serviceList.get(0);
+
+ ServiceMacroHolder smh = new ServiceMacroHolder(service);
+ ArrayList<NetworkResourceCustomization> nrcList = (ArrayList<NetworkResourceCustomization>) this.getAllNetworksByServiceModelUuid(service.getServiceNameVersionId());
+ smh.setNetworkResourceCustomization(nrcList);
+ ArrayList<AllottedResourceCustomization> arcList = (ArrayList<AllottedResourceCustomization>) this.getAllAllottedResourcesByServiceModelUuid(service.getServiceNameVersionId());
+ smh.setAllottedResourceCustomization(arcList);
+ ArrayList<VnfResource> vnfList = (ArrayList<VnfResource>) this.getAllVnfsByServiceModelInvariantUuid(service.getModelInvariantUUID(), service.getVersion());
+ smh.setVnfResources(vnfList);
+
+ LOGGER.recordMetricEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully", "CatalogDB", "getAllResourcesByServiceModelUuid with version", null);
+ return smh;
+ }
+
+ private void populateNetworkResourceType(List<NetworkResourceCustomization> resultList) {
+ HashMap<Integer, NetworkResource> networkResources = new HashMap<Integer, NetworkResource>();
+
+ for (NetworkResourceCustomization nrc : resultList) {
+ Integer network_id = nrc.getNetworkResourceId();
+ if (network_id == null) {
+ nrc.setNetworkResource(null);
+ nrc.setNetworkType("UNKNOWN_NETWORK_ID_NULL");
+ continue;
+ }
+ if (networkResources.containsKey(network_id)) {
+ nrc.setNetworkResource(networkResources.get(network_id));
+ nrc.setNetworkType(networkResources.get(network_id).getNetworkType());
+ } else {
+ NetworkResource nr = this.getNetworkResourceById(network_id);
+ if (nr == null) {
+ nrc.setNetworkType("INVALID_NETWORK_TYPE_ID_NOT_FOUND");
+ } else {
+ nrc.setNetworkType(nr.getNetworkType());
+ nrc.setNetworkResource(nr);
+ networkResources.put(network_id, nr);
+ }
+ }
+ }
+ }
+
/**
* Return a VNF recipe that matches a given VNF_TYPE, VF_MODULE_MODEL_NAME, and ACTION
* first query VF_MODULE table by type, and then use the ID to query
@@ -936,33 +1817,116 @@ public class CatalogDatabase implements Closeable {
LOGGER.recordMetricEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully. VNF recipe found", "CatalogDB", "getVfModuleRecipe", null);
return resultList1.get (0);
}
-
+
/**
- * Return a VNF COMPONENTSrecipe that matches a given VNF_TYPE, VF_MODULE_MODEL_NAME,
+ * Return a VNF Module List that matches a given VNF_TYPE, VF_MODULE_MODEL_NAME,
* ASDC_SERVICE_MODEL_VERSION, MODEL_VERSION, and ACTION
- * first query VF_MODULE table by type, and then use the ID to query
- * VNF_COMPONENTS_RECIPE by VF_MODULE_ID and ACTION
+ *
+ * @param vnfModuleType
+ * @parm modelCustomizationUuid
+ * @param asdcServiceModelVersion
+ * @param modelVersion
+ * @param action
+ * @return VfModule list
+ */
+ public List<VfModule> getVfModule (String vfModuleType, String modelCustomizationUuid, String asdcServiceModelVersion, String modelVersion, String action) {
+ StringBuilder hql;
+ Query query;
+ if(modelCustomizationUuid != null){
+ hql = new StringBuilder ("FROM VfModule WHERE modelCustomizationUuid = :modelCustomizationUuid AND version = :version");
+
+ LOGGER.debug ("Catalog database - get VF MODULE with type " + vfModuleType + ", asdcServiceModelVersion " + asdcServiceModelVersion + ", modelVersion " + modelVersion);
+
+ query = getSession ().createQuery (hql.toString ());
+ query.setParameter ("modelCustomizationUuid", modelCustomizationUuid);
+ query.setParameter ("version", asdcServiceModelVersion);
+ }else{
+ hql = new StringBuilder ("FROM VfModule WHERE type = :type AND version = :version AND modelVersion = :modelVersion");
+
+ LOGGER.debug ("Catalog database - get VF MODULE with type " + vfModuleType + ", asdcServiceModelVersion " + asdcServiceModelVersion + ", modelVersion " + modelVersion);
+
+ query = getSession ().createQuery (hql.toString ());
+ query.setParameter (TYPE, vfModuleType);
+ query.setParameter ("version", asdcServiceModelVersion);
+ query.setParameter ("modelVersion", modelVersion);
+ }
+
+ @SuppressWarnings("unchecked")
+ List <VfModule> resultList = query.list ();
+ return resultList;
+ }
+
+ /**
+ * Return a VNF COMPONENTSrecipe that matches a given VNF_TYPE, VF_MODULE_MODEL_NAME,
+ * ASDC_SERVICE_MODEL_VERSION, MODEL_VERSION, and ACTION
+ * first query VF_MODULE table by type, and then use the ID to query
+ * VNF_COMPONENTS_RECIPE by VF_MODULE_ID and ACTION
*
* @param vnfType
* @parm vfModuleModelName
- * @param action
+ * @param action
* @return VnfRecipe object or null if none found
*/
- public VnfComponentsRecipe getVnfComponentsRecipe (String vnfType, String vfModuleModelName, String asdcServiceModelVersion, String modelVersion, String action) {
- String vfModuleType = vnfType + "::" + vfModuleModelName;
-
- StringBuilder hql = new StringBuilder ("FROM VfModule WHERE type = :type AND version = :version AND modelVersion = :modelVersion");
-
+ public VnfComponentsRecipe getVnfComponentsRecipe (String vnfType, String vfModuleModelName, String modelCustomizationUuid, String asdcServiceModelVersion, String modelVersion, String action) {
+ String vfModuleType = vnfType + "::" + vfModuleModelName;
long startTime = System.currentTimeMillis ();
- LOGGER.debug ("Catalog database - get VF MODULE with type " + vfModuleType + ", asdcServiceModelVersion " + asdcServiceModelVersion + ", modelVersion " + modelVersion);
-
- Query query = getSession ().createQuery (hql.toString ());
- query.setParameter (TYPE, vfModuleType);
- query.setParameter ("version", asdcServiceModelVersion);
- query.setParameter ("modelVersion", modelVersion);
-
+ List <VfModule> resultList = getVfModule(vfModuleType, modelCustomizationUuid, asdcServiceModelVersion, modelVersion, action);
+
+ if (resultList.isEmpty ()) {
+ LOGGER.recordMetricEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully. VF Module Entry not found", "CatalogDB", "getVnfComponentsRecipe", null);
+ return null;
+ }
+
+ Collections.sort (resultList, new MavenLikeVersioningComparator ());
+ Collections.reverse (resultList);
+
+ VfModule vfMod = resultList.get(0);
+
+ int id = vfMod.getId();
+ String vfModuleId = Integer.toString(id);
+
+ StringBuilder hql1 = new StringBuilder ("FROM VnfComponentsRecipe WHERE vfModuleId = :vfModuleId AND action = :action ");
+
+ LOGGER.debug ("Catalog database - get Vnf Components recipe with vf module id " + vfModuleId
+ + " and action "
+ + action);
+
+ Query query1 = getSession ().createQuery (hql1.toString ());
+ query1.setParameter (VF_MODULE_ID, vfModuleId);
+ query1.setParameter (ACTION, action);
+
@SuppressWarnings("unchecked")
- List <VfModule> resultList = query.list ();
+ List <VnfComponentsRecipe> resultList1 = query1.list ();
+
+ if (resultList1.isEmpty ()) {
+ LOGGER.recordMetricEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully. VNF recipe not found", "CatalogDB", "getVnfComponentsRecipe", null);
+ return null;
+ }
+
+ Collections.sort (resultList1, new MavenLikeVersioningComparator ());
+ Collections.reverse (resultList1);
+
+ LOGGER.recordMetricEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully. VNF recipe found", "CatalogDB", "getVnfComponentsRecipe", null);
+ if (resultList1.size() > 1 && (!resultList1. get (0).getOrchestrationUri().equals(resultList1.get (1).getOrchestrationUri ()))) {
+ LOGGER.recordMetricEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully. Different ORCHESTRATION URIs found for same VERSION and ID. No result returned.", "CatalogDB", "getVnfComponentsRecipe", null);
+ return null;
+ }
+ return resultList1.get (0);
+ }
+
+ /**
+ * Return a VNF COMPONENTSrecipe that matches a given VNF_TYPE, VF_MODULE_MODEL_NAME,
+ * ASDC_SERVICE_MODEL_VERSION, MODEL_VERSION, and ACTION
+ * first query VF_MODULE table by type, and then use the ID to query
+ * VNF_COMPONENTS_RECIPE by VF_MODULE_ID and ACTION
+ *
+ * @param vnfType
+ * @parm vfModuleModelName
+ * @param action
+ * @return VnfRecipe object or null if none found
+ */
+ public VnfComponentsRecipe getVnfComponentsRecipeByVfModule(List <VfModule> resultList, String action) {
+ long startTime = System.currentTimeMillis ();
if (resultList.isEmpty ()) {
LOGGER.recordMetricEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully. VF Module Entry not found", "CatalogDB", "getVnfComponentsRecipe", null);
@@ -1000,8 +1964,8 @@ public class CatalogDatabase implements Closeable {
LOGGER.recordMetricEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully. VNF recipe found", "CatalogDB", "getVnfComponentsRecipe", null);
if (resultList1.size() > 1 && (!resultList1. get (0).getOrchestrationUri().equals(resultList1.get (1).getOrchestrationUri ()))) {
- LOGGER.recordMetricEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully. Different ORCHESTRATION URIs found for same VERSION and ID. No result returned.", "CatalogDB", "getVnfComponentsRecipe", null);
- return null;
+ LOGGER.recordMetricEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully. Different ORCHESTRATION URIs found for same VERSION and ID. No result returned.", "CatalogDB", "getVnfComponentsRecipe", null);
+ return null;
}
return resultList1.get (0);
}
@@ -1472,21 +2436,116 @@ public class CatalogDatabase implements Closeable {
LOGGER.recordMetricEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully", "CatalogDB", "saveOrUpdateVnfResource", null);
}
}
-
+
+ public void saveAllottedResourceCustomization (AllottedResourceCustomization resourceCustomization) {
+ long startTime = System.currentTimeMillis ();
+ LOGGER.debug ("Catalog database - save Allotted Resource with Name " + resourceCustomization.getModelName());
+ try {
+ List<AllottedResourceCustomization> allottedResourcesList = getAllAllottedResourcesByArModelCustomizationUuid(resourceCustomization.getModelCustomizationUuid());
+
+ if(allottedResourcesList.size() == 0){
+ this.getSession ().save(resourceCustomization);
+ }
+
+ } finally {
+ LOGGER.recordMetricEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully", "CatalogDB", "saveOrUpdateAllottedResourceCustomization", null);
+ }
+ }
+
+ public void saveNetworkResourceCustomization (NetworkResourceCustomization networkResourceCustomization) throws RecordNotFoundException {
+ long startTime = System.currentTimeMillis ();
+ LOGGER.debug ("Catalog database - save Network Resource Customization with Network Name " + networkResourceCustomization.getModelName());
+ try {
+ // Check if NetworkResourceCustomzation record already exists. If so, skip saving it.
+ List<NetworkResourceCustomization> networkResourceCustomizationList = getAllNetworksByNetworkModelCustomizationUuid(networkResourceCustomization.getModelCustomizationUuid());
+ // Do any matching customization records exist?
+ if(networkResourceCustomizationList.size() == 0){
+
+ // Retreive the record from the Network_Resource table associated to the Customization record based on ModelName
+ NetworkResource networkResource = getNetworkResource(networkResourceCustomization.getModelName());
+
+ if(networkResource == null){
+ throw new RecordNotFoundException("No record found in NETWORK_RESOURCE table for model name " + networkResourceCustomization.getModelName());
+ }
+
+ networkResourceCustomization.setNetworkResourceId(networkResource.getId());
+
+ this.getSession ().save(networkResourceCustomization);
+ }
+
+
+ } finally {
+ LOGGER.recordMetricEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully", "CatalogDB", "saveNetworkResourceCustomization", null);
+ }
+ }
+
+ public void saveServiceToNetworks (ServiceToNetworks serviceToNetworks) {
+ long startTime = System.currentTimeMillis ();
+ LOGGER.debug ("Catalog database - save to ServiceToNetworks table with NetworkModelCustomizationUUID of " + serviceToNetworks.getNetworkModelCustomizationUuid() + " and ServiceModelUUID of " + serviceToNetworks.getServiceModelUuid());
+ try {
+ this.getSession ().save(serviceToNetworks);
+
+ } finally {
+ LOGGER.recordMetricEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully", "CatalogDB", "saveNetworkResourceCustomization", null);
+ }
+ }
+
+ public void saveServiceToAllottedResources (ServiceToAllottedResources serviceToAllottedResources) {
+ long startTime = System.currentTimeMillis ();
+ LOGGER.debug ("Catalog database - save to serviceToAllottedResources table with ARModelCustomizationUUID of " + serviceToAllottedResources.getArModelCustomizationUuid() + " and ServiceModelUUID of " + serviceToAllottedResources.getServiceModelUuid());
+ try {
+ this.getSession ().save(serviceToAllottedResources);
+
+ } finally {
+ LOGGER.recordMetricEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully", "CatalogDB", "saveServiceToAllottedResources", null);
+ }
+ }
+
public void saveService (Service service) {
long startTime = System.currentTimeMillis ();
- LOGGER.debug ("Catalog database - save Service with ServiceName/Version/serviceUUID(SERVICE_NAME_VERSION_ID)" + service.getServiceName()+"/"+service.getServiceVersion()+"/"+service.getServiceNameVersionId());
+ LOGGER.debug ("Catalog database - save Service with ServiceName/Version/serviceUUID(SERVICE_NAME_VERSION_ID)" + service.getServiceName()+"/"+service.getVersion()+"/"+service.getServiceNameVersionId());
try {
- Service serviceDB = this.getServiceByUUID(service.getServiceNameVersionId());
+ Service serviceInvariantDB = null;
+ // Retrieve existing service record by nameVersionId
+ Service serviceDB = this.getServiceByUUID(service.getServiceNameVersionId());
if (serviceDB == null) {
- this.getSession ().save (service);
+ // Check to see if a record with the same modelInvariantId already exists. This tells us that a previous version exists and we can copy its recipe Record for the new service record.
+ serviceInvariantDB = this.getServiceByInvariantUUID(service.getModelInvariantUUID());
+ // Save the new Service record
+ this.getSession ().save (service);
}
-
+
+ if(serviceInvariantDB != null){ // existing modelInvariantId was found.
+ // copy the recipe record with the matching invariant id. We will duplicate this for the new service record
+ List<ServiceRecipe> serviceRecipes = getServiceRecipes(serviceInvariantDB.getId());
+
+ if(serviceRecipes != null && serviceRecipes.size() > 0){
+ for(ServiceRecipe serviceRecipe : serviceRecipes){
+ if(serviceRecipe != null){
+ // Fetch the service record that we just added. We do this so we can extract its Id column value, this will be the foreign key we use in the service recipe table.
+ Service newService = this.getServiceByUUID(service.getServiceNameVersionId());
+ // Create a new ServiceRecipe record based on the existing one we just copied from the DB.
+ ServiceRecipe newServiceRecipe = new ServiceRecipe();
+ newServiceRecipe.setAction(serviceRecipe.getAction());
+ newServiceRecipe.setDescription(serviceRecipe.getDescription());
+ newServiceRecipe.setOrchestrationUri(serviceRecipe.getOrchestrationUri());
+ newServiceRecipe.setRecipeTimeout(serviceRecipe.getRecipeTimeout());
+ newServiceRecipe.setServiceParamXSD(serviceRecipe.getServiceParamXSD());
+ newServiceRecipe.setServiceId(newService.getId());
+ newServiceRecipe.setVersion(serviceRecipe.getVersion());
+ // Save the new recipe record in the service_recipe table and associate it to the new service record that we just added.
+ this.getSession ().save (newServiceRecipe);
+ }
+ }
+ }
+
+ }
+
} finally {
LOGGER.recordMetricEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully", "CatalogDB", "saveOrUpdateService", null);
}
}
-
+
public void saveOrUpdateVfModule (VfModule vfModule) {
long startTime = System.currentTimeMillis ();
LOGGER.debug ("Catalog database - save VNF Module with VF Model Name " + vfModule.getModelName());
@@ -1497,9 +2556,9 @@ public class CatalogDatabase implements Closeable {
} else {
this.getSession ().save (vfModule);
}
-
+
} finally {
- LOGGER.recordMetricEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully", "CatalogDB", "saveOrUpdateVfModule", null);
+ LOGGER.recordMetricEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully", "CatalogDB", "saveOrUpdateVfModule", null);
}
}
@@ -1511,21 +2570,21 @@ public class CatalogDatabase implements Closeable {
HeatNestedTemplate nestedTemplate = new HeatNestedTemplate ();
nestedTemplate.setParentTemplateId (parentTemplateId);
nestedTemplate.setChildTemplateId (childTemplateId);
-
+
return (HeatNestedTemplate)session.get (HeatNestedTemplate.class,nestedTemplate);
} finally {
LOGGER.recordMetricEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully", "CatalogDB", "getNestedHeatTemplate", null);
}
}
-
+
public void saveNestedHeatTemplate (int parentTemplateId, HeatTemplate childTemplate, String yamlFile) {
long startTime = System.currentTimeMillis ();
LOGGER.debug ("Catalog database - save nested Heat template with name "
+ childTemplate.getTemplateName ());
try {
-
+
saveHeatTemplate(childTemplate, childTemplate.getParameters());
- if (getNestedHeatTemplate(parentTemplateId,childTemplate.getId()) == null) {
+ if (getNestedHeatTemplate(parentTemplateId,childTemplate.getId()) == null) {
HeatNestedTemplate nestedTemplate = new HeatNestedTemplate ();
nestedTemplate.setParentTemplateId (parentTemplateId);
nestedTemplate.setChildTemplateId (childTemplate.getId ());
@@ -1536,7 +2595,7 @@ public class CatalogDatabase implements Closeable {
LOGGER.recordMetricEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully", "CatalogDB", "saveNestedHeatTemplate", null);
}
}
-
+
public HeatFiles getHeatFiles(int vnfResourceId,String fileName,String asdcResourceName, String version) {
long startTime = System.currentTimeMillis ();
LOGGER.debug ("Catalog database - getHeatFiles with name " + fileName
@@ -1571,8 +2630,8 @@ public class CatalogDatabase implements Closeable {
LOGGER.debug("Generic Exception - while searching for: fileName='" + fileName + "', vnfResourceId='" + vnfResourceId + "' and asdcResourceName=" + asdcResourceName + " and version=" + version);
LOGGER.error(MessageEnum.GENERAL_EXCEPTION, " Generic exception searching for fileName=" + fileName + " and vnfResourceId=" + vnfResourceId + " and asdcResourceName=" + asdcResourceName + " and version=" + version, "", "", MsoLogger.ErrorCode.DataError, "Generic exception searching for fileName=" + fileName);
heatFilesResult = null;
- }
-
+ }
+
// See if something came back.
if (heatFilesResult == null) {
LOGGER.recordMetricEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully. HeatFiles not found", "CatalogDB", "getHeatFiles", null);
@@ -1582,7 +2641,7 @@ public class CatalogDatabase implements Closeable {
LOGGER.recordMetricEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully", "CatalogDB", "getHeatFiles", null);
return heatFilesResult;
}
-
+
public void saveHeatFiles (HeatFiles childFile) {
long startTime = System.currentTimeMillis ();
LOGGER.debug ("Catalog database - save Heat File with name "
@@ -1593,7 +2652,7 @@ public class CatalogDatabase implements Closeable {
// asdc_heat_files_save
this.getSession ().save (childFile);
-
+
} else {
/* replaced 'heatFiles' by 'childFile'
Based on following comment:
@@ -1606,7 +2665,7 @@ public class CatalogDatabase implements Closeable {
LOGGER.recordMetricEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully", "CatalogDB", "saveHeatFiles", null);
}
}
-
+
public void saveVfModuleToHeatFiles (int parentVfModuleId, HeatFiles childFile) {
long startTime = System.currentTimeMillis ();
LOGGER.debug ("Catalog database - save Heat File to VFmodule link "
@@ -1616,14 +2675,14 @@ public class CatalogDatabase implements Closeable {
VfModuleToHeatFiles vfModuleToHeatFile = new VfModuleToHeatFiles ();
vfModuleToHeatFile.setVfModuleId(parentVfModuleId);
vfModuleToHeatFile.setHeatFilesId(childFile.getId());
-
+
session.save (vfModuleToHeatFile);
-
+
} finally {
LOGGER.recordMetricEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully", "CatalogDB", "saveVfModuleToHeatFiles", null);
}
}
-
+
/**
* Return a Network recipe that matches a given NETWORK_TYPE, ACTION, and, if specified, SERVICE_TYPE
@@ -1662,21 +2721,21 @@ public class CatalogDatabase implements Closeable {
if (resultList.isEmpty ()) {
return null;
}
-
+
Collections.sort (resultList, new MavenLikeVersioningComparator ());
Collections.reverse (resultList);
-
+
return resultList.get (0);
} finally {
LOGGER.recordMetricEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully", "CatalogDB", "getNetworkRecipe", null);
}
}
-
+
/**
* Return a Network recipe that matches a given NETWORK_TYPE and ACTION
*
* @param networkType
- * @param action
+ * @param action
* @return NetworkRecipe object or null if none found
*/
public NetworkRecipe getNetworkRecipe (String networkType, String action) {
@@ -1689,21 +2748,21 @@ public class CatalogDatabase implements Closeable {
try {
String hql = "FROM NetworkRecipe WHERE networkType = :networkType AND action = :action";
-
+
Query query = getSession ().createQuery (hql);
query.setParameter (NETWORK_TYPE, networkType);
query.setParameter (ACTION, action);
-
+
@SuppressWarnings("unchecked")
List <NetworkRecipe> resultList = query.list ();
if (resultList.isEmpty ()) {
return null;
}
-
+
Collections.sort (resultList, new MavenLikeVersioningComparator ());
Collections.reverse (resultList);
-
+
return resultList.get (0);
} finally {
LOGGER.recordMetricEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully", "CatalogDB", "getNetworkRecipe", null);
@@ -1711,6 +2770,40 @@ public class CatalogDatabase implements Closeable {
}
/**
+ * Return a Network Resource that matches the Network Customization defined by given MODEL_CUSTOMIZATION_UUID
+ *
+ * @param networkType
+ * @param action
+ * @param serviceType
+ * @return NetworkRecipe object or null if none found
+ */
+ public NetworkResource getNetworkResourceByModelCustUuid(String modelCustomizationUuid) {
+
+ long startTime = System.currentTimeMillis ();
+ LOGGER.debug ("Catalog database - get network resource with modelCustomizationUuid " + modelCustomizationUuid);
+
+ try {
+ String hql = "select n FROM NetworkResource n, NetworkResourceCustomization c WHERE n.id=c.networkResourceId and c.modelCustomizationUuid = :modelCustomizationUuid";
+ Query query = getSession ().createQuery (hql);
+ query.setParameter (MODEL_CUSTOMIZATION_UUID, modelCustomizationUuid);
+
+ @SuppressWarnings("unchecked")
+ List <NetworkResource> resultList = query.list ();
+
+ if (resultList.isEmpty ()) {
+ return null;
+ }
+
+ Collections.sort (resultList, new MavenLikeVersioningComparator ());
+ Collections.reverse (resultList);
+
+ return resultList.get (0);
+ } finally {
+ LOGGER.recordMetricEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully", "CatalogDB", "getNetworkResourceBySvcNtwkRsrc", null);
+ }
+ }
+
+ /**
* Return a VnfComponents recipe that matches a given VNF_TYPE, VNF_COMPONENT_TYPE, ACTION, and, if specified,
* SERVICE_TYPE
*
@@ -1757,24 +2850,24 @@ public class CatalogDatabase implements Closeable {
}
Collections.sort (resultList, new MavenLikeVersioningComparator ());
Collections.reverse (resultList);
-
+
return resultList.get (0);
} finally {
LOGGER.recordMetricEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully", "CatalogDB", "getVnfComponentsRecipe", null);
}
}
-
+
/**
* Return a VnfComponents recipe that matches a given VF_MODULE_ID, VNF_COMPONENT_TYPE, ACTION
*
* @param vfModuleId
* @param vnfComponentType
- * @param action
+ * @param action
* @return VnfComponentsRecipe object or null if none found
*/
public VnfComponentsRecipe getVnfComponentsRecipeByVfModuleId (String vfModuleId,
String vnfComponentType,
- String action) {
+ String action) {
long startTime = System.currentTimeMillis ();
LOGGER.debug ("Catalog database - get Vnf Component recipe with vfModuleId " + vfModuleId
@@ -1786,12 +2879,12 @@ public class CatalogDatabase implements Closeable {
try {
String hql;
hql = "FROM VnfComponentsRecipe WHERE vfModuleId = :vfModuleId AND vnfComponentType = :vnfComponentType AND action = :action ";
-
+
Query query = getSession ().createQuery (hql);
query.setParameter (VF_MODULE_ID, vfModuleId);
query.setParameter (VNF_COMPONENT_TYPE, vnfComponentType);
query.setParameter (ACTION, action);
-
+
@SuppressWarnings("unchecked")
List <VnfComponentsRecipe> resultList = query.list ();
@@ -1800,7 +2893,7 @@ public class CatalogDatabase implements Closeable {
}
Collections.sort (resultList, new MavenLikeVersioningComparator ());
Collections.reverse (resultList);
-
+
return resultList.get (0);
} finally {
LOGGER.recordMetricEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully", "CatalogDB", "getVnfComponentsRecipeByVfModuleId", null);
@@ -1863,6 +2956,71 @@ public class CatalogDatabase implements Closeable {
}
}
+ /**
+ * Return a Model recipe that matches a given MODEL_TYPE, MODEL_VERSION_ID, ACTION
+ * Note: This method is not currently used but was retained in the event the
+ * architecture moves back to a MODEL/MODEL_RECIPE structure.
+ *
+ * @param modelType
+ * @param modelVersionId
+ * @param action
+ * @return ModelRecipe object or null if none found
+ */
+ public ModelRecipe getModelRecipe(String modelType,
+ String modelVersionId,
+ String action) {
+
+ long startTime = System.currentTimeMillis();
+ LOGGER.debug("Catalog database - get Model recipe with modelType=" + modelType
+ + " and modeVersionId=" + modelVersionId
+ + " and action=" + action);
+
+ try {
+ String hql;
+ // TBD - at some point it would be desirable to figure out how to do a HQL JOIN across
+ // the MODEL and MODEL_RECIPE tables in HQL instead of 2 separate queries.
+ // There seems to be 2 issues: formatting a hql query that executes successfully
+ // and then being able to generate a result that will fit into the ModelRecipe class.
+
+ // 1st query to get the Model record for the given MODEL_TYPE and MODEL_VERSION_ID
+ hql = "FROM Model WHERE modelType = :modelType AND modelVersionId = :modelVersionId";
+ Query query = getSession().createQuery(hql);
+ query.setParameter(MODEL_TYPE, modelType);
+ query.setParameter(MODEL_VERSION_ID, modelVersionId);
+
+ @SuppressWarnings("unchecked")
+ List<Model> modelResultList = query.list();
+ if (modelResultList.isEmpty()) {
+ LOGGER.debug("Catalog database - modelResultList is null");
+ return null;
+ }
+ Collections.sort(modelResultList, new MavenLikeVersioningComparator());
+ Collections.reverse(modelResultList);
+ LOGGER.debug("Catalog database - modelResultList contains " + modelResultList.get(0).toString());
+
+ // 2nd query to get the ModelRecipe record corresponding to the Model from the 1st query
+ hql = "FROM ModelRecipe WHERE modelId = :modelId AND action = :action";
+ query = getSession().createQuery(hql);
+ // The MODEL table 'id' field maps to the MODEL_RECIPE table 'MODEL_ID' field
+ query.setParameter(MODEL_ID, modelResultList.get(0).getId());
+ query.setParameter(ACTION, action);
+
+ @SuppressWarnings("unchecked")
+ List<ModelRecipe> recipeResultList = query.list();
+ if (recipeResultList.isEmpty()) {
+ LOGGER.debug("Catalog database - recipeResultList is null");
+ return null;
+ }
+ Collections.sort(recipeResultList, new MavenLikeVersioningComparator());
+ Collections.reverse(recipeResultList);
+ LOGGER.debug("Catalog database - recipeResultList contains " + recipeResultList.get(0).toString());
+
+ return recipeResultList.get(0);
+ } finally {
+ LOGGER.recordMetricEvent(startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully", "CatalogDB", "getModelRecipe", null);
+ }
+ }
+
/**
* Verify the health of the DB.
diff --git a/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/HibernateUtilsCatalogDb.java b/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/HibernateUtilsCatalogDb.java
new file mode 100644
index 0000000000..c4069be443
--- /dev/null
+++ b/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/HibernateUtilsCatalogDb.java
@@ -0,0 +1,45 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * OPENECOMP - MSO
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+package org.openecomp.mso.db.catalog;
+
+import org.openecomp.mso.db.HibernateUtils;
+import org.openecomp.mso.logger.MessageEnum;
+import org.openecomp.mso.logger.MsoLogger;
+import java.net.URL;
+
+public class HibernateUtilsCatalogDb extends HibernateUtils {
+
+ private static final MsoLogger LOGGER = MsoLogger.getMsoLogger(MsoLogger.Catalog.GENERAL);
+
+ @Override
+ protected URL getHibernateConfigFile() {
+ try {
+ if ("MYSQL".equals (System.getProperty ("mso.db")) || "MARIADB".equals(System.getProperty("mso.db"))) {
+ return this.getClass().getClassLoader().getResource("hibernate-catalog-core-mysql.cfg.xml");
+ } else {
+ LOGGER.error (MessageEnum.APIH_DB_ACCESS_EXC_REASON, "DB Connection not specified to the JVM,choose either:-Dmso.db=MARIADB, -Dmso.db=MYSQL or -Dmso.container=AJSC", "", "", MsoLogger.ErrorCode.DataError , "DB Connection not specified to the JVM,choose either:-Dmso.db=MARIADB, -Dmso.db=MYSQL or -Dmso.container=AJSC");
+ return null;
+ }
+ } catch (Exception ex) {
+ LOGGER.error (MessageEnum.APIH_DB_ACCESS_EXC_REASON, ex.getMessage (), "", "", MsoLogger.ErrorCode.DataError , "Problem in getting DB connection type", ex);
+ return null;
+ }
+ }
+} \ No newline at end of file
diff --git a/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/AllottedResourceCustomization.java b/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/AllottedResourceCustomization.java
new file mode 100644
index 0000000000..21cef1ea9f
--- /dev/null
+++ b/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/AllottedResourceCustomization.java
@@ -0,0 +1,123 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * OPENECOMP - MSO
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+package org.openecomp.mso.db.catalog.beans;
+
+import java.sql.Timestamp;
+
+import org.openecomp.mso.db.catalog.utils.MavenLikeVersioning;
+
+public class AllottedResourceCustomization extends MavenLikeVersioning {
+
+ private String modelCustomizationUuid;
+ private String modelUuid;
+ private String modelInvariantUuid;
+ private String modelVersion = null; // duplicate of version kept in parent class
+ private String modelName;
+ private String description;
+ private Timestamp created;
+ private String modelInstanceName;
+
+ public AllottedResourceCustomization() {
+ super();
+ }
+
+ public String getModelCustomizationUuid() {
+ return this.modelCustomizationUuid;
+ }
+ public void setModelCustomizationUuid(String modelCustomizationUuid) {
+ this.modelCustomizationUuid = modelCustomizationUuid;
+ }
+
+ public String getModelUuid() {
+ return this.modelUuid;
+ }
+ public void setModelUuid(String modelUuid) {
+ this.modelUuid = modelUuid;
+ }
+
+ public String getModelInvariantUuid() {
+ return this.modelInvariantUuid;
+ }
+ public void setModelInvariantUuid(String modelInvariantUuid) {
+ this.modelInvariantUuid = modelInvariantUuid;
+ }
+
+ public String getModelName() {
+ return this.modelName;
+ }
+ public void setModelName(String modelName) {
+ this.modelName = modelName;
+ }
+
+ public String getDescription() {
+ return this.description;
+ }
+ public void setDescription(String description) {
+ this.description = description;
+ }
+
+ public Timestamp getCreated() {
+ return this.created;
+ }
+ public void setCreated(Timestamp created) {
+ this.created = created;
+ }
+
+ public String getModelInstanceName() {
+ return this.modelInstanceName;
+ }
+ public void setModelInstanceName(String modelInstanceName) {
+ this.modelInstanceName = modelInstanceName;
+ }
+ public String getModelVersion() {
+ return this.modelVersion;
+ }
+ public void setModelVersion(String modelVersion) {
+ this.modelVersion = modelVersion;
+ }
+
+ @Override
+ public String toString () {
+ StringBuffer sb = new StringBuffer();
+ sb.append("modelName=");
+ sb.append(this.modelName);
+ sb.append(",modelVersion=");
+ sb.append(this.modelVersion);
+ sb.append(",version=");
+ sb.append(this.version);
+ sb.append(",modelUuid=");
+ sb.append(this.modelUuid);
+ sb.append(",modelInvariantUuid=");
+ sb.append(this.modelInvariantUuid);
+ sb.append(",modelCustomizationUuid=");
+ sb.append(this.modelCustomizationUuid);
+ sb.append(",modelInstanceName=");
+ sb.append(this.modelInstanceName);
+ sb.append(",description=");
+ sb.append(this.description);
+ sb.append(",modelInstanceName=");
+ sb.append(this.modelInstanceName);
+ sb.append(",created=");
+ sb.append(this.created);
+
+ return sb.toString();
+ }
+
+}
diff --git a/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/HeatEnvironment.java b/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/HeatEnvironment.java
index 69db27e989..a920375bcd 100644
--- a/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/HeatEnvironment.java
+++ b/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/HeatEnvironment.java
@@ -7,9 +7,9 @@
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -35,9 +35,10 @@ public class HeatEnvironment extends MavenLikeVersioning {
private String asdcUuid;
private String asdcResourceName;
private String asdcLabel;
+ private String artifactChecksum;
private Timestamp created;
-
+
public HeatEnvironment() {}
public int getId() {
@@ -92,8 +93,15 @@ public class HeatEnvironment extends MavenLikeVersioning {
this.asdcLabel = asdcLabel;
}
+ public String getArtifactChecksum() {
+ return artifactChecksum;
+ }
- /**
+ public void setArtifactChecksum(String artifactChecksum) {
+ this.artifactChecksum = artifactChecksum;
+ }
+
+ /**
* @return the asdcResourceName
*/
public String getAsdcResourceName () {
@@ -115,7 +123,7 @@ public class HeatEnvironment extends MavenLikeVersioning {
public void setCreated(Timestamp created) {
this.created = created;
}
-
+
@Override
public String toString () {
StringBuffer sb = new StringBuffer();
diff --git a/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/HeatFiles.java b/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/HeatFiles.java
index a1b6f228e1..d379c2471a 100644
--- a/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/HeatFiles.java
+++ b/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/HeatFiles.java
@@ -7,9 +7,9 @@
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -36,38 +36,39 @@ public class HeatFiles extends MavenLikeVersioning {
private String asdcUuid;
private String asdcLabel;
private String asdcResourceName;
-
+ private String artifactChecksum;
+
public HeatFiles() {}
-
+
public int getId() {
return this.id;
}
-
+
public void setId(int id) {
this.id = id;
}
-
+
public String getDescription() {
return this.description;
}
public void setDescription(String description) {
this.description = description;
}
-
+
public String getFileName() {
return this.fileName;
}
public void setFileName(String fileName) {
this.fileName = fileName;
}
-
+
public String getFileBody() {
return this.fileBody;
}
public void setFileBody(String fileBody) {
this.fileBody = fileBody;
}
-
+
public int getVnfResourceId() {
return this.vnfResourceId;
}
@@ -82,7 +83,7 @@ public class HeatFiles extends MavenLikeVersioning {
public void setCreated(Timestamp created) {
this.created = created;
}
-
+
public String getAsdcUuid() {
return this.asdcUuid;
}
@@ -103,6 +104,14 @@ public class HeatFiles extends MavenLikeVersioning {
this.asdcResourceName = asdcResourceName;
}
+ public String getArtifactChecksum() {
+ return artifactChecksum;
+ }
+
+ public void setArtifactChecksum(String artifactChecksum) {
+ this.artifactChecksum = artifactChecksum;
+ }
+
@Override
public String toString () {
StringBuffer sb = new StringBuffer();
diff --git a/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/HeatTemplate.java b/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/HeatTemplate.java
index a80fa598b9..5762837bfb 100644
--- a/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/HeatTemplate.java
+++ b/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/HeatTemplate.java
@@ -7,9 +7,9 @@
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -46,9 +46,10 @@ public class HeatTemplate extends MavenLikeVersioning {
private String asdcUuid;
private String asdcResourceName;
private String asdcLabel;
-
+ private String artifactChecksum;
+
private Timestamp created;
-
+
public enum TemplateStatus {
PARENT, CHILD, PARENT_COMPLETE
}
@@ -103,7 +104,7 @@ public class HeatTemplate extends MavenLikeVersioning {
public void setParameters (Set <HeatTemplateParam> parameters) {
this.parameters = parameters;
}
-
+
public String getDescription() {
return description;
}
@@ -131,7 +132,7 @@ public class HeatTemplate extends MavenLikeVersioning {
} catch (Exception e) {
LOGGER.debug ("Error reading template file " + templatePath, e);
}
-
+
return body;
}
@@ -150,7 +151,7 @@ public class HeatTemplate extends MavenLikeVersioning {
public void setAsdcUuid(String asdcUuidp) {
this.asdcUuid = asdcUuidp;
}
-
+
public String getAsdcResourceName() {
return asdcResourceName;
}
@@ -164,8 +165,15 @@ public class HeatTemplate extends MavenLikeVersioning {
public void setAsdcLabel(String asdcLabel) {
this.asdcLabel = asdcLabel;
}
-
- public Timestamp getCreated() {
+
+ public String getArtifactChecksum() {
+ return artifactChecksum;
+ }
+
+ public void setArtifactChecksum(String artifactChecksum) {
+ this.artifactChecksum = artifactChecksum;
+ }
+ public Timestamp getCreated() {
return created;
}
@@ -197,7 +205,7 @@ public class HeatTemplate extends MavenLikeVersioning {
sb.append (",created=");
sb.append (DateFormat.getInstance().format(created));
}
-
+
if (parameters != null && !parameters.isEmpty ()) {
sb.append (",params=[");
diff --git a/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/Model.java b/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/Model.java
new file mode 100644
index 0000000000..51153c912b
--- /dev/null
+++ b/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/Model.java
@@ -0,0 +1,198 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * OPENECOMP - MSO
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+package org.openecomp.mso.db.catalog.beans;
+
+
+import java.sql.Timestamp;
+import java.text.DateFormat;
+import java.util.Map;
+
+import org.openecomp.mso.db.catalog.utils.MavenLikeVersioning;
+
+public class Model extends MavenLikeVersioning {
+ private int id;
+ private String modelCustomizationId;
+ private String modelCustomizationName;
+ private String modelInvariantId;
+ private String modelName;
+ private String modelType;
+ private String modelVersion;
+ private String modelVersionId;
+ private Timestamp created;
+ private Map<String,ServiceRecipe> recipes;
+
+ /**
+ * @return the id
+ */
+ public int getId() {
+ return id;
+ }
+
+ /**
+ * @param id the id to set
+ */
+ public void setId(int id) {
+ this.id = id;
+ }
+
+ /**
+ * @return the modelCustomizationId
+ */
+ public String getModelCustomizationId() {
+ return modelCustomizationId;
+ }
+
+ /**
+ * @param modelCustomizationId the modelCustomizationId to set
+ */
+ public void setModelCustomizationId(String modelCustomizationId) {
+ this.modelCustomizationId = modelCustomizationId;
+ }
+
+ /**
+ * @return the modelCustomizationName
+ */
+ public String getModelCustomizationName() {
+ return modelCustomizationName;
+ }
+
+ /**
+ * @param modelCustomizationName the modelCustomizationName to set
+ */
+ public void setModelCustomizationName(String modelCustomizationName) {
+ this.modelCustomizationName = modelCustomizationName;
+ }
+
+ /**
+ * @return the modelInvariantId
+ */
+ public String getModelInvariantId() {
+ return modelInvariantId;
+ }
+
+ /**
+ * @param modelInvariantId the modelInvariantId to set
+ */
+ public void setModelInvariantId(String modelInvariantId) {
+ this.modelInvariantId = modelInvariantId;
+ }
+
+ /**
+ * @return the modelName
+ */
+ public String getModelName() {
+ return modelName;
+ }
+
+ /**
+ * @param modelName the modelName to set
+ */
+ public void setModelName(String modelName) {
+ this.modelName = modelName;
+ }
+
+ /**
+ * @return the modelType
+ */
+ public String getModelType() {
+ return modelType;
+ }
+
+ /**
+ * @param modelType the modelType to set
+ */
+ public void setModelType(String modelType) {
+ this.modelType = modelType;
+ }
+
+ /**
+ * @return the modelVersion
+ */
+ public String getModelVersion() {
+ return modelVersion;
+ }
+
+ /**
+ * @param modelVersion the modelVersion to set
+ */
+ public void setModelVersion(String modelVersion) {
+ this.modelVersion = modelVersion;
+ }
+
+ /**
+ * @return the modelVersionId
+ */
+ public String getModelVersionId() {
+ return modelVersionId;
+ }
+
+ /**
+ * @param modelVersionId the modelVersionId to set
+ */
+ public void setModelVersionId(String modelVersionId) {
+ this.modelVersionId = modelVersionId;
+ }
+
+ /**
+ * @return the created
+ */
+ public Timestamp getCreated() {
+ return created;
+ }
+
+ /**
+ * @param created the created to set
+ */
+ public void setCreated(Timestamp created) {
+ this.created = created;
+ }
+
+ /**
+ * @return the recipes
+ */
+ public Map<String, ServiceRecipe> getRecipes() {
+ return recipes;
+ }
+
+ /**
+ * @param recipes the recipes to set
+ */
+ public void setRecipes(Map<String, ServiceRecipe> recipes) {
+ this.recipes = recipes;
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder sb = new StringBuilder();
+ sb.append("Model: ");
+ sb.append("modelCustomizationId=" + modelCustomizationId);
+ sb.append(",modelCustomizationName=" + modelCustomizationName);
+ sb.append(",modelInvariantId=" + modelInvariantId);
+ sb.append(",modelName=" + modelName);
+ sb.append(",modelType=" + modelType);
+ sb.append(",modelVersion=" + modelVersion);
+ sb.append(",modelVersionId=" + modelVersionId);
+ if (created != null) {
+ sb.append (",created=");
+ sb.append (DateFormat.getInstance().format(created));
+ }
+ return sb.toString();
+ }
+}
diff --git a/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/ModelRecipe.java b/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/ModelRecipe.java
new file mode 100644
index 0000000000..83fb773a8c
--- /dev/null
+++ b/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/ModelRecipe.java
@@ -0,0 +1,180 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * OPENECOMP - MSO
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+package org.openecomp.mso.db.catalog.beans;
+
+
+import java.sql.Timestamp;
+import java.text.DateFormat;
+import org.openecomp.mso.db.catalog.utils.MavenLikeVersioning;
+
+public class ModelRecipe extends MavenLikeVersioning {
+ private int id;
+ private Integer modelId;
+ private String action;
+ private String schemaVersion;
+ private String description;
+ private String orchestrationUri;
+ private String modelParamXSD;
+ private Integer recipeTimeout;
+ private Timestamp created;
+
+ /**
+ * @return the id
+ */
+ public int getId() {
+ return id;
+ }
+
+ /**
+ * @param id the id to set
+ */
+ public void setId(int id) {
+ this.id = id;
+ }
+
+ /**
+ * @return the modelId
+ */
+ public Integer getModelId() {
+ return modelId;
+ }
+
+ /**
+ * @param modelId the modelId to set
+ */
+ public void setModelId(Integer modelId) {
+ this.modelId = modelId;
+ }
+
+ /**
+ * @return the action
+ */
+ public String getAction() {
+ return action;
+ }
+
+ /**
+ * @param action the action to set
+ */
+ public void setAction(String action) {
+ this.action = action;
+ }
+
+ /**
+ * @return the versionStr
+ */
+ public String getSchemaVersion() {
+ return schemaVersion;
+ }
+
+ /**
+ * @param versionStr the versionStr to set
+ */
+ public void setSchemaVersion(String schemaVersion) {
+ this.schemaVersion = schemaVersion;
+ }
+
+ /**
+ * @return the description
+ */
+ public String getDescription() {
+ return description;
+ }
+
+ /**
+ * @param description the description to set
+ */
+ public void setDescription(String description) {
+ this.description = description;
+ }
+
+ /**
+ * @return the orchestrationUri
+ */
+ public String getOrchestrationUri() {
+ return orchestrationUri;
+ }
+
+ /**
+ * @param orchestrationUri the orchestrationUri to set
+ */
+ public void setOrchestrationUri(String orchestrationUri) {
+ this.orchestrationUri = orchestrationUri;
+ }
+
+ /**
+ * @return the modelParamXSD
+ */
+ public String getModelParamXSD() {
+ return modelParamXSD;
+ }
+
+ /**
+ * @param modelParamXSD the modelParamXSD to set
+ */
+ public void setModelParamXSD(String modelParamXSD) {
+ this.modelParamXSD = modelParamXSD;
+ }
+
+ /**
+ * @return the recipeTimeout
+ */
+ public Integer getRecipeTimeout() {
+ return recipeTimeout;
+ }
+
+ /**
+ * @param recipeTimeout the recipeTimeout to set
+ */
+ public void setRecipeTimeout(Integer recipeTimeout) {
+ this.recipeTimeout = recipeTimeout;
+ }
+
+ /**
+ * @return the created
+ */
+ public Timestamp getCreated() {
+ return created;
+ }
+
+ /**
+ * @param created the created to set
+ */
+ public void setCreated(Timestamp created) {
+ this.created = created;
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder sb = new StringBuilder();
+ sb.append("ModelRecipe: ");
+ sb.append("modelId=" + modelId.toString());
+ sb.append(",action=" + action);
+ sb.append(",schemaVersion=" + schemaVersion);
+ sb.append(",orchestrationUri=" + orchestrationUri);
+ sb.append(",modelParamXSD=" + modelParamXSD);
+ sb.append(",recipeTimeout=" + recipeTimeout.toString());
+ if (created != null) {
+ sb.append (",created=");
+ sb.append (DateFormat.getInstance().format(created));
+ }
+ return sb.toString();
+ }
+}
diff --git a/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/NetworkResourceCustomization.java b/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/NetworkResourceCustomization.java
new file mode 100644
index 0000000000..0c49f1b1a4
--- /dev/null
+++ b/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/NetworkResourceCustomization.java
@@ -0,0 +1,140 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * OPENECOMP - MSO
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+package org.openecomp.mso.db.catalog.beans;
+
+import java.sql.Timestamp;
+
+import org.openecomp.mso.db.catalog.utils.MavenLikeVersioning;
+
+public class NetworkResourceCustomization extends MavenLikeVersioning{
+
+ private String modelCustomizationUuid;
+ private String modelName;
+ private String modelInstanceName;
+ private String modelUuid;
+ private String modelVersion;
+ private String modelInvariantUuid;
+ private int networkResourceId = 0;
+ private Timestamp created;
+
+ // These fields are not in the table directly - but I'm adding them here for storage in the objects we're dealing with
+ private NetworkResource networkResource = null;
+ private String networkType = null;
+
+ public NetworkResourceCustomization() {
+ super();
+ }
+
+ public int getNetworkResourceId() {
+ return this.networkResourceId;
+ }
+ public void setNetworkResourceId(int networkResourceId) {
+ this.networkResourceId = networkResourceId;
+ }
+
+ public String getModelUuid() {
+ return this.modelUuid;
+ }
+ public void setModelUuid(String modelUuid) {
+ this.modelUuid = modelUuid;
+ }
+
+ public String getModelInvariantUuid() {
+ return this.modelInvariantUuid;
+ }
+ public void setModelInvariantUuid(String modelInvariantUuid) {
+ this.modelInvariantUuid = modelInvariantUuid;
+ }
+
+ public String getModelVersion() {
+ return this.modelVersion;
+ }
+ public void setModelVersion(String modelVersion) {
+ this.modelVersion = modelVersion;
+ }
+
+ public String getModelCustomizationUuid() {
+ return this.modelCustomizationUuid;
+ }
+ public void setModelCustomizationUuid(String modelCustomizationUuid) {
+ this.modelCustomizationUuid = modelCustomizationUuid;
+ }
+
+ public String getModelInstanceName() {
+ return this.modelInstanceName;
+ }
+ public void setModelInstanceName(String modelInstanceName) {
+ this.modelInstanceName = modelInstanceName;
+ }
+
+ public String getModelName() {
+ return this.modelName;
+ }
+ public void setModelName(String modelName) {
+ this.modelName = modelName;
+ }
+
+ public NetworkResource getNetworkResource() {
+ return this.networkResource;
+ }
+ public void setNetworkResource(NetworkResource networkResource) {
+ this.networkResource = networkResource;
+ }
+
+ public String getNetworkType() {
+ return this.networkType;
+ }
+ public void setNetworkType(String networkType) {
+ this.networkType = networkType;
+ }
+ public Timestamp getCreated() {
+ return this.created;
+ }
+ public void setCreated(Timestamp timestamp) {
+ this.created = timestamp;
+ }
+
+
+ @Override
+ public String toString () {
+ StringBuffer sb = new StringBuffer();
+ sb.append("modelName=");
+ sb.append(this.modelName);
+ sb.append("modelUuid=");
+ sb.append(this.modelUuid);
+ sb.append("modelUuid=");
+ sb.append(this.modelUuid);
+ sb.append("modelInvariantUuid=");
+ sb.append(this.modelInvariantUuid);
+ sb.append("modelVersion=");
+ sb.append(this.modelVersion);
+ sb.append("modelCustomizationUuid=");
+ sb.append(this.modelCustomizationUuid);
+ sb.append("modelInstanceName=");
+ sb.append(this.modelInstanceName);
+ sb.append("networkResourceId=");
+ sb.append(this.networkResourceId);
+ sb.append("networkType=");
+ sb.append(this.networkType);
+
+ return sb.toString();
+ }
+
+} \ No newline at end of file
diff --git a/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/ServiceMacroHolder.java b/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/ServiceMacroHolder.java
new file mode 100644
index 0000000000..01369c4ecd
--- /dev/null
+++ b/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/ServiceMacroHolder.java
@@ -0,0 +1,141 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * OPENECOMP - MSO
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+package org.openecomp.mso.db.catalog.beans;
+
+import org.openecomp.mso.db.catalog.beans.Service;
+import org.openecomp.mso.db.catalog.beans.VnfResource;
+import org.openecomp.mso.db.catalog.beans.VfModule;
+import java.util.ArrayList;
+
+/*
+ * A simple holder for Service and its associated elements:
+ * VnfResource, 1-n VfModule, Network TBD
+ */
+
+public class ServiceMacroHolder {
+
+ private Service service;
+ private ArrayList<VnfResource> vnfResources;
+ private ArrayList<NetworkResourceCustomization> networkResourceCustomizations;
+ private ArrayList<AllottedResourceCustomization> allottedResourceCustomizations;
+
+ public ServiceMacroHolder() {
+ super();
+ this.service = null;
+ this.vnfResources = new ArrayList<VnfResource>();
+ this.networkResourceCustomizations = new ArrayList<NetworkResourceCustomization>();
+ this.allottedResourceCustomizations = new ArrayList<AllottedResourceCustomization>();
+ }
+ public ServiceMacroHolder(Service service) {
+ this();
+ this.service = service;
+ }
+
+ public Service getService() {
+ return this.service;
+ }
+ public void setService(Service service) {
+ this.service = service;
+ }
+
+ public void setVnfResources(ArrayList<VnfResource> vnfResources) {
+ this.vnfResources = vnfResources;
+ }
+ public ArrayList<VnfResource> getVnfResources() {
+ return this.vnfResources;
+ }
+ public void addVnfResource(VnfResource vr) {
+ if (vr != null) {
+ if (this.vnfResources != null) {
+ this.vnfResources.add(vr);
+ } else {
+ this.vnfResources = new ArrayList<VnfResource>();
+ this.vnfResources.add(vr);
+ }
+ }
+ }
+
+ public void setNetworkResourceCustomization(ArrayList<NetworkResourceCustomization> networkResourceCustomizations) {
+ this.networkResourceCustomizations = networkResourceCustomizations;
+ }
+ public ArrayList<NetworkResourceCustomization> getNetworkResourceCustomization() {
+ return this.networkResourceCustomizations;
+ }
+ public void addNetworkResourceCustomization(NetworkResourceCustomization nrc) {
+ if (this.networkResourceCustomizations != null) {
+ this.networkResourceCustomizations.add(nrc);
+ } else {
+ this.networkResourceCustomizations = new ArrayList<NetworkResourceCustomization>();
+ this.networkResourceCustomizations.add(nrc);
+ }
+ }
+
+ public void setAllottedResourceCustomization(ArrayList<AllottedResourceCustomization> allottedResourceCustomizations) {
+ this.allottedResourceCustomizations = allottedResourceCustomizations;
+ }
+ public ArrayList<AllottedResourceCustomization> getAllottedResourceCustomization() {
+ return this.allottedResourceCustomizations;
+ }
+ public void addAllottedResourceCustomization(AllottedResourceCustomization arc) {
+ if (this.allottedResourceCustomizations != null) {
+ this.allottedResourceCustomizations.add(arc);
+ } else {
+ this.allottedResourceCustomizations = new ArrayList<AllottedResourceCustomization>();
+ this.allottedResourceCustomizations.add(arc);
+ }
+ }
+
+ public String toString() {
+ StringBuilder sb = new StringBuilder();
+ sb.append("ServicePlus: ");
+ if (this.service != null) {
+ sb.append("service: " + this.service.toString());
+ } else {
+ sb.append("service: null");
+ }
+ if (this.vnfResources != null && this.vnfResources.size() > 0) {
+ int i=0;
+ sb.append("VnfResources: ");
+ for (VnfResource vr : this.vnfResources) {
+ sb.append(", vnfResource[" + i++ + "]:" + vr.toString());
+ }
+ } else {
+ sb.append("none");
+ }
+ if (this.networkResourceCustomizations != null && this.networkResourceCustomizations.size() > 0) {
+ int i=0;
+ sb.append("NetworkResourceCustomizations:");
+ for (NetworkResourceCustomization nrc : this.networkResourceCustomizations) {
+ sb.append("NRC[" + i++ + "]: " + nrc.toString());
+ }
+ }
+ if (this.allottedResourceCustomizations != null && this.allottedResourceCustomizations.size() > 0) {
+ int i=0;
+ sb.append("AllottedResourceCustomizations:");
+ for (AllottedResourceCustomization arc : this.allottedResourceCustomizations) {
+ sb.append("ARC[" + i++ + "]: " + arc.toString());
+ }
+ }
+
+ return sb.toString();
+ }
+
+
+}
diff --git a/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/ServiceRecipe.java b/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/ServiceRecipe.java
index 53ec3ba278..cc203ff98d 100644
--- a/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/ServiceRecipe.java
+++ b/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/ServiceRecipe.java
@@ -7,9 +7,9 @@
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -26,6 +26,9 @@ package org.openecomp.mso.db.catalog.beans;
import java.sql.Timestamp;
import java.text.DateFormat;
import org.openecomp.mso.db.catalog.utils.MavenLikeVersioning;
+import java.util.Date;
+import org.openecomp.mso.db.catalog.utils.MavenLikeVersioning;
+import org.openecomp.mso.logger.MsoLogger;
public class ServiceRecipe extends MavenLikeVersioning {
private int id;
@@ -36,9 +39,38 @@ public class ServiceRecipe extends MavenLikeVersioning {
private String serviceParamXSD;
private int recipeTimeout;
private Integer serviceTimeoutInterim;
-
+
private Timestamp created;
-
+
+
+ private static final MsoLogger LOGGER = MsoLogger.getMsoLogger (MsoLogger.Catalog.GENERAL);
+
+ // This 'default' CTR is now needed for backward compatibility since a new CTR was added below
+ public ServiceRecipe() {
+ super();
+ }
+
+ // This CTR is needed by the HQL SELECT JOIN between the SERVICE and SERVICE_RECIPE tables
+ // in CatalogDatabase::getServiceRecipe()
+ public ServiceRecipe(int id, int serviceId, String action,
+ String description, String orchestrationUri,
+ String serviceParamXSD, int recipeTimeout,
+ int serviceTimeoutInterim, Date created) {
+ super();
+ LOGGER.debug("ServiceRecipe id=" + id + ", serviceId=" + serviceId + ", action=" + action + ", description=" + description +
+ ", orchestrationUri=" + orchestrationUri + ", serviceParamXSD=" + serviceParamXSD +
+ ", recipeTimeout=" + recipeTimeout + ", serviceTimeoutInterim=" + serviceTimeoutInterim + ", created=" + created);
+ this.id = id;
+ this.serviceId = serviceId;
+ this.action = action;
+ this.description = description;
+ this.orchestrationUri = orchestrationUri;
+ this.serviceParamXSD = serviceParamXSD;
+ this.recipeTimeout = recipeTimeout;
+ this.serviceTimeoutInterim = serviceTimeoutInterim;
+ long date = created.getTime();
+ this.created = new Timestamp(date);
+ }
public int getId() {
return id;
@@ -96,7 +128,7 @@ public class ServiceRecipe extends MavenLikeVersioning {
public void setServiceTimeoutInterim(Integer serviceTimeoutInterim) {
this.serviceTimeoutInterim = serviceTimeoutInterim;
}
-
+
public Timestamp getCreated() {
return created;
}
diff --git a/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/ServiceToAllottedResources.java b/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/ServiceToAllottedResources.java
new file mode 100644
index 0000000000..1fc93be6f5
--- /dev/null
+++ b/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/ServiceToAllottedResources.java
@@ -0,0 +1,67 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * OPENECOMP - MSO
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+package org.openecomp.mso.db.catalog.beans;
+
+import java.io.Serializable;
+import java.sql.Timestamp;
+
+public class ServiceToAllottedResources implements Serializable {
+
+ private String serviceModelUuid;
+ private String arModelCustomizationUuid;
+ private Timestamp created;
+
+ public static final long serialVersionUID = -1322322139926390329L;
+
+ public ServiceToAllottedResources() {
+ super();
+ }
+
+ public String getServiceModelUuid() {
+ return this.serviceModelUuid;
+ }
+ public void setServiceModelUuid(String serviceModelUuid) {
+ this.serviceModelUuid = serviceModelUuid;
+ }
+ public String getArModelCustomizationUuid() {
+ return this.arModelCustomizationUuid;
+ }
+ public void setArModelCustomizationUuid(String arModelCustomizationUuid) {
+ this.arModelCustomizationUuid = arModelCustomizationUuid;
+ }
+ public Timestamp getCreated() {
+ return this.created;
+ }
+ public void setCreated(Timestamp created) {
+ this.created = created;
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder sb = new StringBuilder();
+ sb.append("serviceModelUuid=");
+ sb.append(this.serviceModelUuid);
+ sb.append("arModelCustomizationUuid=");
+ sb.append(this.arModelCustomizationUuid);
+
+ return sb.toString();
+ }
+
+}
diff --git a/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/ServiceToNetworks.java b/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/ServiceToNetworks.java
new file mode 100644
index 0000000000..5ea171e93b
--- /dev/null
+++ b/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/ServiceToNetworks.java
@@ -0,0 +1,68 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * OPENECOMP - MSO
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+package org.openecomp.mso.db.catalog.beans;
+
+import java.io.Serializable;
+import java.sql.Timestamp;
+
+public class ServiceToNetworks implements Serializable {
+
+ // This maps to SERVICE.SERVICE_NAME_VERSION_ID / Service.serviceNameVersionId in SERVICE/Service table
+ private String serviceModelUuid;
+ // This maps to NETWORK_RESOURCE_CUSTOMIZATION.MODEL_CUSTOMIZATION_UUID / NetworkResourceCustomization.ModelCustomizationUuid
+ private String networkModelCustomizationUuid;
+ private Timestamp created;
+ public static final long serialVersionUID = -1322322139926390329L;
+
+ public ServiceToNetworks() {
+ super();
+ }
+
+ public String getServiceModelUuid() {
+ return this.serviceModelUuid;
+ }
+ public void setServiceModelUuid(String serviceModelUuid) {
+ this.serviceModelUuid = serviceModelUuid;
+ }
+
+ public String getNetworkModelCustomizationUuid() {
+ return this.networkModelCustomizationUuid;
+ }
+ public void setNetworkModelCustomizationUuid(String networkCustomizationUuid) {
+ this.networkModelCustomizationUuid = networkCustomizationUuid;
+ }
+
+ public Timestamp getCreated() {
+ return this.created;
+ }
+ public void setCreated(Timestamp timestamp) {
+ this.created = timestamp;
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder sb = new StringBuilder();
+ sb.append("ServiceToNetworks mapping: ");
+ sb.append("serviceModelUuid=" + this.serviceModelUuid);
+ sb.append(",networkModelCustomizationUuid=" + networkModelCustomizationUuid);
+ return sb.toString();
+ }
+
+}
diff --git a/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/VfModule.java b/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/VfModule.java
index 505b3bba9a..a551ef864e 100644
--- a/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/VfModule.java
+++ b/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/VfModule.java
@@ -7,9 +7,9 @@
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -28,7 +28,7 @@ import java.text.DateFormat;
import org.openecomp.mso.db.catalog.utils.MavenLikeVersioning;
public class VfModule extends MavenLikeVersioning {
-
+
private int id;
private Integer vnfResourceId;
private String type;
@@ -40,35 +40,40 @@ public class VfModule extends MavenLikeVersioning {
private Integer volEnvironmentId;
private String description;
private String asdcUuid;
- private Timestamp created;
+ private Timestamp created;
private String modelInvariantUuid;
private String modelVersion;
-
+ private String modelCustomizationUuid = null;
+ private Integer minInstances;
+ private Integer maxInstances;
+ private Integer initialCount;
+ private String label;
+
public VfModule() {
super();
}
-
+
public int getId(){
return this.id;
}
public void setId(int id) {
this.id = id;
}
-
+
public Integer getVnfResourceId() {
return this.vnfResourceId;
}
public void setVnfResourceId(Integer vnfResourceId) {
this.vnfResourceId = vnfResourceId;
}
-
+
public String getModelName() {
return this.modelName;
}
public void setModelName(String modelName) {
this.modelName = modelName;
}
-
+
public String getType() {
return type;
}
@@ -90,14 +95,14 @@ public class VfModule extends MavenLikeVersioning {
return true;
}
}
-
+
public Integer getTemplateId() {
return this.templateId;
}
public void setTemplateId(Integer templateId) {
this.templateId = templateId;
}
-
+
public Integer getEnvironmentId() {
return this.environmentId;
}
@@ -111,21 +116,21 @@ public class VfModule extends MavenLikeVersioning {
public void setVolTemplateId(Integer volTemplateId) {
this.volTemplateId = volTemplateId;
}
-
+
public Integer getVolEnvironmentId() {
return this.volEnvironmentId;
}
public void setVolEnvironmentId(Integer volEnvironmentId) {
this.volEnvironmentId = volEnvironmentId;
}
-
+
public String getDescription() {
return this.description;
}
public void setDescription(String description) {
this.description = description;
}
-
+
public String getAsdcUuid() {
return asdcUuid;
}
@@ -133,7 +138,7 @@ public class VfModule extends MavenLikeVersioning {
public void setAsdcUuid(String asdcUuidp) {
this.asdcUuid = asdcUuidp;
}
-
+
public Timestamp getCreated() {
return created;
}
@@ -147,19 +152,49 @@ public class VfModule extends MavenLikeVersioning {
public void setModelInvariantUuid(String modelInvariantUuid) {
this.modelInvariantUuid = modelInvariantUuid;
}
-
-
+
+
public String getModelVersion() {
return this.modelVersion;
}
public void setModelVersion(String modelVersion) {
this.modelVersion = modelVersion;
}
-
- @Override
+ public String getModelCustomizationUuid() {
+ return this.modelCustomizationUuid;
+ }
+ public void setModelCustomizationUuid(String modelCustomizationUuid) {
+ this.modelCustomizationUuid = modelCustomizationUuid;
+ }
+ public Integer getMinInstances() {
+ return this.minInstances;
+ }
+ public void setMinInstances(Integer minInstances) {
+ this.minInstances = minInstances;
+ }
+ public Integer getMaxInstances() {
+ return this.maxInstances;
+ }
+ public void setMaxInstances(Integer maxInstances) {
+ this.maxInstances = maxInstances;
+ }
+ public Integer getInitialCount() {
+ return this.initialCount;
+ }
+ public void setInitialCount(Integer initialCount) {
+ this.initialCount = initialCount;
+ }
+ public String getLabel() {
+ return this.label;
+ }
+ public void setLabel(String label) {
+ this.label = label;
+ }
+
+ @Override
public String toString () {
StringBuffer buf = new StringBuffer();
-
+
buf.append("VF=");
buf.append(this.type);
buf.append(",modelName=");
@@ -184,12 +219,22 @@ public class VfModule extends MavenLikeVersioning {
buf.append(asdcUuid);
buf.append(",modelVersion=");
buf.append(this.modelVersion);
-
+ buf.append(",modelCustomizationUuid=");
+ buf.append(this.modelCustomizationUuid);
+ buf.append(",minInstances=");
+ buf.append(this.minInstances);
+ buf.append(",maxInstances=");
+ buf.append(this.maxInstances);
+ buf.append(",initialCount=");
+ buf.append(this.initialCount);
+ buf.append(",label=");
+ buf.append(this.label);
+
if (this.created != null) {
buf.append (",created=");
buf.append (DateFormat.getInstance().format(this.created));
}
return buf.toString();
}
-
+
}
diff --git a/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/VnfResource.java b/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/VnfResource.java
index 60c7ef216e..72f143dcc0 100644
--- a/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/VnfResource.java
+++ b/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/VnfResource.java
@@ -7,9 +7,9 @@
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -23,6 +23,7 @@ package org.openecomp.mso.db.catalog.beans;
import java.sql.Timestamp;
import java.text.DateFormat;
+import java.util.ArrayList;
import java.util.Map;
import org.openecomp.mso.db.catalog.utils.MavenLikeVersioning;
@@ -31,30 +32,35 @@ public class VnfResource extends MavenLikeVersioning {
private int id;
private String vnfType;
-
+
private String orchestrationMode = null;
private String description = null;
private Integer templateId;
private Integer environmentId = null;
-
+
private Map <String, HeatFiles> heatFiles;
-
+
private String asdcUuid;
- private Timestamp created;
-
+ private Timestamp created;
+
private String aicVersionMin = null;
private String aicVersionMax = null;
-
+
private String modelInvariantUuid = null;
private String modelVersion = null;
private String modelCustomizationName = null;
-
+
private String modelName = null;
private String serviceModelInvariantUUID = null;
-
+ private String modelCustomizationUuid = null;
+
+ private ArrayList<VfModule> vfModules;
+
public VnfResource () {
+ super();
+ this.vfModules = new ArrayList<VfModule>();
}
public int getId () {
@@ -104,7 +110,7 @@ public class VnfResource extends MavenLikeVersioning {
public void setEnvironmentId (Integer environmentId) {
this.environmentId = environmentId;
}
-
+
public Map <String, HeatFiles> getHeatFiles () {
return this.heatFiles;
}
@@ -120,7 +126,7 @@ public class VnfResource extends MavenLikeVersioning {
public void setAsdcUuid(String asdcUuidp) {
this.asdcUuid = asdcUuidp;
}
-
+
public Timestamp getCreated() {
return created;
}
@@ -128,38 +134,38 @@ public class VnfResource extends MavenLikeVersioning {
public void setCreated(Timestamp created) {
this.created = created;
}
-
+
public String getAicVersionMin() {
return this.aicVersionMin;
}
-
+
public void setAicVersionMin(String aicVersionMin) {
this.aicVersionMin = aicVersionMin;
}
-
+
public String getAicVersionMax() {
return this.aicVersionMax;
}
-
+
public void setAicVersionMax(String aicVersionMax) {
this.aicVersionMax = aicVersionMax;
}
-
+
public String getModelInvariantUuid() {
return this.modelInvariantUuid;
}
-
+
public void setModelInvariantUuid(String modelInvariantUuid) {
this.modelInvariantUuid = modelInvariantUuid;
}
-
+
public String getModelVersion() {
return this.modelVersion;
}
public void setModelVersion(String modelVersion) {
this.modelVersion = modelVersion;
}
-
+
public String getModelCustomizationName() {
return modelCustomizationName;
}
@@ -184,6 +190,29 @@ public class VnfResource extends MavenLikeVersioning {
this.serviceModelInvariantUUID = serviceModelInvariantUUID;
}
+ public String getModelCustomizationUuid() {
+ return this.modelCustomizationUuid;
+ }
+ public void setModelCustomizationUuid(String modelCustomizationUuid) {
+ this.modelCustomizationUuid = modelCustomizationUuid;
+ }
+
+ public ArrayList<VfModule> getVfModules() {
+ return this.vfModules;
+ }
+ public void setVfModules(ArrayList<VfModule> vfModules) {
+ this.vfModules = vfModules;
+ }
+ public void addVfModule(VfModule vfm) {
+ if (vfm != null) {
+ if (this.vfModules != null) {
+ this.vfModules.add(vfm);
+ } else {
+ this.vfModules = new ArrayList<VfModule>();
+ this.vfModules.add(vfm);
+ }
+ }
+ }
@Override
public String toString () {
StringBuffer buf = new StringBuffer();
@@ -214,11 +243,22 @@ public class VnfResource extends MavenLikeVersioning {
buf.append(this.modelName);
buf.append(",serviceModelInvariantUUID=");
buf.append(this.serviceModelInvariantUUID);
-
+ buf.append(",modelCustomizationUuid=");
+ buf.append(this.modelCustomizationUuid);
+
if (created != null) {
buf.append(",created=");
buf.append(DateFormat.getInstance().format(created));
}
+ if (this.vfModules != null && this.vfModules.size() > 0) {
+ buf.append("VfModules:");
+ int i=0;
+ for (VfModule vfm : this.vfModules) {
+ buf.append("vfModule[" + i++ + "]:" + vfm.toString());
+ }
+ } else {
+ buf.append("VfModules: NONE");
+ }
return buf.toString();
}
diff --git a/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/utils/MavenLikeVersioning.java b/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/utils/MavenLikeVersioning.java
index c617a4a6f4..73a9f8eb00 100644
--- a/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/utils/MavenLikeVersioning.java
+++ b/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/utils/MavenLikeVersioning.java
@@ -7,9 +7,9 @@
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -21,15 +21,16 @@
package org.openecomp.mso.db.catalog.utils;
+import java.io.Serializable;
/**
* This class is the base class for object that requires a Version in Catalog DB.
* The version is built on a string as ASDC provides a number like 1.2 or 2.0 ...
* This class supports also 1.2.3.4... (Maven like version)
- *
+ *
*
*/
-public class MavenLikeVersioning {
+public class MavenLikeVersioning implements Serializable {
protected String version;
diff --git a/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/utils/RecordNotFoundException.java b/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/utils/RecordNotFoundException.java
new file mode 100644
index 0000000000..d7f791005a
--- /dev/null
+++ b/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/utils/RecordNotFoundException.java
@@ -0,0 +1,49 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * OPENECOMP - MSO
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+package org.openecomp.mso.db.catalog.utils;
+
+/*
+* Exception of the ASDC controller.
+*/
+public class RecordNotFoundException extends Exception {
+
+ /**
+ * serialization id.
+ */
+ private static final long serialVersionUID = 8425657297510362736L;
+
+ /**
+ * @param message The message to dump
+ * @param cause The Throwable cause object
+ */
+ public RecordNotFoundException(final String message) {
+ super (message);
+
+ }
+
+ /**
+ * @param message The message to dump
+ * @param cause The Throwable cause object
+ */
+ public RecordNotFoundException(final String message, final Throwable cause) {
+ super (message, cause);
+
+ }
+}
diff --git a/mso-catalog-db/src/main/resources/AllottedResourceCustomization.hbm.xml b/mso-catalog-db/src/main/resources/AllottedResourceCustomization.hbm.xml
new file mode 100644
index 0000000000..4a039a45c4
--- /dev/null
+++ b/mso-catalog-db/src/main/resources/AllottedResourceCustomization.hbm.xml
@@ -0,0 +1,59 @@
+<?xml version="1.0"?>
+<!--
+ ============LICENSE_START=======================================================
+ ECOMP MSO
+ ================================================================================
+ Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ ================================================================================
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+ ============LICENSE_END=========================================================
+ -->
+<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
+"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
+<!-- Generated Dec 14, 2016 10:57:53 AM by Hibernate Tools 3.4.0.CR1 -->
+<hibernate-mapping>
+ <class name="org.openecomp.mso.db.catalog.beans.AllottedResourceCustomization"
+ table="ALLOTTED_RESOURCE_CUSTOMIZATION">
+ <id name="modelCustomizationUuid" type="java.lang.String">
+ <column name="MODEL_CUSTOMIZATION_UUID" length="200" not-null="true"/>
+ <generator class="assigned" />
+ </id>
+ <property name="version">
+ <column name="MODEL_VERSION" length="20" not-null="true"/>
+ </property>
+ <property name="modelVersion" update="false" insert="false">
+ <column name="MODEL_VERSION" />
+ </property>
+ <property name="modelUuid" type="java.lang.String">
+ <column name="MODEL_UUID" length="200" not-null="true"/>
+ </property>
+ <property name="modelName" type="java.lang.String">
+ <column name="MODEL_NAME" length="200" not-null="true"/>
+ </property>
+ <property name="modelInstanceName" type="java.lang.String">
+ <column name="MODEL_INSTANCE_NAME" length="200" not-null="true"/>
+ </property>
+ <!-- <property name="created" type="java.sql.Timestamp">
+ <column name="CREATION_TIMESTAMP" />
+ </property> -->
+ <property name="created" type="timestamp" generated="insert" update="false" insert="false" >
+ <column name="CREATION_TIMESTAMP" not-null="true"/>
+ </property>
+ <property name="description" type="java.lang.String">
+ <column name="DESCRIPTION" length="200" not-null="false" default="null"/>
+ </property>
+ <property name="modelInvariantUuid" type="java.lang.String">
+ <column name="MODEL_INVARIANT_UUID" length="200" not-null="true"/>
+ </property>
+ </class>
+</hibernate-mapping> \ No newline at end of file
diff --git a/mso-catalog-db/src/main/resources/HeatEnvironment.hbm.xml b/mso-catalog-db/src/main/resources/HeatEnvironment.hbm.xml
index 992e5d467a..8e86c584d5 100644
--- a/mso-catalog-db/src/main/resources/HeatEnvironment.hbm.xml
+++ b/mso-catalog-db/src/main/resources/HeatEnvironment.hbm.xml
@@ -8,9 +8,9 @@
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
-
+
http://www.apache.org/licenses/LICENSE-2.0
-
+
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -27,7 +27,7 @@
<meta attribute="class-description">
This class describes a HEAT Environment
</meta>
-
+
<id name="id" type="int" column="id">
<generator class="native"/>
</id>
@@ -41,6 +41,9 @@
<property name="asdcResourceName" type="string" >
<column name="ASDC_RESOURCE_NAME" length="100" default="'MANUAL RECORD'" not-null="true"/>
</property>
+ <property name="asdcUuid" type="string">
+ <column name="ASDC_UUID" length="200" default="'MANUAL RECORD'" not-null="true"/>
+ </property>
</properties>
<property name="description" column="DESCRIPTION" type="string" length="1200"/>
<property name="environment" type="text">
@@ -49,10 +52,10 @@
<property name="created" type="timestamp" generated="insert" insert="false" update="false">
<column name="CREATION_TIMESTAMP" not-null="true"/>
</property>
- <property name="asdcUuid" type="string">
- <column name="ASDC_UUID" length="200" default="'MANUAL RECORD'" not-null="false"/>
- </property>
<property name="asdcLabel" column="ASDC_LABEL" type="string" length="200"/>
-
+ <property name="artifactChecksum" type="string">
+ <column name="ARTIFACT_CHECKSUM" length="200" default="'MANUAL RECORD'" not-null="true"/>
+ </property>
+
</class>
</hibernate-mapping>
diff --git a/mso-catalog-db/src/main/resources/HeatTemplate.hbm.xml b/mso-catalog-db/src/main/resources/HeatTemplate.hbm.xml
index 9bc6fb1414..b77656896e 100644
--- a/mso-catalog-db/src/main/resources/HeatTemplate.hbm.xml
+++ b/mso-catalog-db/src/main/resources/HeatTemplate.hbm.xml
@@ -8,9 +8,9 @@
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
-
+
http://www.apache.org/licenses/LICENSE-2.0
-
+
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -26,11 +26,11 @@
<meta attribute="class-description">
This class describes a HEAT template
</meta>
-
+
<id name="id" type="int" column="id">
<generator class="native"/>
</id>
-
+
<properties name="uk_template" unique="true">
<property name="templateName" type="string" >
<column name="TEMPLATE_NAME" length="200" not-null="true"/>
@@ -41,21 +41,25 @@
<property name="asdcResourceName" type="string" >
<column name="ASDC_RESOURCE_NAME" default="'MANUAL RECORD'" length="100" not-null="true"/>
</property>
+ <property name="asdcUuid" type="string" >
+ <column name="ASDC_UUID" length="200" default="'MANUAL RECORD'" not-null="true"/>
+ </property>
</properties>
-
+
<property name="templatePath" column="TEMPLATE_PATH" type="string" length="100"/>
<property name="templateBody" type="text">
<column name="TEMPLATE_BODY" not-null="true"/>
</property>
<property name="timeoutMinutes" column="TIMEOUT_MINUTES" type="int"/>
- <property name="asdcUuid" type="string" >
- <column name="ASDC_UUID" length="200" default="'MANUAL RECORD'" not-null="true"/>
- </property>
<property name="description" column="DESCRIPTION" type="string" length="1200"/>
<property name="asdcLabel" column="ASDC_LABEL" type="string" length="200"/>
+ <property name="artifactChecksum" type="string">
+ <column name="ARTIFACT_CHECKSUM" length="200" default="'MANUAL RECORD'" not-null="true"/>
+ </property>
<property name="created" type="timestamp" generated="insert" update="false" insert="false" >
<column name="CREATION_TIMESTAMP" not-null="true"/>
</property>
+
<set name="parameters" cascade="all">
<key column="HEAT_TEMPLATE_ID"/>
<one-to-many class="HeatTemplateParam"/>
@@ -64,14 +68,14 @@
<key column="CHILD_TEMPLATE_ID"/>
<one-to-many class="HeatTemplate" not-found="ignore"/>
</set>
-
+
</class>
-
+
<class name="HeatTemplateParam" table="HEAT_TEMPLATE_PARAMS">
<meta attribute="class-description">
This class describes an input parameter to a heat template
</meta>
-
+
<id name="id" type="int" column="id">
<generator class="native"/>
</id>
diff --git a/mso-catalog-db/src/main/resources/ModelRecipe.hbm.xml b/mso-catalog-db/src/main/resources/ModelRecipe.hbm.xml
new file mode 100644
index 0000000000..e59bb5c23b
--- /dev/null
+++ b/mso-catalog-db/src/main/resources/ModelRecipe.hbm.xml
@@ -0,0 +1,87 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ ============LICENSE_START=======================================================
+ ECOMP MSO
+ ================================================================================
+ Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ ================================================================================
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+ ============LICENSE_END=========================================================
+ -->
+<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD//EN" "http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd">
+
+<hibernate-mapping package="org.openecomp.mso.db.catalog.beans">
+ <class name="Model" table="MODEL">
+ <meta attribute="class-description">
+ This class describes a Model that may be orchestrated
+ </meta>
+
+ <id name="id" type="int" column="id">
+ <generator class="native"/>
+ </id>
+
+ <properties name="uk1_model" unique="true">
+ <property name="modelType" type="string">
+ <column name="MODEL_TYPE" not-null="true" length="20"/>
+ </property>
+ <property name="modelVersionId" type="string">
+ <column name="MODEL_VERSION_ID" not-null="true" length="40"/>
+ </property>
+ </properties>
+ <property name="modelInvariantId" column="MODEL_INVARIANT_ID" type="string" length="40"/>
+ <property name="modelName" type="string">
+ <column name="MODEL_NAME" not-null="true" length="40"/>
+ </property>
+ <property name="modelVersion" column="MODEL_VERSION" type="string" length="20"/>
+ <property name="modelCustomizationId" column="MODEL_CUSTOMIZATION_ID" type="string" length="40"/>
+ <property name="modelCustomizationName" column="MODEL_CUSTOMIZATION_NAME" type="string" length="40"/>
+ <property name="created" type="timestamp" generated="insert" update="false" insert="false" >
+ <column name="CREATION_TIMESTAMP" not-null="true"/>
+ </property>
+
+ <map name="recipes" cascade="all">
+ <key column="MODEL_ID"/>
+ <map-key column="action" type="string"/>
+ <one-to-many class="ModelRecipe"/>
+ </map>
+ </class>
+
+ <class name="ModelRecipe" table="MODEL_RECIPE">
+ <meta attribute="class-description">
+ This class describes a Model recipe
+ </meta>
+
+ <id name="id" type="int" column="id">
+ <generator class="native"/>
+ </id>
+
+ <properties name="uk1_model_recipe" unique="true">
+ <property name="modelId" type="int">
+ <column name="MODEL_ID" not-null="true"/>
+ </property>
+ <property name="action" type="string" >
+ <column name="ACTION" not-null="true" length="20"/>
+ </property>
+ </properties>
+ <property name="schemaVersion" column="SCHEMA_VERSION" type="string" length="20"/>
+ <property name="description" column="DESCRIPTION" type="string" length="1200"/>
+ <property name="orchestrationUri" type="string">
+ <column name="ORCHESTRATION_URI" not-null="true" length="256"/>
+ </property>
+ <property name="modelParamXSD" column="MODEL_PARAM_XSD" type="string" length="2048"/>
+ <property name="recipeTimeout" column="RECIPE_TIMEOUT" type="int"/>
+ <property name="created" type="timestamp" generated="insert" update="false" insert="false" >
+ <column name="CREATION_TIMESTAMP" not-null="true"/>
+ </property>
+ </class>
+</hibernate-mapping> \ No newline at end of file
diff --git a/mso-catalog-db/src/main/resources/NetworkRecipe.hbm.xml b/mso-catalog-db/src/main/resources/NetworkRecipe.hbm.xml
index bdd16d37e6..28589ea639 100644
--- a/mso-catalog-db/src/main/resources/NetworkRecipe.hbm.xml
+++ b/mso-catalog-db/src/main/resources/NetworkRecipe.hbm.xml
@@ -8,9 +8,9 @@
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
-
+
http://www.apache.org/licenses/LICENSE-2.0
-
+
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -26,7 +26,7 @@
<meta attribute="class-description">
This class describes a Network recipe
</meta>
-
+
<id name="id" type="int" column="id">
<generator class="native"/>
</id>
@@ -41,21 +41,21 @@
<property name="version" type="string">
<column name="VERSION_STR" not-null="true" length="20"/>
</property>
-
+
</properties>
-
- <property name="serviceType" type="string" length="45">
- <column name="SERVICE_TYPE" not-null="false" length="45"/>
- </property>
+
<property name="description" column="DESCRIPTION" type="string" length="1200"/>
<property name="orchestrationUri" type="string">
<column name="ORCHESTRATION_URI" not-null="true" length="256"/>
</property>
<property name="networkParamXSD" column="NETWORK_PARAM_XSD" type="string" length="2048"/>
<property name="recipeTimeout" column="RECIPE_TIMEOUT" type="int"/>
+ <property name="serviceType" type="string" >
+ <column name="SERVICE_TYPE" not-null="false" length="45" default="null"/>
+ </property>
<property name="created" type="timestamp" generated="insert" update="false" insert="false" >
<column name="CREATION_TIMESTAMP" not-null="true"/>
</property>
</class>
-
+
</hibernate-mapping>
diff --git a/mso-catalog-db/src/main/resources/NetworkResource.hbm.xml b/mso-catalog-db/src/main/resources/NetworkResource.hbm.xml
index b3b657aa9f..931db68406 100644
--- a/mso-catalog-db/src/main/resources/NetworkResource.hbm.xml
+++ b/mso-catalog-db/src/main/resources/NetworkResource.hbm.xml
@@ -8,9 +8,9 @@
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
-
+
http://www.apache.org/licenses/LICENSE-2.0
-
+
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -26,7 +26,7 @@
<meta attribute="class-description">
This class describes a Network Resource
</meta>
-
+
<id name="id" type="int" column="id"/>
<properties name="uk_network_resource" unique="true">
@@ -40,16 +40,18 @@
<property name="orchestrationMode" column="ORCHESTRATION_MODE" type="string" length="20"/>
<property name="description" column="DESCRIPTION" type="string" length="1200"/>
<property name="templateId" column="TEMPLATE_ID" type="int"/>
+ <property name="neutronNetworkType" type="string" >
+ <column name="NEUTRON_NETWORK_TYPE" not-null="false" default="null" length="20" />
+ </property>
<property name="created" type="timestamp" generated="insert" update="false" insert="false" >
<column name="CREATION_TIMESTAMP" not-null="true"/>
</property>
<property name="aicVersionMin" type="string" >
- <column name="AIC_VERSION_MIN" not-null="false" default="2.5" length="20" />
+ <column name="AIC_VERSION_MIN" not-null="true" length="20" />
</property>
<property name="aicVersionMax" type="string">
- <column name="AIC_VERSION_MAX" not-null="false" default="2.5" length="20"/>
+ <column name="AIC_VERSION_MAX" not-null="false" default="null" length="20"/>
</property>
- <property name="neutronNetworkType" column="NEUTRON_NETWORK_TYPE" type="string" length="20"/>
</class>
-
+
</hibernate-mapping>
diff --git a/mso-catalog-db/src/main/resources/NetworkResourceCustomization.hbm.xml b/mso-catalog-db/src/main/resources/NetworkResourceCustomization.hbm.xml
new file mode 100644
index 0000000000..401bca1f8d
--- /dev/null
+++ b/mso-catalog-db/src/main/resources/NetworkResourceCustomization.hbm.xml
@@ -0,0 +1,59 @@
+<?xml version="1.0"?>
+<!--
+ ============LICENSE_START=======================================================
+ ECOMP MSO
+ ================================================================================
+ Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ ================================================================================
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+ ============LICENSE_END=========================================================
+ -->
+<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
+
+<hibernate-mapping>
+ <class name="org.openecomp.mso.db.catalog.beans.NetworkResourceCustomization" table="NETWORK_RESOURCE_CUSTOMIZATION">
+
+
+ <composite-id>
+ <key-property name="modelCustomizationUuid" type="java.lang.String" >
+ <column name="MODEL_CUSTOMIZATION_UUID" length="200" not-null="true"/>
+ </key-property>
+ <key-property name="networkResourceId" type="int" >
+ <column name="NETWORK_RESOURCE_ID" length="11" not-null="false" default="null" />
+ </key-property>
+ </composite-id>
+
+ <property name="modelUuid" type="java.lang.String">
+ <column name="MODEL_UUID" length="200" not-null="true"/>
+ </property>
+ <property name="modelName" type="java.lang.String">
+ <column name="MODEL_NAME" length="200" not-null="true"/>
+ </property>
+ <property name="modelInstanceName" type="java.lang.String">
+ <column name="MODEL_INSTANCE_NAME" length="200" not-null="true"/>
+ </property>
+ <property name="modelVersion" type="java.lang.String">
+ <column name="MODEL_VERSION" length="20" not-null="true"/>
+ </property>
+ <property name="modelInvariantUuid" type="java.lang.String">
+ <column name="MODEL_INVARIANT_UUID" length="200" not-null="true"/>
+ </property>
+
+ <property name="created" type="timestamp" generated="insert" update="false" insert="false" >
+ <column name="CREATION_TIMESTAMP" not-null="true"/>
+ </property>
+ <!-- <property name="created" type="java.sql.Timestamp">
+ <column name="CREATION_TIMESTAMP" />
+ </property> -->
+ </class>
+</hibernate-mapping>
diff --git a/mso-catalog-db/src/main/resources/Service.hbm.xml b/mso-catalog-db/src/main/resources/Service.hbm.xml
index 4e43413f47..f6049961fd 100644
--- a/mso-catalog-db/src/main/resources/Service.hbm.xml
+++ b/mso-catalog-db/src/main/resources/Service.hbm.xml
@@ -8,9 +8,9 @@
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
-
+
http://www.apache.org/licenses/LICENSE-2.0
-
+
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -26,16 +26,23 @@
<meta attribute="class-description">
This class describes a Service that may be orchestrated
</meta>
-
+
<id name="id" type="int" column="id">
<generator class="native"/>
</id>
-
- <property name="serviceName" column="SERVICE_NAME" type="string" length="40"/>
- <property name="version" column="VERSION_STR" type="string" length="20"/>
+
+ <properties name="uk" unique="true">
+ <property name="serviceNameVersionId" type="string" >
+ <column name="SERVICE_NAME_VERSION_ID" length="50" not-null="true" default="'MANUAL_RECORD'" />
+ </property>
+ <property name="serviceName" column="SERVICE_NAME" type="string" length="40"/>
+ </properties>
+
+ <property name="version" type="string" >
+ <column name="VERSION_STR" length="20" not-null="true"/>
+ </property>
<property name="description" column="DESCRIPTION" type="string" length="1200"/>
- <property name="serviceNameVersionId" column="SERVICE_NAME_VERSION_ID" type="string" length="50"/>
-
+
<property name="serviceVersion" column="SERVICE_VERSION" type="string" length="10"/>
<property name="httpMethod" column="HTTP_METHOD" type="string" length="50"/>
<property name="created" type="timestamp" generated="insert" update="false" insert="false" >
@@ -44,32 +51,34 @@
<property name="modelInvariantUUID" type="string">
<column name="MODEL_INVARIANT_UUID" default="'MANUAL_RECORD'" not-null="true" length="200"/>
</property>
-
+
<map name="recipes" cascade="all">
<key column="SERVICE_ID"/>
<map-key column="action" type="string"/>
<one-to-many class="ServiceRecipe"/>
</map>
</class>
-
+
<class name="ServiceRecipe" table="SERVICE_RECIPE">
<meta attribute="class-description">
This class describes a Service recipe
</meta>
-
+
<id name="id" type="int" column="id">
<generator class="native"/>
</id>
<properties name="uk1_service_recipe" unique="true">
<property name="serviceId" type="int">
- <column name="SERVICE_ID" not-null="true"/>
+ <column name="SERVICE_ID" not-null="true" length="11"/>
</property>
<property name="action" type="string" >
<column name="ACTION" not-null="true" length="40"/>
</property>
</properties>
- <property name="version" column="VERSION_STR" type="string" length="20"/>
+ <property name="version" type="string">
+ <column name="VERSION_STR" not-null="false" length="20" default="null"/>
+ </property>
<property name="description" column="DESCRIPTION" type="string" length="1200"/>
<property name="orchestrationUri" type="string">
<column name="ORCHESTRATION_URI" not-null="true" length="256"/>
diff --git a/mso-catalog-db/src/main/resources/ServiceToAllottedResources.hbm.xml b/mso-catalog-db/src/main/resources/ServiceToAllottedResources.hbm.xml
new file mode 100644
index 0000000000..1d471ca193
--- /dev/null
+++ b/mso-catalog-db/src/main/resources/ServiceToAllottedResources.hbm.xml
@@ -0,0 +1,41 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ ============LICENSE_START=======================================================
+ ECOMP MSO
+ ================================================================================
+ Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ ================================================================================
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+ ============LICENSE_END=========================================================
+ -->
+<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd" >
+<hibernate-mapping package="org.openecomp.mso.db.catalog.beans">
+ <class name="ServiceToAllottedResources" table="SERVICE_TO_ALLOTTED_RESOURCES">
+ <meta attribute="class-description">
+ This class describes a Service to Allotted Resource Customization relationship
+ </meta>
+
+ <composite-id>
+ <key-property name="serviceModelUuid" type="string" >
+ <column name="SERVICE_MODEL_UUID" length="200" not-null="true"/>
+ </key-property>
+ <key-property name="arModelCustomizationUuid" type="string">
+ <column name="AR_MODEL_CUSTOMIZATION_UUID" length="200" not-null="true"/>
+ </key-property>
+ </composite-id>
+ <property name="created" type="timestamp" generated="insert" update="false" insert="false" >
+ <column name="CREATION_TIMESTAMP" not-null="true"/>
+ </property>
+ </class>
+
+</hibernate-mapping> \ No newline at end of file
diff --git a/mso-catalog-db/src/main/resources/ServiceToNetworks.hbm.xml b/mso-catalog-db/src/main/resources/ServiceToNetworks.hbm.xml
new file mode 100644
index 0000000000..1c96f7ba95
--- /dev/null
+++ b/mso-catalog-db/src/main/resources/ServiceToNetworks.hbm.xml
@@ -0,0 +1,41 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ ============LICENSE_START=======================================================
+ ECOMP MSO
+ ================================================================================
+ Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ ================================================================================
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+ ============LICENSE_END=========================================================
+ -->
+<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd" >
+<hibernate-mapping package="org.openecomp.mso.db.catalog.beans">
+ <class name="ServiceToNetworks" table="SERVICE_TO_NETWORKS">
+ <meta attribute="class-description">
+ This class describes a Service to a Network Resource Customization relationship
+ </meta>
+
+ <composite-id>
+ <key-property name="serviceModelUuid" type="string">
+ <column name="SERVICE_MODEL_UUID" not-null="true" length="200"/>
+ </key-property>
+ <key-property name="networkModelCustomizationUuid" type="string">
+ <column name="NETWORK_MODEL_CUSTOMIZATION_UUID" not-null="true" length="200"/>
+ </key-property>
+ </composite-id>
+ <property name="created" type="timestamp" generated="insert" update="false" insert="false" >
+ <column name="CREATION_TIMESTAMP" not-null="true"/>
+ </property>
+ </class>
+
+</hibernate-mapping> \ No newline at end of file
diff --git a/mso-catalog-db/src/main/resources/VfModule.hbm.xml b/mso-catalog-db/src/main/resources/VfModule.hbm.xml
index 1ccc48daf6..1631057bfd 100644
--- a/mso-catalog-db/src/main/resources/VfModule.hbm.xml
+++ b/mso-catalog-db/src/main/resources/VfModule.hbm.xml
@@ -8,9 +8,9 @@
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
-
+
http://www.apache.org/licenses/LICENSE-2.0
-
+
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -27,55 +27,66 @@
<id name="id" type="int" column="id">
<generator class="native"/>
</id>
-
+ <property name="asdcUuid" type="java.lang.String" >
+ <column name="ASDC_UUID" not-null="false" length="200" default="null"/>
+ </property>
+ <property name="volEnvironmentId" type="java.lang.Integer" >
+ <column name="VOL_ENVIRONMENT_ID" not-null="false" length="11" default="null"/>
+ </property>
<properties name="uk_vfmodule" unique="true">
<property name="type" type="string" >
<column name="TYPE" not-null="true" length="200"/>
</property>
- <property name="version" type="string" >
+ <property name="version" type="string">
<column name="ASDC_SERVICE_MODEL_VERSION" not-null="true" length="20"/>
</property>
</properties>
-
+ <property name="modelCustomizationUuid" type="java.lang.String" >
+ <column name="MODEL_CUSTOMIZATION_UUID" not-null="false" length="200"/>
+ </property>
<property name="modelName" type="string" >
<column name="MODEL_NAME" not-null="true" length="200"/>
</property>
<property name="modelVersion" type="string" >
<column name="MODEL_VERSION" not-null="true" length="20"/>
</property>
-
- <property name="asdcUuid" type="java.lang.String" >
- <column name="ASDC_UUID" not-null="false" length="255"/>
- </property>
- <property name="volEnvironmentId" type="java.lang.Integer" >
- <column name="VOL_ENVIRONMENT_ID" not-null="false"/>
- </property>
- <property name="templateId" type="java.lang.Integer" >
- <column name="TEMPLATE_ID" not-null="false"/>
- </property>
- <property name="isBase" type="int">
- <column name="IS_BASE" not-null="true"/>
- </property>
<property name="created" type="timestamp" generated="insert" update="false" insert="false" >
<column name="CREATION_TIMESTAMP" not-null="true"/>
</property>
-
<property name="description" type="java.lang.String" >
- <column name="DESCRIPTION" not-null="false" length="255"/>
+ <column name="DESCRIPTION" not-null="false" length="255" default="null"/>
</property>
<property name="volTemplateId" type="java.lang.Integer" >
- <column name="VOL_TEMPLATE_ID" not-null="false"/>
+ <column name="VOL_TEMPLATE_ID" not-null="false" default="null" length="11"/>
+ </property>
+ <property name="templateId" type="java.lang.Integer" >
+ <column name="TEMPLATE_ID" not-null="false" length="11" default="null"/>
</property>
<property name="vnfResourceId" type="java.lang.Integer" >
- <column name="VNF_RESOURCE_ID" not-null="true"/>
+ <column name="VNF_RESOURCE_ID" not-null="true" length="11"/>
+ </property>
+ <property name="isBase" type="int">
+ <column name="IS_BASE" not-null="true" length="11"/>
</property>
<property name="environmentId" type="java.lang.Integer" >
<column name="ENVIRONMENT_ID" not-null="false"/>
</property>
<property name="modelInvariantUuid" type="java.lang.String" >
- <column name="MODEL_INVARIANT_UUID" not-null="false" length="255"/>
+ <column name="MODEL_INVARIANT_UUID" not-null="false" length="200" default="null"/>
</property>
+ <property name="minInstances" type="java.lang.Integer" >
+ <column name="MIN_INSTANCES" not-null="false" length="11" default="0"/>
+ </property>
+ <property name="maxInstances" type="java.lang.Integer" >
+ <column name="MAX_INSTANCES" not-null="false" length="11" default="null"/>
+ </property>
+ <property name="initialCount" type="java.lang.Integer" >
+ <column name="INITIAL_COUNT" not-null="false" length="11" default="0"/>
+ </property>
+ <property name="label" type="java.lang.String" >
+ <column name="LABEL" not-null="false" length="200" default="null"/>
+ </property>
</class>
</hibernate-mapping>
diff --git a/mso-catalog-db/src/main/resources/VnfComponentsRecipe.hbm.xml b/mso-catalog-db/src/main/resources/VnfComponentsRecipe.hbm.xml
index e0ef0d2bc2..6297e1c52f 100644
--- a/mso-catalog-db/src/main/resources/VnfComponentsRecipe.hbm.xml
+++ b/mso-catalog-db/src/main/resources/VnfComponentsRecipe.hbm.xml
@@ -8,9 +8,9 @@
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
-
+
http://www.apache.org/licenses/LICENSE-2.0
-
+
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -26,20 +26,22 @@
<meta attribute="class-description">
This class describes a VNF Components Recipe
</meta>
-
+
<id name="id" type="int" column="id">
<generator class="native"/>
</id>
<properties name="uk_vnf_component_recipe" unique="true">
<property name="vnfType" column="VNF_TYPE" type="string" length="200"/>
- <property name="vfModuleId" column="VF_MODULE_ID" type="string" length="100" not-null="false"/>
<property name="vnfComponentType" type="string">
- <column name="VNF_COMPONENT_TYPE" not-null="true" length="45"/>
+ <column name="VNF_COMPONENT_TYPE" not-null="true" length="45"/>
</property>
+ <property name="vfModuleId" column="VF_MODULE_ID" type="string" length="100" not-null="false"/>
<property name="action" type="string">
<column name="ACTION" not-null="true" length="20"/>
</property>
- <property name="serviceType" column="SERVICE_TYPE" type="string" length="45"/>
+ <property name="serviceType" type="string">
+ <column name="SERVICE_TYPE" not-null="false" length="45" default="null"/>
+ </property>
<property name="version" column="VERSION" type="string" length="20"/>
</properties>
<property name="description" column="DESCRIPTION" type="string" length="1200"/>
diff --git a/mso-catalog-db/src/main/resources/VnfRecipe.hbm.xml b/mso-catalog-db/src/main/resources/VnfRecipe.hbm.xml
index ea2b39e861..4c471edfee 100644
--- a/mso-catalog-db/src/main/resources/VnfRecipe.hbm.xml
+++ b/mso-catalog-db/src/main/resources/VnfRecipe.hbm.xml
@@ -8,9 +8,9 @@
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
-
+
http://www.apache.org/licenses/LICENSE-2.0
-
+
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -26,13 +26,13 @@
<meta attribute="class-description">
This class describes a VNF Recipe
</meta>
-
+
<id name="id" type="int" column="id">
<generator class="native"/>
</id>
<properties name="uk_vnf_recipe" unique="true">
-
+
<property name="vfModuleId" type="string">
<column name="VF_MODULE_ID" not-null="false" length="100" />
</property>
@@ -42,23 +42,23 @@
<property name="version" type="string">
<column name="VERSION_STR" not-null="true" length="20" />
</property>
-
+
</properties>
-
+
<property name="vnfType" type="string">
<column name="VNF_TYPE" not-null="false" length="200" />
</property>
-
+
<property name="serviceType" type="string">
- <column name="SERVICE_TYPE" not-null="false" length="45" />
+ <column name="SERVICE_TYPE" not-null="false" length="45" default="null"/>
</property>
-
+
<property name="description" column="DESCRIPTION" type="string" length="1200"/>
-
+
<property name="orchestrationUri" type="string">
<column name="ORCHESTRATION_URI" not-null="true" length="256"/>
</property>
-
+
<property name="vnfParamXSD" column="VNF_PARAM_XSD" type="string" length="2048"/>
<property name="recipeTimeout" column="RECIPE_TIMEOUT" type="int"/>
<property name="created" column="CREATION_TIMESTAMP" type="timestamp" generated="insert" update="false" insert="false" />
diff --git a/mso-catalog-db/src/main/resources/VnfResource.hbm.xml b/mso-catalog-db/src/main/resources/VnfResource.hbm.xml
index 4c9e3b59e3..2fc47009d7 100644
--- a/mso-catalog-db/src/main/resources/VnfResource.hbm.xml
+++ b/mso-catalog-db/src/main/resources/VnfResource.hbm.xml
@@ -8,9 +8,9 @@
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
-
+
http://www.apache.org/licenses/LICENSE-2.0
-
+
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -26,7 +26,7 @@
<meta attribute="class-description">
This class describes a VNF Resource
</meta>
-
+
<id name="id" type="int" column="id">
<generator class="native"/>
</id>
@@ -37,14 +37,20 @@
<property name="version" type="string" >
<column name="ASDC_SERVICE_MODEL_VERSION" not-null="true" length="20"/>
</property>
+ <property name="serviceModelInvariantUUID" type="string" >
+ <column name="SERVICE_MODEL_INVARIANT_UUID" not-null="false" length="200"/>
+ </property>
</properties>
+ <property name="modelCustomizationName" type="string" >
+ <column name="MODEL_CUSTOMIZATION_NAME" not-null="false" length="200"/>
+ </property>
<property name="orchestrationMode" type="string" >
<column name="ORCHESTRATION_MODE" not-null="true" length="20"/>
</property>
<property name="description" type="string" >
<column name="DESCRIPTION" not-null="false" length="1200"/>
</property>
-
+
<property name="templateId" type="int" not-null="false">
<column name="TEMPLATE_ID" not-null="false"/>
</property>
@@ -69,66 +75,62 @@
<property name="modelVersion" type="string" >
<column name="MODEL_VERSION" not-null="true" length="20"/>
</property>
- <property name="modelCustomizationName" type="string" >
- <column name="MODEL_CUSTOMIZATION_NAME" not-null="false" length="200"/>
- </property>
<property name="modelName" type="string" >
<column name="MODEL_NAME" not-null="false" length="200"/>
</property>
- <property name="serviceModelInvariantUUID" type="string" >
- <column name="SERVICE_MODEL_INVARIANT_UUID" not-null="false" length="200"/>
- </property>
-
+ <property name="modelCustomizationUuid" type="string" >
+ <column name="MODEL_CUSTOMIZATION_UUID" not-null="false" length="255"/>
+ </property>
<map name="heatFiles" cascade="all">
<key column="VNF_RESOURCE_ID" foreign-key="none"/>
<map-key column="FILE_NAME" type="string"/>
<one-to-many class="HeatFiles"/>
</map>
-
+
</class>
-
+
<class name="HeatFiles" table="HEAT_FILES">
<meta attribute="class-description">
This class describes a HEAT Template File
</meta>
-
+
<id name="id" type="int" column="id">
<generator class="native"/>
</id>
-
+ <property name="description" type="string" >
+ <column name="DESCRIPTION" not-null="false" length="1200" default="null"/>
+ </property>
<properties name="uk_heat_files" unique="true">
<property name="fileName" type="string" >
<column name="FILE_NAME" not-null="true" length="200"/>
</property>
<property name="asdcResourceName" type="string" >
- <column name="ASDC_RESOURCE_NAME" not-null="true" length="100"/>
+ <column name="ASDC_RESOURCE_NAME" not-null="true" length="100"/>
</property>
<property name="version" type="string" >
- <column name="VERSION" not-null="true" length="20"/>
+ <column name="VERSION" not-null="true" length="20"/>
+ </property>
+ <property name="asdcUuid" type="string" >
+ <column name="ASDC_UUID" not-null="false" length="200" default="'MANUAL RECORD'"/>
</property>
</properties>
-
- <property name="vnfResourceId" type="int">
- <column name="VNF_RESOURCE_ID" not-null="false"/>
- </property>
- <property name="description" type="string" >
- <column name="DESCRIPTION" not-null="false" length="1200"/>
- </property>
+
<property name="fileBody" type="text">
<column name="FILE_BODY" not-null="true"/>
</property>
+ <property name="vnfResourceId" type="int">
+ <column name="VNF_RESOURCE_ID" not-null="false" length="11" default="null"/>
+ </property>
<property name="created" type="timestamp" generated="insert" update="false" insert="false">
<column name="CREATION_TIMESTAMP" not-null="true"/>
</property>
-
- <property name="asdcUuid" type="string" >
- <column name="ASDC_UUID" not-null="false" length="200"/>
- </property>
<property name="asdcLabel" type="string" >
<column name="ASDC_LABEL" not-null="false" length="200"/>
</property>
-
-
+ <property name="artifactChecksum" type="string">
+ <column name="ARTIFACT_CHECKSUM" length="200" default="'MANUAL RECORD'" not-null="true"/>
+ </property>
+
</class>
-
+
</hibernate-mapping>
diff --git a/mso-catalog-db/src/main/resources/hibernate-catalog-mysql.cfg.xml b/mso-catalog-db/src/main/resources/hibernate-catalog-core-mysql.cfg.xml
index 306dfc6d0b..306dfc6d0b 100644
--- a/mso-catalog-db/src/main/resources/hibernate-catalog-mysql.cfg.xml
+++ b/mso-catalog-db/src/main/resources/hibernate-catalog-core-mysql.cfg.xml
diff --git a/mso-catalog-db/src/test/java/org/openecomp/mso/db/catalog/CatalogDatabaseESTest.java b/mso-catalog-db/src/test/java/org/openecomp/mso/db/catalog/CatalogDatabaseESTest.java
index bfd4aa8e09..b577afef66 100644
--- a/mso-catalog-db/src/test/java/org/openecomp/mso/db/catalog/CatalogDatabaseESTest.java
+++ b/mso-catalog-db/src/test/java/org/openecomp/mso/db/catalog/CatalogDatabaseESTest.java
@@ -39,7 +39,7 @@ import org.hibernate.Query;
import org.hibernate.Session;
import org.junit.runner.RunWith;
-@RunWith(EvoRunner.class) @EvoRunnerParameters(mockJVMNonDeterminism = true, useVFS = true, useVNET = true, resetStaticState = true, useJEE = true)
+@RunWith(EvoRunner.class) @EvoRunnerParameters(mockJVMNonDeterminism = true, useVFS = true, useVNET = true, resetStaticState = true, useJEE = true)
public class CatalogDatabaseESTest extends CatalogDatabaseESTestscaffolding {
@Test(timeout = 4000)
@@ -65,10 +65,10 @@ public class CatalogDatabaseESTest extends CatalogDatabaseESTestscaffolding {
PrivateAccess.callMethod((Class<CatalogDatabase>) CatalogDatabase.class, catalogDatabase0, "getSession");
PrivateAccess.callMethod((Class<CatalogDatabase>) CatalogDatabase.class, catalogDatabase0, "getSession");
// Undeclared exception!
- try {
+ try {
catalogDatabase0.getHeatTemplate((String) null);
fail("Expecting exception: ClassCastException");
-
+
} catch(ClassCastException e) {
//
// org.openecomp.mso.db.catalog.beans.VfModuleToHeatFiles$$EnhancerByMockitoWithCGLIB$$309d9392 cannot be cast to org.openecomp.mso.db.catalog.beans.HeatTemplate
@@ -89,10 +89,10 @@ public class CatalogDatabaseESTest extends CatalogDatabaseESTestscaffolding {
Session session1 = mock(Session.class, new ViolatedAssumptionAnswer());
HeatTemplate heatTemplate0 = mock(HeatTemplate.class, new ViolatedAssumptionAnswer());
// Undeclared exception!
- try {
+ try {
catalogDatabase0.getVfModuleType((String) null, (String) null);
fail("Expecting exception: NullPointerException");
-
+
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
@@ -143,10 +143,10 @@ public class CatalogDatabaseESTest extends CatalogDatabaseESTestscaffolding {
catalogDatabase0.saveHeatFiles(heatFiles0);
Set<HeatTemplateParam> set0 = (Set<HeatTemplateParam>) mock(Set.class, new ViolatedAssumptionAnswer());
// Undeclared exception!
- try {
+ try {
catalogDatabase0.saveHeatTemplate(heatTemplate0, set0);
fail("Expecting exception: NullPointerException");
-
+
} catch(NullPointerException e) {
}
}
@@ -190,10 +190,10 @@ public class CatalogDatabaseESTest extends CatalogDatabaseESTestscaffolding {
Set<HeatTemplateParam> set0 = (Set<HeatTemplateParam>) mock(Set.class, new ViolatedAssumptionAnswer());
doReturn(iterator0).when(set0).iterator();
// Undeclared exception!
- try {
+ try {
catalogDatabase0.saveHeatTemplate(heatTemplate0, set0);
fail("Expecting exception: NullPointerException");
-
+
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
@@ -214,10 +214,10 @@ public class CatalogDatabaseESTest extends CatalogDatabaseESTestscaffolding {
doReturn((Query) null).when(session0).createQuery(anyString());
PrivateAccess.setVariable((Class<CatalogDatabase>) CatalogDatabase.class, catalogDatabase0, "session", (Object) session0);
// Undeclared exception!
- try {
+ try {
catalogDatabase0.getService(hashMap0, "Successfully. No template found");
fail("Expecting exception: NullPointerException");
-
+
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
@@ -234,10 +234,10 @@ public class CatalogDatabaseESTest extends CatalogDatabaseESTestscaffolding {
doReturn((Query) null).when(session0).createQuery(anyString());
PrivateAccess.setVariable((Class<CatalogDatabase>) CatalogDatabase.class, catalogDatabase0, "session", (Object) session0);
// Undeclared exception!
- try {
+ try {
catalogDatabase0.getNestedTemplates(2377);
fail("Expecting exception: NullPointerException");
-
+
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
@@ -256,10 +256,10 @@ public class CatalogDatabaseESTest extends CatalogDatabaseESTestscaffolding {
doReturn((Query) null).when(session0).createQuery(anyString());
PrivateAccess.setVariable((Class<CatalogDatabase>) CatalogDatabase.class, catalogDatabase0, "session", (Object) session0);
// Undeclared exception!
- try {
+ try {
catalogDatabase0.getVnfComponentsRecipe("Generic exception searching for vnf_id=", (String) null, (String) null, (String) null);
fail("Expecting exception: NullPointerException");
-
+
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
@@ -287,10 +287,10 @@ public class CatalogDatabaseESTest extends CatalogDatabaseESTestscaffolding {
PrivateAccess.setVariable((Class<CatalogDatabase>) CatalogDatabase.class, catalogDatabase0, "session", (Object) session1);
catalogDatabase0.getVnfComponent(187, "");
// Undeclared exception!
- try {
+ try {
catalogDatabase0.getHeatEnvironment((-1));
fail("Expecting exception: NullPointerException");
-
+
} catch(NullPointerException e) {
}
}
@@ -299,10 +299,10 @@ public class CatalogDatabaseESTest extends CatalogDatabaseESTestscaffolding {
public void test08() throws Throwable {
CatalogDatabase catalogDatabase0 = new CatalogDatabase();
// Undeclared exception!
- try {
+ try {
catalogDatabase0.getNetworkRecipe("735uWxa&iIbU.4]O$", ",hpGX76\"X~ow4", (String) null);
fail("Expecting exception: NullPointerException");
-
+
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
@@ -322,10 +322,10 @@ public class CatalogDatabaseESTest extends CatalogDatabaseESTestscaffolding {
doReturn((Query) null).when(session0).createQuery(anyString());
PrivateAccess.setVariable((Class<CatalogDatabase>) CatalogDatabase.class, catalogDatabase0, "session", (Object) session0);
// Undeclared exception!
- try {
+ try {
catalogDatabase0.getVnfComponentsRecipeByVfModuleId("", "(3", "");
fail("Expecting exception: NullPointerException");
-
+
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
@@ -343,10 +343,10 @@ public class CatalogDatabaseESTest extends CatalogDatabaseESTestscaffolding {
PrivateAccess.setVariable((Class<CatalogDatabase>) CatalogDatabase.class, catalogDatabase0, "session", (Object) session0);
PrivateAccess.callMethod((Class<CatalogDatabase>) CatalogDatabase.class, catalogDatabase0, "getSession");
// Undeclared exception!
- try {
- catalogDatabase0.getVnfComponentsRecipe("B4@1", "v@(U", "", (String) null, "");
+ try {
+ catalogDatabase0.getVnfComponentsRecipe("B4@1", "v@(U", "", (String) null, "", "");
fail("Expecting exception: NullPointerException");
-
+
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
@@ -363,10 +363,10 @@ public class CatalogDatabaseESTest extends CatalogDatabaseESTestscaffolding {
doReturn((Query) null).when(session0).createQuery(anyString());
PrivateAccess.setVariable((Class<CatalogDatabase>) CatalogDatabase.class, catalogDatabase0, "session", (Object) session0);
// Undeclared exception!
- try {
+ try {
catalogDatabase0.getService((String) null);
fail("Expecting exception: NullPointerException");
-
+
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
@@ -383,10 +383,10 @@ public class CatalogDatabaseESTest extends CatalogDatabaseESTestscaffolding {
doReturn((Query) null).when(session0).createQuery(anyString());
PrivateAccess.setVariable((Class<CatalogDatabase>) CatalogDatabase.class, catalogDatabase0, "session", (Object) session0);
// Undeclared exception!
- try {
+ try {
catalogDatabase0.getVfModuleModelName("", "RiY");
fail("Expecting exception: NullPointerException");
-
+
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
@@ -406,10 +406,10 @@ public class CatalogDatabaseESTest extends CatalogDatabaseESTestscaffolding {
VnfRecipe vnfRecipe0 = mock(VnfRecipe.class, new ViolatedAssumptionAnswer());
Service service0 = new Service();
// Undeclared exception!
- try {
+ try {
catalogDatabase0.saveService(service0);
fail("Expecting exception: NullPointerException");
-
+
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
@@ -426,10 +426,10 @@ public class CatalogDatabaseESTest extends CatalogDatabaseESTestscaffolding {
doReturn((Query) null).when(session0).createQuery(anyString());
PrivateAccess.setVariable((Class<CatalogDatabase>) CatalogDatabase.class, catalogDatabase0, "session", (Object) session0);
// Undeclared exception!
- try {
+ try {
catalogDatabase0.getNetworkRecipe("735uWxa&iIbU.4]O$", ",hpGX76\"X~ow4", "");
fail("Expecting exception: NullPointerException");
-
+
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
@@ -444,10 +444,10 @@ public class CatalogDatabaseESTest extends CatalogDatabaseESTestscaffolding {
HeatTemplate heatTemplate0 = mock(HeatTemplate.class, new ViolatedAssumptionAnswer());
VnfResource vnfResource0 = mock(VnfResource.class, new ViolatedAssumptionAnswer());
// Undeclared exception!
- try {
+ try {
catalogDatabase0.saveService((Service) null);
fail("Expecting exception: NullPointerException");
-
+
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
@@ -463,10 +463,10 @@ public class CatalogDatabaseESTest extends CatalogDatabaseESTestscaffolding {
HeatTemplate heatTemplate0 = new HeatTemplate();
LinkedHashSet<HeatTemplateParam> linkedHashSet0 = new LinkedHashSet<HeatTemplateParam>();
// Undeclared exception!
- try {
+ try {
catalogDatabase0.saveHeatTemplate((HeatTemplate) null, (Set<HeatTemplateParam>) linkedHashSet0);
fail("Expecting exception: NullPointerException");
-
+
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
@@ -482,10 +482,10 @@ public class CatalogDatabaseESTest extends CatalogDatabaseESTestscaffolding {
doReturn((-1)).when(vnfResource0).getId();
doReturn("#5|%>JWRPJfP)S@").when(vnfResource0).getVnfType();
// Undeclared exception!
- try {
+ try {
catalogDatabase0.saveOrUpdateVnfResource(vnfResource0);
fail("Expecting exception: NullPointerException");
-
+
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
@@ -500,10 +500,10 @@ public class CatalogDatabaseESTest extends CatalogDatabaseESTestscaffolding {
MsoLogger.StatusCode.values();
CatalogDatabase catalogDatabase0 = new CatalogDatabase();
// Undeclared exception!
- try {
+ try {
catalogDatabase0.saveVnfRecipe((VnfRecipe) null);
fail("Expecting exception: NullPointerException");
-
+
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
@@ -520,10 +520,10 @@ public class CatalogDatabaseESTest extends CatalogDatabaseESTestscaffolding {
doReturn((String) null, (String) null).when(service0).getServiceNameVersionId();
doReturn((String) null).when(service0).getServiceVersion();
// Undeclared exception!
- try {
+ try {
catalogDatabase0.saveService(service0);
fail("Expecting exception: NullPointerException");
-
+
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
@@ -542,10 +542,10 @@ public class CatalogDatabaseESTest extends CatalogDatabaseESTestscaffolding {
CatalogDatabase catalogDatabase0 = new CatalogDatabase();
HeatEnvironment heatEnvironment0 = new HeatEnvironment();
// Undeclared exception!
- try {
+ try {
catalogDatabase0.saveHeatEnvironment(heatEnvironment0);
fail("Expecting exception: NullPointerException");
-
+
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
@@ -559,10 +559,10 @@ public class CatalogDatabaseESTest extends CatalogDatabaseESTestscaffolding {
MessageEnum messageEnum0 = MessageEnum.APIH_GENERAL_METRICS;
CatalogDatabase catalogDatabase0 = new CatalogDatabase();
// Undeclared exception!
- try {
+ try {
catalogDatabase0.saveHeatEnvironment((HeatEnvironment) null);
fail("Expecting exception: NullPointerException");
-
+
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
@@ -575,10 +575,10 @@ public class CatalogDatabaseESTest extends CatalogDatabaseESTestscaffolding {
public void test22() throws Throwable {
CatalogDatabase catalogDatabase0 = new CatalogDatabase();
// Undeclared exception!
- try {
+ try {
catalogDatabase0.getVnfRecipe((String) null, (String) null, (String) null);
fail("Expecting exception: NullPointerException");
-
+
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
@@ -592,10 +592,10 @@ public class CatalogDatabaseESTest extends CatalogDatabaseESTestscaffolding {
MsoLogger.ErrorCode.values();
CatalogDatabase catalogDatabase0 = new CatalogDatabase();
// Undeclared exception!
- try {
+ try {
catalogDatabase0.rollback();
fail("Expecting exception: NullPointerException");
-
+
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
@@ -608,10 +608,10 @@ public class CatalogDatabaseESTest extends CatalogDatabaseESTestscaffolding {
public void test24() throws Throwable {
CatalogDatabase catalogDatabase0 = new CatalogDatabase();
// Undeclared exception!
- try {
+ try {
catalogDatabase0.getAllHeatTemplates();
fail("Expecting exception: NullPointerException");
-
+
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
@@ -624,10 +624,10 @@ public class CatalogDatabaseESTest extends CatalogDatabaseESTestscaffolding {
public void test25() throws Throwable {
CatalogDatabase catalogDatabase0 = new CatalogDatabase();
// Undeclared exception!
- try {
+ try {
catalogDatabase0.getHeatFilesForVfModule((-1539));
fail("Expecting exception: NullPointerException");
-
+
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
@@ -640,10 +640,10 @@ public class CatalogDatabaseESTest extends CatalogDatabaseESTestscaffolding {
public void test26() throws Throwable {
CatalogDatabase catalogDatabase0 = new CatalogDatabase();
// Undeclared exception!
- try {
+ try {
catalogDatabase0.getHeatEnvironment(0);
fail("Expecting exception: NullPointerException");
-
+
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
@@ -656,10 +656,10 @@ public class CatalogDatabaseESTest extends CatalogDatabaseESTestscaffolding {
public void test27() throws Throwable {
CatalogDatabase catalogDatabase0 = new CatalogDatabase();
// Undeclared exception!
- try {
+ try {
catalogDatabase0.getAllHeatEnvironment();
fail("Expecting exception: NullPointerException");
-
+
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
@@ -672,10 +672,10 @@ public class CatalogDatabaseESTest extends CatalogDatabaseESTestscaffolding {
public void test28() throws Throwable {
CatalogDatabase catalogDatabase0 = new CatalogDatabase();
// Undeclared exception!
- try {
+ try {
catalogDatabase0.commit();
fail("Expecting exception: NullPointerException");
-
+
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
@@ -691,10 +691,10 @@ public class CatalogDatabaseESTest extends CatalogDatabaseESTestscaffolding {
heatFiles0.setVersion("E0)WE F/LaV~i2U01");
heatFiles0.setFileName("uIZl|");
// Undeclared exception!
- try {
+ try {
catalogDatabase0.saveHeatFiles(heatFiles0);
fail("Expecting exception: NullPointerException");
-
+
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
@@ -707,10 +707,10 @@ public class CatalogDatabaseESTest extends CatalogDatabaseESTestscaffolding {
public void test30() throws Throwable {
CatalogDatabase catalogDatabase0 = new CatalogDatabase();
// Undeclared exception!
- try {
+ try {
catalogDatabase0.saveVnfComponentsRecipe((VnfComponentsRecipe) null);
fail("Expecting exception: NullPointerException");
-
+
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
@@ -726,10 +726,10 @@ public class CatalogDatabaseESTest extends CatalogDatabaseESTestscaffolding {
MessageEnum messageEnum2 = MessageEnum.NO_PROPERTIES;
CatalogDatabase catalogDatabase0 = new CatalogDatabase();
// Undeclared exception!
- try {
+ try {
catalogDatabase0.healthCheck();
fail("Expecting exception: NullPointerException");
-
+
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
@@ -743,10 +743,10 @@ public class CatalogDatabaseESTest extends CatalogDatabaseESTestscaffolding {
CatalogDatabase catalogDatabase0 = new CatalogDatabase();
catalogDatabase0.close();
// Undeclared exception!
- try {
+ try {
catalogDatabase0.getHeatTemplate(1197);
fail("Expecting exception: NullPointerException");
-
+
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
@@ -759,10 +759,10 @@ public class CatalogDatabaseESTest extends CatalogDatabaseESTestscaffolding {
public void test33() throws Throwable {
CatalogDatabase catalogDatabase0 = new CatalogDatabase();
// Undeclared exception!
- try {
+ try {
catalogDatabase0.getAllNetworkResources();
fail("Expecting exception: NullPointerException");
-
+
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
@@ -775,10 +775,10 @@ public class CatalogDatabaseESTest extends CatalogDatabaseESTestscaffolding {
public void test34() throws Throwable {
CatalogDatabase catalogDatabase0 = new CatalogDatabase();
// Undeclared exception!
- try {
+ try {
catalogDatabase0.getVnfComponentsRecipe("Ikrt3T$WS\"UMs#Q", "Ikrt3T$WS\"UMs#Q", "Ikrt3T$WS\"UMs#Q", "");
fail("Expecting exception: NullPointerException");
-
+
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
@@ -791,10 +791,10 @@ public class CatalogDatabaseESTest extends CatalogDatabaseESTestscaffolding {
public void test35() throws Throwable {
CatalogDatabase catalogDatabase0 = new CatalogDatabase();
// Undeclared exception!
- try {
+ try {
catalogDatabase0.getHeatTemplate((String) null);
fail("Expecting exception: NullPointerException");
-
+
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
@@ -807,10 +807,10 @@ public class CatalogDatabaseESTest extends CatalogDatabaseESTestscaffolding {
public void test36() throws Throwable {
CatalogDatabase catalogDatabase0 = new CatalogDatabase();
// Undeclared exception!
- try {
+ try {
catalogDatabase0.getVnfComponent(1987, "R$9=*_j3~I=:_");
fail("Expecting exception: NullPointerException");
-
+
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
@@ -823,10 +823,10 @@ public class CatalogDatabaseESTest extends CatalogDatabaseESTestscaffolding {
public void test37() throws Throwable {
CatalogDatabase catalogDatabase0 = new CatalogDatabase();
// Undeclared exception!
- try {
+ try {
catalogDatabase0.getHeatFiles(0, "r#j>oJCQI5r'@)jSH", "K6#W1{s", "vRm");
fail("Expecting exception: NullPointerException");
-
+
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
@@ -839,10 +839,10 @@ public class CatalogDatabaseESTest extends CatalogDatabaseESTestscaffolding {
public void test38() throws Throwable {
CatalogDatabase catalogDatabase0 = new CatalogDatabase();
// Undeclared exception!
- try {
+ try {
catalogDatabase0.getVnfResourcesByRole("");
fail("Expecting exception: NullPointerException");
-
+
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
@@ -856,10 +856,10 @@ public class CatalogDatabaseESTest extends CatalogDatabaseESTestscaffolding {
MessageEnum messageEnum0 = MessageEnum.RA_ASYNC_DELETE_VNF;
CatalogDatabase catalogDatabase0 = new CatalogDatabase();
// Undeclared exception!
- try {
+ try {
catalogDatabase0.getAllVnfResources();
fail("Expecting exception: NullPointerException");
-
+
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
@@ -891,10 +891,10 @@ public class CatalogDatabaseESTest extends CatalogDatabaseESTestscaffolding {
PrivateAccess.callMethod((Class<CatalogDatabase>) CatalogDatabase.class, catalogDatabase0, "getSession");
catalogDatabase0.getHeatTemplate((String) null);
// Undeclared exception!
- try {
+ try {
catalogDatabase0.getHeatEnvironment(148);
fail("Expecting exception: NullPointerException");
-
+
} catch(NullPointerException e) {
}
}
@@ -936,10 +936,10 @@ public class CatalogDatabaseESTest extends CatalogDatabaseESTestscaffolding {
catalogDatabase0.saveHeatFiles(heatFiles0);
Set<HeatTemplateParam> set0 = (Set<HeatTemplateParam>) mock(Set.class, new ViolatedAssumptionAnswer());
// Undeclared exception!
- try {
+ try {
catalogDatabase0.saveHeatTemplate(heatTemplate0, set0);
fail("Expecting exception: NullPointerException");
-
+
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
@@ -978,10 +978,10 @@ public class CatalogDatabaseESTest extends CatalogDatabaseESTestscaffolding {
Iterator<HeatTemplateParam> iterator0 = (Iterator<HeatTemplateParam>) mock(Iterator.class, new ViolatedAssumptionAnswer());
Set<HeatTemplateParam> set0 = (Set<HeatTemplateParam>) mock(Set.class, new ViolatedAssumptionAnswer());
// Undeclared exception!
- try {
+ try {
catalogDatabase0.saveHeatTemplate(heatTemplate0, set0);
fail("Expecting exception: NullPointerException");
-
+
} catch(NullPointerException e) {
}
}
@@ -999,10 +999,10 @@ public class CatalogDatabaseESTest extends CatalogDatabaseESTestscaffolding {
doReturn(query0).when(session1).createQuery(anyString());
PrivateAccess.setVariable((Class<CatalogDatabase>) CatalogDatabase.class, catalogDatabase0, "session", (Object) session1);
// Undeclared exception!
- try {
+ try {
catalogDatabase0.getHeatEnvironment((-1));
fail("Expecting exception: NullPointerException");
-
+
} catch(NullPointerException e) {
}
}
@@ -1017,10 +1017,10 @@ public class CatalogDatabaseESTest extends CatalogDatabaseESTestscaffolding {
String string2 = "U`9Z8:QQUr-c(T@_/)";
String string3 = "$q')fpKG]Q&i\"'{x";
// Undeclared exception!
- try {
+ try {
catalogDatabase0.getNetworkResource("FT>Ri6U\"Ks<.H/g[");
fail("Expecting exception: NullPointerException");
-
+
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
@@ -1034,10 +1034,10 @@ public class CatalogDatabaseESTest extends CatalogDatabaseESTestscaffolding {
CatalogDatabase catalogDatabase0 = new CatalogDatabase();
int int0 = 1030;
// Undeclared exception!
- try {
+ try {
catalogDatabase0.getAllVfModules();
fail("Expecting exception: NullPointerException");
-
+
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
@@ -1051,10 +1051,10 @@ public class CatalogDatabaseESTest extends CatalogDatabaseESTestscaffolding {
MsoLogger.ResponseCode msoLogger_ResponseCode0 = MsoLogger.ResponseCode.DataNotFound;
CatalogDatabase catalogDatabase0 = new CatalogDatabase();
// Undeclared exception!
- try {
+ try {
catalogDatabase0.getVfModuleType("serviceVersion", "serviceVersion");
fail("Expecting exception: NullPointerException");
-
+
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
@@ -1068,10 +1068,10 @@ public class CatalogDatabaseESTest extends CatalogDatabaseESTestscaffolding {
MsoLogger.ResponseCode msoLogger_ResponseCode0 = MsoLogger.ResponseCode.Conflict;
CatalogDatabase catalogDatabase0 = new CatalogDatabase();
// Undeclared exception!
- try {
+ try {
catalogDatabase0.getNestedTemplates(2377);
fail("Expecting exception: NullPointerException");
-
+
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
@@ -1088,10 +1088,10 @@ public class CatalogDatabaseESTest extends CatalogDatabaseESTestscaffolding {
CatalogDatabase catalogDatabase0 = new CatalogDatabase();
String string0 = null;
// Undeclared exception!
- try {
+ try {
catalogDatabase0.getVnfResource((String) null, (String) null);
fail("Expecting exception: NullPointerException");
-
+
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
@@ -1105,10 +1105,10 @@ public class CatalogDatabaseESTest extends CatalogDatabaseESTestscaffolding {
CatalogDatabase catalogDatabase0 = new CatalogDatabase();
String string0 = ", description=";
// Undeclared exception!
- try {
+ try {
catalogDatabase0.getServiceRecipe((-1319), ", description=");
fail("Expecting exception: NullPointerException");
-
+
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
@@ -1124,10 +1124,10 @@ public class CatalogDatabaseESTest extends CatalogDatabaseESTestscaffolding {
String string1 = "735uWxa&iIbU.4]O$";
String string2 = "APIH_ERROR_FROM_BPEL_SERVER";
// Undeclared exception!
- try {
+ try {
catalogDatabase0.getNetworkRecipe("735uWxa&iIbU.4]O$", ",hpGX76\"X~ow4", "");
fail("Expecting exception: NullPointerException");
-
+
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
@@ -1142,10 +1142,10 @@ public class CatalogDatabaseESTest extends CatalogDatabaseESTestscaffolding {
String string0 = ",hpGX76\"X~ow4";
String string1 = "APIH_ERROR_FROM_BPEL_SERVER";
// Undeclared exception!
- try {
+ try {
catalogDatabase0.getNetworkRecipe("", ",hpGX76\"X~ow4");
fail("Expecting exception: NullPointerException");
-
+
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
@@ -1162,10 +1162,10 @@ public class CatalogDatabaseESTest extends CatalogDatabaseESTestscaffolding {
String string2 = "";
String string3 = null;
// Undeclared exception!
- try {
+ try {
catalogDatabase0.getVnfResource((String) null);
fail("Expecting exception: NullPointerException");
-
+
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
@@ -1180,10 +1180,10 @@ public class CatalogDatabaseESTest extends CatalogDatabaseESTestscaffolding {
String string0 = "Ikrt3T$WS\"UMs#Q";
String string1 = null;
// Undeclared exception!
- try {
+ try {
catalogDatabase0.getServiceByUUID("Ikrt3T$WS\"UMs#Q");
fail("Expecting exception: NullPointerException");
-
+
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
@@ -1197,10 +1197,10 @@ public class CatalogDatabaseESTest extends CatalogDatabaseESTestscaffolding {
CatalogDatabase catalogDatabase0 = new CatalogDatabase();
String string0 = "v@(U";
// Undeclared exception!
- try {
- catalogDatabase0.getVnfComponentsRecipe("!4@@1", "v@(U", "", (String) null, "");
+ try {
+ catalogDatabase0.getVnfComponentsRecipe("!4@@1", "v@(U", "", (String) null, "", "");
fail("Expecting exception: NullPointerException");
-
+
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
@@ -1217,10 +1217,10 @@ public class CatalogDatabaseESTest extends CatalogDatabaseESTestscaffolding {
CatalogDatabase catalogDatabase0 = new CatalogDatabase();
HashMap<String, String> hashMap0 = new HashMap<String, String>();
// Undeclared exception!
- try {
+ try {
catalogDatabase0.getService(hashMap0, "Successfully. No template found");
fail("Expecting exception: NullPointerException");
-
+
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
@@ -1235,10 +1235,10 @@ public class CatalogDatabaseESTest extends CatalogDatabaseESTestscaffolding {
MessageEnum messageEnum1 = MessageEnum.ASDC_ARTIFACT_DOWNLOAD_FAIL;
CatalogDatabase catalogDatabase0 = new CatalogDatabase();
// Undeclared exception!
- try {
+ try {
catalogDatabase0.getVnfComponentsRecipeByVfModuleId("", "(3", "");
fail("Expecting exception: NullPointerException");
-
+
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
@@ -1255,10 +1255,10 @@ public class CatalogDatabaseESTest extends CatalogDatabaseESTestscaffolding {
String string0 = "";
String string1 = "RiY";
// Undeclared exception!
- try {
+ try {
catalogDatabase0.getHeatEnvironment("", "RiY", "RiY");
fail("Expecting exception: NullPointerException");
-
+
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
@@ -1275,10 +1275,10 @@ public class CatalogDatabaseESTest extends CatalogDatabaseESTestscaffolding {
HeatTemplate heatTemplate0 = new HeatTemplate();
LinkedHashSet<HeatTemplateParam> linkedHashSet0 = new LinkedHashSet<HeatTemplateParam>();
// Undeclared exception!
- try {
+ try {
catalogDatabase0.saveHeatTemplate(heatTemplate0, (Set<HeatTemplateParam>) linkedHashSet0);
fail("Expecting exception: NullPointerException");
-
+
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
@@ -1293,10 +1293,10 @@ public class CatalogDatabaseESTest extends CatalogDatabaseESTestscaffolding {
MessageEnum messageEnum1 = MessageEnum.RA_SEND_REQUEST_SDNC;
CatalogDatabase catalogDatabase0 = new CatalogDatabase();
// Undeclared exception!
- try {
+ try {
catalogDatabase0.getVnfComponentsRecipe("Generic exception searching for vnf_id=", (String) null, (String) null, (String) null);
fail("Expecting exception: NullPointerException");
-
+
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
diff --git a/mso-catalog-db/src/test/java/org/openecomp/mso/db/catalog/beans/AllottedResourceCustomizationESTest.java b/mso-catalog-db/src/test/java/org/openecomp/mso/db/catalog/beans/AllottedResourceCustomizationESTest.java
new file mode 100644
index 0000000000..2f0a1c85ae
--- /dev/null
+++ b/mso-catalog-db/src/test/java/org/openecomp/mso/db/catalog/beans/AllottedResourceCustomizationESTest.java
@@ -0,0 +1,214 @@
+/*
+ * This file was automatically generated by EvoSuite
+ * Wed Feb 22 09:34:38 GMT 2017
+ */
+
+package org.openecomp.mso.db.catalog.beans;
+
+import org.junit.Test;
+import static org.junit.Assert.*;
+import java.sql.Timestamp;
+import java.time.Instant;
+import org.evosuite.runtime.EvoRunner;
+import org.evosuite.runtime.EvoRunnerParameters;
+import org.evosuite.runtime.mock.java.time.MockInstant;
+import org.junit.runner.RunWith;
+import org.openecomp.mso.db.catalog.beans.AllottedResourceCustomization;
+
+@RunWith(EvoRunner.class) @EvoRunnerParameters(mockJVMNonDeterminism = true, useVFS = true, useVNET = true, resetStaticState = true, useJEE = true)
+public class AllottedResourceCustomizationESTest extends AllottedResourceCustomizationESTestscaffolding {
+
+ @Test(timeout = 4000)
+ public void test00() throws Throwable {
+ AllottedResourceCustomization allottedResourceCustomization0 = new AllottedResourceCustomization();
+ allottedResourceCustomization0.setModelVersion("T2<n67gDL");
+ String string0 = allottedResourceCustomization0.getModelVersion();
+ assertEquals("T2<n67gDL", string0);
+ }
+
+ @Test(timeout = 4000)
+ public void test01() throws Throwable {
+ AllottedResourceCustomization allottedResourceCustomization0 = new AllottedResourceCustomization();
+ allottedResourceCustomization0.setModelUuid("/jt");
+ String string0 = allottedResourceCustomization0.getModelUuid();
+ assertEquals("/jt", string0);
+ }
+
+ @Test(timeout = 4000)
+ public void test02() throws Throwable {
+ AllottedResourceCustomization allottedResourceCustomization0 = new AllottedResourceCustomization();
+ allottedResourceCustomization0.setModelName("Pf");
+ String string0 = allottedResourceCustomization0.getModelName();
+ assertEquals("Pf", string0);
+ }
+
+ @Test(timeout = 4000)
+ public void test03() throws Throwable {
+ AllottedResourceCustomization allottedResourceCustomization0 = new AllottedResourceCustomization();
+ allottedResourceCustomization0.setModelInvariantUuid("");
+ String string0 = allottedResourceCustomization0.getModelInvariantUuid();
+ assertEquals("", string0);
+ }
+
+ @Test(timeout = 4000)
+ public void test04() throws Throwable {
+ AllottedResourceCustomization allottedResourceCustomization0 = new AllottedResourceCustomization();
+ allottedResourceCustomization0.setModelInstanceName("modelName=null,modelVersion=null,version=null,modelUuid=null,modelInvariantUuid=null,modelCustomizationUuid=null,modelInstanceName=null,description=null,modelInstanceName=null,created=null");
+ String string0 = allottedResourceCustomization0.getModelInstanceName();
+ assertEquals("modelName=null,modelVersion=null,version=null,modelUuid=null,modelInvariantUuid=null,modelCustomizationUuid=null,modelInstanceName=null,description=null,modelInstanceName=null,created=null", string0);
+ }
+
+ @Test(timeout = 4000)
+ public void test05() throws Throwable {
+ AllottedResourceCustomization allottedResourceCustomization0 = new AllottedResourceCustomization();
+ allottedResourceCustomization0.setModelCustomizationUuid("(;CXN3pGApF720T|Z");
+ String string0 = allottedResourceCustomization0.getModelCustomizationUuid();
+ assertEquals("(;CXN3pGApF720T|Z", string0);
+ }
+
+ @Test(timeout = 4000)
+ public void test06() throws Throwable {
+ AllottedResourceCustomization allottedResourceCustomization0 = new AllottedResourceCustomization();
+ allottedResourceCustomization0.setDescription("Pf");
+ String string0 = allottedResourceCustomization0.getDescription();
+ assertEquals("Pf", string0);
+ }
+
+ @Test(timeout = 4000)
+ public void test07() throws Throwable {
+ AllottedResourceCustomization allottedResourceCustomization0 = new AllottedResourceCustomization();
+ allottedResourceCustomization0.setDescription("");
+ String string0 = allottedResourceCustomization0.getDescription();
+ assertEquals("", string0);
+ }
+
+ @Test(timeout = 4000)
+ public void test08() throws Throwable {
+ AllottedResourceCustomization allottedResourceCustomization0 = new AllottedResourceCustomization();
+ Instant instant0 = MockInstant.now();
+ Timestamp timestamp0 = Timestamp.from(instant0);
+ allottedResourceCustomization0.setCreated(timestamp0);
+ Timestamp timestamp1 = allottedResourceCustomization0.getCreated();
+ assertEquals(320000000, timestamp1.getNanos());
+ }
+
+ @Test(timeout = 4000)
+ public void test09() throws Throwable {
+ AllottedResourceCustomization allottedResourceCustomization0 = new AllottedResourceCustomization();
+ String string0 = allottedResourceCustomization0.getModelUuid();
+ assertNull(string0);
+ }
+
+ @Test(timeout = 4000)
+ public void test10() throws Throwable {
+ AllottedResourceCustomization allottedResourceCustomization0 = new AllottedResourceCustomization();
+ String string0 = allottedResourceCustomization0.toString();
+ assertEquals("modelName=null,modelVersion=null,version=null,modelUuid=null,modelInvariantUuid=null,modelCustomizationUuid=null,modelInstanceName=null,description=null,modelInstanceName=null,created=null", string0);
+ }
+
+ @Test(timeout = 4000)
+ public void test11() throws Throwable {
+ AllottedResourceCustomization allottedResourceCustomization0 = new AllottedResourceCustomization();
+ allottedResourceCustomization0.setModelUuid("");
+ String string0 = allottedResourceCustomization0.getModelUuid();
+ assertEquals("", string0);
+ }
+
+ @Test(timeout = 4000)
+ public void test12() throws Throwable {
+ AllottedResourceCustomization allottedResourceCustomization0 = new AllottedResourceCustomization();
+ String string0 = allottedResourceCustomization0.getModelCustomizationUuid();
+ assertNull(string0);
+ }
+
+ @Test(timeout = 4000)
+ public void test13() throws Throwable {
+ AllottedResourceCustomization allottedResourceCustomization0 = new AllottedResourceCustomization();
+ String string0 = allottedResourceCustomization0.getModelVersion();
+ assertNull(string0);
+ }
+
+ @Test(timeout = 4000)
+ public void test14() throws Throwable {
+ AllottedResourceCustomization allottedResourceCustomization0 = new AllottedResourceCustomization();
+ Timestamp timestamp0 = new Timestamp(0L);
+ allottedResourceCustomization0.setCreated(timestamp0);
+ Timestamp timestamp1 = allottedResourceCustomization0.getCreated();
+ assertEquals(0, timestamp1.getNanos());
+ }
+
+ @Test(timeout = 4000)
+ public void test15() throws Throwable {
+ AllottedResourceCustomization allottedResourceCustomization0 = new AllottedResourceCustomization();
+ String string0 = allottedResourceCustomization0.getModelInstanceName();
+ assertNull(string0);
+ }
+
+ @Test(timeout = 4000)
+ public void test16() throws Throwable {
+ AllottedResourceCustomization allottedResourceCustomization0 = new AllottedResourceCustomization();
+ allottedResourceCustomization0.setModelVersion("");
+ String string0 = allottedResourceCustomization0.getModelVersion();
+ assertEquals("", string0);
+ }
+
+ @Test(timeout = 4000)
+ public void test17() throws Throwable {
+ AllottedResourceCustomization allottedResourceCustomization0 = new AllottedResourceCustomization();
+ String string0 = allottedResourceCustomization0.getDescription();
+ assertNull(string0);
+ }
+
+ @Test(timeout = 4000)
+ public void test18() throws Throwable {
+ AllottedResourceCustomization allottedResourceCustomization0 = new AllottedResourceCustomization();
+ allottedResourceCustomization0.setModelName("");
+ String string0 = allottedResourceCustomization0.getModelName();
+ assertEquals("", string0);
+ }
+
+ @Test(timeout = 4000)
+ public void test19() throws Throwable {
+ AllottedResourceCustomization allottedResourceCustomization0 = new AllottedResourceCustomization();
+ allottedResourceCustomization0.setModelInstanceName("");
+ String string0 = allottedResourceCustomization0.getModelInstanceName();
+ assertEquals("", string0);
+ }
+
+ @Test(timeout = 4000)
+ public void test20() throws Throwable {
+ AllottedResourceCustomization allottedResourceCustomization0 = new AllottedResourceCustomization();
+ String string0 = allottedResourceCustomization0.getModelName();
+ assertNull(string0);
+ }
+
+ @Test(timeout = 4000)
+ public void test21() throws Throwable {
+ AllottedResourceCustomization allottedResourceCustomization0 = new AllottedResourceCustomization();
+ String string0 = allottedResourceCustomization0.getModelInvariantUuid();
+ assertNull(string0);
+ }
+
+ @Test(timeout = 4000)
+ public void test22() throws Throwable {
+ AllottedResourceCustomization allottedResourceCustomization0 = new AllottedResourceCustomization();
+ allottedResourceCustomization0.setModelInvariantUuid("JxwW-uj$dU[pMX`|;GM");
+ String string0 = allottedResourceCustomization0.getModelInvariantUuid();
+ assertEquals("JxwW-uj$dU[pMX`|;GM", string0);
+ }
+
+ @Test(timeout = 4000)
+ public void test23() throws Throwable {
+ AllottedResourceCustomization allottedResourceCustomization0 = new AllottedResourceCustomization();
+ Timestamp timestamp0 = allottedResourceCustomization0.getCreated();
+ assertNull(timestamp0);
+ }
+
+ @Test(timeout = 4000)
+ public void test24() throws Throwable {
+ AllottedResourceCustomization allottedResourceCustomization0 = new AllottedResourceCustomization();
+ allottedResourceCustomization0.setModelCustomizationUuid("");
+ String string0 = allottedResourceCustomization0.getModelCustomizationUuid();
+ assertEquals("", string0);
+ }
+}
diff --git a/mso-catalog-db/src/test/java/org/openecomp/mso/db/catalog/beans/AllottedResourceCustomizationESTestscaffolding.java b/mso-catalog-db/src/test/java/org/openecomp/mso/db/catalog/beans/AllottedResourceCustomizationESTestscaffolding.java
new file mode 100644
index 0000000000..b1b8251957
--- /dev/null
+++ b/mso-catalog-db/src/test/java/org/openecomp/mso/db/catalog/beans/AllottedResourceCustomizationESTestscaffolding.java
@@ -0,0 +1,77 @@
+/**
+ * Scaffolding file used to store all the setups needed to run
+ * tests automatically generated by EvoSuite
+ * Wed Feb 22 09:34:38 GMT 2017
+ */
+
+package org.openecomp.mso.db.catalog.beans;
+
+import org.evosuite.runtime.annotation.EvoSuiteClassExclude;
+import org.junit.BeforeClass;
+import org.junit.Before;
+import org.junit.After;
+import org.junit.AfterClass;
+import org.evosuite.runtime.sandbox.Sandbox;
+
+@EvoSuiteClassExclude
+public class AllottedResourceCustomizationESTestscaffolding {
+
+ @org.junit.Rule
+ public org.evosuite.runtime.vnet.NonFunctionalRequirementRule nfr = new org.evosuite.runtime.vnet.NonFunctionalRequirementRule();
+
+ private static final java.util.Properties defaultProperties = (java.util.Properties) java.lang.System.getProperties().clone();
+
+ private org.evosuite.runtime.thread.ThreadStopper threadStopper = new org.evosuite.runtime.thread.ThreadStopper (org.evosuite.runtime.thread.KillSwitchHandler.getInstance(), 3000);
+
+ @BeforeClass
+ public static void initEvoSuiteFramework() {
+ org.evosuite.runtime.RuntimeSettings.className = "org.openecomp.mso.db.catalog.beans.AllottedResourceCustomization";
+ org.evosuite.runtime.GuiSupport.initialize();
+ org.evosuite.runtime.RuntimeSettings.maxNumberOfThreads = 100;
+ org.evosuite.runtime.RuntimeSettings.maxNumberOfIterationsPerLoop = 10000;
+ org.evosuite.runtime.RuntimeSettings.mockSystemIn = true;
+ org.evosuite.runtime.RuntimeSettings.sandboxMode = org.evosuite.runtime.sandbox.Sandbox.SandboxMode.RECOMMENDED;
+ org.evosuite.runtime.sandbox.Sandbox.initializeSecurityManagerForSUT();
+ org.evosuite.runtime.classhandling.JDKClassResetter.init();
+ initializeClasses();
+ org.evosuite.runtime.Runtime.getInstance().resetRuntime();
+ }
+
+ @AfterClass
+ public static void clearEvoSuiteFramework(){
+ Sandbox.resetDefaultSecurityManager();
+ java.lang.System.setProperties((java.util.Properties) defaultProperties.clone());
+ }
+
+ @Before
+ public void initTestCase(){
+ threadStopper.storeCurrentThreads();
+ threadStopper.startRecordingTime();
+ org.evosuite.runtime.jvm.ShutdownHookHandler.getInstance().initHandler();
+ org.evosuite.runtime.sandbox.Sandbox.goingToExecuteSUTCode();
+ org.evosuite.runtime.GuiSupport.setHeadless();
+ org.evosuite.runtime.Runtime.getInstance().resetRuntime();
+ org.evosuite.runtime.agent.InstrumentingAgent.activate();
+ }
+
+ @After
+ public void doneWithTestCase(){
+ threadStopper.killAndJoinClientThreads();
+ org.evosuite.runtime.jvm.ShutdownHookHandler.getInstance().safeExecuteAddedHooks();
+ org.evosuite.runtime.classhandling.JDKClassResetter.reset();
+ resetClasses();
+ org.evosuite.runtime.sandbox.Sandbox.doneWithExecutingSUTCode();
+ org.evosuite.runtime.agent.InstrumentingAgent.deactivate();
+ org.evosuite.runtime.GuiSupport.restoreHeadlessMode();
+ }
+
+ private static void initializeClasses() {
+ org.evosuite.runtime.classhandling.ClassStateSupport.initializeClasses(AllottedResourceCustomizationESTestscaffolding.class.getClassLoader() ,
+ "org.openecomp.mso.db.catalog.utils.MavenLikeVersioning",
+ "org.openecomp.mso.db.catalog.beans.AllottedResourceCustomization"
+ );
+ }
+
+ private static void resetClasses() {
+ }
+}
diff --git a/mso-catalog-db/src/test/java/org/openecomp/mso/db/catalog/beans/ModelESTest.java b/mso-catalog-db/src/test/java/org/openecomp/mso/db/catalog/beans/ModelESTest.java
new file mode 100644
index 0000000000..545d689378
--- /dev/null
+++ b/mso-catalog-db/src/test/java/org/openecomp/mso/db/catalog/beans/ModelESTest.java
@@ -0,0 +1,271 @@
+/*
+ * This file was automatically generated by EvoSuite
+ * Wed Feb 22 09:32:26 GMT 2017
+ */
+
+package org.openecomp.mso.db.catalog.beans;
+
+import org.junit.Test;
+import static org.junit.Assert.*;
+import java.sql.Timestamp;
+import java.util.HashMap;
+import java.util.Map;
+import org.evosuite.runtime.EvoRunner;
+import org.evosuite.runtime.EvoRunnerParameters;
+import org.junit.runner.RunWith;
+
+@RunWith(EvoRunner.class) @EvoRunnerParameters(mockJVMNonDeterminism = true, useVFS = true, useVNET = true, resetStaticState = true, useJEE = true)
+public class ModelESTest extends ModelESTestscaffolding {
+
+ @Test(timeout = 4000)
+ public void test00() throws Throwable {
+ Model model0 = new Model();
+ HashMap<String, ServiceRecipe> hashMap0 = new HashMap<String, ServiceRecipe>();
+ ServiceRecipe serviceRecipe0 = new ServiceRecipe();
+ hashMap0.putIfAbsent("yyyy-MM-dd'T'HH:mm:ss.SSSXXX", serviceRecipe0);
+ model0.setRecipes(hashMap0);
+ Map<String, ServiceRecipe> map0 = model0.getRecipes();
+ assertEquals(1, map0.size());
+ }
+
+ @Test(timeout = 4000)
+ public void test01() throws Throwable {
+ Model model0 = new Model();
+ model0.setModelVersionId("9WI;kp?]");
+ String string0 = model0.getModelVersionId();
+ assertEquals("9WI;kp?]", string0);
+ }
+
+ @Test(timeout = 4000)
+ public void test02() throws Throwable {
+ Model model0 = new Model();
+ model0.setModelVersion("_Y+vZ)59ie");
+ String string0 = model0.getModelVersion();
+ assertEquals("_Y+vZ)59ie", string0);
+ }
+
+ @Test(timeout = 4000)
+ public void test03() throws Throwable {
+ Model model0 = new Model();
+ model0.setModelType("{!]r;T");
+ String string0 = model0.getModelType();
+ assertEquals("{!]r;T", string0);
+ }
+
+ @Test(timeout = 4000)
+ public void test04() throws Throwable {
+ Model model0 = new Model();
+ model0.setModelName(", description=");
+ String string0 = model0.getModelName();
+ assertEquals(", description=", string0);
+ }
+
+ @Test(timeout = 4000)
+ public void test05() throws Throwable {
+ Model model0 = new Model();
+ model0.setModelInvariantId(".m");
+ String string0 = model0.getModelInvariantId();
+ assertEquals(".m", string0);
+ }
+
+ @Test(timeout = 4000)
+ public void test06() throws Throwable {
+ Model model0 = new Model();
+ model0.setModelCustomizationName("|<HBAfp\"RZv\"?mz&H");
+ String string0 = model0.getModelCustomizationName();
+ assertEquals("|<HBAfp\"RZv\"?mz&H", string0);
+ }
+
+ @Test(timeout = 4000)
+ public void test07() throws Throwable {
+ Model model0 = new Model();
+ model0.setModelCustomizationId("RA");
+ String string0 = model0.getModelCustomizationId();
+ assertEquals("RA", string0);
+ }
+
+ @Test(timeout = 4000)
+ public void test08() throws Throwable {
+ Model model0 = new Model();
+ model0.setModelCustomizationId("");
+ String string0 = model0.getModelCustomizationId();
+ assertEquals("", string0);
+ }
+
+ @Test(timeout = 4000)
+ public void test09() throws Throwable {
+ Model model0 = new Model();
+ model0.setId((-2490));
+ int int0 = model0.getId();
+ assertEquals((-2490), int0);
+ }
+
+ @Test(timeout = 4000)
+ public void test10() throws Throwable {
+ Model model0 = new Model();
+ Timestamp timestamp0 = new Timestamp(0L);
+ model0.setCreated(timestamp0);
+ Timestamp timestamp1 = model0.getCreated();
+ assertSame(timestamp1, timestamp0);
+ }
+
+ @Test(timeout = 4000)
+ public void test11() throws Throwable {
+ Model model0 = new Model();
+ Timestamp timestamp0 = new Timestamp(1L);
+ model0.setCreated(timestamp0);
+ Timestamp timestamp1 = model0.getCreated();
+ assertSame(timestamp1, timestamp0);
+ }
+
+ @Test(timeout = 4000)
+ public void test12() throws Throwable {
+ Model model0 = new Model();
+ String string0 = model0.toString();
+ assertEquals("Model: modelCustomizationId=null,modelCustomizationName=null,modelInvariantId=null,modelName=null,modelType=null,modelVersion=null,modelVersionId=null", string0);
+ }
+
+ @Test(timeout = 4000)
+ public void test13() throws Throwable {
+ Model model0 = new Model();
+ model0.setModelType("");
+ String string0 = model0.getModelType();
+ assertEquals("", string0);
+ }
+
+ @Test(timeout = 4000)
+ public void test14() throws Throwable {
+ Model model0 = new Model();
+ String string0 = model0.getModelInvariantId();
+ assertNull(string0);
+ }
+
+ @Test(timeout = 4000)
+ public void test15() throws Throwable {
+ Model model0 = new Model();
+ Map<String, ServiceRecipe> map0 = model0.getRecipes();
+ assertNull(map0);
+ }
+
+ @Test(timeout = 4000)
+ public void test16() throws Throwable {
+ Model model0 = new Model();
+ String string0 = model0.getModelCustomizationName();
+ assertNull(string0);
+ }
+
+ @Test(timeout = 4000)
+ public void test17() throws Throwable {
+ Model model0 = new Model();
+ model0.setModelVersion("");
+ String string0 = model0.getModelVersion();
+ assertEquals("", string0);
+ }
+
+ @Test(timeout = 4000)
+ public void test18() throws Throwable {
+ Model model0 = new Model();
+ model0.setModelVersionId("");
+ String string0 = model0.getModelVersionId();
+ assertEquals("", string0);
+ }
+
+ @Test(timeout = 4000)
+ public void test19() throws Throwable {
+ Model model0 = new Model();
+ String string0 = model0.getModelType();
+ assertNull(string0);
+ }
+
+ @Test(timeout = 4000)
+ public void test20() throws Throwable {
+ Model model0 = new Model();
+ model0.setModelInvariantId("");
+ String string0 = model0.getModelInvariantId();
+ assertEquals("", string0);
+ }
+
+ @Test(timeout = 4000)
+ public void test21() throws Throwable {
+ Model model0 = new Model();
+ model0.setModelName("");
+ String string0 = model0.getModelName();
+ assertEquals("", string0);
+ }
+
+ @Test(timeout = 4000)
+ public void test22() throws Throwable {
+ Model model0 = new Model();
+ model0.setModelCustomizationName("");
+ String string0 = model0.getModelCustomizationName();
+ assertEquals("", string0);
+ }
+
+ @Test(timeout = 4000)
+ public void test23() throws Throwable {
+ Model model0 = new Model();
+ Timestamp timestamp0 = new Timestamp(0L);
+ model0.setCreated(timestamp0);
+ String string0 = model0.toString();
+ assertEquals("Model: modelCustomizationId=null,modelCustomizationName=null,modelInvariantId=null,modelName=null,modelType=null,modelVersion=null,modelVersionId=null,created=1/1/70 12:00 AM", string0);
+ }
+
+ @Test(timeout = 4000)
+ public void test24() throws Throwable {
+ Model model0 = new Model();
+ int int0 = model0.getId();
+ assertEquals(0, int0);
+ }
+
+ @Test(timeout = 4000)
+ public void test25() throws Throwable {
+ Model model0 = new Model();
+ HashMap<String, ServiceRecipe> hashMap0 = new HashMap<String, ServiceRecipe>();
+ model0.setRecipes(hashMap0);
+ Map<String, ServiceRecipe> map0 = model0.getRecipes();
+ assertTrue(map0.isEmpty());
+ }
+
+ @Test(timeout = 4000)
+ public void test26() throws Throwable {
+ Model model0 = new Model();
+ String string0 = model0.getModelVersionId();
+ assertNull(string0);
+ }
+
+ @Test(timeout = 4000)
+ public void test27() throws Throwable {
+ Model model0 = new Model();
+ String string0 = model0.getModelCustomizationId();
+ assertNull(string0);
+ }
+
+ @Test(timeout = 4000)
+ public void test28() throws Throwable {
+ Model model0 = new Model();
+ String string0 = model0.getModelVersion();
+ assertNull(string0);
+ }
+
+ @Test(timeout = 4000)
+ public void test29() throws Throwable {
+ Model model0 = new Model();
+ Timestamp timestamp0 = model0.getCreated();
+ assertNull(timestamp0);
+ }
+
+ @Test(timeout = 4000)
+ public void test30() throws Throwable {
+ Model model0 = new Model();
+ String string0 = model0.getModelName();
+ assertNull(string0);
+ }
+
+ @Test(timeout = 4000)
+ public void test31() throws Throwable {
+ Model model0 = new Model();
+ model0.setId(2803);
+ int int0 = model0.getId();
+ assertEquals(2803, int0);
+ }
+}
diff --git a/mso-catalog-db/src/test/java/org/openecomp/mso/db/catalog/beans/ModelESTestscaffolding.java b/mso-catalog-db/src/test/java/org/openecomp/mso/db/catalog/beans/ModelESTestscaffolding.java
new file mode 100644
index 0000000000..d9576e0681
--- /dev/null
+++ b/mso-catalog-db/src/test/java/org/openecomp/mso/db/catalog/beans/ModelESTestscaffolding.java
@@ -0,0 +1,106 @@
+/**
+ * Scaffolding file used to store all the setups needed to run
+ * tests automatically generated by EvoSuite
+ * Wed Feb 22 09:32:26 GMT 2017
+ */
+
+package org.openecomp.mso.db.catalog.beans;
+
+import org.evosuite.runtime.annotation.EvoSuiteClassExclude;
+import org.junit.BeforeClass;
+import org.junit.Before;
+import org.junit.After;
+import org.junit.AfterClass;
+import org.evosuite.runtime.sandbox.Sandbox;
+
+@EvoSuiteClassExclude
+public class ModelESTestscaffolding {
+
+ @org.junit.Rule
+ public org.evosuite.runtime.vnet.NonFunctionalRequirementRule nfr = new org.evosuite.runtime.vnet.NonFunctionalRequirementRule();
+
+ private static final java.util.Properties defaultProperties = (java.util.Properties) java.lang.System.getProperties().clone();
+
+ private org.evosuite.runtime.thread.ThreadStopper threadStopper = new org.evosuite.runtime.thread.ThreadStopper (org.evosuite.runtime.thread.KillSwitchHandler.getInstance(), 3000);
+
+ @BeforeClass
+ public static void initEvoSuiteFramework() {
+ org.evosuite.runtime.RuntimeSettings.className = "org.openecomp.mso.db.catalog.beans.Model";
+ org.evosuite.runtime.GuiSupport.initialize();
+ org.evosuite.runtime.RuntimeSettings.maxNumberOfThreads = 100;
+ org.evosuite.runtime.RuntimeSettings.maxNumberOfIterationsPerLoop = 10000;
+ org.evosuite.runtime.RuntimeSettings.mockSystemIn = true;
+ org.evosuite.runtime.RuntimeSettings.sandboxMode = org.evosuite.runtime.sandbox.Sandbox.SandboxMode.RECOMMENDED;
+ org.evosuite.runtime.sandbox.Sandbox.initializeSecurityManagerForSUT();
+ org.evosuite.runtime.classhandling.JDKClassResetter.init();
+ initializeClasses();
+ org.evosuite.runtime.Runtime.getInstance().resetRuntime();
+ }
+
+ @AfterClass
+ public static void clearEvoSuiteFramework(){
+ Sandbox.resetDefaultSecurityManager();
+ java.lang.System.setProperties((java.util.Properties) defaultProperties.clone());
+ }
+
+ @Before
+ public void initTestCase(){
+ threadStopper.storeCurrentThreads();
+ threadStopper.startRecordingTime();
+ org.evosuite.runtime.jvm.ShutdownHookHandler.getInstance().initHandler();
+ org.evosuite.runtime.sandbox.Sandbox.goingToExecuteSUTCode();
+ org.evosuite.runtime.GuiSupport.setHeadless();
+ org.evosuite.runtime.Runtime.getInstance().resetRuntime();
+ org.evosuite.runtime.agent.InstrumentingAgent.activate();
+ }
+
+ @After
+ public void doneWithTestCase(){
+ threadStopper.killAndJoinClientThreads();
+ org.evosuite.runtime.jvm.ShutdownHookHandler.getInstance().safeExecuteAddedHooks();
+ org.evosuite.runtime.classhandling.JDKClassResetter.reset();
+ resetClasses();
+ org.evosuite.runtime.sandbox.Sandbox.doneWithExecutingSUTCode();
+ org.evosuite.runtime.agent.InstrumentingAgent.deactivate();
+ org.evosuite.runtime.GuiSupport.restoreHeadlessMode();
+ }
+
+ private static void initializeClasses() {
+ org.evosuite.runtime.classhandling.ClassStateSupport.initializeClasses(ModelESTestscaffolding.class.getClassLoader() ,
+ "org.openecomp.mso.logger.MessageEnum",
+ "com.att.eelf.i18n.EELFResolvableErrorEnum",
+ "org.openecomp.mso.logger.MsoLogger$Catalog",
+ "org.openecomp.mso.logger.MsoLogger$StatusCode",
+ "com.att.eelf.i18n.EELFResourceManager$RESOURCE_TYPES",
+ "org.openecomp.mso.db.catalog.utils.MavenLikeVersioning",
+ "org.openecomp.mso.db.catalog.beans.Model",
+ "com.att.eelf.configuration.EELFManager",
+ "com.att.eelf.configuration.EELFLogger",
+ "com.att.eelf.i18n.EELFMsgs",
+ "org.openecomp.mso.entity.MsoRequest",
+ "com.att.eelf.configuration.EELFLogger$Level",
+ "org.openecomp.mso.db.catalog.beans.ServiceRecipe",
+ "org.openecomp.mso.logger.MsoLogger$ResponseCode",
+ "com.att.eelf.configuration.SLF4jWrapper",
+ "com.att.eelf.i18n.EELFResourceManager",
+ "org.openecomp.mso.logger.MsoLogger",
+ "org.openecomp.mso.logger.MsoLogger$ErrorCode"
+ );
+ }
+
+ private static void resetClasses() {
+ org.evosuite.runtime.classhandling.ClassResetter.getInstance().setClassLoader(ModelESTestscaffolding.class.getClassLoader());
+
+ org.evosuite.runtime.classhandling.ClassStateSupport.resetClasses(
+ "org.openecomp.mso.logger.MsoLogger$Catalog",
+ "org.openecomp.mso.logger.MsoLogger",
+ "com.att.eelf.i18n.EELFResourceManager",
+ "com.att.eelf.i18n.EELFMsgs",
+ "com.att.eelf.i18n.EELFResourceManager$RESOURCE_TYPES",
+ "com.att.eelf.configuration.EELFLogger$Level",
+ "com.att.eelf.configuration.EELFManager",
+ "org.openecomp.mso.logger.MessageEnum",
+ "org.openecomp.mso.db.catalog.beans.ServiceRecipe"
+ );
+ }
+}
diff --git a/mso-catalog-db/src/test/java/org/openecomp/mso/db/catalog/beans/ModelRecipeESTest.java b/mso-catalog-db/src/test/java/org/openecomp/mso/db/catalog/beans/ModelRecipeESTest.java
new file mode 100644
index 0000000000..d148e94246
--- /dev/null
+++ b/mso-catalog-db/src/test/java/org/openecomp/mso/db/catalog/beans/ModelRecipeESTest.java
@@ -0,0 +1,287 @@
+/*
+ * This file was automatically generated by EvoSuite
+ * Wed Feb 22 09:32:08 GMT 2017
+ */
+
+package org.openecomp.mso.db.catalog.beans;
+
+import org.junit.Test;
+import static org.junit.Assert.*;
+import static org.evosuite.runtime.EvoAssertions.*;
+import java.sql.Timestamp;
+import org.evosuite.runtime.EvoRunner;
+import org.evosuite.runtime.EvoRunnerParameters;
+import org.junit.runner.RunWith;
+
+@RunWith(EvoRunner.class) @EvoRunnerParameters(mockJVMNonDeterminism = true, useVFS = true, useVNET = true, resetStaticState = true, useJEE = true)
+public class ModelRecipeESTest extends ModelRecipeESTestscaffolding {
+
+ @Test(timeout = 4000)
+ public void test00() throws Throwable {
+ ModelRecipe modelRecipe0 = new ModelRecipe();
+ modelRecipe0.setSchemaVersion("594t4m7A7,kaNK");
+ String string0 = modelRecipe0.getSchemaVersion();
+ assertEquals("594t4m7A7,kaNK", string0);
+ }
+
+ @Test(timeout = 4000)
+ public void test01() throws Throwable {
+ ModelRecipe modelRecipe0 = new ModelRecipe();
+ Integer integer0 = new Integer(0);
+ modelRecipe0.setRecipeTimeout(integer0);
+ Integer integer1 = modelRecipe0.getRecipeTimeout();
+ assertEquals(0, (int)integer1);
+ }
+
+ @Test(timeout = 4000)
+ public void test02() throws Throwable {
+ ModelRecipe modelRecipe0 = new ModelRecipe();
+ Integer integer0 = new Integer(1303);
+ modelRecipe0.setRecipeTimeout(integer0);
+ Integer integer1 = modelRecipe0.getRecipeTimeout();
+ assertEquals(1303, (int)integer1);
+ }
+
+ @Test(timeout = 4000)
+ public void test03() throws Throwable {
+ ModelRecipe modelRecipe0 = new ModelRecipe();
+ Integer integer0 = new Integer((-8));
+ modelRecipe0.setRecipeTimeout(integer0);
+ Integer integer1 = modelRecipe0.getRecipeTimeout();
+ assertEquals((-8), (int)integer1);
+ }
+
+ @Test(timeout = 4000)
+ public void test04() throws Throwable {
+ ModelRecipe modelRecipe0 = new ModelRecipe();
+ modelRecipe0.setOrchestrationUri("+");
+ String string0 = modelRecipe0.getOrchestrationUri();
+ assertEquals("+", string0);
+ }
+
+ @Test(timeout = 4000)
+ public void test05() throws Throwable {
+ ModelRecipe modelRecipe0 = new ModelRecipe();
+ modelRecipe0.setModelParamXSD("");
+ String string0 = modelRecipe0.getModelParamXSD();
+ assertEquals("", string0);
+ }
+
+ @Test(timeout = 4000)
+ public void test06() throws Throwable {
+ ModelRecipe modelRecipe0 = new ModelRecipe();
+ Integer integer0 = new Integer(1);
+ modelRecipe0.setModelId(integer0);
+ Integer integer1 = modelRecipe0.getModelId();
+ assertEquals(1, (int)integer1);
+ }
+
+ @Test(timeout = 4000)
+ public void test07() throws Throwable {
+ ModelRecipe modelRecipe0 = new ModelRecipe();
+ Integer integer0 = new Integer((-8));
+ modelRecipe0.setModelId(integer0);
+ Integer integer1 = modelRecipe0.getModelId();
+ assertEquals((-8), (int)integer1);
+ }
+
+ @Test(timeout = 4000)
+ public void test08() throws Throwable {
+ ModelRecipe modelRecipe0 = new ModelRecipe();
+ modelRecipe0.setId(2372);
+ int int0 = modelRecipe0.getId();
+ assertEquals(2372, int0);
+ }
+
+ @Test(timeout = 4000)
+ public void test09() throws Throwable {
+ ModelRecipe modelRecipe0 = new ModelRecipe();
+ modelRecipe0.setId((-438));
+ int int0 = modelRecipe0.getId();
+ assertEquals((-438), int0);
+ }
+
+ @Test(timeout = 4000)
+ public void test10() throws Throwable {
+ ModelRecipe modelRecipe0 = new ModelRecipe();
+ modelRecipe0.setDescription("D|`<b3b");
+ String string0 = modelRecipe0.getDescription();
+ assertEquals("D|`<b3b", string0);
+ }
+
+ @Test(timeout = 4000)
+ public void test11() throws Throwable {
+ ModelRecipe modelRecipe0 = new ModelRecipe();
+ Timestamp timestamp0 = new Timestamp(0L);
+ modelRecipe0.setCreated(timestamp0);
+ Timestamp timestamp1 = modelRecipe0.getCreated();
+ assertSame(timestamp1, timestamp0);
+ }
+
+ @Test(timeout = 4000)
+ public void test12() throws Throwable {
+ ModelRecipe modelRecipe0 = new ModelRecipe();
+ Timestamp timestamp0 = new Timestamp(619L);
+ modelRecipe0.setCreated(timestamp0);
+ Timestamp timestamp1 = modelRecipe0.getCreated();
+ assertEquals("1970-01-01 00:00:00.619", timestamp1.toString());
+ }
+
+ @Test(timeout = 4000)
+ public void test13() throws Throwable {
+ ModelRecipe modelRecipe0 = new ModelRecipe();
+ modelRecipe0.setAction("hz4FY");
+ String string0 = modelRecipe0.getAction();
+ assertEquals("hz4FY", string0);
+ }
+
+ @Test(timeout = 4000)
+ public void test14() throws Throwable {
+ ModelRecipe modelRecipe0 = new ModelRecipe();
+ modelRecipe0.setAction("");
+ String string0 = modelRecipe0.getAction();
+ assertEquals("", string0);
+ }
+
+ @Test(timeout = 4000)
+ public void test15() throws Throwable {
+ ModelRecipe modelRecipe0 = new ModelRecipe();
+ // Undeclared exception!
+ try {
+ modelRecipe0.toString();
+ fail("Expecting exception: NullPointerException");
+
+ } catch(NullPointerException e) {
+ //
+ // no message in exception (getMessage() returned null)
+ //
+ verifyException("org.openecomp.mso.db.catalog.beans.ModelRecipe", e);
+ }
+ }
+
+ @Test(timeout = 4000)
+ public void test16() throws Throwable {
+ ModelRecipe modelRecipe0 = new ModelRecipe();
+ Integer integer0 = new Integer(7);
+ modelRecipe0.setRecipeTimeout(integer0);
+ modelRecipe0.setModelId(integer0);
+ String string0 = modelRecipe0.toString();
+ assertEquals("ModelRecipe: modelId=7,action=null,schemaVersion=null,orchestrationUri=null,modelParamXSD=null,recipeTimeout=7", string0);
+ }
+
+ @Test(timeout = 4000)
+ public void test17() throws Throwable {
+ ModelRecipe modelRecipe0 = new ModelRecipe();
+ Integer integer0 = modelRecipe0.getModelId();
+ assertNull(integer0);
+ }
+
+ @Test(timeout = 4000)
+ public void test18() throws Throwable {
+ ModelRecipe modelRecipe0 = new ModelRecipe();
+ Integer integer0 = new Integer(0);
+ modelRecipe0.setRecipeTimeout(integer0);
+ modelRecipe0.setModelId(integer0);
+ Timestamp timestamp0 = new Timestamp((long) 0);
+ modelRecipe0.setCreated(timestamp0);
+ String string0 = modelRecipe0.toString();
+ assertEquals("ModelRecipe: modelId=0,action=null,schemaVersion=null,orchestrationUri=null,modelParamXSD=null,recipeTimeout=0,created=1/1/70 12:00 AM", string0);
+ }
+
+ @Test(timeout = 4000)
+ public void test19() throws Throwable {
+ ModelRecipe modelRecipe0 = new ModelRecipe();
+ String string0 = modelRecipe0.getAction();
+ assertNull(string0);
+ }
+
+ @Test(timeout = 4000)
+ public void test20() throws Throwable {
+ ModelRecipe modelRecipe0 = new ModelRecipe();
+ modelRecipe0.setDescription("");
+ String string0 = modelRecipe0.getDescription();
+ assertEquals("", string0);
+ }
+
+ @Test(timeout = 4000)
+ public void test21() throws Throwable {
+ ModelRecipe modelRecipe0 = new ModelRecipe();
+ modelRecipe0.setModelParamXSD("nb[xSaP");
+ String string0 = modelRecipe0.getModelParamXSD();
+ assertEquals("nb[xSaP", string0);
+ }
+
+ @Test(timeout = 4000)
+ public void test22() throws Throwable {
+ ModelRecipe modelRecipe0 = new ModelRecipe();
+ modelRecipe0.setSchemaVersion("");
+ String string0 = modelRecipe0.getSchemaVersion();
+ assertEquals("", string0);
+ }
+
+ @Test(timeout = 4000)
+ public void test23() throws Throwable {
+ ModelRecipe modelRecipe0 = new ModelRecipe();
+ Integer integer0 = new Integer(0);
+ modelRecipe0.setModelId(integer0);
+ Integer integer1 = modelRecipe0.getModelId();
+ assertEquals(0, (int)integer1);
+ }
+
+ @Test(timeout = 4000)
+ public void test24() throws Throwable {
+ ModelRecipe modelRecipe0 = new ModelRecipe();
+ int int0 = modelRecipe0.getId();
+ assertEquals(0, int0);
+ }
+
+ @Test(timeout = 4000)
+ public void test25() throws Throwable {
+ ModelRecipe modelRecipe0 = new ModelRecipe();
+ String string0 = modelRecipe0.getDescription();
+ assertNull(string0);
+ }
+
+ @Test(timeout = 4000)
+ public void test26() throws Throwable {
+ ModelRecipe modelRecipe0 = new ModelRecipe();
+ String string0 = modelRecipe0.getSchemaVersion();
+ assertNull(string0);
+ }
+
+ @Test(timeout = 4000)
+ public void test27() throws Throwable {
+ ModelRecipe modelRecipe0 = new ModelRecipe();
+ Integer integer0 = modelRecipe0.getRecipeTimeout();
+ assertNull(integer0);
+ }
+
+ @Test(timeout = 4000)
+ public void test28() throws Throwable {
+ ModelRecipe modelRecipe0 = new ModelRecipe();
+ String string0 = modelRecipe0.getOrchestrationUri();
+ assertNull(string0);
+ }
+
+ @Test(timeout = 4000)
+ public void test29() throws Throwable {
+ ModelRecipe modelRecipe0 = new ModelRecipe();
+ Timestamp timestamp0 = modelRecipe0.getCreated();
+ assertNull(timestamp0);
+ }
+
+ @Test(timeout = 4000)
+ public void test30() throws Throwable {
+ ModelRecipe modelRecipe0 = new ModelRecipe();
+ modelRecipe0.setOrchestrationUri("");
+ String string0 = modelRecipe0.getOrchestrationUri();
+ assertEquals("", string0);
+ }
+
+ @Test(timeout = 4000)
+ public void test31() throws Throwable {
+ ModelRecipe modelRecipe0 = new ModelRecipe();
+ String string0 = modelRecipe0.getModelParamXSD();
+ assertNull(string0);
+ }
+}
diff --git a/mso-catalog-db/src/test/java/org/openecomp/mso/db/catalog/beans/ModelRecipeESTestscaffolding.java b/mso-catalog-db/src/test/java/org/openecomp/mso/db/catalog/beans/ModelRecipeESTestscaffolding.java
new file mode 100644
index 0000000000..710e5372f6
--- /dev/null
+++ b/mso-catalog-db/src/test/java/org/openecomp/mso/db/catalog/beans/ModelRecipeESTestscaffolding.java
@@ -0,0 +1,77 @@
+/**
+ * Scaffolding file used to store all the setups needed to run
+ * tests automatically generated by EvoSuite
+ * Wed Feb 22 09:32:08 GMT 2017
+ */
+
+package org.openecomp.mso.db.catalog.beans;
+
+import org.evosuite.runtime.annotation.EvoSuiteClassExclude;
+import org.junit.BeforeClass;
+import org.junit.Before;
+import org.junit.After;
+import org.junit.AfterClass;
+import org.evosuite.runtime.sandbox.Sandbox;
+
+@EvoSuiteClassExclude
+public class ModelRecipeESTestscaffolding {
+
+ @org.junit.Rule
+ public org.evosuite.runtime.vnet.NonFunctionalRequirementRule nfr = new org.evosuite.runtime.vnet.NonFunctionalRequirementRule();
+
+ private static final java.util.Properties defaultProperties = (java.util.Properties) java.lang.System.getProperties().clone();
+
+ private org.evosuite.runtime.thread.ThreadStopper threadStopper = new org.evosuite.runtime.thread.ThreadStopper (org.evosuite.runtime.thread.KillSwitchHandler.getInstance(), 3000);
+
+ @BeforeClass
+ public static void initEvoSuiteFramework() {
+ org.evosuite.runtime.RuntimeSettings.className = "org.openecomp.mso.db.catalog.beans.ModelRecipe";
+ org.evosuite.runtime.GuiSupport.initialize();
+ org.evosuite.runtime.RuntimeSettings.maxNumberOfThreads = 100;
+ org.evosuite.runtime.RuntimeSettings.maxNumberOfIterationsPerLoop = 10000;
+ org.evosuite.runtime.RuntimeSettings.mockSystemIn = true;
+ org.evosuite.runtime.RuntimeSettings.sandboxMode = org.evosuite.runtime.sandbox.Sandbox.SandboxMode.RECOMMENDED;
+ org.evosuite.runtime.sandbox.Sandbox.initializeSecurityManagerForSUT();
+ org.evosuite.runtime.classhandling.JDKClassResetter.init();
+ initializeClasses();
+ org.evosuite.runtime.Runtime.getInstance().resetRuntime();
+ }
+
+ @AfterClass
+ public static void clearEvoSuiteFramework(){
+ Sandbox.resetDefaultSecurityManager();
+ java.lang.System.setProperties((java.util.Properties) defaultProperties.clone());
+ }
+
+ @Before
+ public void initTestCase(){
+ threadStopper.storeCurrentThreads();
+ threadStopper.startRecordingTime();
+ org.evosuite.runtime.jvm.ShutdownHookHandler.getInstance().initHandler();
+ org.evosuite.runtime.sandbox.Sandbox.goingToExecuteSUTCode();
+ org.evosuite.runtime.GuiSupport.setHeadless();
+ org.evosuite.runtime.Runtime.getInstance().resetRuntime();
+ org.evosuite.runtime.agent.InstrumentingAgent.activate();
+ }
+
+ @After
+ public void doneWithTestCase(){
+ threadStopper.killAndJoinClientThreads();
+ org.evosuite.runtime.jvm.ShutdownHookHandler.getInstance().safeExecuteAddedHooks();
+ org.evosuite.runtime.classhandling.JDKClassResetter.reset();
+ resetClasses();
+ org.evosuite.runtime.sandbox.Sandbox.doneWithExecutingSUTCode();
+ org.evosuite.runtime.agent.InstrumentingAgent.deactivate();
+ org.evosuite.runtime.GuiSupport.restoreHeadlessMode();
+ }
+
+ private static void initializeClasses() {
+ org.evosuite.runtime.classhandling.ClassStateSupport.initializeClasses(ModelRecipeESTestscaffolding.class.getClassLoader() ,
+ "org.openecomp.mso.db.catalog.utils.MavenLikeVersioning",
+ "org.openecomp.mso.db.catalog.beans.ModelRecipe"
+ );
+ }
+
+ private static void resetClasses() {
+ }
+}
diff --git a/mso-catalog-db/src/test/java/org/openecomp/mso/db/catalog/beans/ServiceMacroHolderESTest.java b/mso-catalog-db/src/test/java/org/openecomp/mso/db/catalog/beans/ServiceMacroHolderESTest.java
new file mode 100644
index 0000000000..eafc69906f
--- /dev/null
+++ b/mso-catalog-db/src/test/java/org/openecomp/mso/db/catalog/beans/ServiceMacroHolderESTest.java
@@ -0,0 +1,261 @@
+/*
+ * This file was automatically generated by EvoSuite
+ * Tue Feb 21 15:49:25 GMT 2017
+ */
+
+package org.openecomp.mso.db.catalog.beans;
+
+import org.junit.Test;
+import static org.junit.Assert.*;
+import static org.evosuite.shaded.org.mockito.Mockito.*;
+import static org.evosuite.runtime.EvoAssertions.*;
+import java.util.ArrayList;
+import org.evosuite.runtime.EvoRunner;
+import org.evosuite.runtime.EvoRunnerParameters;
+import org.evosuite.runtime.PrivateAccess;
+import org.evosuite.runtime.ViolatedAssumptionAnswer;
+import org.junit.runner.RunWith;
+
+@RunWith(EvoRunner.class) @EvoRunnerParameters(mockJVMNonDeterminism = true, useVFS = true, useVNET = true, resetStaticState = true, useJEE = true)
+public class ServiceMacroHolderESTest extends ServiceMacroHolderESTestscaffolding {
+
+ @Test(timeout = 4000)
+ public void test00() throws Throwable {
+ Service service0 = new Service();
+ ServiceMacroHolder serviceMacroHolder0 = new ServiceMacroHolder(service0);
+ serviceMacroHolder0.setVnfResources((ArrayList<VnfResource>) null);
+ ArrayList<VnfResource> arrayList0 = serviceMacroHolder0.getVnfResources();
+ assertNull(arrayList0);
+ }
+
+ @Test(timeout = 4000)
+ public void test01() throws Throwable {
+ ServiceMacroHolder serviceMacroHolder0 = new ServiceMacroHolder();
+ VnfResource vnfResource0 = new VnfResource();
+ serviceMacroHolder0.addVnfResource(vnfResource0);
+ ArrayList<VnfResource> arrayList0 = serviceMacroHolder0.getVnfResources();
+ assertEquals(1, arrayList0.size());
+ }
+
+ @Test(timeout = 4000)
+ public void test02() throws Throwable {
+ ServiceMacroHolder serviceMacroHolder0 = new ServiceMacroHolder();
+ Service service0 = serviceMacroHolder0.getService();
+ assertNull(service0);
+ }
+
+ @Test(timeout = 4000)
+ public void test03() throws Throwable {
+ Service service0 = new Service();
+ ServiceMacroHolder serviceMacroHolder0 = new ServiceMacroHolder(service0);
+ service0.setId(1124);
+ Service service1 = serviceMacroHolder0.getService();
+ assertNull(service1.getServiceNameVersionId());
+ }
+
+ @Test(timeout = 4000)
+ public void test04() throws Throwable {
+ Service service0 = new Service();
+ ServiceMacroHolder serviceMacroHolder0 = new ServiceMacroHolder(service0);
+ service0.setId((-760));
+ Service service1 = serviceMacroHolder0.getService();
+ assertNull(service1.getServiceNameVersionId());
+ }
+
+ @Test(timeout = 4000)
+ public void test05() throws Throwable {
+ ServiceMacroHolder serviceMacroHolder0 = new ServiceMacroHolder();
+ NetworkResourceCustomization networkResourceCustomization0 = new NetworkResourceCustomization();
+ serviceMacroHolder0.addNetworkResourceCustomization(networkResourceCustomization0);
+ ArrayList<NetworkResourceCustomization> arrayList0 = serviceMacroHolder0.getNetworkResourceCustomization();
+ assertFalse(arrayList0.isEmpty());
+ }
+
+ @Test(timeout = 4000)
+ public void test06() throws Throwable {
+ ServiceMacroHolder serviceMacroHolder0 = new ServiceMacroHolder();
+ serviceMacroHolder0.setAllottedResourceCustomization((ArrayList<AllottedResourceCustomization>) null);
+ ArrayList<AllottedResourceCustomization> arrayList0 = serviceMacroHolder0.getAllottedResourceCustomization();
+ assertNull(arrayList0);
+ }
+
+ @Test(timeout = 4000)
+ public void test07() throws Throwable {
+ ServiceMacroHolder serviceMacroHolder0 = new ServiceMacroHolder();
+ AllottedResourceCustomization allottedResourceCustomization0 = new AllottedResourceCustomization();
+ serviceMacroHolder0.addAllottedResourceCustomization(allottedResourceCustomization0);
+ ArrayList<AllottedResourceCustomization> arrayList0 = serviceMacroHolder0.getAllottedResourceCustomization();
+ assertFalse(arrayList0.isEmpty());
+ }
+
+ @Test(timeout = 4000)
+ public void test08() throws Throwable {
+ ServiceMacroHolder serviceMacroHolder0 = new ServiceMacroHolder();
+ serviceMacroHolder0.setAllottedResourceCustomization((ArrayList<AllottedResourceCustomization>) null);
+ String string0 = serviceMacroHolder0.toString();
+ assertEquals("ServicePlus: service: nullnone", string0);
+ }
+
+ @Test(timeout = 4000)
+ public void test09() throws Throwable {
+ ServiceMacroHolder serviceMacroHolder0 = new ServiceMacroHolder();
+ serviceMacroHolder0.setNetworkResourceCustomization((ArrayList<NetworkResourceCustomization>) null);
+ String string0 = serviceMacroHolder0.toString();
+ assertEquals("ServicePlus: service: nullnone", string0);
+ }
+
+ @Test(timeout = 4000)
+ public void test10() throws Throwable {
+ Service service0 = mock(Service.class, new ViolatedAssumptionAnswer());
+ doReturn((String) null).when(service0).toString();
+ ServiceMacroHolder serviceMacroHolder0 = new ServiceMacroHolder(service0);
+ ArrayList<Object> arrayList0 = new ArrayList<Object>();
+ arrayList0.add((Object) serviceMacroHolder0);
+ PrivateAccess.setVariable((Class<ServiceMacroHolder>) ServiceMacroHolder.class, serviceMacroHolder0, "vnfResources", (Object) arrayList0);
+ // Undeclared exception!
+ try {
+ serviceMacroHolder0.toString();
+ fail("Expecting exception: ClassCastException");
+
+ } catch(ClassCastException e) {
+ //
+ // org.openecomp.mso.db.catalog.beans.ServiceMacroHolder cannot be cast to org.openecomp.mso.db.catalog.beans.VnfResource
+ //
+ verifyException("org.openecomp.mso.db.catalog.beans.ServiceMacroHolder", e);
+ }
+ }
+
+ @Test(timeout = 4000)
+ public void test11() throws Throwable {
+ ServiceMacroHolder serviceMacroHolder0 = new ServiceMacroHolder();
+ serviceMacroHolder0.setVnfResources((ArrayList<VnfResource>) null);
+ String string0 = serviceMacroHolder0.toString();
+ assertEquals("ServicePlus: service: nullnone", string0);
+ }
+
+ @Test(timeout = 4000)
+ public void test12() throws Throwable {
+ Service service0 = new Service();
+ ServiceMacroHolder serviceMacroHolder0 = new ServiceMacroHolder(service0);
+ // Undeclared exception!
+ try {
+ serviceMacroHolder0.toString();
+ fail("Expecting exception: NullPointerException");
+
+ } catch(NullPointerException e) {
+ //
+ // no message in exception (getMessage() returned null)
+ //
+ verifyException("org.openecomp.mso.db.catalog.beans.Service", e);
+ }
+ }
+
+ @Test(timeout = 4000)
+ public void test13() throws Throwable {
+ ServiceMacroHolder serviceMacroHolder0 = new ServiceMacroHolder();
+ AllottedResourceCustomization allottedResourceCustomization0 = new AllottedResourceCustomization();
+ serviceMacroHolder0.addAllottedResourceCustomization(allottedResourceCustomization0);
+ String string0 = serviceMacroHolder0.toString();
+ assertEquals("ServicePlus: service: nullnoneAllottedResourceCustomizations:ARC[0]: modelName=null,modelVersion=null,version=null,modelUuid=null,modelInvariantUuid=null,modelCustomizationUuid=null,modelInstanceName=null,description=null,modelInstanceName=null,created=null", string0);
+ }
+
+ @Test(timeout = 4000)
+ public void test14() throws Throwable {
+ ServiceMacroHolder serviceMacroHolder0 = new ServiceMacroHolder();
+ NetworkResourceCustomization networkResourceCustomization0 = new NetworkResourceCustomization();
+ serviceMacroHolder0.addNetworkResourceCustomization(networkResourceCustomization0);
+ String string0 = serviceMacroHolder0.toString();
+ assertEquals("ServicePlus: service: nullnoneNetworkResourceCustomizations:NRC[0]: modelName=nullmodelUuid=nullmodelUuid=nullmodelInvariantUuid=nullmodelVersion=nullmodelCustomizationUuid=nullmodelInstanceName=nullnetworkResourceId=0networkType=null", string0);
+ }
+
+ @Test(timeout = 4000)
+ public void test15() throws Throwable {
+ ServiceMacroHolder serviceMacroHolder0 = new ServiceMacroHolder();
+ NetworkResourceCustomization networkResourceCustomization0 = new NetworkResourceCustomization();
+ serviceMacroHolder0.setNetworkResourceCustomization((ArrayList<NetworkResourceCustomization>) null);
+ serviceMacroHolder0.addNetworkResourceCustomization(networkResourceCustomization0);
+ assertNull(networkResourceCustomization0.getModelInstanceName());
+ }
+
+ @Test(timeout = 4000)
+ public void test16() throws Throwable {
+ ServiceMacroHolder serviceMacroHolder0 = new ServiceMacroHolder();
+ serviceMacroHolder0.setVnfResources((ArrayList<VnfResource>) null);
+ VnfResource vnfResource0 = new VnfResource();
+ serviceMacroHolder0.addVnfResource(vnfResource0);
+ assertNull(vnfResource0.getModelCustomizationUuid());
+ }
+
+ @Test(timeout = 4000)
+ public void test17() throws Throwable {
+ ServiceMacroHolder serviceMacroHolder0 = new ServiceMacroHolder();
+ VnfResource vnfResource0 = new VnfResource();
+ serviceMacroHolder0.addVnfResource(vnfResource0);
+ String string0 = serviceMacroHolder0.toString();
+ assertEquals("ServicePlus: service: nullVnfResources: , vnfResource[0]:VNF=null,version=null,mode=null,template=null,envtId=null,asdcUuid=null,aicVersionMin=null,aicVersionMax=null,modelInvariantUuid=null,modelVersion=null,modelCustomizationName=null,modelName=null,serviceModelInvariantUUID=null,modelCustomizationUuid=nullVfModules: NONE", string0);
+ }
+
+ @Test(timeout = 4000)
+ public void test18() throws Throwable {
+ ServiceMacroHolder serviceMacroHolder0 = new ServiceMacroHolder();
+ serviceMacroHolder0.addVnfResource((VnfResource) null);
+ }
+
+ @Test(timeout = 4000)
+ public void test19() throws Throwable {
+ Service service0 = new Service();
+ ServiceMacroHolder serviceMacroHolder0 = new ServiceMacroHolder(service0);
+ serviceMacroHolder0.setNetworkResourceCustomization((ArrayList<NetworkResourceCustomization>) null);
+ ArrayList<NetworkResourceCustomization> arrayList0 = serviceMacroHolder0.getNetworkResourceCustomization();
+ assertNull(arrayList0);
+ }
+
+ @Test(timeout = 4000)
+ public void test20() throws Throwable {
+ Service service0 = new Service();
+ ServiceMacroHolder serviceMacroHolder0 = new ServiceMacroHolder(service0);
+ Service service1 = serviceMacroHolder0.getService();
+ assertNull(service1.getModelInvariantUUID());
+ }
+
+ @Test(timeout = 4000)
+ public void test21() throws Throwable {
+ Service service0 = new Service();
+ ServiceMacroHolder serviceMacroHolder0 = new ServiceMacroHolder(service0);
+ ArrayList<NetworkResourceCustomization> arrayList0 = serviceMacroHolder0.getNetworkResourceCustomization();
+ assertEquals(0, arrayList0.size());
+ }
+
+ @Test(timeout = 4000)
+ public void test22() throws Throwable {
+ ServiceMacroHolder serviceMacroHolder0 = new ServiceMacroHolder();
+ serviceMacroHolder0.setAllottedResourceCustomization((ArrayList<AllottedResourceCustomization>) null);
+ AllottedResourceCustomization allottedResourceCustomization0 = new AllottedResourceCustomization();
+ serviceMacroHolder0.addAllottedResourceCustomization(allottedResourceCustomization0);
+ assertNull(allottedResourceCustomization0.getVersion());
+ }
+
+ @Test(timeout = 4000)
+ public void test23() throws Throwable {
+ ServiceMacroHolder serviceMacroHolder0 = new ServiceMacroHolder();
+ Service service0 = new Service();
+ serviceMacroHolder0.setService(service0);
+ assertNull(service0.getModelInvariantUUID());
+ }
+
+ @Test(timeout = 4000)
+ public void test24() throws Throwable {
+ Service service0 = new Service();
+ ServiceMacroHolder serviceMacroHolder0 = new ServiceMacroHolder(service0);
+ ArrayList<AllottedResourceCustomization> arrayList0 = serviceMacroHolder0.getAllottedResourceCustomization();
+ assertEquals(0, arrayList0.size());
+ }
+
+ @Test(timeout = 4000)
+ public void test25() throws Throwable {
+ Service service0 = new Service();
+ ServiceMacroHolder serviceMacroHolder0 = new ServiceMacroHolder(service0);
+ ArrayList<VnfResource> arrayList0 = serviceMacroHolder0.getVnfResources();
+ assertTrue(arrayList0.isEmpty());
+ }
+}
diff --git a/mso-catalog-db/src/test/java/org/openecomp/mso/db/catalog/beans/ServiceMacroHolderESTestscaffolding.java b/mso-catalog-db/src/test/java/org/openecomp/mso/db/catalog/beans/ServiceMacroHolderESTestscaffolding.java
new file mode 100644
index 0000000000..43ccd7b728
--- /dev/null
+++ b/mso-catalog-db/src/test/java/org/openecomp/mso/db/catalog/beans/ServiceMacroHolderESTestscaffolding.java
@@ -0,0 +1,97 @@
+/**
+ * Scaffolding file used to store all the setups needed to run
+ * tests automatically generated by EvoSuite
+ * Tue Feb 21 15:49:25 GMT 2017
+ */
+
+package org.openecomp.mso.db.catalog.beans;
+
+import org.evosuite.runtime.annotation.EvoSuiteClassExclude;
+import org.junit.BeforeClass;
+import org.junit.Before;
+import org.junit.After;
+import org.junit.AfterClass;
+import org.evosuite.runtime.sandbox.Sandbox;
+
+@EvoSuiteClassExclude
+public class ServiceMacroHolderESTestscaffolding {
+
+ @org.junit.Rule
+ public org.evosuite.runtime.vnet.NonFunctionalRequirementRule nfr = new org.evosuite.runtime.vnet.NonFunctionalRequirementRule();
+
+ private static final java.util.Properties defaultProperties = (java.util.Properties) java.lang.System.getProperties().clone();
+
+ private org.evosuite.runtime.thread.ThreadStopper threadStopper = new org.evosuite.runtime.thread.ThreadStopper (org.evosuite.runtime.thread.KillSwitchHandler.getInstance(), 3000);
+
+ @BeforeClass
+ public static void initEvoSuiteFramework() {
+ org.evosuite.runtime.RuntimeSettings.className = "org.openecomp.mso.db.catalog.beans.ServiceMacroHolder";
+ org.evosuite.runtime.GuiSupport.initialize();
+ org.evosuite.runtime.RuntimeSettings.maxNumberOfThreads = 100;
+ org.evosuite.runtime.RuntimeSettings.maxNumberOfIterationsPerLoop = 10000;
+ org.evosuite.runtime.RuntimeSettings.mockSystemIn = true;
+ org.evosuite.runtime.RuntimeSettings.sandboxMode = org.evosuite.runtime.sandbox.Sandbox.SandboxMode.RECOMMENDED;
+ org.evosuite.runtime.sandbox.Sandbox.initializeSecurityManagerForSUT();
+ org.evosuite.runtime.classhandling.JDKClassResetter.init();
+ initializeClasses();
+ org.evosuite.runtime.Runtime.getInstance().resetRuntime();
+ }
+
+ @AfterClass
+ public static void clearEvoSuiteFramework(){
+ Sandbox.resetDefaultSecurityManager();
+ java.lang.System.setProperties((java.util.Properties) defaultProperties.clone());
+ }
+
+ @Before
+ public void initTestCase(){
+ threadStopper.storeCurrentThreads();
+ threadStopper.startRecordingTime();
+ org.evosuite.runtime.jvm.ShutdownHookHandler.getInstance().initHandler();
+ org.evosuite.runtime.sandbox.Sandbox.goingToExecuteSUTCode();
+ org.evosuite.runtime.GuiSupport.setHeadless();
+ org.evosuite.runtime.Runtime.getInstance().resetRuntime();
+ org.evosuite.runtime.agent.InstrumentingAgent.activate();
+ }
+
+ @After
+ public void doneWithTestCase(){
+ threadStopper.killAndJoinClientThreads();
+ org.evosuite.runtime.jvm.ShutdownHookHandler.getInstance().safeExecuteAddedHooks();
+ org.evosuite.runtime.classhandling.JDKClassResetter.reset();
+ resetClasses();
+ org.evosuite.runtime.sandbox.Sandbox.doneWithExecutingSUTCode();
+ org.evosuite.runtime.agent.InstrumentingAgent.deactivate();
+ org.evosuite.runtime.GuiSupport.restoreHeadlessMode();
+ }
+
+ private static void initializeClasses() {
+ org.evosuite.runtime.classhandling.ClassStateSupport.initializeClasses(ServiceMacroHolderESTestscaffolding.class.getClassLoader() ,
+ "org.openecomp.mso.db.catalog.beans.VfModule",
+ "com.att.eelf.i18n.EELFResolvableErrorEnum",
+ "org.openecomp.mso.db.catalog.beans.Service",
+ "org.openecomp.mso.db.catalog.beans.NetworkResource",
+ "org.openecomp.mso.db.catalog.beans.NetworkResourceCustomization",
+ "org.openecomp.mso.db.catalog.utils.MavenLikeVersioning",
+ "org.openecomp.mso.db.catalog.beans.VnfResource",
+ "org.openecomp.mso.db.catalog.beans.AllottedResourceCustomization",
+ "org.openecomp.mso.db.catalog.beans.ServiceMacroHolder"
+ );
+ }
+
+ private static void resetClasses() {
+ org.evosuite.runtime.classhandling.ClassResetter.getInstance().setClassLoader(ServiceMacroHolderESTestscaffolding.class.getClassLoader());
+
+ org.evosuite.runtime.classhandling.ClassStateSupport.resetClasses(
+ "org.openecomp.mso.logger.MsoLogger$Catalog",
+ "org.openecomp.mso.logger.MsoLogger",
+ "com.att.eelf.i18n.EELFResourceManager",
+ "com.att.eelf.i18n.EELFMsgs",
+ "com.att.eelf.i18n.EELFResourceManager$RESOURCE_TYPES",
+ "com.att.eelf.configuration.EELFLogger$Level",
+ "com.att.eelf.configuration.EELFManager",
+ "org.openecomp.mso.logger.MessageEnum",
+ "org.openecomp.mso.db.catalog.beans.ServiceRecipe"
+ );
+ }
+}
diff --git a/mso-catalog-db/src/test/java/org/openecomp/mso/db/catalog/beans/ServiceToAllottedResourcesESTest.java b/mso-catalog-db/src/test/java/org/openecomp/mso/db/catalog/beans/ServiceToAllottedResourcesESTest.java
new file mode 100644
index 0000000000..84fbcb5391
--- /dev/null
+++ b/mso-catalog-db/src/test/java/org/openecomp/mso/db/catalog/beans/ServiceToAllottedResourcesESTest.java
@@ -0,0 +1,95 @@
+/*
+ * This file was automatically generated by EvoSuite
+ * Wed Feb 22 09:33:37 GMT 2017
+ */
+
+package org.openecomp.mso.db.catalog.beans;
+
+import org.junit.Test;
+import static org.junit.Assert.*;
+import java.sql.Timestamp;
+import org.evosuite.runtime.EvoRunner;
+import org.evosuite.runtime.EvoRunnerParameters;
+import org.junit.runner.RunWith;
+
+@RunWith(EvoRunner.class) @EvoRunnerParameters(mockJVMNonDeterminism = true, useVFS = true, useVNET = true, resetStaticState = true, useJEE = true)
+public class ServiceToAllottedResourcesESTest extends ServiceToAllottedResourcesESTestscaffolding {
+
+ @Test(timeout = 4000)
+ public void test0() throws Throwable {
+ ServiceToAllottedResources serviceToAllottedResources0 = new ServiceToAllottedResources();
+ serviceToAllottedResources0.setServiceModelUuid("serviceModelUuid=nullarModelCustomizationUuid=null");
+ String string0 = serviceToAllottedResources0.getServiceModelUuid();
+ assertEquals("serviceModelUuid=nullarModelCustomizationUuid=null", string0);
+ }
+
+ @Test(timeout = 4000)
+ public void test1() throws Throwable {
+ ServiceToAllottedResources serviceToAllottedResources0 = new ServiceToAllottedResources();
+ Timestamp timestamp0 = new Timestamp(0L);
+ serviceToAllottedResources0.setCreated(timestamp0);
+ Timestamp timestamp1 = serviceToAllottedResources0.getCreated();
+ assertEquals("1970-01-01 00:00:00.0", timestamp1.toString());
+ }
+
+ @Test(timeout = 4000)
+ public void test2() throws Throwable {
+ ServiceToAllottedResources serviceToAllottedResources0 = new ServiceToAllottedResources();
+ serviceToAllottedResources0.setArModelCustomizationUuid("D7q@");
+ String string0 = serviceToAllottedResources0.getArModelCustomizationUuid();
+ assertEquals("D7q@", string0);
+ }
+
+ @Test(timeout = 4000)
+ public void test3() throws Throwable {
+ ServiceToAllottedResources serviceToAllottedResources0 = new ServiceToAllottedResources();
+ serviceToAllottedResources0.setArModelCustomizationUuid("");
+ String string0 = serviceToAllottedResources0.getArModelCustomizationUuid();
+ assertEquals("", string0);
+ }
+
+ @Test(timeout = 4000)
+ public void test4() throws Throwable {
+ ServiceToAllottedResources serviceToAllottedResources0 = new ServiceToAllottedResources();
+ String string0 = serviceToAllottedResources0.toString();
+ assertEquals("serviceModelUuid=nullarModelCustomizationUuid=null", string0);
+ }
+
+ @Test(timeout = 4000)
+ public void test5() throws Throwable {
+ ServiceToAllottedResources serviceToAllottedResources0 = new ServiceToAllottedResources();
+ serviceToAllottedResources0.setServiceModelUuid("");
+ String string0 = serviceToAllottedResources0.getServiceModelUuid();
+ assertEquals("", string0);
+ }
+
+ @Test(timeout = 4000)
+ public void test6() throws Throwable {
+ ServiceToAllottedResources serviceToAllottedResources0 = new ServiceToAllottedResources();
+ Timestamp timestamp0 = new Timestamp((-683L));
+ serviceToAllottedResources0.setCreated(timestamp0);
+ Timestamp timestamp1 = serviceToAllottedResources0.getCreated();
+ assertEquals("1969-12-31 23:59:59.317", timestamp1.toString());
+ }
+
+ @Test(timeout = 4000)
+ public void test7() throws Throwable {
+ ServiceToAllottedResources serviceToAllottedResources0 = new ServiceToAllottedResources();
+ String string0 = serviceToAllottedResources0.getServiceModelUuid();
+ assertNull(string0);
+ }
+
+ @Test(timeout = 4000)
+ public void test8() throws Throwable {
+ ServiceToAllottedResources serviceToAllottedResources0 = new ServiceToAllottedResources();
+ String string0 = serviceToAllottedResources0.getArModelCustomizationUuid();
+ assertNull(string0);
+ }
+
+ @Test(timeout = 4000)
+ public void test9() throws Throwable {
+ ServiceToAllottedResources serviceToAllottedResources0 = new ServiceToAllottedResources();
+ Timestamp timestamp0 = serviceToAllottedResources0.getCreated();
+ assertNull(timestamp0);
+ }
+}
diff --git a/mso-catalog-db/src/test/java/org/openecomp/mso/db/catalog/beans/ServiceToAllottedResourcesESTestscaffolding.java b/mso-catalog-db/src/test/java/org/openecomp/mso/db/catalog/beans/ServiceToAllottedResourcesESTestscaffolding.java
new file mode 100644
index 0000000000..14ff62fb02
--- /dev/null
+++ b/mso-catalog-db/src/test/java/org/openecomp/mso/db/catalog/beans/ServiceToAllottedResourcesESTestscaffolding.java
@@ -0,0 +1,81 @@
+/**
+ * Scaffolding file used to store all the setups needed to run
+ * tests automatically generated by EvoSuite
+ * Wed Feb 22 09:33:37 GMT 2017
+ */
+
+package org.openecomp.mso.db.catalog.beans;
+
+import org.evosuite.runtime.annotation.EvoSuiteClassExclude;
+import org.junit.BeforeClass;
+import org.junit.Before;
+import org.junit.After;
+import org.junit.AfterClass;
+import org.evosuite.runtime.sandbox.Sandbox;
+
+@EvoSuiteClassExclude
+public class ServiceToAllottedResourcesESTestscaffolding {
+
+ @org.junit.Rule
+ public org.evosuite.runtime.vnet.NonFunctionalRequirementRule nfr = new org.evosuite.runtime.vnet.NonFunctionalRequirementRule();
+
+ private static final java.util.Properties defaultProperties = (java.util.Properties) java.lang.System.getProperties().clone();
+
+ private org.evosuite.runtime.thread.ThreadStopper threadStopper = new org.evosuite.runtime.thread.ThreadStopper (org.evosuite.runtime.thread.KillSwitchHandler.getInstance(), 3000);
+
+ @BeforeClass
+ public static void initEvoSuiteFramework() {
+ org.evosuite.runtime.RuntimeSettings.className = "org.openecomp.mso.db.catalog.beans.ServiceToAllottedResources";
+ org.evosuite.runtime.GuiSupport.initialize();
+ org.evosuite.runtime.RuntimeSettings.maxNumberOfThreads = 100;
+ org.evosuite.runtime.RuntimeSettings.maxNumberOfIterationsPerLoop = 10000;
+ org.evosuite.runtime.RuntimeSettings.mockSystemIn = true;
+ org.evosuite.runtime.RuntimeSettings.sandboxMode = org.evosuite.runtime.sandbox.Sandbox.SandboxMode.RECOMMENDED;
+ org.evosuite.runtime.sandbox.Sandbox.initializeSecurityManagerForSUT();
+ org.evosuite.runtime.classhandling.JDKClassResetter.init();
+ initializeClasses();
+ org.evosuite.runtime.Runtime.getInstance().resetRuntime();
+ }
+
+ @AfterClass
+ public static void clearEvoSuiteFramework(){
+ Sandbox.resetDefaultSecurityManager();
+ java.lang.System.setProperties((java.util.Properties) defaultProperties.clone());
+ }
+
+ @Before
+ public void initTestCase(){
+ threadStopper.storeCurrentThreads();
+ threadStopper.startRecordingTime();
+ org.evosuite.runtime.jvm.ShutdownHookHandler.getInstance().initHandler();
+ org.evosuite.runtime.sandbox.Sandbox.goingToExecuteSUTCode();
+ org.evosuite.runtime.GuiSupport.setHeadless();
+ org.evosuite.runtime.Runtime.getInstance().resetRuntime();
+ org.evosuite.runtime.agent.InstrumentingAgent.activate();
+ }
+
+ @After
+ public void doneWithTestCase(){
+ threadStopper.killAndJoinClientThreads();
+ org.evosuite.runtime.jvm.ShutdownHookHandler.getInstance().safeExecuteAddedHooks();
+ org.evosuite.runtime.classhandling.JDKClassResetter.reset();
+ resetClasses();
+ org.evosuite.runtime.sandbox.Sandbox.doneWithExecutingSUTCode();
+ org.evosuite.runtime.agent.InstrumentingAgent.deactivate();
+ org.evosuite.runtime.GuiSupport.restoreHeadlessMode();
+ }
+
+ private static void initializeClasses() {
+ org.evosuite.runtime.classhandling.ClassStateSupport.initializeClasses(ServiceToAllottedResourcesESTestscaffolding.class.getClassLoader() ,
+ "org.openecomp.mso.db.catalog.beans.ServiceToAllottedResources"
+ );
+ }
+
+ private static void resetClasses() {
+ org.evosuite.runtime.classhandling.ClassResetter.getInstance().setClassLoader(ServiceToAllottedResourcesESTestscaffolding.class.getClassLoader());
+
+ org.evosuite.runtime.classhandling.ClassStateSupport.resetClasses(
+ "org.openecomp.mso.db.catalog.beans.ServiceToAllottedResources"
+ );
+ }
+}
diff --git a/mso-catalog-db/src/test/java/org/openecomp/mso/db/catalog/beans/ServiceToNetworksESTest.java b/mso-catalog-db/src/test/java/org/openecomp/mso/db/catalog/beans/ServiceToNetworksESTest.java
new file mode 100644
index 0000000000..aa2ba2a488
--- /dev/null
+++ b/mso-catalog-db/src/test/java/org/openecomp/mso/db/catalog/beans/ServiceToNetworksESTest.java
@@ -0,0 +1,95 @@
+/*
+ * This file was automatically generated by EvoSuite
+ * Wed Feb 22 09:34:56 GMT 2017
+ */
+
+package org.openecomp.mso.db.catalog.beans;
+
+import org.junit.Test;
+import static org.junit.Assert.*;
+import java.sql.Timestamp;
+import org.evosuite.runtime.EvoRunner;
+import org.evosuite.runtime.EvoRunnerParameters;
+import org.junit.runner.RunWith;
+
+@RunWith(EvoRunner.class) @EvoRunnerParameters(mockJVMNonDeterminism = true, useVFS = true, useVNET = true, resetStaticState = true, useJEE = true)
+public class ServiceToNetworksESTest extends ServiceToNetworksESTestscaffolding {
+
+ @Test(timeout = 4000)
+ public void test0() throws Throwable {
+ ServiceToNetworks serviceToNetworks0 = new ServiceToNetworks();
+ serviceToNetworks0.setServiceModelUuid("XcrRZj-Y)7");
+ String string0 = serviceToNetworks0.getServiceModelUuid();
+ assertEquals("XcrRZj-Y)7", string0);
+ }
+
+ @Test(timeout = 4000)
+ public void test1() throws Throwable {
+ ServiceToNetworks serviceToNetworks0 = new ServiceToNetworks();
+ serviceToNetworks0.setNetworkModelCustomizationUuid("XcrRZj-Y)7");
+ String string0 = serviceToNetworks0.getNetworkModelCustomizationUuid();
+ assertEquals("XcrRZj-Y)7", string0);
+ }
+
+ @Test(timeout = 4000)
+ public void test2() throws Throwable {
+ ServiceToNetworks serviceToNetworks0 = new ServiceToNetworks();
+ Timestamp timestamp0 = new Timestamp(4701L);
+ serviceToNetworks0.setCreated(timestamp0);
+ Timestamp timestamp1 = serviceToNetworks0.getCreated();
+ assertEquals(701000000, timestamp1.getNanos());
+ }
+
+ @Test(timeout = 4000)
+ public void test3() throws Throwable {
+ ServiceToNetworks serviceToNetworks0 = new ServiceToNetworks();
+ Timestamp timestamp0 = serviceToNetworks0.getCreated();
+ assertNull(timestamp0);
+ }
+
+ @Test(timeout = 4000)
+ public void test4() throws Throwable {
+ ServiceToNetworks serviceToNetworks0 = new ServiceToNetworks();
+ String string0 = serviceToNetworks0.getNetworkModelCustomizationUuid();
+ assertNull(string0);
+ }
+
+ @Test(timeout = 4000)
+ public void test5() throws Throwable {
+ ServiceToNetworks serviceToNetworks0 = new ServiceToNetworks();
+ String string0 = serviceToNetworks0.getServiceModelUuid();
+ assertNull(string0);
+ }
+
+ @Test(timeout = 4000)
+ public void test6() throws Throwable {
+ ServiceToNetworks serviceToNetworks0 = new ServiceToNetworks();
+ String string0 = serviceToNetworks0.toString();
+ assertEquals("ServiceToNetworks mapping: serviceModelUuid=null,networkModelCustomizationUuid=null", string0);
+ }
+
+ @Test(timeout = 4000)
+ public void test7() throws Throwable {
+ ServiceToNetworks serviceToNetworks0 = new ServiceToNetworks();
+ Timestamp timestamp0 = new Timestamp(0L);
+ serviceToNetworks0.setCreated(timestamp0);
+ Timestamp timestamp1 = serviceToNetworks0.getCreated();
+ assertEquals(0, timestamp1.getNanos());
+ }
+
+ @Test(timeout = 4000)
+ public void test8() throws Throwable {
+ ServiceToNetworks serviceToNetworks0 = new ServiceToNetworks();
+ serviceToNetworks0.setNetworkModelCustomizationUuid("");
+ String string0 = serviceToNetworks0.getNetworkModelCustomizationUuid();
+ assertEquals("", string0);
+ }
+
+ @Test(timeout = 4000)
+ public void test9() throws Throwable {
+ ServiceToNetworks serviceToNetworks0 = new ServiceToNetworks();
+ serviceToNetworks0.setServiceModelUuid("");
+ String string0 = serviceToNetworks0.getServiceModelUuid();
+ assertEquals("", string0);
+ }
+}
diff --git a/mso-catalog-db/src/test/java/org/openecomp/mso/db/catalog/beans/ServiceToNetworksESTestscaffolding.java b/mso-catalog-db/src/test/java/org/openecomp/mso/db/catalog/beans/ServiceToNetworksESTestscaffolding.java
new file mode 100644
index 0000000000..ba0c5d7d5b
--- /dev/null
+++ b/mso-catalog-db/src/test/java/org/openecomp/mso/db/catalog/beans/ServiceToNetworksESTestscaffolding.java
@@ -0,0 +1,81 @@
+/**
+ * Scaffolding file used to store all the setups needed to run
+ * tests automatically generated by EvoSuite
+ * Wed Feb 22 09:34:56 GMT 2017
+ */
+
+package org.openecomp.mso.db.catalog.beans;
+
+import org.evosuite.runtime.annotation.EvoSuiteClassExclude;
+import org.junit.BeforeClass;
+import org.junit.Before;
+import org.junit.After;
+import org.junit.AfterClass;
+import org.evosuite.runtime.sandbox.Sandbox;
+
+@EvoSuiteClassExclude
+public class ServiceToNetworksESTestscaffolding {
+
+ @org.junit.Rule
+ public org.evosuite.runtime.vnet.NonFunctionalRequirementRule nfr = new org.evosuite.runtime.vnet.NonFunctionalRequirementRule();
+
+ private static final java.util.Properties defaultProperties = (java.util.Properties) java.lang.System.getProperties().clone();
+
+ private org.evosuite.runtime.thread.ThreadStopper threadStopper = new org.evosuite.runtime.thread.ThreadStopper (org.evosuite.runtime.thread.KillSwitchHandler.getInstance(), 3000);
+
+ @BeforeClass
+ public static void initEvoSuiteFramework() {
+ org.evosuite.runtime.RuntimeSettings.className = "org.openecomp.mso.db.catalog.beans.ServiceToNetworks";
+ org.evosuite.runtime.GuiSupport.initialize();
+ org.evosuite.runtime.RuntimeSettings.maxNumberOfThreads = 100;
+ org.evosuite.runtime.RuntimeSettings.maxNumberOfIterationsPerLoop = 10000;
+ org.evosuite.runtime.RuntimeSettings.mockSystemIn = true;
+ org.evosuite.runtime.RuntimeSettings.sandboxMode = org.evosuite.runtime.sandbox.Sandbox.SandboxMode.RECOMMENDED;
+ org.evosuite.runtime.sandbox.Sandbox.initializeSecurityManagerForSUT();
+ org.evosuite.runtime.classhandling.JDKClassResetter.init();
+ initializeClasses();
+ org.evosuite.runtime.Runtime.getInstance().resetRuntime();
+ }
+
+ @AfterClass
+ public static void clearEvoSuiteFramework(){
+ Sandbox.resetDefaultSecurityManager();
+ java.lang.System.setProperties((java.util.Properties) defaultProperties.clone());
+ }
+
+ @Before
+ public void initTestCase(){
+ threadStopper.storeCurrentThreads();
+ threadStopper.startRecordingTime();
+ org.evosuite.runtime.jvm.ShutdownHookHandler.getInstance().initHandler();
+ org.evosuite.runtime.sandbox.Sandbox.goingToExecuteSUTCode();
+ org.evosuite.runtime.GuiSupport.setHeadless();
+ org.evosuite.runtime.Runtime.getInstance().resetRuntime();
+ org.evosuite.runtime.agent.InstrumentingAgent.activate();
+ }
+
+ @After
+ public void doneWithTestCase(){
+ threadStopper.killAndJoinClientThreads();
+ org.evosuite.runtime.jvm.ShutdownHookHandler.getInstance().safeExecuteAddedHooks();
+ org.evosuite.runtime.classhandling.JDKClassResetter.reset();
+ resetClasses();
+ org.evosuite.runtime.sandbox.Sandbox.doneWithExecutingSUTCode();
+ org.evosuite.runtime.agent.InstrumentingAgent.deactivate();
+ org.evosuite.runtime.GuiSupport.restoreHeadlessMode();
+ }
+
+ private static void initializeClasses() {
+ org.evosuite.runtime.classhandling.ClassStateSupport.initializeClasses(ServiceToNetworksESTestscaffolding.class.getClassLoader() ,
+ "org.openecomp.mso.db.catalog.beans.ServiceToNetworks"
+ );
+ }
+
+ private static void resetClasses() {
+ org.evosuite.runtime.classhandling.ClassResetter.getInstance().setClassLoader(ServiceToNetworksESTestscaffolding.class.getClassLoader());
+
+ org.evosuite.runtime.classhandling.ClassStateSupport.resetClasses(
+ "org.openecomp.mso.db.catalog.beans.ServiceToNetworks"
+ );
+ }
+}
diff --git a/mso-catalog-db/src/test/java/org/openecomp/mso/db/catalog/beans/VfModuleESTest.java b/mso-catalog-db/src/test/java/org/openecomp/mso/db/catalog/beans/VfModuleESTest.java
index 1a1c6ea2c2..1ab15a22fb 100644
--- a/mso-catalog-db/src/test/java/org/openecomp/mso/db/catalog/beans/VfModuleESTest.java
+++ b/mso-catalog-db/src/test/java/org/openecomp/mso/db/catalog/beans/VfModuleESTest.java
@@ -1,6 +1,6 @@
/*
* This file was automatically generated by EvoSuite
- * Mon Nov 14 08:19:11 GMT 2016
+ * Tue Feb 21 15:51:08 GMT 2017
*/
package org.openecomp.mso.db.catalog.beans;
@@ -8,719 +8,971 @@ package org.openecomp.mso.db.catalog.beans;
import org.junit.Test;
import static org.junit.Assert.*;
import static org.evosuite.runtime.EvoAssertions.*;
-
import java.sql.Timestamp;
import java.time.Instant;
+import java.time.temporal.ChronoField;
+import java.time.temporal.ChronoUnit;
+import java.time.temporal.TemporalField;
+import java.time.temporal.UnsupportedTemporalTypeException;
import org.evosuite.runtime.EvoRunner;
import org.evosuite.runtime.EvoRunnerParameters;
import org.evosuite.runtime.PrivateAccess;
import org.evosuite.runtime.System;
import org.evosuite.runtime.mock.java.time.MockInstant;
+import org.evosuite.runtime.mock.java.util.MockDate;
import org.junit.runner.RunWith;
+import org.openecomp.mso.db.catalog.beans.VfModule;
-@RunWith(EvoRunner.class) @EvoRunnerParameters(mockJVMNonDeterminism = true, useVFS = true, useVNET = true, resetStaticState = true, useJEE = true)
+@RunWith(EvoRunner.class) @EvoRunnerParameters(mockJVMNonDeterminism = true, useVFS = true, useVNET = true, resetStaticState = true, useJEE = true)
public class VfModuleESTest extends VfModuleESTestscaffolding {
- @Test(timeout = 4000)
- public void test00() throws Throwable {
- VfModule vfModule0 = new VfModule();
- vfModule0.setModelVersion("EzJ)~3C++");
- Integer integer0 = new Integer((-1));
- vfModule0.setVnfResourceId(integer0);
- vfModule0.getModelInvariantUuid();
- vfModule0.getModelInvariantUuid();
- VfModule vfModule1 = new VfModule();
- vfModule1.setDescription("");
- vfModule1.setIsBase((-1));
- Integer integer1 = new Integer((-289));
- vfModule1.setTemplateId(integer1);
- vfModule1.getTemplateId();
- vfModule1.setModelName("Yp{,,+-pFJp!Ym6r^");
- vfModule1.getDescription();
- vfModule0.setId((-1));
- vfModule0.setId((-4103));
- vfModule0.getId();
- vfModule1.getVnfResourceId();
- vfModule1.setTemplateId((Integer) null);
- Timestamp timestamp0 = new Timestamp((-3970L));
- vfModule0.setCreated(timestamp0);
- }
-
- @Test(timeout = 4000)
- public void test01() throws Throwable {
- VfModule vfModule0 = new VfModule();
- vfModule0.isTheSameVersion("1&T-qG");
- Integer integer0 = new Integer((-385));
- Integer integer1 = Integer.valueOf((-385));
- Integer.toUnsignedString((-1));
- Integer.getInteger("", integer1);
- vfModule0.setVolTemplateId(integer0);
- vfModule0.setModelInvariantUuid("1&T-qG");
- vfModule0.toString();
- vfModule0.getIsBase();
- vfModule0.setModelVersion("VF=null,modelName=null,version=null,id=0,vnfResourceId=null,templateId=null,envtId=null,volTemplateId=-385,volEnvtId=null, description=null,asdcUuid=null,modelVersion=null");
- vfModule0.setType("wO");
- vfModule0.getType();
- vfModule0.isBase();
- vfModule0.getIsBase();
- vfModule0.setAsdcUuid("VF=");
- vfModule0.getModelVersion();
- vfModule0.setId(1);
- vfModule0.setModelName("VF=");
- vfModule0.getVolEnvironmentId();
- vfModule0.setVolTemplateId((Integer) null);
- vfModule0.setAsdcUuid("");
- vfModule0.setModelVersion("1&T-qG");
- vfModule0.isBase();
- vfModule0.getEnvironmentId();
- vfModule0.toString();
- vfModule0.getDescription();
- vfModule0.setType("");
- vfModule0.setVnfResourceId(integer1);
- System.setCurrentTimeMillis((-1L));
- vfModule0.getVnfResourceId();
- }
-
- @Test(timeout = 4000)
- public void test02() throws Throwable {
- System.setCurrentTimeMillis(1L);
- VfModule vfModule0 = new VfModule();
- vfModule0.setModelInvariantUuid("57f9");
- vfModule0.setModelName("");
- vfModule0.getDescription();
- vfModule0.toString();
- vfModule0.setType("");
- vfModule0.getDescription();
- vfModule0.getCreated();
- vfModule0.setCreated((Timestamp) null);
- Integer integer0 = new Integer(2109);
- Integer integer1 = new Integer(1);
- Integer.getInteger("D}'htOb?", integer1);
- vfModule0.setVolEnvironmentId(integer0);
- vfModule0.getVnfResourceId();
- vfModule0.getModelName();
- System.setCurrentTimeMillis(0L);
- vfModule0.getModelName();
- vfModule0.getCreated();
- vfModule0.getModelName();
- vfModule0.getDescription();
- vfModule0.getDescription();
- vfModule0.getModelName();
- vfModule0.toString();
- vfModule0.getCreated();
- System.setCurrentTimeMillis(1L);
- }
-
- @Test(timeout = 4000)
- public void test03() throws Throwable {
- VfModule vfModule0 = new VfModule();
- vfModule0.setId(600);
- vfModule0.toString();
- Integer integer0 = new Integer((-1));
- Integer.divideUnsigned((-1), 1);
- Integer.min((-1), 1);
- Integer.max(2123, 600);
- Integer integer1 = new Integer(2123);
- vfModule0.setEnvironmentId(integer1);
- vfModule0.setEnvironmentId(integer0);
- vfModule0.isMoreRecentThan(",volEnvtId=");
- vfModule0.getId();
- Integer.compareUnsigned(467, (-1));
- vfModule0.setEnvironmentId(integer0);
- VfModule vfModule1 = new VfModule();
- vfModule1.isMoreRecentThan("VF=null,modelName=null,version=null,id=600,vnfResourceId=null,templateId=null,envtId=null,volTemplateId=null,volEnvtId=null, description=null,asdcUuid=null,modelVersion=null");
- vfModule1.toString();
- VfModule vfModule2 = new VfModule();
- vfModule0.getEnvironmentId();
- vfModule2.getDescription();
- vfModule2.setDescription((String) null);
- vfModule2.setModelVersion(", description=");
- vfModule2.toString();
- vfModule1.getModelInvariantUuid();
- vfModule1.toString();
- vfModule1.getEnvironmentId();
- vfModule0.setAsdcUuid("");
- vfModule0.setDescription((String) null);
- vfModule0.getIsBase();
- vfModule0.getAsdcUuid();
- vfModule0.getCreated();
- }
-
- @Test(timeout = 4000)
- public void test04() throws Throwable {
- VfModule vfModule0 = new VfModule();
- vfModule0.getDescription();
- Integer integer0 = new Integer(0);
- vfModule0.setVolTemplateId(integer0);
- vfModule0.setVersion((String) null);
- vfModule0.getDescription();
- vfModule0.setAsdcUuid((String) null);
- Integer integer1 = new Integer(0);
- Integer.getInteger((String) null);
- vfModule0.setVnfResourceId(integer1);
- vfModule0.setIsBase(1);
- vfModule0.getVolEnvironmentId();
- vfModule0.setId(0);
- vfModule0.getModelInvariantUuid();
- vfModule0.getEnvironmentId();
- vfModule0.getIsBase();
- vfModule0.setTemplateId(integer1);
- vfModule0.getCreated();
- vfModule0.getId();
- vfModule0.getCreated();
- vfModule0.getId();
- vfModule0.setModelInvariantUuid((String) null);
- vfModule0.getAsdcUuid();
- vfModule0.getVnfResourceId();
- }
-
- @Test(timeout = 4000)
- public void test05() throws Throwable {
- VfModule vfModule0 = new VfModule();
- vfModule0.getDescription();
- Integer integer0 = new Integer(0);
- Integer.divideUnsigned(1, 659);
- vfModule0.setVolTemplateId(integer0);
- vfModule0.setVersion((String) null);
- vfModule0.getDescription();
- vfModule0.setAsdcUuid((String) null);
- Integer integer1 = new Integer(0);
- Integer.getInteger((String) null);
- vfModule0.setVnfResourceId(integer1);
- vfModule0.setIsBase(1);
- vfModule0.getVolEnvironmentId();
- vfModule0.setId(0);
- vfModule0.getModelInvariantUuid();
- vfModule0.getEnvironmentId();
- vfModule0.getIsBase();
- vfModule0.setTemplateId(integer1);
- vfModule0.getCreated();
- vfModule0.getId();
- vfModule0.getCreated();
- vfModule0.getId();
- vfModule0.setModelInvariantUuid((String) null);
- vfModule0.getAsdcUuid();
- System.setCurrentTimeMillis((-1L));
- vfModule0.getTemplateId();
- vfModule0.getDescription();
- vfModule0.getAsdcUuid();
- }
-
- @Test(timeout = 4000)
- public void test06() throws Throwable {
- VfModule vfModule0 = new VfModule();
- vfModule0.getVolEnvironmentId();
- vfModule0.setEnvironmentId((Integer) null);
- assertNull(vfModule0.getModelVersion());
-
- Integer integer0 = new Integer(1);
- Integer.getInteger((String) null, (Integer) null);
- vfModule0.setEnvironmentId(integer0);
- vfModule0.setModelVersion((String) null);
- vfModule0.setId(171);
- vfModule0.toString();
- vfModule0.getEnvironmentId();
- }
-
- @Test(timeout = 4000)
- public void test07() throws Throwable {
- VfModule vfModule0 = new VfModule();
- Integer integer0 = Integer.valueOf((-2041));
- Integer.compareUnsigned((-2041), (-1));
- vfModule0.setTemplateId(integer0);
- vfModule0.setIsBase(3154);
- vfModule0.setModelInvariantUuid("");
- vfModule0.setDescription("nPVyq+_;@IZP:L");
- vfModule0.setId(883);
- vfModule0.toString();
- vfModule0.setIsBase((-2041));
- vfModule0.getTemplateId();
- vfModule0.getModelName();
- vfModule0.getVnfResourceId();
- vfModule0.toString();
- vfModule0.isBase();
- }
-
- @Test(timeout = 4000)
- public void test08() throws Throwable {
- VfModule vfModule0 = new VfModule();
- vfModule0.setIsBase(0);
- vfModule0.isMoreRecentThan(".");
- vfModule0.toString();
- vfModule0.setIsBase((-1465));
- vfModule0.setModelInvariantUuid("u5L");
- vfModule0.getIsBase();
- vfModule0.setId(0);
- vfModule0.getVolEnvironmentId();
- System.setCurrentTimeMillis((-1465));
- vfModule0.setModelVersion("VF=null,modelName=null,version=null,id=0,vnfResourceId=null,templateId=null,envtId=null,volTemplateId=null,volEnvtId=null, description=null,asdcUuid=null,modelVersion=null");
- vfModule0.setVersion("");
- vfModule0.toString();
- vfModule0.getAsdcUuid();
- vfModule0.getEnvironmentId();
- vfModule0.setVolEnvironmentId((Integer) null);
- vfModule0.getVnfResourceId();
- vfModule0.getDescription();
- vfModule0.getVolEnvironmentId();
- vfModule0.getCreated();
- }
-
- @Test(timeout = 4000)
- public void test09() throws Throwable {
- VfModule vfModule0 = new VfModule();
- vfModule0.isMoreRecentThan("zL");
- vfModule0.getType();
- vfModule0.setModelName((String) null);
- Integer integer0 = new Integer(0);
- Integer.getInteger("zL", (Integer) null);
- vfModule0.setType("");
- Integer.sum(34, 34);
- Integer.min(0, 2510);
- Integer.divideUnsigned(0, (-1));
- Integer.compare(0, 0);
- vfModule0.setVolEnvironmentId(integer0);
- vfModule0.setCreated((Timestamp) null);
- vfModule0.getCreated();
- vfModule0.getIsBase();
- vfModule0.setAsdcUuid("");
- vfModule0.setId(0);
- vfModule0.getModelVersion();
- vfModule0.setCreated((Timestamp) null);
- vfModule0.setModelVersion((String) null);
- vfModule0.getEnvironmentId();
- vfModule0.getVolEnvironmentId();
- vfModule0.getType();
- vfModule0.setAsdcUuid((String) null);
- }
-
- @Test(timeout = 4000)
- public void test10() throws Throwable {
- VfModule vfModule0 = new VfModule();
- vfModule0.setModelInvariantUuid("");
- vfModule0.setType(",modelName=");
- vfModule0.setModelVersion("");
- vfModule0.setModelName("+cQA/1wAo}o/T7,S");
- vfModule0.getVolTemplateId();
- vfModule0.getVolEnvironmentId();
- vfModule0.getVolTemplateId();
- vfModule0.getModelInvariantUuid();
- }
-
- @Test(timeout = 4000)
- public void test11() throws Throwable {
- VfModule vfModule0 = new VfModule();
- Integer integer0 = new Integer((-495));
- Integer.getInteger("M0@M@T", (-495));
- vfModule0.setVolEnvironmentId(integer0);
- vfModule0.setId(892);
- vfModule0.getTemplateId();
- vfModule0.toString();
- vfModule0.getVolEnvironmentId();
- vfModule0.setDescription("M0@M@T");
- vfModule0.getTemplateId();
- }
-
- @Test(timeout = 4000)
- public void test12() throws Throwable {
- VfModule vfModule0 = new VfModule();
- Integer integer0 = new Integer(2707);
- Integer integer1 = new Integer((-1));
- Integer.getInteger("", integer1);
- vfModule0.setVolEnvironmentId(integer0);
- vfModule0.getModelName();
- vfModule0.isMoreRecentThan("");
- vfModule0.getAsdcUuid();
- vfModule0.isMoreRecentThan((String) null);
- vfModule0.getVnfResourceId();
- vfModule0.toString();
- vfModule0.getCreated();
- vfModule0.getVolEnvironmentId();
- vfModule0.getModelName();
- vfModule0.getVnfResourceId();
- vfModule0.getVnfResourceId();
- vfModule0.getModelName();
- vfModule0.getAsdcUuid();
- vfModule0.getCreated();
- }
-
- @Test(timeout = 4000)
- public void test13() throws Throwable {
- VfModule vfModule0 = new VfModule();
- vfModule0.isMoreRecentThan((String) null);
- vfModule0.getCreated();
- vfModule0.setVolEnvironmentId((Integer) null);
- vfModule0.getVnfResourceId();
- Integer integer0 = new Integer(2983);
- vfModule0.isTheSameVersion((String) null);
- vfModule0.setDescription(")b,;fs\"&l\"#:Z");
- Integer.min(296, 0);
- vfModule0.setTemplateId(integer0);
- vfModule0.setType(")b,;fs\"&l\"#:Z");
- vfModule0.setModelInvariantUuid(")b,;fs\"&l\"#:Z");
- vfModule0.getId();
- vfModule0.setModelVersion("");
- vfModule0.getTemplateId();
- vfModule0.getModelVersion();
- vfModule0.setIsBase(2983);
- Integer integer1 = new Integer(0);
- try {
- Integer.decode("X&-4c&g>;lQ`");
- fail("Expecting exception: NumberFormatException");
-
- } catch(NumberFormatException e) {
- //
- // For input string: \"X&-4c&g>;lQ`\"
- //
- verifyException("java.lang.NumberFormatException", e);
- }
- }
-
- @Test(timeout = 4000)
- public void test14() throws Throwable {
- VfModule vfModule0 = new VfModule();
- vfModule0.toString();
- vfModule0.isMoreRecentThan("ql");
- vfModule0.toString();
- vfModule0.isMoreRecentThan("v;ese");
- vfModule0.getCreated();
- Integer integer0 = new Integer(0);
- Integer.getInteger("v;ese", 0);
- vfModule0.setVolTemplateId(integer0);
- vfModule0.isBase();
- vfModule0.getIsBase();
- vfModule0.setAsdcUuid("VF=null,modelName=null,version=null,id=0,vnfResourceId=null,templateId=null,envtId=null,volTemplateId=null,volEnvtId=null, description=null,asdcUuid=null,modelVersion=null");
- vfModule0.getId();
- vfModule0.getTemplateId();
- vfModule0.getVolTemplateId();
- vfModule0.getAsdcUuid();
- vfModule0.setId(0);
- Integer integer1 = new Integer(0);
- try {
- Integer.parseUnsignedInt("ql", (-122));
- fail("Expecting exception: NumberFormatException");
-
- } catch(NumberFormatException e) {
- //
- // radix -122 less than Character.MIN_RADIX
- //
- verifyException("java.lang.Integer", e);
- }
- }
-
- @Test(timeout = 4000)
- public void test15() throws Throwable {
- VfModule vfModule0 = new VfModule();
- Integer integer0 = new Integer((-1847));
- vfModule0.setTemplateId(integer0);
- vfModule0.setVolTemplateId(integer0);
- vfModule0.getVolTemplateId();
- try {
- Integer.decode("");
- fail("Expecting exception: NumberFormatException");
-
- } catch(NumberFormatException e) {
- //
- // Zero length string
- //
- verifyException("java.lang.Integer", e);
- }
- }
-
- @Test(timeout = 4000)
- public void test16() throws Throwable {
- VfModule vfModule0 = new VfModule();
- Integer integer0 = new Integer(1);
- vfModule0.setVolTemplateId(integer0);
- vfModule0.setType("");
- vfModule0.setDescription("");
- vfModule0.getVolTemplateId();
- vfModule0.getTemplateId();
- vfModule0.setModelInvariantUuid("");
- vfModule0.getType();
- vfModule0.setVersion("");
- vfModule0.getEnvironmentId();
- try {
- Integer.decode("");
- fail("Expecting exception: NumberFormatException");
-
- } catch(NumberFormatException e) {
- //
- // Zero length string
- //
- verifyException("java.lang.Integer", e);
- }
- }
-
- @Test(timeout = 4000)
- public void test17() throws Throwable {
- VfModule vfModule0 = new VfModule();
- Integer integer0 = Integer.valueOf(797);
- vfModule0.setVnfResourceId(integer0);
- vfModule0.isMoreRecentThan("xApm&c~GA&l*X$");
- vfModule0.getVnfResourceId();
- vfModule0.getModelInvariantUuid();
- }
-
- @Test(timeout = 4000)
- public void test18() throws Throwable {
- VfModule vfModule0 = new VfModule();
- vfModule0.setModelVersion("");
- Integer integer0 = new Integer(1170);
- vfModule0.setVnfResourceId(integer0);
- vfModule0.getCreated();
- vfModule0.setVolTemplateId(integer0);
- vfModule0.setType("");
- vfModule0.setDescription("");
- vfModule0.getVnfResourceId();
- VfModule vfModule1 = new VfModule();
- vfModule1.setId((-1424));
- vfModule1.getVolTemplateId();
- vfModule1.getModelVersion();
- vfModule0.getId();
- vfModule0.setAsdcUuid("");
- }
-
- @Test(timeout = 4000)
- public void test19() throws Throwable {
- VfModule vfModule0 = new VfModule();
- Integer integer0 = new Integer((-1483));
- Integer.toUnsignedString((-1742));
- Integer.toUnsignedString(0);
- Integer.getInteger("", (-1483));
- vfModule0.setModelVersion(".");
- Integer.divideUnsigned(0, 1371);
- vfModule0.setVolTemplateId(integer0);
- Integer.compare(1783, (-1404));
- vfModule0.setEnvironmentId(integer0);
- vfModule0.setVersion("");
- vfModule0.getModelVersion();
- vfModule0.getId();
- }
-
- @Test(timeout = 4000)
- public void test20() throws Throwable {
- VfModule vfModule0 = new VfModule();
- vfModule0.getId();
- vfModule0.setDescription("JZ)_Y_-H SVr5xC");
- Integer integer0 = new Integer(1266);
- Integer.remainderUnsigned(0, 1266);
- vfModule0.setEnvironmentId(integer0);
- vfModule0.getModelInvariantUuid();
- vfModule0.setDescription((String) null);
- vfModule0.getEnvironmentId();
- vfModule0.getModelName();
- vfModule0.getIsBase();
- }
-
- @Test(timeout = 4000)
- public void test21() throws Throwable {
- VfModule vfModule0 = new VfModule();
- vfModule0.setModelInvariantUuid(",version=");
- vfModule0.toString();
- vfModule0.toString();
- vfModule0.toString();
- vfModule0.isTheSameVersion("VF=null,modelName=null,version=null,id=0,vnfResourceId=null,templateId=null,envtId=null,volTemplateId=null,volEnvtId=null, description=null,asdcUuid=null,modelVersion=null");
- vfModule0.setId(1438);
- vfModule0.getVolTemplateId();
- Instant instant0 = MockInstant.ofEpochMilli(1438);
- Timestamp timestamp0 = Timestamp.from(instant0);
- timestamp0.clone();
- vfModule0.setCreated(timestamp0);
- vfModule0.setDescription(",version=");
- vfModule0.getTemplateId();
- vfModule0.getId();
- }
-
- @Test(timeout = 4000)
- public void test22() throws Throwable {
- VfModule vfModule0 = new VfModule();
- vfModule0.setModelVersion("EzJ)~3C++");
- Integer integer0 = new Integer((-1));
- vfModule0.setVnfResourceId(integer0);
- vfModule0.getModelInvariantUuid();
- vfModule0.getModelInvariantUuid();
- VfModule vfModule1 = new VfModule();
- vfModule1.setIsBase((-1));
- Integer integer1 = new Integer((-289));
- vfModule1.setTemplateId(integer1);
- vfModule1.getTemplateId();
- vfModule1.setModelName("Yp{,,+-pFJp!Ym6r^");
- vfModule1.getDescription();
- vfModule0.setId((-1));
- vfModule0.setId((-4103));
- vfModule0.getId();
- vfModule1.getVnfResourceId();
- vfModule1.setTemplateId((Integer) null);
- Timestamp timestamp0 = new Timestamp((-3970L));
- vfModule0.setCreated(timestamp0);
- }
-
- @Test(timeout = 4000)
- public void test23() throws Throwable {
- VfModule vfModule0 = new VfModule();
- vfModule0.isTheSameVersion(", description=");
- vfModule0.setType("");
- Integer integer0 = new Integer(0);
- Integer.max(0, 0);
- Integer.min(0, 0);
- vfModule0.setEnvironmentId(integer0);
- vfModule0.setDescription("Kx6@ Rh^oX; 9s(c&>|");
- vfModule0.setId((-2750));
- vfModule0.setType((String) null);
- vfModule0.getDescription();
- vfModule0.setId(0);
- }
-
- @Test(timeout = 4000)
- public void test24() throws Throwable {
- VfModule vfModule0 = new VfModule();
- vfModule0.setType("}f");
- vfModule0.setModelName("?2n6Dj");
- vfModule0.toString();
- vfModule0.getModelName();
- vfModule0.setAsdcUuid("?2n6Dj");
- vfModule0.getId();
- vfModule0.isTheSameVersion("");
- vfModule0.getAsdcUuid();
- vfModule0.getVolTemplateId();
- try {
- Integer.parseUnsignedInt("6pu", 0);
- fail("Expecting exception: NumberFormatException");
-
- } catch(NumberFormatException e) {
- //
- // radix 0 less than Character.MIN_RADIX
- //
- verifyException("java.lang.Integer", e);
- }
- }
-
- @Test(timeout = 4000)
- public void test25() throws Throwable {
- VfModule vfModule0 = new VfModule();
- Timestamp timestamp0 = new Timestamp(0L);
- timestamp0.clone();
- timestamp0.setNanos(3848);
- vfModule0.setCreated(timestamp0);
- vfModule0.getVolTemplateId();
- Timestamp timestamp1 = vfModule0.getCreated();
- timestamp1.toInstant();
- Integer integer0 = new Integer(719);
- timestamp1.setNanos(3848);
- try {
- Integer.parseUnsignedInt("1\t`FE9f:0z]~");
- fail("Expecting exception: NumberFormatException");
-
- } catch(NumberFormatException e) {
- //
- // For input string: \"1\t`FE9f:0z]~\"
- //
- verifyException("java.lang.NumberFormatException", e);
- }
- }
-
- @Test(timeout = 4000)
- public void test26() throws Throwable {
- VfModule vfModule0 = new VfModule();
- Integer integer0 = new Integer(2069);
- Integer.compare(0, 0);
- Integer.min(2661, 2661);
- Integer.max(2069, 2069);
- vfModule0.setVnfResourceId(integer0);
- vfModule0.setDescription(",id=");
- vfModule0.isTheSameVersion(",id=");
- vfModule0.isMoreRecentThan(",id=");
- vfModule0.getEnvironmentId();
- vfModule0.setType("h4:pQoD8*M");
- vfModule0.getType();
- vfModule0.getType();
- }
-
- @Test(timeout = 4000)
- public void test27() throws Throwable {
- VfModule vfModule0 = new VfModule();
- Integer integer0 = new Integer(0);
- vfModule0.setEnvironmentId(integer0);
- vfModule0.setModelInvariantUuid("H'CQI+Q^^WoGt^Q2X]");
- vfModule0.toString();
- vfModule0.getModelInvariantUuid();
- Integer integer1 = vfModule0.getEnvironmentId();
- vfModule0.setVersion("");
- Integer.getInteger("", integer0);
- Integer.getInteger("", integer0);
- vfModule0.setVnfResourceId(integer1);
- }
-
- @Test(timeout = 4000)
- public void test28() throws Throwable {
- VfModule vfModule0 = new VfModule();
- vfModule0.toString();
- vfModule0.setModelVersion("VF=null,modelName=null,version=null,id=0,vnfResourceId=null,templateId=null,envtId=null,volTemplateId=null,volEnvtId=null, description=null,asdcUuid=null,modelVersion=null");
- vfModule0.setDescription("VF=null,modelName=null,version=null,id=0,vnfResourceId=null,templateId=null,envtId=null,volTemplateId=null,volEnvtId=null, description=null,asdcUuid=null,modelVersion=null");
- vfModule0.setId(0);
- vfModule0.getModelName();
- vfModule0.getAsdcUuid();
- Timestamp timestamp0 = new Timestamp((long) 0);
- timestamp0.toLocalDateTime();
- vfModule0.setCreated(timestamp0);
- vfModule0.getVolTemplateId();
- int int0 = vfModule0.getId();
- vfModule0.getTemplateId();
- vfModule0.setModelInvariantUuid((String) null);
- vfModule0.setType("VF=null,modelName=null,version=null,id=0,vnfResourceId=null,templateId=null,envtId=null,volTemplateId=null,volEnvtId=null, description=null,asdcUuid=null,modelVersion=null");
- Timestamp timestamp1 = vfModule0.getCreated();
- vfModule0.setDescription((String) null);
- vfModule0.setCreated(timestamp1);
- vfModule0.setVolTemplateId((Integer) null);
- vfModule0.getTemplateId();
- int int1 = vfModule0.getIsBase();
- assertTrue(int1 == int0);
-
- vfModule0.setModelVersion((String) null);
- boolean boolean0 = vfModule0.isBase();
- assertFalse(boolean0);
-
- vfModule0.setVolEnvironmentId((Integer) null);
- vfModule0.setModelInvariantUuid("VF=null,modelName=null,version=null,id=0,vnfResourceId=null,templateId=null,envtId=null,volTemplateId=null,volEnvtId=null, description=null,asdcUuid=null,modelVersion=null");
- vfModule0.getDescription();
- String string0 = vfModule0.toString();
- assertEquals("VF=VF=null,modelName=null,version=null,id=0,vnfResourceId=null,templateId=null,envtId=null,volTemplateId=null,volEnvtId=null, description=null,asdcUuid=null,modelVersion=null,modelName=null,version=null,id=0,vnfResourceId=null,templateId=null,envtId=null,volTemplateId=null,volEnvtId=null, description=null,asdcUuid=null,modelVersion=null,created=1/1/70 12:00 AM", string0);
- }
-
- @Test(timeout = 4000)
- public void test29() throws Throwable {
- VfModule vfModule0 = new VfModule();
- vfModule0.setIsBase(1);
- vfModule0.getVnfResourceId();
- vfModule0.getEnvironmentId();
- vfModule0.toString();
- vfModule0.isBase();
- Integer integer0 = new Integer(0);
- vfModule0.getCreated();
- vfModule0.setAsdcUuid("VF=null,modelName=null,version=null,id=0,vnfResourceId=null,templateId=null,envtId=null,volTemplateId=null,volEnvtId=null, description=null,asdcUuid=null,modelVersion=null");
- vfModule0.getCreated();
- PrivateAccess.setVariable((Class<VfModule>) VfModule.class, vfModule0, "asdcUuid", (Object) "VF=null,modelName=null,version=null,id=0,vnfResourceId=null,templateId=null,envtId=null,volTemplateId=null,volEnvtId=null, description=null,asdcUuid=null,modelVersion=null");
- assertEquals(1, vfModule0.getIsBase());
- }
-
- @Test(timeout = 4000)
- public void test30() throws Throwable {
- VfModule vfModule0 = new VfModule();
- vfModule0.toString();
- vfModule0.getModelVersion();
- String string0 = vfModule0.getType();
- assertNull(string0);
- }
-
- @Test(timeout = 4000)
- public void test31() throws Throwable {
- VfModule vfModule0 = new VfModule();
- Integer integer0 = new Integer((-1));
- vfModule0.setVnfResourceId(integer0);
- vfModule0.getModelInvariantUuid();
- vfModule0.setTemplateId(integer0);
- vfModule0.setModelName((String) null);
- Timestamp timestamp0 = vfModule0.getCreated();
- assertNull(timestamp0);
- }
+ @Test(timeout = 4000)
+ public void test00() throws Throwable {
+ VfModule vfModule0 = new VfModule();
+ vfModule0.setIsBase(1684);
+ vfModule0.getMinInstances();
+ vfModule0.setMaxInstances((Integer) null);
+ vfModule0.isBase();
+ vfModule0.setVolTemplateId((Integer) null);
+ vfModule0.setModelVersion("p(>v(f\"rnCo");
+ vfModule0.getIsBase();
+ vfModule0.getModelInvariantUuid();
+ vfModule0.setModelVersion("a,U*#FCv(}H+aG}");
+ vfModule0.getVolTemplateId();
+ vfModule0.getMinInstances();
+ vfModule0.toString();
+ }
+
+ @Test(timeout = 4000)
+ public void test01() throws Throwable {
+ VfModule vfModule0 = new VfModule();
+ Instant instant0 = MockInstant.now();
+ Timestamp timestamp0 = Timestamp.from(instant0);
+ vfModule0.setCreated(timestamp0);
+ vfModule0.setLabel("7.");
+ vfModule0.isBase();
+ vfModule0.getId();
+ vfModule0.getLabel();
+ vfModule0.toString();
+ }
+
+ @Test(timeout = 4000)
+ public void test02() throws Throwable {
+ VfModule vfModule0 = new VfModule();
+ Integer integer0 = Integer.valueOf((-3299));
+ vfModule0.getEnvironmentId();
+ Integer.toUnsignedString((-697));
+ vfModule0.setMinInstances((Integer) null);
+ vfModule0.setMaxInstances(integer0);
+ Integer integer1 = new Integer(5932);
+ Integer integer2 = Integer.getInteger("DZ>}qM>", integer1);
+ vfModule0.setVolEnvironmentId(integer0);
+ vfModule0.setTemplateId(integer2);
+ Integer.toUnsignedString(5932);
+ vfModule0.getVolTemplateId();
+ vfModule0.setTemplateId((Integer) null);
+ Integer.divideUnsigned((-3299), (-3299));
+ vfModule0.setEnvironmentId((Integer) null);
+ vfModule0.setVolEnvironmentId((Integer) null);
+ vfModule0.setMinInstances(integer1);
+ vfModule0.setIsBase((-3299));
+ vfModule0.setIsBase((-745));
+ vfModule0.setModelVersion("5932");
+ vfModule0.getVolTemplateId();
+ vfModule0.getVolEnvironmentId();
+ vfModule0.getMinInstances();
+ vfModule0.getVolEnvironmentId();
+ }
+
+ @Test(timeout = 4000)
+ public void test03() throws Throwable {
+ VfModule vfModule0 = new VfModule();
+ Integer integer0 = new Integer(0);
+ vfModule0.setVolTemplateId(integer0);
+ vfModule0.getVolTemplateId();
+ Integer integer1 = vfModule0.getVolTemplateId();
+ vfModule0.setVolTemplateId(integer1);
+ vfModule0.setIsBase(863);
+ Integer integer2 = new Integer(1554);
+ vfModule0.setVnfResourceId(integer2);
+ vfModule0.setIsBase(780);
+ vfModule0.setMaxInstances(integer2);
+ vfModule0.getEnvironmentId();
+ vfModule0.getVolEnvironmentId();
+ vfModule0.getVolEnvironmentId();
+ }
+
+ @Test(timeout = 4000)
+ public void test04() throws Throwable {
+ VfModule vfModule0 = new VfModule();
+ Timestamp timestamp0 = new Timestamp((-2168L));
+ vfModule0.setCreated(timestamp0);
+ vfModule0.setId((-1));
+ vfModule0.getEnvironmentId();
+ vfModule0.setCreated(timestamp0);
+ vfModule0.setVolTemplateId((Integer) null);
+ vfModule0.setLabel(".");
+ vfModule0.getModelName();
+ vfModule0.getCreated();
+ vfModule0.getTemplateId();
+ }
+
+ @Test(timeout = 4000)
+ public void test05() throws Throwable {
+ VfModule vfModule0 = new VfModule();
+ vfModule0.isMoreRecentThan("");
+ vfModule0.setLabel("");
+ Integer integer0 = new Integer(1183);
+ vfModule0.setMaxInstances(integer0);
+ Integer.compare(1183, 1183);
+ vfModule0.setTemplateId(integer0);
+ vfModule0.getLabel();
+ vfModule0.getDescription();
+ }
+
+ @Test(timeout = 4000)
+ public void test06() throws Throwable {
+ VfModule vfModule0 = new VfModule();
+ Integer integer0 = new Integer(0);
+ Integer.compare(1, 0);
+ vfModule0.setMaxInstances(integer0);
+ vfModule0.getVolEnvironmentId();
+ Integer.sum(0, 1);
+ vfModule0.setVolTemplateId((Integer) null);
+ vfModule0.setMaxInstances((Integer) null);
+ vfModule0.setModelVersion("");
+ vfModule0.setIsBase((-1435));
+ vfModule0.setVnfResourceId((Integer) null);
+ vfModule0.getVnfResourceId();
+ vfModule0.setIsBase((-3635));
+ vfModule0.getDescription();
+ vfModule0.getAsdcUuid();
+ Integer integer1 = new Integer((-3635));
+ Integer integer2 = new Integer(1);
+ Integer.getInteger(".", integer2);
+ vfModule0.setVolTemplateId(integer1);
+ vfModule0.getVnfResourceId();
+ vfModule0.getModelVersion();
+ }
+
+ @Test(timeout = 4000)
+ public void test07() throws Throwable {
+ VfModule vfModule0 = new VfModule();
+ vfModule0.setIsBase(597);
+ vfModule0.setId(662);
+ Integer integer0 = Integer.valueOf(597);
+ Integer.compare((-1), 0);
+ Integer.divideUnsigned(597, (-3368));
+ vfModule0.setVolTemplateId(integer0);
+ Integer.getInteger(",modelCustomizationUuid=", 0);
+ vfModule0.setVolEnvironmentId(integer0);
+ vfModule0.setId(0);
+ vfModule0.getVnfResourceId();
+ Integer integer1 = new Integer(0);
+ vfModule0.setMaxInstances(integer1);
+ vfModule0.getMaxInstances();
+ vfModule0.setModelName("");
+ }
+
+ @Test(timeout = 4000)
+ public void test08() throws Throwable {
+ VfModule vfModule0 = new VfModule();
+ Integer integer0 = new Integer(0);
+ vfModule0.setInitialCount(integer0);
+ Integer integer1 = new Integer((-2063));
+ vfModule0.setVolTemplateId(integer1);
+ vfModule0.getModelVersion();
+ Integer integer2 = new Integer(0);
+ vfModule0.setInitialCount(integer2);
+ vfModule0.getLabel();
+ vfModule0.setTemplateId(integer0);
+ Integer integer3 = vfModule0.getInitialCount();
+ vfModule0.setMaxInstances(integer3);
+ }
+
+ @Test(timeout = 4000)
+ public void test09() throws Throwable {
+ VfModule vfModule0 = new VfModule();
+ vfModule0.setModelInvariantUuid("");
+ vfModule0.setDescription(",templateId=");
+ Timestamp timestamp0 = new Timestamp((-1360L));
+ MockDate mockDate0 = new MockDate(0, 0, (-1723), (-3154), (-1723));
+ vfModule0.setId((-1158));
+ mockDate0.setTime(0L);
+ timestamp0.after(mockDate0);
+ vfModule0.setCreated(timestamp0);
+ vfModule0.setType(".");
+ vfModule0.getId();
+ Integer integer0 = new Integer((-1158));
+ vfModule0.setVnfResourceId(integer0);
+ vfModule0.isBase();
+ vfModule0.setMinInstances((Integer) null);
+ }
+
+ @Test(timeout = 4000)
+ public void test10() throws Throwable {
+ VfModule vfModule0 = new VfModule();
+ vfModule0.isTheSameVersion("");
+ vfModule0.setMaxInstances((Integer) null);
+ vfModule0.setId((-2621));
+ vfModule0.setModelVersion("");
+ vfModule0.setAsdcUuid(".");
+ Integer integer0 = new Integer((-2621));
+ vfModule0.isTheSameVersion("");
+ vfModule0.setTemplateId(integer0);
+ vfModule0.getTemplateId();
+ vfModule0.getModelVersion();
+ }
+
+ @Test(timeout = 4000)
+ public void test11() throws Throwable {
+ VfModule vfModule0 = new VfModule();
+ vfModule0.toString();
+ vfModule0.setType("\"~J0_gjDe<M|_&}EQ");
+ vfModule0.getModelCustomizationUuid();
+ Integer integer0 = new Integer((-1597));
+ vfModule0.setEnvironmentId(integer0);
+ vfModule0.setVnfResourceId(integer0);
+ vfModule0.getModelCustomizationUuid();
+ vfModule0.setModelInvariantUuid((String) null);
+ vfModule0.getIsBase();
+ vfModule0.getVolEnvironmentId();
+ vfModule0.getLabel();
+ vfModule0.getVnfResourceId();
+ vfModule0.setModelVersion("VF=null,modelName=null,version=null,id=0,vnfResourceId=null,templateId=null,envtId=null,volTemplateId=null,volEnvtId=null, description=null,asdcUuid=null,modelVersion=null,modelCustomizationUuid=null,minInstances=null,maxInstances=null,initialCount=null,label=null");
+ vfModule0.getCreated();
+ Integer integer1 = new Integer((-805));
+ vfModule0.setTemplateId(integer1);
+ }
+
+ @Test(timeout = 4000)
+ public void test12() throws Throwable {
+ VfModule vfModule0 = new VfModule();
+ vfModule0.setDescription("");
+ vfModule0.getLabel();
+ Integer integer0 = new Integer(1);
+ vfModule0.setVnfResourceId(integer0);
+ vfModule0.getModelCustomizationUuid();
+ vfModule0.getLabel();
+ Integer integer1 = new Integer(1);
+ Integer.sum(542, 542);
+ vfModule0.setVolTemplateId(integer1);
+ vfModule0.getEnvironmentId();
+ vfModule0.setIsBase(1084);
+ vfModule0.setAsdcUuid((String) null);
+ vfModule0.getId();
+ vfModule0.getVnfResourceId();
+ vfModule0.setModelCustomizationUuid("o?;po<j");
+ vfModule0.getTemplateId();
+ }
+
+ @Test(timeout = 4000)
+ public void test13() throws Throwable {
+ VfModule vfModule0 = new VfModule();
+ vfModule0.setMinInstances((Integer) null);
+ Integer integer0 = new Integer(334);
+ Integer.sum(334, (-2392));
+ vfModule0.setTemplateId(integer0);
+ Integer.getInteger("");
+ vfModule0.setVnfResourceId(integer0);
+ Integer integer1 = new Integer((-2392));
+ Integer.toUnsignedLong(0);
+ vfModule0.setMaxInstances(integer1);
+ vfModule0.setModelInvariantUuid("");
+ vfModule0.getTemplateId();
+ }
+
+ @Test(timeout = 4000)
+ public void test14() throws Throwable {
+ VfModule vfModule0 = new VfModule();
+ vfModule0.setType("");
+ vfModule0.setModelCustomizationUuid("");
+ vfModule0.getIsBase();
+ vfModule0.setModelVersion("");
+ vfModule0.isMoreRecentThan("");
+ Integer integer0 = Integer.valueOf(3556);
+ Integer.compareUnsigned(0, 2007);
+ Integer.toUnsignedString(0);
+ vfModule0.setMaxInstances(integer0);
+ vfModule0.getType();
+ vfModule0.setType("");
+ vfModule0.setModelName("<>]");
+ vfModule0.getModelCustomizationUuid();
+ vfModule0.toString();
+ vfModule0.getTemplateId();
+ vfModule0.getMaxInstances();
+ }
+
+ @Test(timeout = 4000)
+ public void test15() throws Throwable {
+ VfModule vfModule0 = new VfModule();
+ vfModule0.getModelName();
+ vfModule0.setModelName("uQAnJq?Z");
+ vfModule0.getTemplateId();
+ vfModule0.setModelCustomizationUuid("");
+ vfModule0.getModelCustomizationUuid();
+ }
+
+ @Test(timeout = 4000)
+ public void test16() throws Throwable {
+ VfModule vfModule0 = new VfModule();
+ vfModule0.getInitialCount();
+ vfModule0.setMinInstances((Integer) null);
+ vfModule0.isBase();
+ vfModule0.getVolEnvironmentId();
+ Integer integer0 = new Integer((-414));
+ vfModule0.setMaxInstances(integer0);
+ vfModule0.getVolEnvironmentId();
+ vfModule0.getMaxInstances();
+ System.setCurrentTimeMillis(0L);
+ vfModule0.getMaxInstances();
+ vfModule0.getTemplateId();
+ vfModule0.getInitialCount();
+ vfModule0.getEnvironmentId();
+ }
+
+ @Test(timeout = 4000)
+ public void test17() throws Throwable {
+ VfModule vfModule0 = new VfModule();
+ vfModule0.setVolEnvironmentId((Integer) null);
+ vfModule0.setAsdcUuid(",created=");
+ Integer integer0 = new Integer(0);
+ vfModule0.setVnfResourceId(integer0);
+ Integer.getInteger(",created=", (Integer) null);
+ vfModule0.setDescription(",label=");
+ vfModule0.setLabel(".");
+ vfModule0.getModelName();
+ vfModule0.setId(0);
+ Integer.max(0, 0);
+ vfModule0.setMinInstances(integer0);
+ vfModule0.setMaxInstances((Integer) null);
+ vfModule0.getCreated();
+ vfModule0.getMaxInstances();
+ vfModule0.getAsdcUuid();
+ vfModule0.getDescription();
+ vfModule0.getMaxInstances();
+ Integer integer1 = new Integer(0);
+ vfModule0.setMaxInstances(integer1);
+ vfModule0.toString();
+ vfModule0.setCreated((Timestamp) null);
+ }
+
+ @Test(timeout = 4000)
+ public void test18() throws Throwable {
+ VfModule vfModule0 = new VfModule();
+ vfModule0.setModelCustomizationUuid(",modelVersion=");
+ Integer integer0 = new Integer((-4139));
+ vfModule0.setInitialCount(integer0);
+ Integer integer1 = new Integer((-789));
+ Integer.sum((-4139), (-2408));
+ Integer.toUnsignedString((-1850));
+ Integer.sum(958, (-176));
+ Integer.getInteger(",modelVersion=", integer0);
+ Integer.remainderUnsigned((-789), (-789));
+ vfModule0.setAsdcUuid("Y?ht4");
+ vfModule0.setEnvironmentId(integer1);
+ vfModule0.getEnvironmentId();
+ System.setCurrentTimeMillis(0L);
+ System.setCurrentTimeMillis((-2179L));
+ vfModule0.getMinInstances();
+ vfModule0.getVolTemplateId();
+ vfModule0.isBase();
+ vfModule0.isBase();
+ vfModule0.isBase();
+ vfModule0.getVnfResourceId();
+ vfModule0.getCreated();
+ }
+
+ @Test(timeout = 4000)
+ public void test19() throws Throwable {
+ VfModule vfModule0 = new VfModule();
+ Integer integer0 = new Integer(714);
+ vfModule0.setEnvironmentId(integer0);
+ vfModule0.setInitialCount((Integer) null);
+ vfModule0.toString();
+ vfModule0.setDescription("VF=null,modelName=null,version=null,id=0,vnfResourceId=null,templateId=null,envtId=714,volTemplateId=null,volEnvtId=null, description=null,asdcUuid=null,modelVersion=null,modelCustomizationUuid=null,minInstances=null,maxInstances=null,initialCount=null,label=null");
+ vfModule0.setModelVersion("VF=null,modelName=null,version=null,id=0,vnfResourceId=null,templateId=null,envtId=714,volTemplateId=null,volEnvtId=null, description=null,asdcUuid=null,modelVersion=null,modelCustomizationUuid=null,minInstances=null,maxInstances=null,initialCount=null,label=null");
+ vfModule0.setInitialCount((Integer) null);
+ vfModule0.setIsBase(1549);
+ vfModule0.setMinInstances((Integer) null);
+ vfModule0.getModelCustomizationUuid();
+ Integer integer1 = vfModule0.getEnvironmentId();
+ vfModule0.setAsdcUuid(".");
+ vfModule0.getVolEnvironmentId();
+ vfModule0.getLabel();
+ Integer.remainderUnsigned(1544, 1549);
+ Integer.sum((-277), (-277));
+ vfModule0.setMaxInstances(integer1);
+ vfModule0.getVolTemplateId();
+ vfModule0.getIsBase();
+ vfModule0.getInitialCount();
+ }
+
+ @Test(timeout = 4000)
+ public void test20() throws Throwable {
+ VfModule vfModule0 = new VfModule();
+ vfModule0.setId(0);
+ vfModule0.setDescription("sh;.zWRp.C?-rn");
+ vfModule0.setModelInvariantUuid(",label=");
+ vfModule0.getLabel();
+ vfModule0.getModelInvariantUuid();
+ Timestamp timestamp0 = new Timestamp((long) 0);
+ vfModule0.setCreated(timestamp0);
+ vfModule0.setDescription("");
+ vfModule0.setModelInvariantUuid((String) null);
+ vfModule0.getDescription();
+ }
+
+ @Test(timeout = 4000)
+ public void test21() throws Throwable {
+ VfModule vfModule0 = new VfModule();
+ vfModule0.toString();
+ vfModule0.getDescription();
+ vfModule0.setAsdcUuid("VF=null,modelName=null,version=null,id=0,vnfResourceId=null,templateId=null,envtId=null,volTemplateId=null,volEnvtId=null, description=null,asdcUuid=null,modelVersion=null,modelCustomizationUuid=null,minInstances=null,maxInstances=null,initialCount=null,label=null");
+ vfModule0.getModelName();
+ Integer integer0 = new Integer(0);
+ Integer.toUnsignedString(378);
+ Integer.sum(0, 0);
+ vfModule0.setMaxInstances(integer0);
+ vfModule0.setModelInvariantUuid((String) null);
+ vfModule0.setType("}^`%'{@?s`OiaLz");
+ vfModule0.setInitialCount(integer0);
+ vfModule0.getType();
+ vfModule0.setAsdcUuid("VF=null,modelName=null,version=null,id=0,vnfResourceId=null,templateId=null,envtId=null,volTemplateId=null,volEnvtId=null, description=null,asdcUuid=null,modelVersion=null,modelCustomizationUuid=null,minInstances=null,maxInstances=null,initialCount=null,label=null");
+ VfModule vfModule1 = new VfModule();
+ vfModule0.setType("VF=null,modelName=null,version=null,id=0,vnfResourceId=null,templateId=null,envtId=null,volTemplateId=null,volEnvtId=null, description=null,asdcUuid=null,modelVersion=null,modelCustomizationUuid=null,minInstances=null,maxInstances=null,initialCount=null,label=null");
+ vfModule0.toString();
+ vfModule0.getId();
+ vfModule1.setVnfResourceId(integer0);
+ vfModule0.getDescription();
+ vfModule0.getType();
+ vfModule0.getVolEnvironmentId();
+ vfModule0.getTemplateId();
+ }
+
+ @Test(timeout = 4000)
+ public void test22() throws Throwable {
+ VfModule vfModule0 = new VfModule();
+ vfModule0.setId(2389);
+ vfModule0.setModelCustomizationUuid("");
+ vfModule0.isTheSameVersion("");
+ vfModule0.getVolTemplateId();
+ vfModule0.getLabel();
+ vfModule0.setInitialCount((Integer) null);
+ vfModule0.getCreated();
+ vfModule0.setAsdcUuid("");
+ vfModule0.getAsdcUuid();
+ }
+
+ @Test(timeout = 4000)
+ public void test23() throws Throwable {
+ VfModule vfModule0 = new VfModule();
+ Integer integer0 = new Integer(1268);
+ vfModule0.setInitialCount(integer0);
+ Integer integer1 = new Integer(0);
+ Integer.compare(1268, 1);
+ vfModule0.setEnvironmentId(integer1);
+ vfModule0.setVersion("");
+ vfModule0.getEnvironmentId();
+ vfModule0.getVnfResourceId();
+ vfModule0.getType();
+ vfModule0.getIsBase();
+ vfModule0.getCreated();
+ ChronoUnit chronoUnit0 = ChronoUnit.MINUTES;
+ // Undeclared exception!
+ try {
+ MockInstant.truncatedTo((Instant) null, chronoUnit0);
+ fail("Expecting exception: NullPointerException");
+
+ } catch(NullPointerException e) {
+ //
+ // no message in exception (getMessage() returned null)
+ //
+ verifyException("org.evosuite.runtime.mock.java.time.MockInstant", e);
+ }
+ }
+
+ @Test(timeout = 4000)
+ public void test24() throws Throwable {
+ VfModule vfModule0 = new VfModule();
+ vfModule0.setTemplateId((Integer) null);
+ Integer integer0 = new Integer(2617);
+ vfModule0.setVolEnvironmentId(integer0);
+ vfModule0.setEnvironmentId((Integer) null);
+ vfModule0.setType("");
+ vfModule0.toString();
+ VfModule vfModule1 = new VfModule();
+ vfModule0.toString();
+ vfModule0.isMoreRecentThan("");
+ vfModule0.getModelName();
+ vfModule1.getLabel();
+ Integer integer1 = new Integer(321);
+ vfModule1.setVolTemplateId(integer1);
+ vfModule1.getVnfResourceId();
+ vfModule0.getVolTemplateId();
+ vfModule0.getVnfResourceId();
+ vfModule0.getVolEnvironmentId();
+ }
+
+ @Test(timeout = 4000)
+ public void test25() throws Throwable {
+ VfModule vfModule0 = new VfModule();
+ vfModule0.getLabel();
+ Integer integer0 = new Integer(0);
+ vfModule0.setEnvironmentId(integer0);
+ vfModule0.isMoreRecentThan("!X");
+ vfModule0.setIsBase(0);
+ vfModule0.setId(4322);
+ vfModule0.getMaxInstances();
+ vfModule0.setAsdcUuid("");
+ vfModule0.getDescription();
+ vfModule0.setDescription((String) null);
+ vfModule0.setIsBase(0);
+ vfModule0.setAsdcUuid((String) null);
+ vfModule0.setId(4322);
+ Integer.min(4322, (-1));
+ vfModule0.getDescription();
+ Integer.divideUnsigned((-2839), 4322);
+ vfModule0.getIsBase();
+ vfModule0.setInitialCount(integer0);
+ vfModule0.toString();
+ vfModule0.getModelName();
+ vfModule0.getVolEnvironmentId();
+ vfModule0.setAsdcUuid("");
+ vfModule0.getId();
+ VfModule vfModule1 = new VfModule();
+ vfModule1.getTemplateId();
+ Integer integer1 = new Integer(4322);
+ vfModule1.setMinInstances(integer1);
+ vfModule0.getId();
+ }
+
+ @Test(timeout = 4000)
+ public void test26() throws Throwable {
+ VfModule vfModule0 = new VfModule();
+ vfModule0.getAsdcUuid();
+ vfModule0.getModelVersion();
+ vfModule0.setModelName((String) null);
+ vfModule0.getVolEnvironmentId();
+ vfModule0.getIsBase();
+ Integer integer0 = new Integer((-1));
+ vfModule0.setEnvironmentId(integer0);
+ vfModule0.setMinInstances(integer0);
+ vfModule0.getVolTemplateId();
+ vfModule0.setModelVersion((String) null);
+ VfModule vfModule1 = new VfModule();
+ vfModule1.setId(0);
+ vfModule1.setModelInvariantUuid((String) null);
+ vfModule1.getModelInvariantUuid();
+ vfModule1.getModelName();
+ vfModule1.setVolEnvironmentId(integer0);
+ vfModule1.getMinInstances();
+ vfModule0.setModelName("");
+ Integer.getInteger("");
+ vfModule0.setTemplateId((Integer) null);
+ vfModule0.getModelName();
+ Integer integer1 = new Integer((-1));
+ vfModule0.setVolEnvironmentId(integer1);
+ vfModule1.getVnfResourceId();
+ Integer integer2 = vfModule1.getVolEnvironmentId();
+ vfModule0.setVolEnvironmentId(integer2);
+ vfModule1.setMinInstances((Integer) null);
+ }
+
+ @Test(timeout = 4000)
+ public void test27() throws Throwable {
+ VfModule vfModule0 = new VfModule();
+ vfModule0.toString();
+ vfModule0.setModelVersion("LBV90^6*");
+ vfModule0.setDescription("LBV90^6*");
+ vfModule0.getVnfResourceId();
+ vfModule0.setTemplateId((Integer) null);
+ vfModule0.isBase();
+ vfModule0.setIsBase((-531));
+ Integer integer0 = new Integer(2646);
+ vfModule0.setVolEnvironmentId(integer0);
+ Integer integer1 = new Integer((-531));
+ Integer.divideUnsigned((-531), 2646);
+ Integer.compare((-1), (-531));
+ Integer.toUnsignedLong((-1));
+ vfModule0.setVolEnvironmentId((Integer) null);
+ vfModule0.setVolEnvironmentId(integer1);
+ vfModule0.setTemplateId((Integer) null);
+ vfModule0.getVolEnvironmentId();
+ vfModule0.setModelName("LBV90^6*");
+ vfModule0.getTemplateId();
+ vfModule0.getModelName();
+ }
+
+ @Test(timeout = 4000)
+ public void test28() throws Throwable {
+ VfModule vfModule0 = new VfModule();
+ Integer integer0 = new Integer(2752);
+ vfModule0.setVolEnvironmentId(integer0);
+ Integer integer1 = vfModule0.getVolEnvironmentId();
+ vfModule0.setVnfResourceId(integer1);
+ vfModule0.getModelVersion();
+ vfModule0.setModelVersion((String) null);
+ vfModule0.getMinInstances();
+ vfModule0.getAsdcUuid();
+ Integer integer2 = new Integer((-672));
+ Instant instant0 = MockInstant.now();
+ ChronoField chronoField0 = ChronoField.EPOCH_DAY;
+ // Undeclared exception!
+ try {
+ MockInstant.with(instant0, (TemporalField) chronoField0, 1268L);
+ fail("Expecting exception: UnsupportedTemporalTypeException");
+
+ } catch(UnsupportedTemporalTypeException e) {
+ //
+ // Unsupported field: EpochDay
+ //
+ verifyException("java.time.Instant", e);
+ }
+ }
+
+ @Test(timeout = 4000)
+ public void test29() throws Throwable {
+ VfModule vfModule0 = new VfModule();
+ vfModule0.getMinInstances();
+ Integer integer0 = new Integer(397);
+ vfModule0.setInitialCount(integer0);
+ vfModule0.setMaxInstances((Integer) null);
+ vfModule0.isBase();
+ vfModule0.setVolEnvironmentId((Integer) null);
+ vfModule0.setModelVersion("p(>v(f\"rnCo");
+ vfModule0.setMinInstances((Integer) null);
+ vfModule0.setModelVersion("*");
+ vfModule0.getIsBase();
+ vfModule0.getModelInvariantUuid();
+ vfModule0.setIsBase((-1066));
+ vfModule0.getInitialCount();
+ vfModule0.toString();
+ vfModule0.getVolTemplateId();
+ vfModule0.getCreated();
+ }
+
+ @Test(timeout = 4000)
+ public void test30() throws Throwable {
+ VfModule vfModule0 = new VfModule();
+ vfModule0.getTemplateId();
+ Instant instant0 = MockInstant.ofEpochSecond(1L);
+ Timestamp timestamp0 = Timestamp.from(instant0);
+ vfModule0.setCreated(timestamp0);
+ vfModule0.getCreated();
+ vfModule0.getTemplateId();
+ }
+
+ @Test(timeout = 4000)
+ public void test31() throws Throwable {
+ VfModule vfModule0 = new VfModule();
+ Integer integer0 = new Integer(0);
+ vfModule0.setTemplateId(integer0);
+ vfModule0.setModelVersion("");
+ vfModule0.getModelName();
+ vfModule0.setId(0);
+ vfModule0.setModelVersion("wk~z+v");
+ Integer integer1 = new Integer(0);
+ Integer.getInteger((String) null, 0);
+ vfModule0.setEnvironmentId(integer1);
+ vfModule0.getTemplateId();
+ vfModule0.setModelName("a(");
+ Integer integer2 = vfModule0.getTemplateId();
+ vfModule0.setMinInstances(integer2);
+ vfModule0.setModelCustomizationUuid("01*}(,sCh");
+ vfModule0.getModelCustomizationUuid();
+ vfModule0.getVolEnvironmentId();
+ vfModule0.getVolEnvironmentId();
+ }
+
+ @Test(timeout = 4000)
+ public void test32() throws Throwable {
+ VfModule vfModule0 = new VfModule();
+ Integer integer0 = new Integer(4222);
+ vfModule0.setEnvironmentId(integer0);
+ vfModule0.getModelName();
+ vfModule0.setAsdcUuid((String) null);
+ vfModule0.setModelCustomizationUuid((String) null);
+ vfModule0.setType(",minInstances=");
+ vfModule0.setVnfResourceId(integer0);
+ vfModule0.getEnvironmentId();
+ vfModule0.getMaxInstances();
+ vfModule0.getVolEnvironmentId();
+ }
+
+ @Test(timeout = 4000)
+ public void test33() throws Throwable {
+ VfModule vfModule0 = new VfModule();
+ Integer integer0 = new Integer(0);
+ Integer integer1 = new Integer(1244);
+ Integer.compareUnsigned(0, 1549);
+ Integer.getInteger("", integer1);
+ vfModule0.setVolEnvironmentId(integer0);
+ vfModule0.getCreated();
+ vfModule0.getVolEnvironmentId();
+ System.setCurrentTimeMillis(1856L);
+ vfModule0.getVolTemplateId();
+ }
+
+ @Test(timeout = 4000)
+ public void test34() throws Throwable {
+ VfModule vfModule0 = new VfModule();
+ vfModule0.getModelName();
+ Integer integer0 = new Integer(0);
+ vfModule0.setVnfResourceId(integer0);
+ vfModule0.setId(0);
+ vfModule0.setModelVersion((String) null);
+ Integer integer1 = new Integer(0);
+ Integer.getInteger((String) null, 0);
+ vfModule0.setEnvironmentId(integer1);
+ vfModule0.getTemplateId();
+ vfModule0.setModelName((String) null);
+ vfModule0.setMinInstances(integer1);
+ vfModule0.setModelCustomizationUuid("01*}(,sCh");
+ vfModule0.getCreated();
+ vfModule0.getVnfResourceId();
+ vfModule0.getVolTemplateId();
+ }
+
+ @Test(timeout = 4000)
+ public void test35() throws Throwable {
+ VfModule vfModule0 = new VfModule();
+ vfModule0.getInitialCount();
+ Integer integer0 = new Integer((-1066));
+ vfModule0.getVolEnvironmentId();
+ Integer.getInteger("", (Integer) null);
+ Integer.getInteger(",envtId=", (-1066));
+ vfModule0.setMinInstances(integer0);
+ vfModule0.toString();
+ vfModule0.setVersion("VF=null,modelName=null,version=null,id=0,vnfResourceId=null,templateId=null,envtId=null,volTemplateId=null,volEnvtId=null, description=null,asdcUuid=null,modelVersion=null,modelCustomizationUuid=null,minInstances=-1066,maxInstances=null,initialCount=null,label=null");
+ vfModule0.getVolTemplateId();
+ vfModule0.getVolTemplateId();
+ vfModule0.getVnfResourceId();
+ vfModule0.getMinInstances();
+ vfModule0.getVolTemplateId();
+ vfModule0.setVersion("");
+ vfModule0.getVnfResourceId();
+ System.setCurrentTimeMillis((-1066));
+ vfModule0.setModelCustomizationUuid("VF=null,modelName=null,version=null,id=0,vnfResourceId=null,templateId=null,envtId=null,volTemplateId=null,volEnvtId=null, description=null,asdcUuid=null,modelVersion=null,modelCustomizationUuid=null,minInstances=-1066,maxInstances=null,initialCount=null,label=null");
+ vfModule0.getCreated();
+ vfModule0.getCreated();
+ System.setCurrentTimeMillis((-1066));
+ }
+
+ @Test(timeout = 4000)
+ public void test36() throws Throwable {
+ VfModule vfModule0 = new VfModule();
+ vfModule0.getEnvironmentId();
+ vfModule0.setVolEnvironmentId((Integer) null);
+ int int0 = vfModule0.getId();
+ assertEquals(0, int0);
+
+ vfModule0.getVolTemplateId();
+ String string0 = vfModule0.toString();
+ assertEquals("VF=null,modelName=null,version=null,id=0,vnfResourceId=null,templateId=null,envtId=null,volTemplateId=null,volEnvtId=null, description=null,asdcUuid=null,modelVersion=null,modelCustomizationUuid=null,minInstances=null,maxInstances=null,initialCount=null,label=null", string0);
+ }
+
+ @Test(timeout = 4000)
+ public void test37() throws Throwable {
+ VfModule vfModule0 = new VfModule();
+ vfModule0.isTheSameVersion("X+]2+]y^$6");
+ vfModule0.getTemplateId();
+ vfModule0.getId();
+ Integer.toUnsignedString(0);
+ vfModule0.getLabel();
+ Integer.remainderUnsigned((-472), 1579);
+ Integer integer0 = new Integer((-1701));
+ Integer.compare((-1701), (-1));
+ Integer.getInteger("0", integer0);
+ vfModule0.setEnvironmentId((Integer) null);
+ vfModule0.setModelInvariantUuid((String) null);
+ vfModule0.getAsdcUuid();
+ Integer integer1 = new Integer((-1701));
+ vfModule0.setVnfResourceId((Integer) null);
+ vfModule0.getIsBase();
+ Integer.compareUnsigned(1, 0);
+ vfModule0.getType();
+ vfModule0.getVnfResourceId();
+ vfModule0.setInitialCount(integer1);
+ vfModule0.setDescription("");
+ vfModule0.getEnvironmentId();
+ vfModule0.setInitialCount(integer1);
+ vfModule0.setId(1946);
+ vfModule0.getCreated();
+ vfModule0.getInitialCount();
+ vfModule0.getVnfResourceId();
+ vfModule0.getCreated();
+ assertEquals(1946, vfModule0.getId());
+ }
+
+ @Test(timeout = 4000)
+ public void test38() throws Throwable {
+ VfModule vfModule0 = new VfModule();
+ vfModule0.getMaxInstances();
+ Integer integer0 = new Integer(550);
+ vfModule0.setMinInstances(integer0);
+ Integer integer1 = new Integer(275);
+ Integer.max(0, 0);
+ vfModule0.setInitialCount(integer1);
+ vfModule0.setIsBase(275);
+ vfModule0.getEnvironmentId();
+ Integer.compare(275, 275);
+ vfModule0.setMinInstances((Integer) null);
+ vfModule0.setType("");
+ vfModule0.setVersion("]");
+ vfModule0.getId();
+ vfModule0.setId(0);
+ vfModule0.setIsBase((-17));
+ vfModule0.setId((-17));
+ vfModule0.getDescription();
+ vfModule0.getAsdcUuid();
+ vfModule0.getIsBase();
+ vfModule0.getModelName();
+ vfModule0.getEnvironmentId();
+ vfModule0.toString();
+ vfModule0.setModelInvariantUuid("D2");
+ vfModule0.getInitialCount();
+ assertEquals(-17, vfModule0.getIsBase());
+ }
+
+ @Test(timeout = 4000)
+ public void test39() throws Throwable {
+ VfModule vfModule0 = new VfModule();
+ Integer integer0 = new Integer(4477);
+ vfModule0.setVolTemplateId(integer0);
+ vfModule0.getModelInvariantUuid();
+ vfModule0.getModelInvariantUuid();
+ vfModule0.getVolTemplateId();
+ vfModule0.getMinInstances();
+ System.setCurrentTimeMillis((-1006L));
+ }
+
+ @Test(timeout = 4000)
+ public void test40() throws Throwable {
+ VfModule vfModule0 = new VfModule();
+ Integer integer0 = new Integer(0);
+ vfModule0.setMinInstances(integer0);
+ vfModule0.setType((String) null);
+ vfModule0.setAsdcUuid(",asdcUuid=");
+ Integer integer1 = vfModule0.getMinInstances();
+ assertEquals(0, (int)integer1);
+ }
+
+ @Test(timeout = 4000)
+ public void test41() throws Throwable {
+ VfModule vfModule0 = new VfModule();
+ vfModule0.getDescription();
+ String string0 = vfModule0.getModelCustomizationUuid();
+ assertNull(string0);
+ }
+
+ @Test(timeout = 4000)
+ public void test42() throws Throwable {
+ VfModule vfModule0 = new VfModule();
+ Instant instant0 = MockInstant.now();
+ Timestamp timestamp0 = Timestamp.from(instant0);
+ vfModule0.setCreated(timestamp0);
+ int int0 = vfModule0.getId();
+ assertEquals(0, int0);
+
+ vfModule0.getLabel();
+ String string0 = vfModule0.toString();
+ assertEquals("VF=null,modelName=null,version=null,id=0,vnfResourceId=null,templateId=null,envtId=null,volTemplateId=null,volEnvtId=null, description=null,asdcUuid=null,modelVersion=null,modelCustomizationUuid=null,minInstances=null,maxInstances=null,initialCount=null,label=null,created=2/14/14 8:21 PM", string0);
+ }
+
+ @Test(timeout = 4000)
+ public void test43() throws Throwable {
+ VfModule vfModule0 = new VfModule();
+ vfModule0.getMinInstances();
+ vfModule0.isBase();
+ vfModule0.setModelVersion("");
+ vfModule0.getIsBase();
+ vfModule0.getModelInvariantUuid();
+ vfModule0.setIsBase((-1066));
+ vfModule0.toString();
+ boolean boolean0 = vfModule0.isBase();
+ assertEquals(-1066, vfModule0.getIsBase());
+ assertTrue(boolean0);
+ }
+
+ @Test(timeout = 4000)
+ public void test44() throws Throwable {
+ VfModule vfModule0 = new VfModule();
+ vfModule0.getMinInstances();
+ vfModule0.toString();
+ vfModule0.setLabel("VF=null,modelName=null,version=null,id=0,vnfResourceId=null,templateId=null,envtId=null,volTemplateId=null,volEnvtId=null, description=null,asdcUuid=null,modelVersion=null,modelCustomizationUuid=null,minInstances=null,maxInstances=null,initialCount=null,label=null");
+ vfModule0.getDescription();
+ vfModule0.getModelVersion();
+ PrivateAccess.setVariable((Class<VfModule>) VfModule.class, vfModule0, "minInstances", (Object) null);
+ assertEquals(0, vfModule0.getIsBase());
+ }
+
+ @Test(timeout = 4000)
+ public void test45() throws Throwable {
+ VfModule vfModule0 = new VfModule();
+ vfModule0.setAsdcUuid(",maxInstances=");
+ vfModule0.isTheSameVersion(",maxInstances=");
+ Integer integer0 = new Integer(0);
+ vfModule0.setEnvironmentId(integer0);
+ vfModule0.setTemplateId(integer0);
+ vfModule0.setModelCustomizationUuid(",maxInstances=");
+ vfModule0.getModelInvariantUuid();
+ vfModule0.getType();
+ vfModule0.getModelCustomizationUuid();
+ vfModule0.setVolEnvironmentId(integer0);
+ vfModule0.getMaxInstances();
+ String string0 = vfModule0.toString();
+ assertEquals("VF=null,modelName=null,version=null,id=0,vnfResourceId=null,templateId=0,envtId=0,volTemplateId=null,volEnvtId=0, description=null,asdcUuid=,maxInstances=,modelVersion=null,modelCustomizationUuid=,maxInstances=,minInstances=null,maxInstances=null,initialCount=null,label=null", string0);
+ }
+
+ @Test(timeout = 4000)
+ public void test46() throws Throwable {
+ VfModule vfModule0 = new VfModule();
+ Integer integer0 = new Integer((-1));
+ Integer.remainderUnsigned((-1), (-1));
+ Integer.remainderUnsigned(0, (-1));
+ Integer.compareUnsigned((-1), 0);
+ vfModule0.setMaxInstances(integer0);
+ vfModule0.setMaxInstances(integer0);
+ vfModule0.setIsBase((-1));
+ vfModule0.setVolTemplateId(integer0);
+ vfModule0.getTemplateId();
+ Integer.divideUnsigned(0, (-1));
+ vfModule0.setMinInstances((Integer) null);
+ vfModule0.getVnfResourceId();
+ vfModule0.getVolTemplateId();
+ vfModule0.setIsBase(0);
+ vfModule0.getInitialCount();
+ int int0 = vfModule0.getIsBase();
+ assertFalse(vfModule0.isBase());
+ assertEquals(0, int0);
+ }
+
+ @Test(timeout = 4000)
+ public void test47() throws Throwable {
+ VfModule vfModule0 = new VfModule();
+ vfModule0.setType("");
+ vfModule0.setVolEnvironmentId((Integer) null);
+ vfModule0.setDescription("");
+ vfModule0.setModelInvariantUuid("");
+ vfModule0.getModelInvariantUuid();
+ vfModule0.getVolEnvironmentId();
+ vfModule0.setVnfResourceId((Integer) null);
+ vfModule0.setModelName("");
+ assertEquals(0, vfModule0.getIsBase());
+ }
+
+ @Test(timeout = 4000)
+ public void test48() throws Throwable {
+ VfModule vfModule0 = new VfModule();
+ Integer integer0 = new Integer(275);
+ vfModule0.setInitialCount(integer0);
+ vfModule0.getEnvironmentId();
+ vfModule0.setId(275);
+ vfModule0.getAsdcUuid();
+ vfModule0.getModelName();
+ vfModule0.getAsdcUuid();
+ vfModule0.getCreated();
+ assertEquals(275, vfModule0.getId());
+ }
}
diff --git a/mso-catalog-db/src/test/java/org/openecomp/mso/db/catalog/utils/RecordNotFoundExceptionESTest.java b/mso-catalog-db/src/test/java/org/openecomp/mso/db/catalog/utils/RecordNotFoundExceptionESTest.java
new file mode 100644
index 0000000000..1a0d1de41a
--- /dev/null
+++ b/mso-catalog-db/src/test/java/org/openecomp/mso/db/catalog/utils/RecordNotFoundExceptionESTest.java
@@ -0,0 +1,23 @@
+/*
+ * This file was automatically generated by EvoSuite
+ * Wed Feb 22 09:33:42 GMT 2017
+ */
+
+package org.openecomp.mso.db.catalog.utils;
+
+import org.junit.Test;
+import static org.junit.Assert.*;
+import org.evosuite.runtime.EvoRunner;
+import org.evosuite.runtime.EvoRunnerParameters;
+import org.junit.runner.RunWith;
+
+@RunWith(EvoRunner.class) @EvoRunnerParameters(mockJVMNonDeterminism = true, useVFS = true, useVNET = true, resetStaticState = true, useJEE = true)
+public class RecordNotFoundExceptionESTest extends RecordNotFoundExceptionESTestscaffolding {
+
+ @Test(timeout = 4000)
+ public void test0() throws Throwable {
+ RecordNotFoundException recordNotFoundException0 = new RecordNotFoundException("K\"]E;o`'jowz5?'`3");
+ RecordNotFoundException recordNotFoundException1 = new RecordNotFoundException("~&", (Throwable) recordNotFoundException0);
+ assertFalse(recordNotFoundException1.equals((Object)recordNotFoundException0));
+ }
+}
diff --git a/mso-catalog-db/src/test/java/org/openecomp/mso/db/catalog/utils/RecordNotFoundExceptionESTestscaffolding.java b/mso-catalog-db/src/test/java/org/openecomp/mso/db/catalog/utils/RecordNotFoundExceptionESTestscaffolding.java
new file mode 100644
index 0000000000..e74f0c4502
--- /dev/null
+++ b/mso-catalog-db/src/test/java/org/openecomp/mso/db/catalog/utils/RecordNotFoundExceptionESTestscaffolding.java
@@ -0,0 +1,81 @@
+/**
+ * Scaffolding file used to store all the setups needed to run
+ * tests automatically generated by EvoSuite
+ * Wed Feb 22 09:33:42 GMT 2017
+ */
+
+package org.openecomp.mso.db.catalog.utils;
+
+import org.evosuite.runtime.annotation.EvoSuiteClassExclude;
+import org.junit.BeforeClass;
+import org.junit.Before;
+import org.junit.After;
+import org.junit.AfterClass;
+import org.evosuite.runtime.sandbox.Sandbox;
+
+@EvoSuiteClassExclude
+public class RecordNotFoundExceptionESTestscaffolding {
+
+ @org.junit.Rule
+ public org.evosuite.runtime.vnet.NonFunctionalRequirementRule nfr = new org.evosuite.runtime.vnet.NonFunctionalRequirementRule();
+
+ private static final java.util.Properties defaultProperties = (java.util.Properties) java.lang.System.getProperties().clone();
+
+ private org.evosuite.runtime.thread.ThreadStopper threadStopper = new org.evosuite.runtime.thread.ThreadStopper (org.evosuite.runtime.thread.KillSwitchHandler.getInstance(), 3000);
+
+ @BeforeClass
+ public static void initEvoSuiteFramework() {
+ org.evosuite.runtime.RuntimeSettings.className = "org.openecomp.mso.db.catalog.utils.RecordNotFoundException";
+ org.evosuite.runtime.GuiSupport.initialize();
+ org.evosuite.runtime.RuntimeSettings.maxNumberOfThreads = 100;
+ org.evosuite.runtime.RuntimeSettings.maxNumberOfIterationsPerLoop = 10000;
+ org.evosuite.runtime.RuntimeSettings.mockSystemIn = true;
+ org.evosuite.runtime.RuntimeSettings.sandboxMode = org.evosuite.runtime.sandbox.Sandbox.SandboxMode.RECOMMENDED;
+ org.evosuite.runtime.sandbox.Sandbox.initializeSecurityManagerForSUT();
+ org.evosuite.runtime.classhandling.JDKClassResetter.init();
+ initializeClasses();
+ org.evosuite.runtime.Runtime.getInstance().resetRuntime();
+ }
+
+ @AfterClass
+ public static void clearEvoSuiteFramework(){
+ Sandbox.resetDefaultSecurityManager();
+ java.lang.System.setProperties((java.util.Properties) defaultProperties.clone());
+ }
+
+ @Before
+ public void initTestCase(){
+ threadStopper.storeCurrentThreads();
+ threadStopper.startRecordingTime();
+ org.evosuite.runtime.jvm.ShutdownHookHandler.getInstance().initHandler();
+ org.evosuite.runtime.sandbox.Sandbox.goingToExecuteSUTCode();
+ org.evosuite.runtime.GuiSupport.setHeadless();
+ org.evosuite.runtime.Runtime.getInstance().resetRuntime();
+ org.evosuite.runtime.agent.InstrumentingAgent.activate();
+ }
+
+ @After
+ public void doneWithTestCase(){
+ threadStopper.killAndJoinClientThreads();
+ org.evosuite.runtime.jvm.ShutdownHookHandler.getInstance().safeExecuteAddedHooks();
+ org.evosuite.runtime.classhandling.JDKClassResetter.reset();
+ resetClasses();
+ org.evosuite.runtime.sandbox.Sandbox.doneWithExecutingSUTCode();
+ org.evosuite.runtime.agent.InstrumentingAgent.deactivate();
+ org.evosuite.runtime.GuiSupport.restoreHeadlessMode();
+ }
+
+ private static void initializeClasses() {
+ org.evosuite.runtime.classhandling.ClassStateSupport.initializeClasses(RecordNotFoundExceptionESTestscaffolding.class.getClassLoader() ,
+ "org.openecomp.mso.db.catalog.utils.RecordNotFoundException"
+ );
+ }
+
+ private static void resetClasses() {
+ org.evosuite.runtime.classhandling.ClassResetter.getInstance().setClassLoader(RecordNotFoundExceptionESTestscaffolding.class.getClassLoader());
+
+ org.evosuite.runtime.classhandling.ClassStateSupport.resetClasses(
+ "org.openecomp.mso.db.catalog.utils.RecordNotFoundException"
+ );
+ }
+}