diff options
author | ChrisC <cc697w@intl.att.com> | 2017-01-31 11:40:03 +0100 |
---|---|---|
committer | ChrisC <cc697w@intl.att.com> | 2017-01-31 12:59:33 +0100 |
commit | 025301d08b061482c1f046d562bf017c8cbcfe8d (patch) | |
tree | 68a2a549736c9bf0f7cd4e71c76e40ef7e2606f2 /mso-api-handlers/mso-requests-db | |
parent | 2754ad52f833278a5c925bd788a16d1dce16a598 (diff) |
Initial OpenECOMP MSO commit
Change-Id: Ia6a7574859480717402cc2f22534d9973a78fa6d
Signed-off-by: ChrisC <cc697w@intl.att.com>
Diffstat (limited to 'mso-api-handlers/mso-requests-db')
29 files changed, 4583 insertions, 0 deletions
diff --git a/mso-api-handlers/mso-requests-db/hibernate.properties b/mso-api-handlers/mso-requests-db/hibernate.properties new file mode 100644 index 0000000000..c7803eab12 --- /dev/null +++ b/mso-api-handlers/mso-requests-db/hibernate.properties @@ -0,0 +1,2 @@ +hibernate.show_sql=true
+hibernate.format_sql=true
diff --git a/mso-api-handlers/mso-requests-db/hibernate.reveng.xml b/mso-api-handlers/mso-requests-db/hibernate.reveng.xml new file mode 100644 index 0000000000..dfbf9ed4c4 --- /dev/null +++ b/mso-api-handlers/mso-requests-db/hibernate.reveng.xml @@ -0,0 +1,11 @@ +<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE hibernate-reverse-engineering PUBLIC "-//Hibernate/Hibernate Reverse Engineering DTD 3.0//EN" "http://www.hibernate.org/dtd/hibernate-reverse-engineering-3.0.dtd" >
+
+<hibernate-reverse-engineering>
+
+ <schema-selection match-schema="MSO"/>
+ <type-mapping>
+ <sql-type jdbc-type="OTHER" hibernate-type="java.sql.Timestamp" />
+ </type-mapping>
+ <table-filter match-schema="MSO" match-name=".*"/>
+</hibernate-reverse-engineering>
\ No newline at end of file diff --git a/mso-api-handlers/mso-requests-db/pom.xml b/mso-api-handlers/mso-requests-db/pom.xml new file mode 100644 index 0000000000..fc09305ea9 --- /dev/null +++ b/mso-api-handlers/mso-requests-db/pom.xml @@ -0,0 +1,207 @@ +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + <modelVersion>4.0.0</modelVersion> + + <parent> + <groupId>org.openecomp.mso</groupId> + <artifactId>mso-api-handlers</artifactId> + <version>0.0.4-SNAPSHOT</version> + </parent> + + <artifactId>mso-requests-db</artifactId> + + <name>mso-requests-db</name> + <description>MSO Requests Database definition and Hibernate objects</description> + <properties> + <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> + <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> + </properties> + + <dependencies> + <dependency> + <groupId>org.hibernate</groupId> + <artifactId>hibernate-core</artifactId> + <version>4.3.6.Final</version> + <exclusions> + <!-- Avoid hibernate inclusion as provided in Jboss --> + <exclusion> + <groupId>org.jboss</groupId> + <artifactId>jandex</artifactId> + </exclusion> + <exclusion> + <groupId>org.javassist</groupId> + <artifactId>javassist</artifactId> + </exclusion> + <exclusion> + <groupId>org.jboss.logging</groupId> + <artifactId>jboss-logging</artifactId> + </exclusion> + <exclusion> + <groupId>org.jboss.logging</groupId> + <artifactId>jboss-logging-annotations</artifactId> + </exclusion> + <exclusion> + <groupId>org.jboss.spec.javax.transaction</groupId> + <artifactId>jboss-transaction-api_1.2_spec</artifactId> + </exclusion> + <exclusion> + <groupId>antlr</groupId> + <artifactId>antlr</artifactId> + </exclusion> + <exclusion> + <groupId>dom4j</groupId> + <artifactId>dom4j</artifactId> + </exclusion> + </exclusions> + </dependency> + <dependency> + <groupId>org.hibernate</groupId> + <artifactId>hibernate-entitymanager</artifactId> + <version>4.3.6.Final</version> + <exclusions> + <!-- Avoid hibernate inclusion as provided in Jboss --> + <exclusion> + <groupId>org.jboss</groupId> + <artifactId>jandex</artifactId> + </exclusion> + <exclusion> + <groupId>org.javassist</groupId> + <artifactId>javassist</artifactId> + </exclusion> + <exclusion> + <groupId>org.jboss.logging</groupId> + <artifactId>jboss-logging</artifactId> + </exclusion> + <exclusion> + <groupId>org.jboss.logging</groupId> + <artifactId>jboss-logging-annotations</artifactId> + </exclusion> + <exclusion> + <groupId>org.jboss.spec.javax.transaction</groupId> + <artifactId>jboss-transaction-api_1.2_spec</artifactId> + </exclusion> + <exclusion> + <groupId>antlr</groupId> + <artifactId>antlr</artifactId> + </exclusion> + <exclusion> + <groupId>dom4j</groupId> + <artifactId>dom4j</artifactId> + </exclusion> + </exclusions> + </dependency> + + <dependency> + <groupId>org.hibernate.javax.persistence</groupId> + <artifactId>hibernate-jpa-2.1-api</artifactId> + <version>1.0.0.Final</version> + </dependency> + + <dependency> + <groupId>org.openecomp.mso</groupId> + <artifactId>common</artifactId> + <version>${project.version}</version> + </dependency> + </dependencies> + <packaging>jar</packaging> + <build> + <finalName>${project.artifactId}</finalName> + <plugins> + + <plugin> + <artifactId>maven-war-plugin</artifactId> + <version>2.3</version> + <configuration> + <warSourceDirectory>WebContent</warSourceDirectory> + <failOnMissingWebXml>false</failOnMissingWebXml> + </configuration> + </plugin> + + <plugin> + <groupId>de.juplo</groupId> + <artifactId>hibernate4-maven-plugin</artifactId> + <version>1.1.0</version> + <executions> + <!-- MySQL --> + <execution> + <id>MySQL</id> + <goals> + <goal>export</goal> + </goals> + <configuration> + <hibernateDialect>org.hibernate.dialect.MySQL5Dialect</hibernateDialect> + <hibernateMapping>${project.basedir}/src/main/resources/InfraActiveRequests.hbm.xml,${project.basedir}/src/main/resources/SiteStatus.hbm.xml</hibernateMapping> + <target>SCRIPT</target> + <skip>false</skip> + <force>true</force> + <outputFile>${project.build.directory}/MySQL-Requests-schema.sql</outputFile> + </configuration> + </execution> + </executions> + </plugin> + <plugin> + <artifactId>maven-resources-plugin</artifactId> + <version>3.0.1</version> + <executions> + + <execution> + <id>copy-sql-file</id> + <phase>install</phase> + <goals> + <goal>copy-resources</goal> + </goals> + <configuration> + <overwrite>true</overwrite> + + <outputDirectory>${project.basedir}/../../packages/root-pack-extras/config-resources/mariadb/db-sql-scripts/main-schemas</outputDirectory> + + <resources> + <resource> + <directory>${project.build.directory}</directory> + <filtering>false</filtering> + <includes> + <include>*.sql</include> + </includes> + </resource> + </resources> + </configuration> + </execution> + </executions> + </plugin> + </plugins> + <pluginManagement> + <plugins> + <!--This plugin's configuration is used to store Eclipse m2e settings only. It has no influence on the Maven build itself.--> + <plugin> + <groupId>org.eclipse.m2e</groupId> + <artifactId>lifecycle-mapping</artifactId> + <version>1.0.0</version> + <configuration> + <lifecycleMappingMetadata> + <pluginExecutions> + <pluginExecution> + <pluginExecutionFilter> + <groupId>de.juplo</groupId> + <artifactId> + hibernate4-maven-plugin + </artifactId> + <versionRange> + [1.0.3,) + </versionRange> + <goals> + <goal>export</goal> + </goals> + </pluginExecutionFilter> + <action> + <ignore></ignore> + </action> + </pluginExecution> + </pluginExecutions> + </lifecycleMappingMetadata> + </configuration> + </plugin> + </plugins> + </pluginManagement> + </build> + +</project>
\ No newline at end of file diff --git a/mso-api-handlers/mso-requests-db/src/hibernate.reveng.xml b/mso-api-handlers/mso-requests-db/src/hibernate.reveng.xml new file mode 100644 index 0000000000..b9ac472778 --- /dev/null +++ b/mso-api-handlers/mso-requests-db/src/hibernate.reveng.xml @@ -0,0 +1,31 @@ +<?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-reverse-engineering PUBLIC "-//Hibernate/Hibernate Reverse Engineering DTD 3.0//EN" "http://www.hibernate.org/dtd//hibernate-reverse-engineering-3.0.dtd" > + +<hibernate-reverse-engineering> + + <schema-selection match-schema="MSO"/> + <table-filter match-schema="MSO" match-name=".*"/> + <type-mapping> + <sql-type jdbc-type="OTHER" hibernate-type="java.sql.Timestamp" /> + </type-mapping> +</hibernate-reverse-engineering> diff --git a/mso-api-handlers/mso-requests-db/src/main/java/META-INF/MANIFEST.MF b/mso-api-handlers/mso-requests-db/src/main/java/META-INF/MANIFEST.MF new file mode 100644 index 0000000000..5e9495128c --- /dev/null +++ b/mso-api-handlers/mso-requests-db/src/main/java/META-INF/MANIFEST.MF @@ -0,0 +1,3 @@ +Manifest-Version: 1.0
+Class-Path:
+
diff --git a/mso-api-handlers/mso-requests-db/src/main/java/org/openecomp/mso/requestsdb/HibernateUtil.java b/mso-api-handlers/mso-requests-db/src/main/java/org/openecomp/mso/requestsdb/HibernateUtil.java new file mode 100644 index 0000000000..21bece9b10 --- /dev/null +++ b/mso-api-handlers/mso-requests-db/src/main/java/org/openecomp/mso/requestsdb/HibernateUtil.java @@ -0,0 +1,59 @@ +/*- + * ============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.requestsdb; + + +import org.hibernate.SessionFactory; +import org.hibernate.cfg.Configuration; +import org.openecomp.mso.logger.MessageEnum; +import org.openecomp.mso.logger.MsoLogger; + +@SuppressWarnings("deprecation") +public class HibernateUtil { + + //private static SessionFactory SESSION_FACTORY; + private static final MsoLogger LOGGER = MsoLogger.getMsoLogger (MsoLogger.Catalog.APIH); + + private static SessionFactory SESSION_FACTORY; + + + static { + try { + + if ("MYSQL".equals (System.getProperty ("mso.db")) || "MARIADB".equals(System.getProperty("mso.db"))) { + SESSION_FACTORY = new Configuration ().configure ("hibernate-mysql.cfg.xml").buildSessionFactory (); + } 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 ex) { + LOGGER.error (MessageEnum.APIH_DB_ACCESS_EXC_REASON, ex.getMessage (), "", "", MsoLogger.ErrorCode.DataError , "Problem in getting DB connection type", ex); + throw ex; + } + } + + public static SessionFactory getSessionFactory () { + return SESSION_FACTORY; + } + + private HibernateUtil () { + // Avoid creation of an instance + } +} diff --git a/mso-api-handlers/mso-requests-db/src/main/java/org/openecomp/mso/requestsdb/InfraActiveRequests.java b/mso-api-handlers/mso-requests-db/src/main/java/org/openecomp/mso/requestsdb/InfraActiveRequests.java new file mode 100644 index 0000000000..992cf6afc1 --- /dev/null +++ b/mso-api-handlers/mso-requests-db/src/main/java/org/openecomp/mso/requestsdb/InfraActiveRequests.java @@ -0,0 +1,41 @@ +/*- + * ============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.requestsdb; + + +/** + * InfraActiveRequests + */ +public class InfraActiveRequests extends InfraRequests { + + /** + * Serialization id. + */ + private static final long serialVersionUID = 5003555140088137254L; + + public InfraActiveRequests() { + super (); + } + + public InfraActiveRequests(String requestId, String action) { + super (requestId, action); + } +} diff --git a/mso-api-handlers/mso-requests-db/src/main/java/org/openecomp/mso/requestsdb/InfraRequests.java b/mso-api-handlers/mso-requests-db/src/main/java/org/openecomp/mso/requestsdb/InfraRequests.java new file mode 100644 index 0000000000..43128192d9 --- /dev/null +++ b/mso-api-handlers/mso-requests-db/src/main/java/org/openecomp/mso/requestsdb/InfraRequests.java @@ -0,0 +1,405 @@ +/*- + * ============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.requestsdb; + +// Generated Jul 27, 2015 3:05:00 PM by Hibernate Tools 3.4.0.CR1 + +import java.sql.Timestamp; + +import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; + +import org.openecomp.mso.requestsdb.adapter.TimestampXMLAdapter; + +/** + * InfraActiveRequests generated by hbm2java + */ +public class InfraRequests implements java.io.Serializable { + + /** + * Serialization id. + */ + private static final long serialVersionUID = -661307666798018192L; + + private String requestId; + private String clientRequestId; + private String action; + private String requestStatus; + private String statusMessage; + private Long progress; + private Timestamp startTime; + private Timestamp endTime; + private String source; + private String vnfId; + private String vnfName; + private String vnfType; + private String serviceType; + private String aicNodeClli; + private String tenantId; + private String provStatus; + private String vnfParams; + private String vnfOutputs; + private String requestBody; + private String responseBody; + private String lastModifiedBy; + private Timestamp modifyTime; + private String requestType; + private String volumeGroupId; + private String volumeGroupName; + private String vfModuleId; + private String vfModuleName; + private String vfModuleModelName; + private String aaiServiceId; + private String aicCloudRegion; + private String callBackUrl; + private String correlator; + private String serviceInstanceId; + private String serviceInstanceName; + private String requestScope; + private String requestAction; + private String networkId; + private String networkName; + private String networkType; + + + public InfraRequests() { + } + + public InfraRequests(String requestId, String action) { + this.requestId = requestId; + this.action = action; + } + + public String getRequestId() { + return this.requestId; + } + + public void setRequestId(String requestId) { + this.requestId = requestId; + } + + public String getClientRequestId() { + return clientRequestId; + } + + public void setClientRequestId(String clientRequestId) { + this.clientRequestId = clientRequestId; + } + + public String getAction() { + return this.action; + } + + public void setAction(String action) { + this.action = action; + } + + public String getRequestStatus() { + return this.requestStatus; + } + + public void setRequestStatus(String requestStatus) { + this.requestStatus = requestStatus; + } + + public String getStatusMessage() { + return this.statusMessage; + } + + public void setStatusMessage(String statusMessage) { + this.statusMessage = statusMessage; + } + + public Long getProgress() { + return this.progress; + } + + public void setProgress(Long progress) { + this.progress = progress; + } + + @XmlJavaTypeAdapter(TimestampXMLAdapter.class) + public Timestamp getStartTime() { + return this.startTime; + } + + public void setStartTime(Timestamp startTime) { + this.startTime = startTime; + } + + @XmlJavaTypeAdapter(TimestampXMLAdapter.class) + public Timestamp getEndTime() { + return this.endTime; + } + + public void setEndTime(Timestamp endTime) { + this.endTime = endTime; + } + + public String getSource() { + return this.source; + } + + public void setSource(String source) { + this.source = source; + } + + public String getVnfId() { + return this.vnfId; + } + + public void setVnfId(String vnfId) { + this.vnfId = vnfId; + } + + public String getVnfName() { + return this.vnfName; + } + + public void setVnfName(String vnfName) { + this.vnfName = vnfName; + } + + public String getVnfType() { + return this.vnfType; + } + + public void setVnfType(String vnfType) { + this.vnfType = vnfType; + } + + public String getServiceType() { + return this.serviceType; + } + + public void setServiceType(String serviceType) { + this.serviceType = serviceType; + } + + public String getAicNodeClli() { + return this.aicNodeClli; + } + + public void setAicNodeClli(String aicNodeClli) { + this.aicNodeClli = aicNodeClli; + } + + public String getTenantId() { + return this.tenantId; + } + + public void setTenantId(String tenantId) { + this.tenantId = tenantId; + } + + public String getProvStatus() { + return this.provStatus; + } + + public void setProvStatus(String provStatus) { + this.provStatus = provStatus; + } + + public String getVnfParams() { + return this.vnfParams; + } + + public void setVnfParams(String vnfParams) { + this.vnfParams = vnfParams; + } + + public String getVnfOutputs() { + return this.vnfOutputs; + } + + public void setVnfOutputs(String vnfOutputs) { + this.vnfOutputs = vnfOutputs; + } + + public String getRequestBody() { + return this.requestBody; + } + + public void setRequestBody(String requestBody) { + this.requestBody = requestBody; + } + + public String getResponseBody() { + return this.responseBody; + } + + public void setResponseBody(String responseBody) { + this.responseBody = responseBody; + } + + public String getLastModifiedBy() { + return this.lastModifiedBy; + } + + public void setLastModifiedBy(String lastModifiedBy) { + this.lastModifiedBy = lastModifiedBy; + } + + @XmlJavaTypeAdapter(TimestampXMLAdapter.class) + public Timestamp getModifyTime() { + return this.modifyTime; + } + + public void setModifyTime(Timestamp modifyTime) { + this.modifyTime = modifyTime; + } + + public String getRequestType() { + return this.requestType; + } + + public void setRequestType(String requestType) { + this.requestType = requestType; + } + + public String getVolumeGroupId() { + return this.volumeGroupId; + } + + public void setVolumeGroupId(String volumeGroupId) { + this.volumeGroupId = volumeGroupId; + } + + public String getVolumeGroupName() { + return this.volumeGroupName; + } + + public void setVolumeGroupName(String volumeGroupName) { + this.volumeGroupName = volumeGroupName; + } + + public String getVfModuleId() { + return this.vfModuleId; + } + + public void setVfModuleId(String vfModuleId) { + this.vfModuleId = vfModuleId; + } + + public String getVfModuleName() { + return this.vfModuleName; + } + + public void setVfModuleName(String vfModuleName) { + this.vfModuleName = vfModuleName; + } + + public String getVfModuleModelName() { + return this.vfModuleModelName; + } + + public void setVfModuleModelName(String vfModuleModelName) { + this.vfModuleModelName = vfModuleModelName; + } + + public String getAaiServiceId() { + return this.aaiServiceId; + } + + public void setAaiServiceId(String aaiServiceId) { + this.aaiServiceId = aaiServiceId; + } + + public String getAicCloudRegion() { + return this.aicCloudRegion; + } + + public void setAicCloudRegion(String aicCloudRegion) { + this.aicCloudRegion = aicCloudRegion; + } + + public String getCallBackUrl() { + return callBackUrl; + } + + public void setCallBackUrl(String callBackUrl) { + this.callBackUrl = callBackUrl; + } + + public String getCorrelator() { + return correlator; + } + + public void setCorrelator(String correlator) { + this.correlator = correlator; + } + + public String getServiceInstanceId() { + return serviceInstanceId; + } + + public void setServiceInstanceId(String serviceInstanceId) { + this.serviceInstanceId = serviceInstanceId; + } + + public String getServiceInstanceName() { + return serviceInstanceName; + } + + public void setServiceInstanceName(String serviceInstanceName) { + this.serviceInstanceName = serviceInstanceName; + } + + public String getRequestScope() { + return requestScope; + } + + public void setRequestScope(String requestScope) { + this.requestScope = requestScope; + } + + public String getRequestAction() { + return requestAction; + } + + public void setRequestAction(String requestAction) { + this.requestAction = requestAction; + } + + public String getNetworkId() { + return networkId; + } + + public void setNetworkId(String networkId) { + this.networkId = networkId; + } + + public String getNetworkName() { + return networkName; + } + + public void setNetworkName(String networkName) { + this.networkName = networkName; + } + + public String getNetworkType() { + return networkType; + } + + public void setNetworkType(String networkType) { + this.networkType = networkType; + } + +} diff --git a/mso-api-handlers/mso-requests-db/src/main/java/org/openecomp/mso/requestsdb/MockRequestsDatabase.java b/mso-api-handlers/mso-requests-db/src/main/java/org/openecomp/mso/requestsdb/MockRequestsDatabase.java new file mode 100644 index 0000000000..22179e95f8 --- /dev/null +++ b/mso-api-handlers/mso-requests-db/src/main/java/org/openecomp/mso/requestsdb/MockRequestsDatabase.java @@ -0,0 +1,72 @@ +/*- + * ============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.requestsdb; + + + +import java.util.HashMap; +import java.util.Map; + +public class MockRequestsDatabase { + + private Map<String, InfraActiveRequests> activeRequests; + + public MockRequestsDatabase() { + activeRequests = new HashMap<String, InfraActiveRequests>(); + } + + public void addRecord(InfraActiveRequests record) { + String serviceType = record.getServiceType(); + String serviceInstanceId = record.getServiceInstanceId(); + String key = serviceType + "::" + serviceInstanceId; + activeRequests.put(key, record); + } + + public void deleteRecord(String serviceType, String serviceInstanceId) { + String key = serviceType + "::" + serviceInstanceId; + activeRequests.remove(key); + } + + public InfraActiveRequests getRecord(String serviceType, String serviceInstanceId) { + String key = serviceType + "::" + serviceInstanceId; + InfraActiveRequests record = activeRequests.get(key); + return record; + } + + public InfraActiveRequests checkDuplicate(String serviceType, String serviceInstanceId) { + return getRecord(serviceType, serviceInstanceId); + } + + public InfraActiveRequests checkRetry(String serviceType, String serviceInstanceId) { + InfraActiveRequests record = getRecord(serviceType, serviceInstanceId); + InfraActiveRequests returnRecord = null; + if (record != null) { + String requestAction = record.getRequestAction(); + if (requestAction == null || !requestAction.equals("GetLayer3ServiceDetailsRequest")) { + String status = record.getRequestStatus(); + if (status != null && status.equals("COMPLETED")) { + return returnRecord = record; + } + } + } + return returnRecord; + } +} diff --git a/mso-api-handlers/mso-requests-db/src/main/java/org/openecomp/mso/requestsdb/RequestsDatabase.java b/mso-api-handlers/mso-requests-db/src/main/java/org/openecomp/mso/requestsdb/RequestsDatabase.java new file mode 100644 index 0000000000..8961b26a80 --- /dev/null +++ b/mso-api-handlers/mso-requests-db/src/main/java/org/openecomp/mso/requestsdb/RequestsDatabase.java @@ -0,0 +1,494 @@ +/*- + * ============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.requestsdb; + +import java.sql.Timestamp; +import java.util.ArrayList; +import java.util.Calendar; +import java.util.HashMap; +import java.util.LinkedList; +import java.util.List; +import java.util.Map; + +import org.apache.http.HttpStatus; +import org.hibernate.Criteria; +import org.hibernate.Query; +import org.hibernate.Session; +import org.hibernate.criterion.Criterion; +import org.hibernate.criterion.Order; +import org.hibernate.criterion.Restrictions; +import org.hibernate.persister.entity.AbstractEntityPersister; + +import org.openecomp.mso.logger.MsoLogger; + +public final class RequestsDatabase { + + private static MsoLogger msoLogger = MsoLogger.getMsoLogger (MsoLogger.Catalog.GENERAL); + + private static final String SOURCE = "source"; + private static final String START_TIME = "startTime"; + private static final String REQUEST_TYPE = "requestType"; + private static final String SERVICE_INSTANCE_ID = "serviceInstanceId"; + private static final String SERVICE_INSTANCE_NAME = "serviceInstanceName"; + private static final String VNF_INSTANCE_NAME = "vnfName"; + private static final String VNF_INSTANCE_ID = "vnfId"; + private static final String VOLUME_GROUP_INSTANCE_NAME = "volumeGroupName"; + private static final String VOLUME_GROUP_INSTANCE_ID = "volumeGroupId"; + private static final String VFMODULE_INSTANCE_NAME = "vfModuleName"; + private static final String VFMODULE_INSTANCE_ID = "vfModuleId"; + private static final String NETWORK_INSTANCE_NAME = "networkName"; + private static final String NETWORK_INSTANCE_ID = "networkId"; + private static final String GLOBAL_SUBSCRIBER_ID = "globalSubscriberId"; + private static final String SERVICE_NAME_VERSION_ID = "serviceNameVersionId"; + private static final String SERVICE_ID = "serviceId"; + private static final String SERVICE_VERSION = "serviceVersion"; + private static final String SERVICE_TYPE = "serviceType"; + private static final String REQUEST_ID = "requestId"; + private static MockRequestsDatabase mockDB = null; + + /** + * Avoids creating an instance of this utility class. + */ + private RequestsDatabase () { + } + + public static boolean healthCheck () { + Session session = HibernateUtil.getSessionFactory ().openSession (); + try { + Query query = session.createSQLQuery (" show tables "); + + List<?> list = query.list(); + + } finally { + if (session != null && session.isOpen ()) { + session.close (); + } + } + return true; + } + + + public static int updateInfraStatus (String requestId, String requestStatus, String lastModifiedBy) { + long startTime = System.currentTimeMillis (); + msoLogger.debug ("Update infra request record " + requestId + " with status " + requestStatus); + Session session = HibernateUtil.getSessionFactory ().openSession (); + + int result = 0; + try { + session.beginTransaction (); + Query query = session.createQuery ("update InfraActiveRequests set requestStatus = :requestStatus, modifyTime = :modifyTime, lastModifiedBy = :lastModifiedBy where requestId = :requestId "); + query.setParameter ("requestStatus", requestStatus); + query.setParameter (REQUEST_ID, requestId); + query.setParameter ("lastModifiedBy", lastModifiedBy); + Calendar modifyTime = Calendar.getInstance (); + Timestamp modifyTimeStamp = new Timestamp (modifyTime.getTimeInMillis ()); + query.setParameter ("modifyTime", modifyTimeStamp); + result = query.executeUpdate (); + session.getTransaction ().commit (); + } finally { + if (session != null && session.isOpen ()) { + session.close (); + } + msoLogger.recordMetricEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully", "RequestDB", "updateInfraStatus", null); + } + return result; + } + + public static int updateInfraStatus (String requestId, String requestStatus, long progress, String lastModifiedBy) { + long startTime = System.currentTimeMillis (); + msoLogger.debug ("Update infra request record " + requestId + " with status " + requestStatus); + Session session = HibernateUtil.getSessionFactory ().openSession (); + + int result = 0; + try { + session.beginTransaction (); + Query query = session.createQuery ("update InfraActiveRequests set requestStatus = :requestStatus, modifyTime = :modifyTime, progress = :progress, lastModifiedBy = :lastModifiedBy where requestId = :requestId "); + query.setParameter ("requestStatus", requestStatus); + query.setParameter (REQUEST_ID, requestId); + query.setParameter ("progress", progress); + query.setParameter ("lastModifiedBy", lastModifiedBy); + Calendar modifyTime = Calendar.getInstance (); + Timestamp modifyTimeStamp = new Timestamp (modifyTime.getTimeInMillis ()); + query.setParameter ("modifyTime", modifyTimeStamp); + result = query.executeUpdate (); + session.getTransaction ().commit (); + } finally { + if (session != null && session.isOpen ()) { + session.close (); + } + msoLogger.recordMetricEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully", "RequestDB", "updateInfraStatus", null); + } + return result; + } + + public static int updateInfraFinalStatus (String requestId, String requestStatus, String statusMessage, long progress, String responseBody, String lastModifiedBy) { + long startTime = System.currentTimeMillis (); + msoLogger.debug ("Update infra request record " + requestId + " with status " + requestStatus); + Session session = HibernateUtil.getSessionFactory ().openSession (); + + int result = 0; + try { + session.beginTransaction (); + Query query = session.createQuery ("update InfraActiveRequests set requestStatus = :requestStatus, statusMessage = :statusMessage, progress = :progress, endTime = :endTime, responseBody = :responseBody, lastModifiedBy = :lastModifiedBy where id.requestId = :requestId "); + query.setParameter ("requestStatus", requestStatus); + query.setParameter ("requestId", requestId); + Calendar endTime = Calendar.getInstance (); + Timestamp endTimeStamp = new Timestamp (endTime.getTimeInMillis ()); + query.setParameter ("endTime", endTimeStamp); + query.setParameter ("statusMessage", statusMessage); + query.setParameter ("progress", progress); + query.setParameter ("responseBody", responseBody); + query.setParameter ("lastModifiedBy", lastModifiedBy); + result = query.executeUpdate (); + session.getTransaction ().commit (); + } finally { + if (session != null && session.isOpen ()) { + session.close (); + } + msoLogger.recordMetricEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully", "RequestDB", "updateInfraFinalStatus", null); + } + return result; + } + + + private static List<InfraActiveRequests> executeInfraQuery (List <Criterion> criteria, Order order) { + + long startTime = System.currentTimeMillis (); + msoLogger.debug ("Execute query on infra active request table"); + + List <InfraActiveRequests> results = new ArrayList<InfraActiveRequests>(); + + Session session = HibernateUtil.getSessionFactory ().openSession (); + try { + session.beginTransaction (); + Criteria crit = session.createCriteria (InfraActiveRequests.class); + for (Criterion criterion : criteria) { + crit.add (criterion); + } + crit.addOrder (order); + + // @SuppressWarnings("unchecked") + results = crit.list (); + + } finally { + if (session != null && session.isOpen ()) { + session.close (); + } + msoLogger.recordMetricEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully", "RequestDB", "getInfraActiveRequest", null); + } + return results; + } + + public static InfraActiveRequests getRequestFromInfraActive (String requestId) { + long startTime = System.currentTimeMillis (); + msoLogger.debug ("Get request " + requestId + " from InfraActiveRequests DB"); + + Session session = HibernateUtil.getSessionFactory ().openSession (); + InfraActiveRequests ar = null; + try { + session.beginTransaction (); + Query query = session.createQuery ("from InfraActiveRequests where requestId = :requestId OR clientRequestId = :requestId"); + query.setParameter (REQUEST_ID, requestId); + ar = (InfraActiveRequests) query.uniqueResult (); + } finally { + if (session != null && session.isOpen ()) { + session.close (); + } + msoLogger.recordMetricEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully", "InfraRequestDB", "getRequestFromInfraActive", null); + } + return ar; + } + + public static InfraActiveRequests checkInstanceNameDuplicate (HashMap<String,String> instanceIdMap, String instanceName, String requestScope) { + + List <Criterion> criteria = new LinkedList <> (); + + if(instanceName != null && !instanceName.equals("")) { + + if(requestScope.equals("service")){ + criteria.add (Restrictions.eq (SERVICE_INSTANCE_NAME, instanceName)); + } else if(requestScope.equals("vnf")){ + criteria.add (Restrictions.eq (VNF_INSTANCE_NAME, instanceName)); + } else if(requestScope.equals("volumeGroup")){ + criteria.add (Restrictions.eq (VOLUME_GROUP_INSTANCE_NAME, instanceName)); + } else if(requestScope.equals("vfModule")){ + criteria.add (Restrictions.eq (VFMODULE_INSTANCE_NAME, instanceName)); + } else if(requestScope.equals("network")){ + criteria.add (Restrictions.eq (NETWORK_INSTANCE_NAME, instanceName)); + } + + } else { + if(instanceIdMap != null){ + if(requestScope.equals("service") && instanceIdMap.get("serviceInstanceId") != null){ + criteria.add (Restrictions.eq (SERVICE_INSTANCE_ID, instanceIdMap.get("serviceInstanceId"))); + } + + if(requestScope.equals("vnf") && instanceIdMap.get("vnfInstanceId") != null){ + criteria.add (Restrictions.eq (VNF_INSTANCE_ID, instanceIdMap.get("vnfInstanceId"))); + } + + if(requestScope.equals("vfModule") && instanceIdMap.get("vfModuleInstanceId") != null){ + criteria.add (Restrictions.eq (VFMODULE_INSTANCE_ID, instanceIdMap.get("vfModuleInstanceId"))); + } + + if(requestScope.equals("volumeGroup") && instanceIdMap.get("volumeGroupInstanceId") != null){ + criteria.add (Restrictions.eq (VOLUME_GROUP_INSTANCE_ID, instanceIdMap.get("volumeGroupInstanceId"))); + } + + if(requestScope.equals("network") && instanceIdMap.get("networkInstanceId") != null){ + criteria.add (Restrictions.eq (NETWORK_INSTANCE_ID, instanceIdMap.get("networkInstanceId"))); + } + } + } + + criteria.add (Restrictions.in ("requestStatus", new String[] { "PENDING", "IN_PROGRESS", "TIMEOUT" })); + + Order order = Order.desc (START_TIME); + + List<InfraActiveRequests> dupList = executeInfraQuery(criteria, order); + + InfraActiveRequests infraActiveRequests = null; + + if(dupList != null && dupList.size() > 0){ + infraActiveRequests = dupList.get(0); + } + + return infraActiveRequests; + } + + public static List<InfraActiveRequests> getOrchestrationFiltersFromInfraActive (Map<String, List<String>> orchestrationMap) { + + + List <Criterion> criteria = new LinkedList <> (); + for (Map.Entry<String, List<String>> entry : orchestrationMap.entrySet()) + { + String mapKey = entry.getKey(); + + if(mapKey.equalsIgnoreCase("vnfInstanceId")){ + mapKey = "vnfId"; + } else if(mapKey.equalsIgnoreCase("vnfInstanceName")) { + mapKey = "vnfName"; + } else if(mapKey.equalsIgnoreCase("vfModuleInstanceId")) { + mapKey = "vfModuleId"; + } else if(mapKey.equalsIgnoreCase("vfModuleInstanceName")) { + mapKey = "vfModuleName"; + } else if(mapKey.equalsIgnoreCase("volumeGroupInstanceId")) { + mapKey = "volumeGroupId"; + } else if(mapKey.equalsIgnoreCase("volumeGroupInstanceName")) { + mapKey = "volumeGroupName"; + } else if(mapKey.equalsIgnoreCase("networkInstanceId")) { + mapKey = "networkId"; + } else if(mapKey.equalsIgnoreCase("networkInstanceName")) { + mapKey = "networkName"; + } else if(mapKey.equalsIgnoreCase("lcpCloudRegionId")) { + mapKey = "aicCloudRegion"; + } + + criteria.add(Restrictions.eq(mapKey, entry.getValue().get(1))); + + } + + Order order = Order.asc (START_TIME); + + return executeInfraQuery (criteria, order); + } + + + public static List <InfraActiveRequests> getRequestListFromInfraActive (String queryAttributeName, + String queryValue, + String requestType) { + long startTime = System.currentTimeMillis (); + msoLogger.debug ("Get list of infra requests from DB with " + queryAttributeName + " = " + queryValue); + + Session session = HibernateUtil.getSessionFactory ().openSession (); + try { + session.beginTransaction (); + Criteria crit = session.createCriteria (InfraActiveRequests.class) + .add (Restrictions.eq (queryAttributeName, queryValue)); + crit.add (Restrictions.eqOrIsNull (REQUEST_TYPE, requestType)); + crit.addOrder (Order.desc (START_TIME)); + crit.addOrder (Order.asc (SOURCE)); + + @SuppressWarnings("unchecked") + List <InfraActiveRequests> arList = crit.list (); + if (arList != null && !arList.isEmpty ()) { + return arList; + } + } finally { + if (session != null && session.isOpen ()) { + session.close (); + } + // msoLogger.recordMetricEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully", "RequestDB", "getRequestListFromInfraActive", null); + } + return null; + } + + + public static InfraActiveRequests getRequestFromInfraActive (String requestId, String requestType) { + long startTime = System.currentTimeMillis (); + msoLogger.debug ("Get infra request from DB with id " + requestId); + + Session session = HibernateUtil.getSessionFactory ().openSession (); + InfraActiveRequests ar = null; + try { + session.beginTransaction (); + Query query = session.createQuery ("from InfraActiveRequests where (requestId = :requestId OR clientRequestId = :requestId) and requestType = :requestType"); + query.setParameter (REQUEST_ID, requestId); + query.setParameter (REQUEST_TYPE, requestType); + ar = (InfraActiveRequests) query.uniqueResult (); + } finally { + if (session != null && session.isOpen ()) { + session.close (); + } + msoLogger.recordMetricEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully", "RequestDB", "getRequestFromInfraActive", null); + } + return ar; + } + + + public static InfraActiveRequests checkDuplicateByVnfName (String vnfName, String action, String requestType) { + + long startTime = System.currentTimeMillis (); + msoLogger.debug ("Get infra request from DB for VNF " + vnfName + " and action " + action + " and requestType " + requestType); + + InfraActiveRequests ar = null; + Session session = HibernateUtil.getSessionFactory ().openSession (); + + try { + session.beginTransaction (); + Query query = session.createQuery ("from InfraActiveRequests where vnfName = :vnfName and action = :action and (requestStatus = 'PENDING' or requestStatus = 'IN_PROGRESS' or requestStatus = 'TIMEOUT') and requestType = :requestType ORDER BY startTime DESC"); + query.setParameter ("vnfName", vnfName); + query.setParameter ("action", action); + query.setParameter (REQUEST_TYPE, requestType); + @SuppressWarnings("unchecked") + List <InfraActiveRequests> results = query.list (); + if (!results.isEmpty ()) { + ar = results.get (0); + } + } finally { + if (session != null && session.isOpen ()) { + session.close (); + } + msoLogger.recordMetricEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully", "RequestDB", "checkDuplicateByVnfName", null); + } + + return ar; + } + + public static InfraActiveRequests checkDuplicateByVnfId (String vnfId, String action, String requestType) { + + long startTime = System.currentTimeMillis (); + msoLogger.debug ("Get list of infra requests from DB for VNF " + vnfId + " and action " + action); + + InfraActiveRequests ar = null; + Session session = HibernateUtil.getSessionFactory ().openSession (); + + try { + session.beginTransaction (); + Query query = session.createQuery ("from InfraActiveRequests where vnfId = :vnfId and action = :action and (requestStatus = 'PENDING' or requestStatus = 'IN_PROGRESS' or requestStatus = 'TIMEOUT') and requestType = :requestType ORDER BY startTime DESC"); + query.setParameter ("vnfId", vnfId); + query.setParameter ("action", action); + query.setParameter (REQUEST_TYPE, requestType); + @SuppressWarnings("unchecked") + List <InfraActiveRequests> results = query.list (); + if (!results.isEmpty ()) { + ar = results.get (0); + } + } finally { + if (session != null && session.isOpen ()) { + session.close (); + } + msoLogger.recordMetricEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully", "RequestDB", "checkDuplicateByVnfId", null); + } + + return ar; + } + + public static void setMockDB(MockRequestsDatabase mockDB) { + RequestsDatabase.mockDB = mockDB; + } + + /** + * Fetch a specific SiteStatus by SiteName. + * + * @param siteName The unique name of the site + * @return SiteStatus object or null if none found + */ + public static SiteStatus getSiteStatus (String siteName) { + Session session = HibernateUtil.getSessionFactory ().openSession (); + + long startTime = System.currentTimeMillis (); + SiteStatus siteStatus = null; + msoLogger.debug ("Request database - get Site Status with Site name:" + siteName); + try { + String hql = "FROM SiteStatus WHERE siteName = :site_name"; + Query query = session.createQuery (hql); + query.setParameter ("site_name", siteName); + + siteStatus = (SiteStatus) query.uniqueResult (); + } finally { + if (session != null && session.isOpen ()) { + session.close (); + } + msoLogger.debug ("getSiteStatus - Successfully: " + siteStatus); + } + return siteStatus; + } + + /** + * Fetch a specific SiteStatus by SiteName. + * + * @param siteName The unique name of the site + * @param status The updated status of the Site + */ + public static void updateSiteStatus (String siteName, boolean status) { + Session session = HibernateUtil.getSessionFactory ().openSession (); + session.beginTransaction (); + + long startTime = System.currentTimeMillis (); + msoLogger.debug ("Request database - save Site Status with Site name:" + siteName); + try { + String hql = "FROM SiteStatus WHERE siteName = :site_name"; + Query query = session.createQuery (hql); + query.setParameter ("site_name", siteName); + + SiteStatus siteStatus = (SiteStatus) query.uniqueResult (); + if (siteStatus == null) { + siteStatus = new SiteStatus (); + siteStatus.setSiteName (siteName); + siteStatus.setStatus (status); + //siteStatus.setCreated(new Timestamp(new Date().getTime())); + session.save (siteStatus); + } else { + siteStatus.setStatus(status); + //siteStatus.setCreated(new Timestamp(new Date().getTime())); + session.merge (siteStatus); + } + session.getTransaction ().commit (); + } finally { + if (session != null && session.isOpen ()) { + session.close (); + } + msoLogger.recordMetricEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully", "RequestDB", "updateSiteStatus", null); + } + } + +} diff --git a/mso-api-handlers/mso-requests-db/src/main/java/org/openecomp/mso/requestsdb/SiteStatus.java b/mso-api-handlers/mso-requests-db/src/main/java/org/openecomp/mso/requestsdb/SiteStatus.java new file mode 100644 index 0000000000..421809612c --- /dev/null +++ b/mso-api-handlers/mso-requests-db/src/main/java/org/openecomp/mso/requestsdb/SiteStatus.java @@ -0,0 +1,72 @@ +/*- + * ============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.requestsdb; + + +import org.openecomp.mso.logger.MsoLogger; + +import java.sql.Timestamp; + + +public class SiteStatus { + + private static final MsoLogger LOGGER = MsoLogger.getMsoLogger(MsoLogger.Catalog.GENERAL); + + private boolean status; + private String siteName; + private Timestamp created; + + public SiteStatus() { + } + + public Timestamp getCreated() { + return created; + } + + public void setCreated(Timestamp created) { + this.created = created; + } + + public String getSiteName() { + return siteName; + } + + public void setSiteName(String siteName) { + this.siteName = siteName; + } + + public void setStatus(boolean status) { + this.status = status; + } + + public boolean getStatus() { + return status; + } + + @Override + public String toString() { + return "SiteStatus{" + + "status=" + status + + ", siteName='" + siteName + '\'' + + ", created=" + created + + '}'; + } +} diff --git a/mso-api-handlers/mso-requests-db/src/main/java/org/openecomp/mso/requestsdb/adapter/TimestampXMLAdapter.java b/mso-api-handlers/mso-requests-db/src/main/java/org/openecomp/mso/requestsdb/adapter/TimestampXMLAdapter.java new file mode 100644 index 0000000000..1e3f46db4b --- /dev/null +++ b/mso-api-handlers/mso-requests-db/src/main/java/org/openecomp/mso/requestsdb/adapter/TimestampXMLAdapter.java @@ -0,0 +1,42 @@ +/*- + * ============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.requestsdb.adapter; + + +import java.sql.Timestamp; + +import javax.xml.bind.annotation.adapters.XmlAdapter; + +public class TimestampXMLAdapter extends XmlAdapter <Long, Timestamp> { + + @Override + public Long marshal (Timestamp v) throws Exception { + return v.getTime (); + } + + @Override + public Timestamp unmarshal (Long v) throws Exception { + if (v == null) { + return new Timestamp(0); + } + return new Timestamp (v); + } +} diff --git a/mso-api-handlers/mso-requests-db/src/main/java/org/openecomp/mso/requestsdb/adapter/package-info.java b/mso-api-handlers/mso-requests-db/src/main/java/org/openecomp/mso/requestsdb/adapter/package-info.java new file mode 100644 index 0000000000..542d711ab1 --- /dev/null +++ b/mso-api-handlers/mso-requests-db/src/main/java/org/openecomp/mso/requestsdb/adapter/package-info.java @@ -0,0 +1,26 @@ +/*- + * ============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========================================================= + */ + +/** + * XML adapters. + */ + +package org.openecomp.mso.requestsdb.adapter; + diff --git a/mso-api-handlers/mso-requests-db/src/main/resources/InfraActiveRequests.hbm.xml b/mso-api-handlers/mso-requests-db/src/main/resources/InfraActiveRequests.hbm.xml new file mode 100644 index 0000000000..b98177ae83 --- /dev/null +++ b/mso-api-handlers/mso-requests-db/src/main/resources/InfraActiveRequests.hbm.xml @@ -0,0 +1,146 @@ +<?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 Jul 27, 2015 3:05:00 PM by Hibernate Tools 3.4.0.CR1 --> +<hibernate-mapping> + <class name="org.openecomp.mso.requestsdb.InfraActiveRequests" table="INFRA_ACTIVE_REQUESTS"> + <id name="requestId" type="string"> + <column name="REQUEST_ID" length="45"/> + <generator class="assigned"/> + </id> + <property name="clientRequestId" type="string" unique="true"> + <column name="CLIENT_REQUEST_ID" length="45" unique="true"/> + </property> + <property name="action" type="string"> + <column name="ACTION" length="45" not-null="true"/> + </property> + <property name="requestStatus" type="string"> + <column name="REQUEST_STATUS" length="20"/> + </property> + <property name="statusMessage" type="string"> + <column name="STATUS_MESSAGE" length="2000"/> + </property> + <property name="progress" type="java.lang.Long"> + <column name="PROGRESS" precision="11" scale="0"/> + </property> + <property name="startTime" type="timestamp"> + <column name="START_TIME"/> + </property> + <property name="endTime" type="timestamp"> + <column name="END_TIME"/> + </property> + <property name="source" type="string"> + <column name="SOURCE" length="45"/> + </property> + <property name="vnfId" type="string"> + <column name="VNF_ID" length="45"/> + </property> + <property name="vnfName" type="string"> + <column name="VNF_NAME" length="80"/> + </property> + <property name="vnfType" type="string"> + <column name="VNF_TYPE" length="200"/> + </property> + <property name="serviceType" type="string"> + <column name="SERVICE_TYPE" length="45"/> + </property> + <property name="aicNodeClli" type="string"> + <column name="AIC_NODE_CLLI" length="11"/> + </property> + <property name="tenantId" type="string"> + <column name="TENANT_ID" length="45"/> + </property> + <property name="provStatus" type="string"> + <column name="PROV_STATUS" length="20"/> + </property> + <property name="vnfParams" type="text"> + <column name="VNF_PARAMS"/> + </property> + <property name="vnfOutputs" type="text"> + <column name="VNF_OUTPUTS"/> + </property> + <property name="requestBody" type="text"> + <column name="REQUEST_BODY"/> + </property> + <property name="responseBody" type="text"> + <column name="RESPONSE_BODY"/> + </property> + <property name="lastModifiedBy" type="string"> + <column name="LAST_MODIFIED_BY" length="50"/> + </property> + <property name="modifyTime" type="timestamp"> + <column name="MODIFY_TIME"/> + </property> + <property name="requestType" type="string"> + <column name="REQUEST_TYPE" length="20"/> + </property> + <property name="volumeGroupId" type="string"> + <column name="VOLUME_GROUP_ID" length="45"/> + </property> + <property name="volumeGroupName" type="string"> + <column name="VOLUME_GROUP_NAME" length="45"/> + </property> + <property name="vfModuleId" type="string"> + <column name="VF_MODULE_ID" length="45"/> + </property> + <property name="vfModuleName" type="string"> + <column name="VF_MODULE_NAME" length="200"/> + </property> + <property name="vfModuleModelName" type="string"> + <column name="VF_MODULE_MODEL_NAME" length="200"/> + </property> + <property name="aaiServiceId" type="string"> + <column name="AAI_SERVICE_ID" length="50"/> + </property> + <property name="aicCloudRegion" type="string"> + <column name="AIC_CLOUD_REGION" length="11"/> + </property> + <property name="callBackUrl" type="string"> + <column name="CALLBACK_URL" length="200"/> + </property> + <property name="correlator" type="string"> + <column name="CORRELATOR" length="80"/> + </property> + <property name="serviceInstanceId" type="string"> + <column name="SERVICE_INSTANCE_ID" length="45"/> + </property> + <property name="serviceInstanceName" type="string"> + <column name="SERVICE_INSTANCE_NAME" length="80"/> + </property> + <property name="requestScope" type="string"> + <column name="REQUEST_SCOPE" length="20"/> + </property> + <property name="requestAction" type="string"> + <column name="REQUEST_ACTION" length="45" not-null="true"/> + </property> + <property name="networkId" type="string"> + <column name="NETWORK_ID" length="45"/> + </property> + <property name="networkName" type="string"> + <column name="NETWORK_NAME" length="80"/> + </property> + <property name="networkType" type="string"> + <column name="NETWORK_TYPE" length="80"/> + </property> + </class> +</hibernate-mapping> diff --git a/mso-api-handlers/mso-requests-db/src/main/resources/SiteStatus.hbm.xml b/mso-api-handlers/mso-requests-db/src/main/resources/SiteStatus.hbm.xml new file mode 100644 index 0000000000..95ccfda5fe --- /dev/null +++ b/mso-api-handlers/mso-requests-db/src/main/resources/SiteStatus.hbm.xml @@ -0,0 +1,35 @@ +<?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.requestsdb"> + <class name="SiteStatus" table="SITE_STATUS"> + <meta attribute="class-description"> + This class describes a Site Status + </meta> + + <id name="siteName" type="string" column="SITE_NAME"/> + + <property name="status" column="STATUS" type="boolean" length="256"/> + <property name="created" column="CREATION_TIMESTAMP" type="timestamp" generated="insert" insert="false" update="false"/> + </class> +</hibernate-mapping> diff --git a/mso-api-handlers/mso-requests-db/src/main/resources/hibernate-mysql.cfg.xml b/mso-api-handlers/mso-requests-db/src/main/resources/hibernate-mysql.cfg.xml new file mode 100644 index 0000000000..531b77196c --- /dev/null +++ b/mso-api-handlers/mso-requests-db/src/main/resources/hibernate-mysql.cfg.xml @@ -0,0 +1,37 @@ +<?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-configuration PUBLIC + "-//Hibernate/Hibernate Configuration DTD 3.0//EN" + "http://www.hibernate.org/dtd/hibernate-configuration-3.0.dtd"> +<hibernate-configuration> + <session-factory> + <property name="hibernate.dialect">org.hibernate.dialect.MySQL5Dialect</property> + <property name="hibernate.show_sql">false</property> + <property name="hibernate.format_sql">true</property> + <property name="connection.datasource">java:jboss/datasources/mso-requests</property> + +<!-- <property name="hibernate.hbm2ddl.auto">create</property> --> + + <mapping resource="InfraActiveRequests.hbm.xml"></mapping> + <mapping resource="SiteStatus.hbm.xml"></mapping> + </session-factory> +</hibernate-configuration> diff --git a/mso-api-handlers/mso-requests-db/src/main/resources/hibernate-requests-ajsc.cfg.xml b/mso-api-handlers/mso-requests-db/src/main/resources/hibernate-requests-ajsc.cfg.xml new file mode 100644 index 0000000000..14bd7b5e69 --- /dev/null +++ b/mso-api-handlers/mso-requests-db/src/main/resources/hibernate-requests-ajsc.cfg.xml @@ -0,0 +1,59 @@ +<?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-configuration PUBLIC + "-//Hibernate/Hibernate Configuration DTD 3.0//EN" + "http://www.hibernate.org/dtd/hibernate-configuration-3.0.dtd"> +<hibernate-configuration> + <session-factory> + <property name="hibernate.dialect">org.hibernate.dialect.MySQL5Dialect</property> + <property name="hibernate.show_sql">false</property> + <property name="hibernate.format_sql">true</property> + + <mapping resource="InfraActiveRequests.hbm.xml"></mapping> + <mapping resource="SiteStatus.hbm.xml"></mapping> + </session-factory> + <!-- <session-factory name="MSORequestsFactory"> + <property name="connection.url">${REQUESTS_CONNECTION_URL}</property> + <property name="connection.username">${REQUESTS_USERNAME}</property> + <property name="connection.password">${REQUESTS_PASSWORD}</property> + <property name="hibernate.dialect">org.hibernate.dialect.MySQL5Dialect</property> + <property name="hibernate.default_schema">mso_requests</property> + <property name="connection.driver_class">org.mariadb.jdbc.Driver</property> + <property name="hibernate.current_session_context_class">thread</property> + <property name="hibernate.show_sql">false</property> + <property name="hibernate.format_sql">true</property> + + + <property name="hibernate.connection.provider_class">org.hibernate.connection.C3P0ConnectionProvider</property> + <property name="hibernate.c3p0.min_size">${REQUESTS_MIN_POOL_SIZE}</property> + <property name="hibernate.c3p0.max_size">${REQUESTS_MAX_POOL_SIZE}</property> + <property name="hibernate.c3p0.timeout">${REQUESTS_TIMEOUT}</property> + <property name="hibernate.c3p0.max_statements">50</property> + <property name="hibernate.c3p0.idle_test_period">1000</property> + <property name="hibernate.connection.provider_class">org.hibernate.service.jdbc.connections.internal.C3P0ConnectionProvider</property> + + + + <mapping resource="InfraActiveRequests.hbm.xml"></mapping> + + </session-factory> --> +</hibernate-configuration> diff --git a/mso-api-handlers/mso-requests-db/src/test/java/org/openecomp/mso/requestsdb/HibernateUtilESTest.java b/mso-api-handlers/mso-requests-db/src/test/java/org/openecomp/mso/requestsdb/HibernateUtilESTest.java new file mode 100644 index 0000000000..6ae0a641c8 --- /dev/null +++ b/mso-api-handlers/mso-requests-db/src/test/java/org/openecomp/mso/requestsdb/HibernateUtilESTest.java @@ -0,0 +1,24 @@ +/* + * This file was automatically generated by EvoSuite + * Wed Dec 14 15:15:07 GMT 2016 + */ + +package org.openecomp.mso.requestsdb; + +import org.junit.Test; +import static org.junit.Assert.*; +import org.evosuite.runtime.EvoRunner; +import org.evosuite.runtime.EvoRunnerParameters; +import org.evosuite.runtime.PrivateAccess; +import org.junit.runner.RunWith; +import org.openecomp.mso.requestsdb.HibernateUtil; + +@RunWith(EvoRunner.class) @EvoRunnerParameters(mockJVMNonDeterminism = true, useVFS = true, useVNET = true, resetStaticState = true, useJEE = true) +public class HibernateUtilESTest extends HibernateUtilESTestscaffolding { + + @Test(timeout = 4000) + public void test0() throws Throwable { + HibernateUtil hibernateUtil0 = (HibernateUtil)PrivateAccess.callDefaultConstructorOfTheClassUnderTest(); + assertNotNull(hibernateUtil0); + } +} diff --git a/mso-api-handlers/mso-requests-db/src/test/java/org/openecomp/mso/requestsdb/HibernateUtilESTestscaffolding.java b/mso-api-handlers/mso-requests-db/src/test/java/org/openecomp/mso/requestsdb/HibernateUtilESTestscaffolding.java new file mode 100644 index 0000000000..e2e9b60026 --- /dev/null +++ b/mso-api-handlers/mso-requests-db/src/test/java/org/openecomp/mso/requestsdb/HibernateUtilESTestscaffolding.java @@ -0,0 +1,107 @@ +/** + * Scaffolding file used to store all the setups needed to run + * tests automatically generated by EvoSuite + * Wed Dec 14 15:15:07 GMT 2016 + */ + +package org.openecomp.mso.requestsdb; + +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; +import org.evosuite.runtime.sandbox.Sandbox.SandboxMode; + +@EvoSuiteClassExclude +public class HibernateUtilESTestscaffolding { + + @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.requestsdb.HibernateUtil"; + 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(HibernateUtilESTestscaffolding.class.getClassLoader() , + "org.openecomp.mso.logger.MessageEnum", + "com.att.eelf.i18n.EELFResolvableErrorEnum", + "org.openecomp.mso.logger.MsoLogger$Catalog", + "org.openecomp.mso.logger.MsoLogger$StatusCode", + "org.hibernate.SessionFactory", + "com.att.eelf.i18n.EELFResourceManager$RESOURCE_TYPES", + "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.requestsdb.HibernateUtil", + "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(HibernateUtilESTestscaffolding.class.getClassLoader()); + + org.evosuite.runtime.classhandling.ClassStateSupport.resetClasses( + "com.att.eelf.i18n.EELFResourceManager", + "org.openecomp.mso.logger.MessageEnum", + "org.openecomp.mso.logger.MsoLogger$Catalog", + "org.openecomp.mso.logger.MsoLogger", + "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.MsoLogger$ErrorCode", + "org.openecomp.mso.requestsdb.HibernateUtil" + ); + } +} diff --git a/mso-api-handlers/mso-requests-db/src/test/java/org/openecomp/mso/requestsdb/InfraActiveRequestsESTest.java b/mso-api-handlers/mso-requests-db/src/test/java/org/openecomp/mso/requestsdb/InfraActiveRequestsESTest.java new file mode 100644 index 0000000000..96ed0bea83 --- /dev/null +++ b/mso-api-handlers/mso-requests-db/src/test/java/org/openecomp/mso/requestsdb/InfraActiveRequestsESTest.java @@ -0,0 +1,29 @@ +/* + * This file was automatically generated by EvoSuite + * Wed Dec 14 15:13:40 GMT 2016 + */ + +package org.openecomp.mso.requestsdb; + +import org.junit.Test; +import static org.junit.Assert.*; +import org.evosuite.runtime.EvoRunner; +import org.evosuite.runtime.EvoRunnerParameters; +import org.junit.runner.RunWith; +import org.openecomp.mso.requestsdb.InfraActiveRequests; + +@RunWith(EvoRunner.class) @EvoRunnerParameters(mockJVMNonDeterminism = true, useVFS = true, useVNET = true, resetStaticState = true, useJEE = true) +public class InfraActiveRequestsESTest extends InfraActiveRequestsESTestscaffolding { + + @Test(timeout = 4000) + public void test0() throws Throwable { + InfraActiveRequests infraActiveRequests0 = new InfraActiveRequests(); + assertNull(infraActiveRequests0.getVolumeGroupId()); + } + + @Test(timeout = 4000) + public void test1() throws Throwable { + InfraActiveRequests infraActiveRequests0 = new InfraActiveRequests("#)r", "#)r"); + assertNull(infraActiveRequests0.getNetworkName()); + } +} diff --git a/mso-api-handlers/mso-requests-db/src/test/java/org/openecomp/mso/requestsdb/InfraActiveRequestsESTestscaffolding.java b/mso-api-handlers/mso-requests-db/src/test/java/org/openecomp/mso/requestsdb/InfraActiveRequestsESTestscaffolding.java new file mode 100644 index 0000000000..012b17a4d0 --- /dev/null +++ b/mso-api-handlers/mso-requests-db/src/test/java/org/openecomp/mso/requestsdb/InfraActiveRequestsESTestscaffolding.java @@ -0,0 +1,84 @@ +/** + * Scaffolding file used to store all the setups needed to run + * tests automatically generated by EvoSuite + * Wed Dec 14 15:13:40 GMT 2016 + */ + +package org.openecomp.mso.requestsdb; + +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; +import org.evosuite.runtime.sandbox.Sandbox.SandboxMode; + +@EvoSuiteClassExclude +public class InfraActiveRequestsESTestscaffolding { + + @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.requestsdb.InfraActiveRequests"; + 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(InfraActiveRequestsESTestscaffolding.class.getClassLoader() , + "org.openecomp.mso.requestsdb.InfraActiveRequests", + "org.openecomp.mso.requestsdb.InfraRequests" + ); + } + + private static void resetClasses() { + org.evosuite.runtime.classhandling.ClassResetter.getInstance().setClassLoader(InfraActiveRequestsESTestscaffolding.class.getClassLoader()); + + org.evosuite.runtime.classhandling.ClassStateSupport.resetClasses( + "org.openecomp.mso.requestsdb.InfraRequests", + "org.openecomp.mso.requestsdb.InfraActiveRequests" + ); + } +} diff --git a/mso-api-handlers/mso-requests-db/src/test/java/org/openecomp/mso/requestsdb/InfraRequestsESTest.java b/mso-api-handlers/mso-requests-db/src/test/java/org/openecomp/mso/requestsdb/InfraRequestsESTest.java new file mode 100644 index 0000000000..e3f5710833 --- /dev/null +++ b/mso-api-handlers/mso-requests-db/src/test/java/org/openecomp/mso/requestsdb/InfraRequestsESTest.java @@ -0,0 +1,2029 @@ +/* + * This file was automatically generated by EvoSuite + * Wed Dec 14 15:15:48 GMT 2016 + */ + +package org.openecomp.mso.requestsdb; + +import org.junit.Test; +import static org.junit.Assert.*; +import static org.evosuite.runtime.EvoAssertions.*; +import java.sql.Timestamp; +import java.time.Clock; +import java.time.DateTimeException; +import java.time.Instant; +import java.time.LocalDateTime; +import java.time.Month; +import java.time.ZoneId; +import java.time.ZoneOffset; +import java.time.temporal.ChronoUnit; +import java.time.temporal.TemporalUnit; +import java.time.temporal.UnsupportedTemporalTypeException; +import java.util.Date; +import org.evosuite.runtime.EvoRunner; +import org.evosuite.runtime.EvoRunnerParameters; +import org.evosuite.runtime.System; +import org.evosuite.runtime.mock.java.net.MockURI; +import org.evosuite.runtime.mock.java.time.MockClock; +import org.evosuite.runtime.mock.java.time.MockInstant; +import org.evosuite.runtime.mock.java.time.MockLocalDateTime; +import org.evosuite.runtime.mock.java.util.MockDate; +import org.junit.runner.RunWith; +import org.openecomp.mso.requestsdb.InfraRequests; + +@RunWith(EvoRunner.class) @EvoRunnerParameters(mockJVMNonDeterminism = true, useVFS = true, useVNET = true, resetStaticState = true, useJEE = true) +public class InfraRequestsESTest extends InfraRequestsESTestscaffolding { + + @Test(timeout = 4000) + public void test000() throws Throwable { + System.setCurrentTimeMillis(0L); + InfraRequests infraRequests0 = new InfraRequests(); + infraRequests0.setRequestStatus("org.openecomp.mso.requestsdb.InfraRequests"); + Instant instant0 = MockInstant.ofEpochSecond((-1L)); + Timestamp timestamp0 = Timestamp.from(instant0); + infraRequests0.setModifyTime(timestamp0); + infraRequests0.setTenantId("7z3rvWw}>"); + infraRequests0.setVnfParams("7z3rvWw}>"); + infraRequests0.setVfModuleModelName("H(+:J_^eh02J"); + InfraRequests infraRequests1 = new InfraRequests("", "zCyMQj^e"); + infraRequests1.setProvStatus("7z3rvWw}>"); + infraRequests1.getProgress(); + infraRequests0.setProgress((Long) null); + infraRequests0.setRequestId(""); + infraRequests0.getStartTime(); + Timestamp timestamp1 = infraRequests0.getModifyTime(); + infraRequests0.getEndTime(); + Timestamp timestamp2 = infraRequests0.getModifyTime(); + assertSame(timestamp2, timestamp1); + } + + @Test(timeout = 4000) + public void test001() throws Throwable { + InfraRequests infraRequests0 = new InfraRequests("&^pJug .NI><P", "&^pJug .NI><P"); + infraRequests0.setNetworkType("jxNkugb+TFTHEb"); + infraRequests0.setVfModuleName("&^pJug .NI><P"); + Timestamp timestamp0 = new Timestamp(0L); + timestamp0.toLocalDateTime(); + timestamp0.clone(); + infraRequests0.setStartTime(timestamp0); + infraRequests0.setVolumeGroupName("&^pJug .NI><P"); + infraRequests0.setRequestAction(" g)]V!'`TH5O"); + infraRequests0.setServiceInstanceId("DfLF%$Jbfi.Q31<"); + infraRequests0.getStartTime(); + infraRequests0.getStartTime(); + infraRequests0.setAicCloudRegion("sz.!~p3obl/"); + infraRequests0.setClientRequestId("sz.!~p3obl/"); + infraRequests0.setVnfParams((String) null); + infraRequests0.getEndTime(); + infraRequests0.getStartTime(); + infraRequests0.getStartTime(); + infraRequests0.getEndTime(); + infraRequests0.getModifyTime(); + infraRequests0.getModifyTime(); + Timestamp timestamp1 = infraRequests0.getEndTime(); + assertNull(timestamp1); + } + + @Test(timeout = 4000) + public void test002() throws Throwable { + InfraRequests infraRequests0 = new InfraRequests(); + Timestamp timestamp0 = new Timestamp(153L); + Instant instant0 = timestamp0.toInstant(); + Timestamp timestamp1 = Timestamp.from(instant0); + infraRequests0.setStartTime(timestamp1); + Timestamp timestamp2 = infraRequests0.getStartTime(); + assertNotSame(timestamp2, timestamp0); + } + + @Test(timeout = 4000) + public void test003() throws Throwable { + InfraRequests infraRequests0 = new InfraRequests("", ""); + Timestamp timestamp0 = new Timestamp((-1852L)); + infraRequests0.setEndTime(timestamp0); + Timestamp timestamp1 = infraRequests0.getEndTime(); + assertEquals(148000000, timestamp1.getNanos()); + } + + @Test(timeout = 4000) + public void test004() throws Throwable { + System.setCurrentTimeMillis(0L); + InfraRequests infraRequests0 = new InfraRequests((String) null, (String) null); + infraRequests0.setAction(""); + infraRequests0.setLastModifiedBy("et'?MxG"); + infraRequests0.setSource((String) null); + infraRequests0.setRequestStatus("i>Ckz=#\"! &-"); + infraRequests0.setVnfName((String) null); + infraRequests0.setRequestBody(""); + infraRequests0.setProvStatus(""); + infraRequests0.setRequestBody((String) null); + infraRequests0.setAicCloudRegion("m&WTLl(Z@56C"); + infraRequests0.getNetworkId(); + infraRequests0.setNetworkId("zcYzTK3rhfL`Cw"); + infraRequests0.getStartTime(); + System.setCurrentTimeMillis(2579L); + infraRequests0.getModifyTime(); + infraRequests0.getStartTime(); + infraRequests0.setAicCloudRegion("=o7|rLO^"); + infraRequests0.getEndTime(); + infraRequests0.getEndTime(); + infraRequests0.getNetworkId(); + System.setCurrentTimeMillis(0L); + System.setCurrentTimeMillis(0L); + infraRequests0.getStartTime(); + infraRequests0.getSource(); + String string0 = infraRequests0.getNetworkId(); + assertEquals("zcYzTK3rhfL`Cw", string0); + } + + @Test(timeout = 4000) + public void test005() throws Throwable { + InfraRequests infraRequests0 = new InfraRequests(); + Long long0 = new Long(1283L); + infraRequests0.setProvStatus("'4~OJS*DL/lP"); + Long.sum((-978L), 1283L); + infraRequests0.setProgress(long0); + infraRequests0.setServiceInstanceName("'4~OJS*DL/lP"); + infraRequests0.getSource(); + infraRequests0.setRequestId(""); + infraRequests0.getSource(); + infraRequests0.setVnfParams((String) null); + infraRequests0.getNetworkId(); + infraRequests0.getEndTime(); + infraRequests0.getNetworkId(); + infraRequests0.getModifyTime(); + infraRequests0.getProgress(); + infraRequests0.getSource(); + infraRequests0.getModifyTime(); + infraRequests0.getNetworkId(); + infraRequests0.getSource(); + infraRequests0.getModifyTime(); + infraRequests0.getEndTime(); + infraRequests0.getEndTime(); + infraRequests0.getModifyTime(); + infraRequests0.getProgress(); + infraRequests0.getProgress(); + Timestamp timestamp0 = infraRequests0.getStartTime(); + assertNull(timestamp0); + } + + @Test(timeout = 4000) + public void test006() throws Throwable { + InfraRequests infraRequests0 = new InfraRequests(); + infraRequests0.getEndTime(); + infraRequests0.setVfModuleModelName(""); + infraRequests0.setVfModuleId(""); + infraRequests0.getStartTime(); + infraRequests0.getVfModuleModelName(); + infraRequests0.getSource(); + infraRequests0.setVfModuleModelName(""); + infraRequests0.setAction(""); + infraRequests0.setVnfType("32ex<U{"); + infraRequests0.setVfModuleId("~!_Y!cPw*c_>H$"); + infraRequests0.getModifyTime(); + System.setCurrentTimeMillis(0L); + infraRequests0.getEndTime(); + infraRequests0.setRequestStatus(""); + infraRequests0.setServiceInstanceName(""); + infraRequests0.getStartTime(); + infraRequests0.getVfModuleModelName(); + infraRequests0.setVolumeGroupName(""); + infraRequests0.getProgress(); + infraRequests0.setProvStatus(""); + System.setCurrentTimeMillis(0L); + infraRequests0.getStartTime(); + System.setCurrentTimeMillis(0L); + infraRequests0.getVfModuleModelName(); + infraRequests0.getNetworkId(); + infraRequests0.getNetworkId(); + infraRequests0.getVfModuleModelName(); + System.setCurrentTimeMillis(0L); + infraRequests0.getProgress(); + Timestamp timestamp0 = infraRequests0.getStartTime(); + assertNull(timestamp0); + } + + @Test(timeout = 4000) + public void test007() throws Throwable { + System.setCurrentTimeMillis((-2047L)); + InfraRequests infraRequests0 = new InfraRequests(); + infraRequests0.setVolumeGroupName("k*}2I)_;C'i,[i>aRNU"); + infraRequests0.setSource("%az="); + infraRequests0.getModifyTime(); + infraRequests0.setRequestAction(""); + infraRequests0.setClientRequestId(""); + infraRequests0.setAicNodeClli(""); + infraRequests0.setCallBackUrl(""); + infraRequests0.setAction(""); + infraRequests0.getNetworkId(); + infraRequests0.getNetworkId(); + infraRequests0.getProgress(); + infraRequests0.getProgress(); + infraRequests0.getNetworkId(); + infraRequests0.getProgress(); + infraRequests0.getModifyTime(); + infraRequests0.setRequestScope("URuw\"b-"); + infraRequests0.setNetworkName(""); + infraRequests0.getStartTime(); + infraRequests0.getAicNodeClli(); + infraRequests0.getProgress(); + infraRequests0.setCallBackUrl(""); + infraRequests0.getEndTime(); + infraRequests0.setVnfId(""); + infraRequests0.getProgress(); + infraRequests0.getNetworkId(); + Long long0 = infraRequests0.getProgress(); + assertNull(long0); + } + + @Test(timeout = 4000) + public void test008() throws Throwable { + InfraRequests infraRequests0 = new InfraRequests((String) null, (String) null); + infraRequests0.setClientRequestId((String) null); + infraRequests0.setVfModuleModelName((String) null); + Long long0 = new Long((-43L)); + Long.compare((-1L), 0L); + Long.compare(819L, (-43L)); + infraRequests0.setProgress(long0); + infraRequests0.getModifyTime(); + infraRequests0.getStartTime(); + infraRequests0.setAction(""); + infraRequests0.getSource(); + infraRequests0.getSource(); + infraRequests0.getStartTime(); + infraRequests0.setNetworkId((String) null); + infraRequests0.getNetworkId(); + Long long1 = infraRequests0.getProgress(); + assertEquals((-43L), (long)long1); + } + + @Test(timeout = 4000) + public void test009() throws Throwable { + InfraRequests infraRequests0 = new InfraRequests(); + infraRequests0.getStartTime(); + infraRequests0.setRequestScope(""); + System.setCurrentTimeMillis(0L); + infraRequests0.setVnfType(""); + infraRequests0.setProvStatus(""); + infraRequests0.setRequestScope("LB1xoi:3Wz.5'5uxZ"); + infraRequests0.setVfModuleId("+x66Ol"); + infraRequests0.setVfModuleModelName("org.openecomp.mso.requestsdb.InfraRequests"); + infraRequests0.setVnfOutputs("LB1xoi:3Wz.5'5uxZ"); + infraRequests0.setCorrelator("{%N>'KCKdC"); + infraRequests0.getEndTime(); + infraRequests0.getVfModuleModelName(); + infraRequests0.getSource(); + infraRequests0.getStartTime(); + infraRequests0.getNetworkId(); + infraRequests0.setRequestBody("jBcy6j^"); + infraRequests0.setAaiServiceId("m,{Gy9PQsY5J/aU!uX"); + infraRequests0.setVolumeGroupId(""); + infraRequests0.getEndTime(); + infraRequests0.getEndTime(); + infraRequests0.getVfModuleId(); + infraRequests0.getModifyTime(); + infraRequests0.getEndTime(); + infraRequests0.getModifyTime(); + String string0 = infraRequests0.getSource(); + assertNull(string0); + } + + @Test(timeout = 4000) + public void test010() throws Throwable { + InfraRequests infraRequests0 = new InfraRequests(); + infraRequests0.getVfModuleId(); + infraRequests0.getEndTime(); + infraRequests0.setVfModuleId((String) null); + infraRequests0.setServiceType(""); + infraRequests0.getModifyTime(); + infraRequests0.getAicNodeClli(); + infraRequests0.setAaiServiceId((String) null); + infraRequests0.getVfModuleModelName(); + infraRequests0.getVfModuleId(); + infraRequests0.getEndTime(); + infraRequests0.setVfModuleModelName((String) null); + infraRequests0.getModifyTime(); + infraRequests0.getVfModuleModelName(); + infraRequests0.getEndTime(); + infraRequests0.setVnfName((String) null); + infraRequests0.getVfModuleId(); + infraRequests0.getAicNodeClli(); + infraRequests0.getAicNodeClli(); + infraRequests0.getNetworkId(); + infraRequests0.getVfModuleId(); + infraRequests0.getSource(); + infraRequests0.getAicNodeClli(); + infraRequests0.getSource(); + infraRequests0.getServiceType(); + infraRequests0.getModifyTime(); + String string0 = infraRequests0.getVfModuleId(); + assertNull(string0); + } + + @Test(timeout = 4000) + public void test011() throws Throwable { + InfraRequests infraRequests0 = new InfraRequests(); + infraRequests0.setVnfName("s4 -bpK"); + infraRequests0.setLastModifiedBy(""); + infraRequests0.getProgress(); + infraRequests0.getServiceType(); + infraRequests0.setVfModuleName((String) null); + infraRequests0.setVnfName(""); + infraRequests0.setVnfType(""); + infraRequests0.getVfModuleId(); + infraRequests0.setResponseBody(""); + infraRequests0.getStartTime(); + infraRequests0.setStartTime((Timestamp) null); + infraRequests0.setCorrelator(""); + infraRequests0.getVnfType(); + infraRequests0.getNetworkId(); + infraRequests0.setServiceInstanceId(""); + infraRequests0.getProgress(); + infraRequests0.getAicNodeClli(); + infraRequests0.getNetworkId(); + infraRequests0.setCorrelator((String) null); + infraRequests0.getNetworkId(); + infraRequests0.getVnfType(); + infraRequests0.getVfModuleModelName(); + infraRequests0.getAicNodeClli(); + infraRequests0.setVnfName(""); + System.setCurrentTimeMillis((-1L)); + infraRequests0.setProvStatus(""); + infraRequests0.getVfModuleId(); + infraRequests0.getSource(); + infraRequests0.getAicNodeClli(); + String string0 = infraRequests0.getServiceType(); + assertNull(string0); + } + + @Test(timeout = 4000) + public void test012() throws Throwable { + System.setCurrentTimeMillis(1L); + InfraRequests infraRequests0 = new InfraRequests(); + infraRequests0.setEndTime((Timestamp) null); + infraRequests0.setTenantId(""); + infraRequests0.setRequestStatus(""); + infraRequests0.setClientRequestId(""); + infraRequests0.setAction(""); + infraRequests0.setCorrelator(""); + infraRequests0.setAicNodeClli(""); + infraRequests0.getVnfParams(); + System.setCurrentTimeMillis(1L); + infraRequests0.setVolumeGroupName(""); + infraRequests0.setVfModuleId((String) null); + infraRequests0.setVnfParams(""); + infraRequests0.getSource(); + infraRequests0.getVfModuleModelName(); + infraRequests0.getSource(); + infraRequests0.getVnfParams(); + infraRequests0.getServiceType(); + infraRequests0.setAaiServiceId("i`q1kSghF"); + infraRequests0.setStatusMessage((String) null); + infraRequests0.getProgress(); + infraRequests0.getModifyTime(); + infraRequests0.getVnfType(); + infraRequests0.getProgress(); + infraRequests0.getServiceType(); + String string0 = infraRequests0.getVfModuleId(); + assertNull(string0); + } + + @Test(timeout = 4000) + public void test013() throws Throwable { + InfraRequests infraRequests0 = new InfraRequests(); + infraRequests0.setRequestScope(""); + infraRequests0.setAaiServiceId(")9?S*`\"0>k"); + infraRequests0.getEndTime(); + infraRequests0.setVolumeGroupName(""); + infraRequests0.setServiceInstanceId(""); + infraRequests0.getProgress(); + infraRequests0.getRequestScope(); + Long long0 = infraRequests0.getProgress(); + assertNull(long0); + } + + @Test(timeout = 4000) + public void test014() throws Throwable { + System.setCurrentTimeMillis(3986L); + InfraRequests infraRequests0 = new InfraRequests("", (String) null); + infraRequests0.setVnfName((String) null); + infraRequests0.getResponseBody(); + infraRequests0.setAction((String) null); + infraRequests0.setCallBackUrl("(tW~,tC"); + infraRequests0.setClientRequestId("$Y$nNqJ`e'KL#@v>:"); + infraRequests0.setVolumeGroupId("mSK_k$P)79N/:l"); + infraRequests0.setResponseBody(""); + infraRequests0.setSource("(tW~,tC"); + infraRequests0.setProvStatus((String) null); + infraRequests0.setVfModuleName("9"); + infraRequests0.getServiceType(); + infraRequests0.getVnfParams(); + infraRequests0.getVnfType(); + infraRequests0.getVnfParams(); + infraRequests0.getStartTime(); + infraRequests0.getVnfType(); + infraRequests0.getStartTime(); + infraRequests0.getSource(); + infraRequests0.getVfModuleModelName(); + infraRequests0.getStartTime(); + infraRequests0.getAicNodeClli(); + System.setCurrentTimeMillis((-1622L)); + infraRequests0.getVfModuleModelName(); + String string0 = infraRequests0.getResponseBody(); + assertEquals("", string0); + } + + @Test(timeout = 4000) + public void test015() throws Throwable { + InfraRequests infraRequests0 = new InfraRequests("wkT`'", "kMn9?"); + infraRequests0.setVfModuleName(""); + infraRequests0.setNetworkType(""); + infraRequests0.getVfModuleModelName(); + infraRequests0.setProvStatus("kMn9?"); + infraRequests0.getRequestScope(); + infraRequests0.setVfModuleModelName((String) null); + infraRequests0.setAicCloudRegion("wkT`'"); + infraRequests0.setServiceInstanceName("7Stei0W{<@QDoE9~"); + infraRequests0.setRequestAction(""); + infraRequests0.getServiceType(); + infraRequests0.getVnfParams(); + infraRequests0.getAicNodeClli(); + infraRequests0.getRequestScope(); + infraRequests0.getNetworkType(); + infraRequests0.getStartTime(); + infraRequests0.getNetworkType(); + infraRequests0.getStartTime(); + infraRequests0.getRequestAction(); + infraRequests0.setCorrelator("!5"); + infraRequests0.getSource(); + infraRequests0.getServiceType(); + infraRequests0.getVfModuleModelName(); + infraRequests0.getVnfParams(); + infraRequests0.getModifyTime(); + infraRequests0.getVnfParams(); + infraRequests0.getProvStatus(); + infraRequests0.getAicNodeClli(); + infraRequests0.getVfModuleModelName(); + assertEquals("wkT`'", infraRequests0.getRequestId()); + assertEquals("kMn9?", infraRequests0.getAction()); + } + + @Test(timeout = 4000) + public void test016() throws Throwable { + InfraRequests infraRequests0 = new InfraRequests("", (String) null); + infraRequests0.setRequestId(""); + infraRequests0.setVfModuleId(""); + infraRequests0.setRequestScope(""); + infraRequests0.setVfModuleId(""); + infraRequests0.setSource((String) null); + infraRequests0.setClientRequestId(""); + infraRequests0.setVnfName("3?/m3##"); + infraRequests0.setVfModuleName(""); + infraRequests0.setSource("y [b8^A,yt|auh|y"); + infraRequests0.setRequestScope("y [b8^A,yt|auh|y"); + infraRequests0.setClientRequestId(""); + infraRequests0.getEndTime(); + infraRequests0.setVolumeGroupName("r7szQIK?~Q"); + infraRequests0.getRequestAction(); + infraRequests0.getVfModuleModelName(); + infraRequests0.setServiceInstanceId("y [b8^A,yt|auh|y"); + infraRequests0.getServiceType(); + infraRequests0.getNetworkType(); + System.setCurrentTimeMillis(3509L); + infraRequests0.getClientRequestId(); + infraRequests0.setTenantId((String) null); + infraRequests0.getVfModuleModelName(); + infraRequests0.getVnfType(); + infraRequests0.getVnfParams(); + infraRequests0.getServiceType(); + infraRequests0.getVnfParams(); + String string0 = infraRequests0.getVfModuleModelName(); + assertNull(string0); + } + + @Test(timeout = 4000) + public void test017() throws Throwable { + InfraRequests infraRequests0 = new InfraRequests("", ""); + LocalDateTime localDateTime0 = MockLocalDateTime.of(264, 1, 1, 0, 1, 0); + Timestamp timestamp0 = Timestamp.valueOf(localDateTime0); + infraRequests0.setEndTime(timestamp0); + infraRequests0.setServiceInstanceId("TmMT"); + infraRequests0.setServiceInstanceName(""); + infraRequests0.setAicNodeClli(";"); + infraRequests0.setAicCloudRegion(""); + infraRequests0.setAction(""); + infraRequests0.setServiceInstanceId(""); + infraRequests0.setAaiServiceId(""); + infraRequests0.getVnfType(); + infraRequests0.getSource(); + infraRequests0.getVnfParams(); + infraRequests0.getVfModuleId(); + infraRequests0.getStartTime(); + infraRequests0.getProvStatus(); + infraRequests0.getServiceType(); + infraRequests0.getProvStatus(); + infraRequests0.getServiceType(); + System.setCurrentTimeMillis(1); + infraRequests0.setVnfParams((String) null); + infraRequests0.getServiceInstanceName(); + infraRequests0.getEndTime(); + infraRequests0.setAicNodeClli((String) null); + infraRequests0.getNetworkType(); + infraRequests0.getEndTime(); + infraRequests0.getRequestScope(); + System.setCurrentTimeMillis(0); + } + + @Test(timeout = 4000) + public void test018() throws Throwable { + InfraRequests infraRequests0 = new InfraRequests(); + infraRequests0.setCorrelator("nBvp})-N}"); + infraRequests0.setSource("dOe#{Gx#~I(,F)0("); + infraRequests0.setVnfId(""); + infraRequests0.getVolumeGroupName(); + infraRequests0.getCorrelator(); + infraRequests0.getModifyTime(); + infraRequests0.getRequestScope(); + infraRequests0.getVfModuleModelName(); + String string0 = infraRequests0.getProvStatus(); + assertNull(string0); + } + + @Test(timeout = 4000) + public void test019() throws Throwable { + InfraRequests infraRequests0 = new InfraRequests("HY7\"yA%CG", ""); + infraRequests0.setVnfType(""); + infraRequests0.setAicNodeClli(""); + infraRequests0.setNetworkId("HY7\"yA%CG"); + infraRequests0.setAicNodeClli(""); + infraRequests0.getProgress(); + infraRequests0.setProgress((Long) null); + infraRequests0.setServiceType(""); + infraRequests0.setLastModifiedBy(""); + infraRequests0.getRequestScope(); + infraRequests0.getProvStatus(); + infraRequests0.setVolumeGroupName((String) null); + infraRequests0.getLastModifiedBy(); + infraRequests0.getProvStatus(); + infraRequests0.setAicCloudRegion(""); + infraRequests0.getRequestScope(); + infraRequests0.getProvStatus(); + assertEquals("HY7\"yA%CG", infraRequests0.getRequestId()); + assertEquals("", infraRequests0.getAction()); + } + + @Test(timeout = 4000) + public void test020() throws Throwable { + InfraRequests infraRequests0 = new InfraRequests(); + infraRequests0.setRequestBody(""); + infraRequests0.setTenantId(""); + infraRequests0.setRequestType(""); + infraRequests0.setCallBackUrl(""); + infraRequests0.setRequestAction(">Q'MsuT`)ThP6"); + infraRequests0.setVfModuleId(""); + infraRequests0.setResponseBody(""); + infraRequests0.getVnfName(); + infraRequests0.getProgress(); + infraRequests0.setVnfName(""); + infraRequests0.getVfModuleModelName(); + infraRequests0.setClientRequestId((String) null); + infraRequests0.getServiceType(); + infraRequests0.getVfModuleId(); + infraRequests0.getVnfName(); + infraRequests0.getVfModuleModelName(); + infraRequests0.getNetworkId(); + infraRequests0.getRequestAction(); + infraRequests0.getNetworkType(); + infraRequests0.getCorrelator(); + infraRequests0.setLastModifiedBy((String) null); + infraRequests0.getCorrelator(); + infraRequests0.getNetworkId(); + infraRequests0.getTenantId(); + infraRequests0.getVolumeGroupName(); + String string0 = infraRequests0.getVolumeGroupName(); + assertNull(string0); + } + + @Test(timeout = 4000) + public void test021() throws Throwable { + InfraRequests infraRequests0 = new InfraRequests(); + infraRequests0.getNetworkId(); + infraRequests0.setRequestAction((String) null); + Long long0 = new Long((-965L)); + infraRequests0.setProgress(long0); + infraRequests0.getSource(); + infraRequests0.setNetworkType("5K\u0002}.V3dm%yU_&r"); + infraRequests0.setVnfOutputs("5K\u0002}.V3dm%yU_&r"); + String string0 = infraRequests0.getVnfOutputs(); + assertEquals("5K\u0002}.V3dm%yU_&r", string0); + } + + @Test(timeout = 4000) + public void test022() throws Throwable { + InfraRequests infraRequests0 = new InfraRequests(); + infraRequests0.setRequestBody(""); + infraRequests0.setNetworkName("K|it"); + infraRequests0.setAction("hcA}j,"); + infraRequests0.setLastModifiedBy(""); + infraRequests0.getCallBackUrl(); + infraRequests0.getVfModuleId(); + infraRequests0.getRequestScope(); + String string0 = infraRequests0.getRequestBody(); + assertEquals("", string0); + } + + @Test(timeout = 4000) + public void test023() throws Throwable { + InfraRequests infraRequests0 = new InfraRequests("0", "0"); + infraRequests0.setNetworkType("0"); + infraRequests0.getStatusMessage(); + infraRequests0.getProvStatus(); + infraRequests0.getVnfParams(); + infraRequests0.getStatusMessage(); + infraRequests0.setVfModuleName((String) null); + infraRequests0.getResponseBody(); + infraRequests0.setStatusMessage("[3aRfG;XuP"); + infraRequests0.setVolumeGroupId((String) null); + infraRequests0.setAction(""); + infraRequests0.getEndTime(); + infraRequests0.getStartTime(); + infraRequests0.getServiceType(); + infraRequests0.getResponseBody(); + infraRequests0.getVfModuleId(); + infraRequests0.getServiceInstanceName(); + infraRequests0.getEndTime(); + infraRequests0.getNetworkType(); + infraRequests0.getVnfOutputs(); + infraRequests0.getVnfType(); + infraRequests0.getRequestScope(); + infraRequests0.getStartTime(); + infraRequests0.getRequestAction(); + infraRequests0.getProgress(); + infraRequests0.getLastModifiedBy(); + infraRequests0.getStatusMessage(); + infraRequests0.getVolumeGroupName(); + infraRequests0.getVnfName(); + System.setCurrentTimeMillis(1480L); + String string0 = infraRequests0.getVnfName(); + assertNull(string0); + } + + @Test(timeout = 4000) + public void test024() throws Throwable { + InfraRequests infraRequests0 = new InfraRequests(); + infraRequests0.setRequestType("2AfD]In8p;DK-]O`8}s"); + infraRequests0.getClientRequestId(); + infraRequests0.setClientRequestId((String) null); + infraRequests0.setResponseBody("2AfD]In8p;DK-]O`8}s"); + infraRequests0.setAaiServiceId("2AfD]In8p;DK-]O`8}s"); + infraRequests0.setRequestBody((String) null); + infraRequests0.setVfModuleId(""); + Timestamp timestamp0 = new Timestamp(0L); + infraRequests0.setEndTime(timestamp0); + infraRequests0.setVfModuleModelName((String) null); + infraRequests0.getAicNodeClli(); + infraRequests0.getAicNodeClli(); + infraRequests0.setVnfName("}}xiNsZQ:D73z4dha"); + Clock clock0 = MockClock.systemDefaultZone(); + Timestamp timestamp1 = infraRequests0.getEndTime(); + timestamp0.before(timestamp1); + Instant instant0 = MockInstant.now(clock0); + Instant instant1 = MockInstant.minusNanos(instant0, (-290L)); + ChronoUnit chronoUnit0 = ChronoUnit.DECADES; + // Undeclared exception! + try { + MockInstant.plus(instant1, 0L, (TemporalUnit) chronoUnit0); + fail("Expecting exception: UnsupportedTemporalTypeException"); + + } catch(UnsupportedTemporalTypeException e) { + // + // Unsupported unit: Decades + // + verifyException("java.time.Instant", e); + } + } + + @Test(timeout = 4000) + public void test025() throws Throwable { + InfraRequests infraRequests0 = new InfraRequests(); + infraRequests0.getTenantId(); + infraRequests0.setServiceType(""); + infraRequests0.getModifyTime(); + infraRequests0.setModifyTime((Timestamp) null); + infraRequests0.getClientRequestId(); + infraRequests0.setVolumeGroupId((String) null); + infraRequests0.getRequestId(); + infraRequests0.getVfModuleName(); + infraRequests0.getServiceInstanceName(); + infraRequests0.setNetworkId(""); + infraRequests0.setNetworkName((String) null); + infraRequests0.getResponseBody(); + infraRequests0.getNetworkId(); + Timestamp timestamp0 = infraRequests0.getModifyTime(); + assertNull(timestamp0); + } + + @Test(timeout = 4000) + public void test026() throws Throwable { + InfraRequests infraRequests0 = new InfraRequests(); + infraRequests0.getVolumeGroupName(); + infraRequests0.setResponseBody(")Y?y`MhJSG>i"); + infraRequests0.setVfModuleId((String) null); + infraRequests0.setRequestStatus((String) null); + infraRequests0.getResponseBody(); + infraRequests0.setVnfOutputs("q+6_~:+S5N.3.Lge\""); + infraRequests0.setVfModuleModelName("q+6_~:+S5N.3.Lge\""); + infraRequests0.setSource("q+6_~:+S5N.3.Lge\""); + infraRequests0.setServiceInstanceName(")Y?y`MhJSG>i"); + infraRequests0.getServiceType(); + infraRequests0.getModifyTime(); + infraRequests0.setNetworkName("YUNs`H&7xu@i2P/1_"); + InfraRequests infraRequests1 = new InfraRequests(); + infraRequests1.setVfModuleModelName(""); + infraRequests1.setRequestStatus("org.openecomp.mso.requestsdb.InfraRequests"); + infraRequests0.setRequestId("6A'N2)N@dyHD|PV"); + infraRequests1.getNetworkType(); + infraRequests0.getNetworkName(); + infraRequests1.getLastModifiedBy(); + infraRequests0.getRequestBody(); + infraRequests1.setServiceInstanceId(""); + infraRequests0.setServiceInstanceName(":fK$0REpUY"); + assertEquals(")Y?y`MhJSG>i", infraRequests0.getResponseBody()); + } + + @Test(timeout = 4000) + public void test027() throws Throwable { + InfraRequests infraRequests0 = new InfraRequests(); + infraRequests0.setServiceType("i3b%q%2jvX"); + infraRequests0.getServiceType(); + infraRequests0.setClientRequestId("i3b%q%2jvX"); + infraRequests0.setVnfId(""); + infraRequests0.getSource(); + ChronoUnit chronoUnit0 = ChronoUnit.NANOS; + // Undeclared exception! + try { + MockInstant.plus((Instant) null, (-1L), (TemporalUnit) 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 test028() throws Throwable { + InfraRequests infraRequests0 = new InfraRequests("org.openecomp.mso.requestsdb.InfraRequests", ""); + infraRequests0.setRequestType(""); + infraRequests0.setRequestBody("org.openecomp.mso.requestsdb.InfraRequests"); + infraRequests0.setAction(""); + infraRequests0.getVnfParams(); + InfraRequests infraRequests1 = new InfraRequests(); + infraRequests0.setVfModuleName((String) null); + infraRequests0.getVfModuleName(); + infraRequests1.setVfModuleName("?ynVFwCW]h"); + infraRequests0.setVnfParams(""); + infraRequests1.setResponseBody((String) null); + infraRequests1.setLastModifiedBy((String) null); + infraRequests1.setClientRequestId("oCb )W1D3x;e}QaJ"); + infraRequests0.setServiceInstanceName(""); + infraRequests0.getVfModuleId(); + infraRequests1.getClientRequestId(); + infraRequests1.getModifyTime(); + infraRequests0.setSource("org.openecomp.mso.requestsdb.InfraRequests"); + infraRequests1.setVfModuleName("org.openecomp.mso.requestsdb.InfraRequests"); + String string0 = infraRequests1.getAaiServiceId(); + assertNull(string0); + } + + @Test(timeout = 4000) + public void test029() throws Throwable { + InfraRequests infraRequests0 = new InfraRequests(); + infraRequests0.setServiceType(""); + infraRequests0.setVfModuleModelName("QE|"); + infraRequests0.setStatusMessage("/`_aGH,(,:O9e'"); + infraRequests0.setStatusMessage("/`_aGH,(,:O9e'"); + infraRequests0.setLastModifiedBy((String) null); + infraRequests0.setServiceInstanceName("QE|"); + infraRequests0.setCallBackUrl("QE|"); + infraRequests0.setCallBackUrl("QE|"); + Long long0 = new Long(0L); + Long.getLong("/`_aGH,(,:O9e'", 0L); + Long.getLong("QE|", (Long) null); + infraRequests0.setProgress(long0); + infraRequests0.setVfModuleName("QE|"); + infraRequests0.setSource(""); + infraRequests0.setVfModuleId("QE|"); + infraRequests0.setVolumeGroupId(""); + infraRequests0.getTenantId(); + infraRequests0.getClientRequestId(); + String string0 = infraRequests0.getServiceInstanceName(); + assertEquals("QE|", string0); + } + + @Test(timeout = 4000) + public void test030() throws Throwable { + InfraRequests infraRequests0 = new InfraRequests(); + infraRequests0.getResponseBody(); + infraRequests0.setServiceInstanceName((String) null); + InfraRequests infraRequests1 = new InfraRequests((String) null, ";*MXO3Cx^<r~)I#t"); + infraRequests1.setSource("H>f%;>>.T7]h8?L]*"); + infraRequests1.setRequestScope((String) null); + infraRequests1.setNetworkName(""); + infraRequests0.setRequestAction("FLknU%"); + infraRequests1.setCallBackUrl(""); + InfraRequests infraRequests2 = new InfraRequests(";*MXO3Cx^<r~)I#t", ";*MXO3Cx^<r~)I#t"); + infraRequests2.setCorrelator(""); + infraRequests1.getNetworkName(); + infraRequests0.setRequestBody((String) null); + assertNull(infraRequests0.getRequestScope()); + } + + @Test(timeout = 4000) + public void test031() throws Throwable { + InfraRequests infraRequests0 = new InfraRequests(); + infraRequests0.getNetworkId(); + infraRequests0.setVfModuleModelName((String) null); + infraRequests0.setNetworkType((String) null); + infraRequests0.setAction((String) null); + infraRequests0.setVfModuleModelName("d@?@e`uVahW|y"); + infraRequests0.setVolumeGroupName("$1"); + infraRequests0.getResponseBody(); + infraRequests0.getVnfParams(); + infraRequests0.getRequestAction(); + infraRequests0.setClientRequestId("N] J}ueWB9R)u"); + infraRequests0.getVfModuleId(); + infraRequests0.getNetworkType(); + infraRequests0.getModifyTime(); + infraRequests0.getNetworkId(); + infraRequests0.getModifyTime(); + infraRequests0.getVolumeGroupName(); + infraRequests0.getAicNodeClli(); + infraRequests0.setVnfOutputs("d@?@e`uVahW|y"); + infraRequests0.getVfModuleModelName(); + infraRequests0.getRequestAction(); + infraRequests0.getRequestAction(); + infraRequests0.setVnfId("2dCOj."); + System.setCurrentTimeMillis(509L); + infraRequests0.getNetworkId(); + infraRequests0.getProgress(); + infraRequests0.getVfModuleId(); + infraRequests0.getVfModuleId(); + infraRequests0.getProgress(); + String string0 = infraRequests0.getAicNodeClli(); + assertNull(string0); + } + + @Test(timeout = 4000) + public void test032() throws Throwable { + InfraRequests infraRequests0 = new InfraRequests(); + infraRequests0.setVfModuleName(""); + infraRequests0.setVfModuleModelName("1Hr"); + infraRequests0.setNetworkType(""); + infraRequests0.setCallBackUrl(""); + infraRequests0.setSource("[@Z"); + infraRequests0.setRequestBody(">!b;YwVyr(8"); + infraRequests0.setRequestBody("[@Z"); + infraRequests0.setServiceInstanceId("1Hr"); + infraRequests0.setClientRequestId((String) null); + infraRequests0.setRequestAction(">!b;YwVyr(8"); + infraRequests0.setVnfName(">!b;YwVyr(8"); + infraRequests0.setAicCloudRegion("[@Z"); + infraRequests0.setNetworkId("OU%$T'av6Ca'8.%"); + infraRequests0.setCallBackUrl("1Hr"); + infraRequests0.setServiceInstanceId(""); + infraRequests0.setNetworkName("OU%$T'av6Ca'8.%"); + infraRequests0.setNetworkName("gB~~7^R}E0VY*jjv"); + infraRequests0.getSource(); + infraRequests0.getLastModifiedBy(); + infraRequests0.getVfModuleName(); + String string0 = infraRequests0.getRequestStatus(); + assertNull(string0); + } + + @Test(timeout = 4000) + public void test033() throws Throwable { + InfraRequests infraRequests0 = new InfraRequests("", "c~]g[*"); + infraRequests0.setServiceType(""); + infraRequests0.setAaiServiceId("c~]g[*"); + infraRequests0.setVnfType("8u=!kEh2}E<wR-=T3Eu"); + infraRequests0.setAicNodeClli("c~]g[*"); + infraRequests0.getVnfType(); + infraRequests0.setVnfName("~x"); + infraRequests0.setVnfOutputs("8u=!kEh2}E<wR-=T3Eu"); + infraRequests0.setServiceType(""); + infraRequests0.setVnfOutputs("CxZIOx,v-"); + infraRequests0.getVfModuleModelName(); + infraRequests0.getAicNodeClli(); + assertEquals("c~]g[*", infraRequests0.getAction()); + + infraRequests0.setAction("Z+$8\"UD&O@G"); + assertEquals("", infraRequests0.getRequestId()); + } + + @Test(timeout = 4000) + public void test034() throws Throwable { + InfraRequests infraRequests0 = new InfraRequests(); + Timestamp timestamp0 = new Timestamp((-2655L)); + infraRequests0.setModifyTime(timestamp0); + Timestamp timestamp1 = infraRequests0.getModifyTime(); + timestamp1.after(timestamp0); + infraRequests0.setStartTime(timestamp1); + infraRequests0.getAaiServiceId(); + infraRequests0.getRequestStatus(); + infraRequests0.setRequestStatus("I1e1@rWiu`h-"); + infraRequests0.setVolumeGroupName("I1e1@rWiu`h-"); + infraRequests0.setAicNodeClli("H/;N:1&TC[5,}"); + String string0 = infraRequests0.getClientRequestId(); + assertNull(string0); + } + + @Test(timeout = 4000) + public void test035() throws Throwable { + InfraRequests infraRequests0 = new InfraRequests(); + infraRequests0.setNetworkType("org.openecomp.mso.requestsdb.InfraRequests"); + infraRequests0.getVnfOutputs(); + infraRequests0.getProgress(); + infraRequests0.setClientRequestId((String) null); + infraRequests0.setRequestAction("YN8"); + infraRequests0.setProvStatus(""); + infraRequests0.getServiceInstanceId(); + infraRequests0.getProvStatus(); + infraRequests0.setRequestScope((String) null); + infraRequests0.getAicNodeClli(); + infraRequests0.getRequestScope(); + infraRequests0.getServiceInstanceName(); + infraRequests0.setVnfName((String) null); + infraRequests0.getVolumeGroupName(); + infraRequests0.getTenantId(); + infraRequests0.getNetworkId(); + infraRequests0.setStatusMessage((String) null); + infraRequests0.setTenantId("org.openecomp.mso.requestsdb.InfraRequests"); + // Undeclared exception! + try { + Timestamp.valueOf((String) null); + fail("Expecting exception: IllegalArgumentException"); + + } catch(IllegalArgumentException e) { + // + // null string + // + verifyException("java.sql.Timestamp", e); + } + } + + @Test(timeout = 4000) + public void test036() throws Throwable { + InfraRequests infraRequests0 = new InfraRequests(); + infraRequests0.getVolumeGroupId(); + infraRequests0.setVnfParams("xeM>h;aPCLLMO/"); + infraRequests0.setAaiServiceId("xeM>h;aPCLLMO/"); + infraRequests0.setProvStatus(""); + infraRequests0.setVfModuleId("xeM>h;aPCLLMO/"); + infraRequests0.setVnfOutputs(""); + infraRequests0.setAaiServiceId((String) null); + infraRequests0.setClientRequestId("S|%I {=}otjRfuQa8Ab"); + infraRequests0.setRequestBody("S|%I {=}otjRfuQa8Ab"); + infraRequests0.setModifyTime((Timestamp) null); + infraRequests0.getRequestBody(); + infraRequests0.setAaiServiceId(""); + infraRequests0.setRequestId("4_X\":Ety|S,O-RObu"); + infraRequests0.getCorrelator(); + infraRequests0.setVnfOutputs("%~+Mc"); + infraRequests0.getVolumeGroupId(); + infraRequests0.setVnfId(""); + assertNull(infraRequests0.getStatusMessage()); + } + + @Test(timeout = 4000) + public void test037() throws Throwable { + InfraRequests infraRequests0 = new InfraRequests("org.openecomp.mso.requestsdb.InfraRequests", "YpJ&"); + infraRequests0.setRequestType(""); + infraRequests0.setSource("org.openecomp.mso.requestsdb.InfraRequests"); + infraRequests0.getNetworkId(); + infraRequests0.getSource(); + infraRequests0.setVfModuleName("org.openecomp.mso.requestsdb.InfraRequests"); + infraRequests0.setRequestType((String) null); + infraRequests0.getStatusMessage(); + infraRequests0.getVolumeGroupName(); + infraRequests0.getVnfName(); + infraRequests0.getModifyTime(); + MockDate mockDate0 = new MockDate((-1949L)); + Instant instant0 = mockDate0.toInstant(); + Instant instant1 = MockInstant.plusSeconds(instant0, (-1949L)); + Date.from(instant1); + infraRequests0.getRequestBody(); + infraRequests0.getNetworkId(); + infraRequests0.setModifyTime((Timestamp) null); + infraRequests0.getEndTime(); + infraRequests0.getProvStatus(); + infraRequests0.getRequestAction(); + infraRequests0.getVfModuleName(); + infraRequests0.getRequestAction(); + assertEquals("YpJ&", infraRequests0.getAction()); + assertEquals("org.openecomp.mso.requestsdb.InfraRequests", infraRequests0.getRequestId()); + } + + @Test(timeout = 4000) + public void test038() throws Throwable { + InfraRequests infraRequests0 = new InfraRequests("", ""); + infraRequests0.setAicCloudRegion((String) null); + infraRequests0.setRequestType("_P-9"); + infraRequests0.getRequestBody(); + infraRequests0.setRequestStatus(""); + infraRequests0.setCorrelator(".3!"); + infraRequests0.setRequestId((String) null); + String string0 = infraRequests0.getRequestType(); + assertEquals("_P-9", string0); + } + + @Test(timeout = 4000) + public void test039() throws Throwable { + InfraRequests infraRequests0 = new InfraRequests(); + infraRequests0.setAaiServiceId(""); + infraRequests0.setCallBackUrl(""); + infraRequests0.setVnfOutputs("]8N<"); + infraRequests0.setVfModuleId(""); + infraRequests0.setCorrelator("]8N<"); + infraRequests0.setResponseBody(""); + infraRequests0.setNetworkType("]8N<"); + infraRequests0.getProgress(); + infraRequests0.setCallBackUrl(""); + infraRequests0.getCallBackUrl(); + infraRequests0.setServiceType("]8N<"); + infraRequests0.getVnfId(); + infraRequests0.setRequestAction(""); + infraRequests0.setVnfName(""); + infraRequests0.setVnfName("x'+i.S`"); + infraRequests0.getTenantId(); + infraRequests0.getAicCloudRegion(); + infraRequests0.getTenantId(); + infraRequests0.setStartTime((Timestamp) null); + infraRequests0.setRequestId("c"); + infraRequests0.getRequestType(); + infraRequests0.getEndTime(); + infraRequests0.setModifyTime((Timestamp) null); + String string0 = infraRequests0.getVnfName(); + assertEquals("x'+i.S`", string0); + } + + @Test(timeout = 4000) + public void test040() throws Throwable { + InfraRequests infraRequests0 = new InfraRequests(); + infraRequests0.setNetworkId("8FcIWeVboHbH"); + infraRequests0.setVnfId(""); + infraRequests0.setStatusMessage(""); + infraRequests0.getClientRequestId(); + infraRequests0.setNetworkName((String) null); + infraRequests0.setVnfName((String) null); + infraRequests0.setCallBackUrl("sK9}!C'50J,"); + infraRequests0.setVolumeGroupId("oC"); + infraRequests0.getVnfOutputs(); + infraRequests0.setVnfName("sK9}!C'50J,"); + infraRequests0.setRequestScope("sK9}!C'50J,"); + infraRequests0.getRequestAction(); + infraRequests0.setVnfParams("oC"); + infraRequests0.getVolumeGroupName(); + infraRequests0.setResponseBody((String) null); + infraRequests0.setNetworkId((String) null); + infraRequests0.setProvStatus(""); + infraRequests0.setAicNodeClli(""); + infraRequests0.getAaiServiceId(); + infraRequests0.getCallBackUrl(); + infraRequests0.getResponseBody(); + infraRequests0.setAaiServiceId((String) null); + infraRequests0.getResponseBody(); + infraRequests0.getEndTime(); + infraRequests0.setModifyTime((Timestamp) null); + infraRequests0.getServiceType(); + infraRequests0.setResponseBody(""); + infraRequests0.getServiceInstanceId(); + infraRequests0.setRequestBody("J2E*wkiH'm}"); + assertEquals("sK9}!C'50J,", infraRequests0.getCallBackUrl()); + } + + @Test(timeout = 4000) + public void test041() throws Throwable { + InfraRequests infraRequests0 = new InfraRequests(); + infraRequests0.setRequestStatus("gUu8 g"); + infraRequests0.setClientRequestId("org.openecomp.mso.requestsdb.InfraRequests"); + infraRequests0.setVnfOutputs(""); + infraRequests0.setResponseBody(""); + infraRequests0.setVnfId(""); + infraRequests0.setAaiServiceId("org.openecomp.mso.requestsdb.InfraRequests"); + infraRequests0.setAicNodeClli("org.openecomp.mso.requestsdb.InfraRequests"); + infraRequests0.setVnfParams("org.openecomp.mso.requestsdb.InfraRequests"); + infraRequests0.setResponseBody(""); + infraRequests0.getModifyTime(); + infraRequests0.getVnfOutputs(); + infraRequests0.getRequestStatus(); + infraRequests0.setVfModuleId("GrYS{|<Q&Zg22qy+qi"); + infraRequests0.setStartTime((Timestamp) null); + infraRequests0.getVnfOutputs(); + String string0 = infraRequests0.getRequestAction(); + assertNull(string0); + } + + @Test(timeout = 4000) + public void test042() throws Throwable { + InfraRequests infraRequests0 = new InfraRequests(); + infraRequests0.setServiceInstanceId((String) null); + infraRequests0.setAction("niZk9/S^^Ok_H^a{"); + infraRequests0.setVfModuleId("niZk9/S^^Ok_H^a{"); + infraRequests0.setVolumeGroupId(""); + infraRequests0.setNetworkId(""); + infraRequests0.setVnfId(""); + infraRequests0.setRequestType("?_I%o"); + infraRequests0.setProvStatus("niZk9/S^^Ok_H^a{"); + infraRequests0.setCallBackUrl(""); + infraRequests0.setServiceInstanceName("XA&Ybqzx!ro6hEU"); + infraRequests0.setLastModifiedBy(""); + infraRequests0.setRequestId(""); + infraRequests0.getRequestScope(); + infraRequests0.getNetworkName(); + infraRequests0.getVnfId(); + infraRequests0.setAaiServiceId(""); + infraRequests0.setTenantId("XA&Ybqzx!ro6hEU"); + infraRequests0.setVolumeGroupId("{O)c"); + infraRequests0.getAction(); + infraRequests0.getVolumeGroupName(); + infraRequests0.getTenantId(); + infraRequests0.setServiceInstanceId(""); + assertNull(infraRequests0.getNetworkType()); + } + + @Test(timeout = 4000) + public void test043() throws Throwable { + InfraRequests infraRequests0 = new InfraRequests("", ""); + infraRequests0.setTenantId(""); + infraRequests0.setNetworkName(""); + infraRequests0.setAction(""); + Long long0 = new Long(210L); + Long.compare(1164L, 210L); + infraRequests0.setProgress(long0); + infraRequests0.setVfModuleName(""); + Timestamp timestamp0 = new Timestamp(0L); + timestamp0.toInstant(); + timestamp0.setTime(210L); + Instant instant0 = MockInstant.ofEpochMilli(210L); + timestamp0.toLocalDateTime(); + Date.from(instant0); + infraRequests0.setModifyTime(timestamp0); + infraRequests0.setAicCloudRegion("org.openecomp.mso.requestsdb.InfraRequests"); + infraRequests0.setRequestAction("qa^[z3j"); + infraRequests0.setVnfType(""); + infraRequests0.getEndTime(); + infraRequests0.setVnfId("wI"); + infraRequests0.getAicCloudRegion(); + infraRequests0.setServiceType(""); + infraRequests0.getAction(); + Timestamp timestamp1 = infraRequests0.getStartTime(); + assertNull(timestamp1); + } + + @Test(timeout = 4000) + public void test044() throws Throwable { + InfraRequests infraRequests0 = new InfraRequests("y_J8g=Q8E|gns?USs", "~6yl5nFR7N_I'Tv@."); + infraRequests0.setCallBackUrl("_w^p*-dH4_6v"); + infraRequests0.setVolumeGroupName("y_J8g=Q8E|gns?USs"); + String string0 = infraRequests0.getAction(); + assertEquals("~6yl5nFR7N_I'Tv@.", string0); + + InfraRequests infraRequests1 = new InfraRequests("S?cD1SU", ""); + assertEquals("S?cD1SU", infraRequests1.getRequestId()); + } + + @Test(timeout = 4000) + public void test045() throws Throwable { + InfraRequests infraRequests0 = new InfraRequests(); + infraRequests0.setVolumeGroupName(""); + infraRequests0.setServiceInstanceName(""); + infraRequests0.setVfModuleName(""); + infraRequests0.setStatusMessage(""); + infraRequests0.setVnfName("GG-<o?t l"); + infraRequests0.setVnfName(""); + infraRequests0.setRequestBody(""); + infraRequests0.setCallBackUrl(""); + infraRequests0.setRequestAction(""); + infraRequests0.setVnfType(""); + infraRequests0.setVnfId(""); + infraRequests0.setServiceInstanceId("{CyVx7 >*vO|"); + infraRequests0.setVnfId(""); + infraRequests0.getProvStatus(); + infraRequests0.setProvStatus("{CyVx7 >*vO|"); + infraRequests0.setAicNodeClli("?g9!S#sMQWI4rg"); + infraRequests0.setVnfParams(""); + infraRequests0.setRequestAction("GG-<o?t l"); + infraRequests0.getRequestType(); + infraRequests0.getVolumeGroupName(); + infraRequests0.getRequestAction(); + infraRequests0.getRequestStatus(); + InfraRequests infraRequests1 = new InfraRequests(); + String string0 = infraRequests1.getServiceInstanceId(); + assertNull(string0); + } + + @Test(timeout = 4000) + public void test046() throws Throwable { + InfraRequests infraRequests0 = new InfraRequests("", ""); + infraRequests0.setVnfName(""); + infraRequests0.setServiceInstanceId(""); + infraRequests0.setVolumeGroupId(""); + infraRequests0.setNetworkId("?"); + infraRequests0.setVnfName(""); + infraRequests0.setServiceType(""); + infraRequests0.setSource(""); + infraRequests0.getRequestType(); + InfraRequests infraRequests1 = new InfraRequests(); + infraRequests1.setVolumeGroupName(")Na<;z"); + infraRequests1.setRequestAction(""); + infraRequests1.getAicNodeClli(); + infraRequests1.setResponseBody((String) null); + infraRequests1.setVnfType((String) null); + infraRequests1.getVnfName(); + infraRequests1.getVnfType(); + infraRequests0.getServiceInstanceId(); + infraRequests0.setRequestType(""); + infraRequests1.getVnfName(); + infraRequests0.getRequestBody(); + infraRequests1.getVnfType(); + infraRequests1.setRequestAction("Yy"); + infraRequests0.setVnfParams("DnrZ78}s"); + infraRequests0.setServiceInstanceId("]V55Aq\u0003(z<Ct92L`F"); + infraRequests1.setVfModuleName((String) null); + assertNull(infraRequests1.getNetworkId()); + } + + @Test(timeout = 4000) + public void test047() throws Throwable { + InfraRequests infraRequests0 = new InfraRequests("", ""); + infraRequests0.getAction(); + infraRequests0.setVnfName(""); + infraRequests0.getNetworkType(); + infraRequests0.getVnfParams(); + infraRequests0.setLastModifiedBy((String) null); + String string0 = infraRequests0.getAaiServiceId(); + assertNull(string0); + } + + @Test(timeout = 4000) + public void test048() throws Throwable { + InfraRequests infraRequests0 = new InfraRequests(); + infraRequests0.setNetworkType(""); + infraRequests0.setStatusMessage(""); + infraRequests0.setRequestAction(""); + infraRequests0.setSource(""); + infraRequests0.setVnfId((String) null); + infraRequests0.setLastModifiedBy((String) null); + infraRequests0.setVolumeGroupId((String) null); + infraRequests0.setRequestScope(""); + infraRequests0.getServiceType(); + infraRequests0.setRequestBody((String) null); + infraRequests0.getProgress(); + infraRequests0.setVnfType((String) null); + infraRequests0.setSource((String) null); + infraRequests0.getVfModuleModelName(); + infraRequests0.getStatusMessage(); + infraRequests0.setResponseBody(""); + infraRequests0.setRequestStatus((String) null); + infraRequests0.getAicCloudRegion(); + Timestamp timestamp0 = new Timestamp(2519L); + infraRequests0.setEndTime(timestamp0); + String string0 = infraRequests0.getRequestBody(); + assertNull(string0); + } + + @Test(timeout = 4000) + public void test049() throws Throwable { + InfraRequests infraRequests0 = new InfraRequests("$V/<$XAp+o>Im\"*", "$V/<$XAp+o>Im\"*"); + infraRequests0.setNetworkName("$V/<$XAp+o>Im\"*"); + infraRequests0.setVnfName((String) null); + infraRequests0.setVfModuleId(""); + infraRequests0.getServiceInstanceName(); + infraRequests0.setAaiServiceId(""); + infraRequests0.setRequestScope(""); + infraRequests0.getAaiServiceId(); + infraRequests0.getModifyTime(); + infraRequests0.setNetworkName((String) null); + infraRequests0.setSource(""); + infraRequests0.getRequestBody(); + infraRequests0.setVnfType(""); + infraRequests0.setStatusMessage(""); + assertNull(infraRequests0.getVolumeGroupId()); + } + + @Test(timeout = 4000) + public void test050() throws Throwable { + InfraRequests infraRequests0 = new InfraRequests(); + infraRequests0.setRequestStatus(""); + infraRequests0.getServiceInstanceName(); + infraRequests0.setRequestBody((String) null); + infraRequests0.getAction(); + infraRequests0.setVnfParams(""); + infraRequests0.setAction((String) null); + infraRequests0.getSource(); + infraRequests0.getAicCloudRegion(); + infraRequests0.getRequestType(); + infraRequests0.getClientRequestId(); + infraRequests0.getServiceInstanceId(); + infraRequests0.setResponseBody(""); + infraRequests0.getVolumeGroupId(); + infraRequests0.getRequestStatus(); + infraRequests0.getRequestScope(); + infraRequests0.setAicCloudRegion(""); + Long long0 = new Long(0L); + Long.getLong("TQRm 6Q}I>x7UHTd!cH"); + // Undeclared exception! + try { + Long.remainderUnsigned((-1L), 0L); + fail("Expecting exception: ArithmeticException"); + + } catch(ArithmeticException e) { + // + // BigInteger divide by zero + // + verifyException("java.math.MutableBigInteger", e); + } + } + + @Test(timeout = 4000) + public void test051() throws Throwable { + InfraRequests infraRequests0 = new InfraRequests("", ""); + infraRequests0.setProvStatus(""); + infraRequests0.setClientRequestId(""); + infraRequests0.setVnfType("BJ@B"); + infraRequests0.setProvStatus(""); + infraRequests0.setRequestType(""); + infraRequests0.setAaiServiceId("k^;d!:UH+Z"); + infraRequests0.setRequestType(""); + infraRequests0.setTenantId(""); + infraRequests0.getCallBackUrl(); + InfraRequests infraRequests1 = new InfraRequests(); + infraRequests1.setVnfName("C,,\"N"); + infraRequests0.setVnfParams((String) null); + InfraRequests infraRequests2 = new InfraRequests("", ""); + infraRequests1.setVolumeGroupId(""); + infraRequests2.setTenantId("k^;d!:UH+Z"); + infraRequests1.setVfModuleName(""); + infraRequests2.setVnfType("eDfR<b$HYx"); + infraRequests2.setStatusMessage((String) null); + infraRequests2.setVnfId(""); + infraRequests1.getVolumeGroupId(); + infraRequests0.setAicCloudRegion("BJ@B"); + infraRequests1.setNetworkType(""); + String string0 = infraRequests2.getRequestBody(); + assertNull(string0); + } + + @Test(timeout = 4000) + public void test052() throws Throwable { + InfraRequests infraRequests0 = new InfraRequests("", ""); + infraRequests0.setRequestStatus(""); + infraRequests0.getAicNodeClli(); + infraRequests0.setVolumeGroupName("=xQ^U6%j?LcGU"); + infraRequests0.setVolumeGroupId("~L$J"); + infraRequests0.setVnfOutputs("C"); + infraRequests0.setVnfId("YU GUY+c}[>6+QI83q"); + infraRequests0.setVfModuleName(""); + infraRequests0.getRequestId(); + infraRequests0.setVfModuleModelName("S9h|[hF*h/aEBZ--"); + infraRequests0.setCallBackUrl(""); + infraRequests0.getVnfId(); + infraRequests0.setVnfParams(""); + infraRequests0.getSource(); + infraRequests0.getVnfType(); + InfraRequests infraRequests1 = new InfraRequests("", ""); + infraRequests0.setAaiServiceId("S9h|[hF*h/aEBZ--"); + infraRequests0.setVnfParams(""); + infraRequests1.getRequestBody(); + Month month0 = Month.MARCH; + // Undeclared exception! + try { + MockLocalDateTime.of(1, month0, 1, 1, 0, (-1068)); + fail("Expecting exception: DateTimeException"); + + } catch(DateTimeException e) { + // + // Invalid value for SecondOfMinute (valid values 0 - 59): -1068 + // + verifyException("java.time.temporal.ValueRange", e); + } + } + + @Test(timeout = 4000) + public void test053() throws Throwable { + InfraRequests infraRequests0 = new InfraRequests(); + infraRequests0.setLastModifiedBy("M+YL/d"); + infraRequests0.setCorrelator("M+YL/d"); + infraRequests0.getLastModifiedBy(); + Month month0 = Month.MAY; + // Undeclared exception! + try { + MockLocalDateTime.of((-574), month0, (-574), (-574), 0); + fail("Expecting exception: DateTimeException"); + + } catch(DateTimeException e) { + // + // Invalid value for DayOfMonth (valid values 1 - 28/31): -574 + // + verifyException("java.time.temporal.ValueRange", e); + } + } + + @Test(timeout = 4000) + public void test054() throws Throwable { + InfraRequests infraRequests0 = new InfraRequests(); + infraRequests0.setRequestType(""); + infraRequests0.setEndTime((Timestamp) null); + Long long0 = new Long(0L); + Long.compare(0L, 0L); + Long.min(0L, 0L); + infraRequests0.setProvStatus(""); + Long.compare(0L, 0L); + Long.max(0, 0L); + Long.divideUnsigned((-1239L), 561L); + Long.divideUnsigned(0, 31L); + Long.sum(0, 31L); + Long.getLong("}'{?rnxwE~m.*b/<", (-2588L)); + infraRequests0.setProgress(long0); + infraRequests0.setProvStatus(""); + infraRequests0.setVnfParams(""); + infraRequests0.setRequestScope("Gz0xF^~M`"); + infraRequests0.setRequestType(""); + infraRequests0.getAaiServiceId(); + infraRequests0.setCallBackUrl(""); + infraRequests0.setNetworkName(""); + infraRequests0.setRequestStatus("No<5t"); + infraRequests0.setVolumeGroupId(""); + infraRequests0.getEndTime(); + infraRequests0.getProgress(); + String string0 = infraRequests0.getRequestScope(); + assertEquals("Gz0xF^~M`", string0); + } + + @Test(timeout = 4000) + public void test055() throws Throwable { + InfraRequests infraRequests0 = new InfraRequests("K66EFm]%0}Hi", "K66EFm]%0}Hi"); + infraRequests0.setVnfName("K66EFm]%0}Hi"); + infraRequests0.getVfModuleModelName(); + infraRequests0.getProgress(); + infraRequests0.setStatusMessage("K66EFm]%0}Hi"); + infraRequests0.setVolumeGroupId((String) null); + infraRequests0.setVolumeGroupName("K66EFm]%0}Hi"); + infraRequests0.setRequestBody("J1UB"); + assertNull(infraRequests0.getResponseBody()); + } + + @Test(timeout = 4000) + public void test056() throws Throwable { + InfraRequests infraRequests0 = new InfraRequests("", "UwUvkc"); + infraRequests0.setVolumeGroupName("UwUvkc"); + infraRequests0.getVfModuleId(); + ZoneOffset zoneOffset0 = ZoneOffset.MIN; + ZoneOffset zoneOffset1 = (ZoneOffset)ZoneId.ofOffset("", zoneOffset0); + LocalDateTime localDateTime0 = MockLocalDateTime.now((ZoneId) zoneOffset1); + Timestamp timestamp0 = Timestamp.valueOf(localDateTime0); + infraRequests0.setModifyTime(timestamp0); + String string0 = infraRequests0.getRequestId(); + assertEquals("", string0); + + infraRequests0.getCorrelator(); + assertEquals("UwUvkc", infraRequests0.getAction()); + } + + @Test(timeout = 4000) + public void test057() throws Throwable { + InfraRequests infraRequests0 = new InfraRequests(); + infraRequests0.getVnfName(); + infraRequests0.setAction((String) null); + infraRequests0.getVfModuleName(); + infraRequests0.getNetworkId(); + infraRequests0.getVnfId(); + infraRequests0.setRequestId((String) null); + infraRequests0.setNetworkId((String) null); + infraRequests0.setRequestStatus((String) null); + infraRequests0.setAaiServiceId("wL6o_:EmO)#"); + infraRequests0.setSource((String) null); + infraRequests0.setVnfType("yMKDqB`W?]q"); + infraRequests0.setRequestType((String) null); + infraRequests0.setRequestType(""); + infraRequests0.setRequestScope((String) null); + infraRequests0.getVfModuleName(); + infraRequests0.getVolumeGroupName(); + infraRequests0.getSource(); + infraRequests0.setAicCloudRegion((String) null); + infraRequests0.getSource(); + infraRequests0.getRequestBody(); + infraRequests0.getAaiServiceId(); + infraRequests0.setVnfType((String) null); + String string0 = infraRequests0.getClientRequestId(); + assertNull(string0); + } + + @Test(timeout = 4000) + public void test058() throws Throwable { + InfraRequests infraRequests0 = new InfraRequests("", ""); + infraRequests0.setSource("c"); + infraRequests0.setRequestType("*Q}l.yW`VI`i_Q8YL]"); + infraRequests0.setRequestId(""); + infraRequests0.setCorrelator("Y;5!~N0v@x"); + infraRequests0.setNetworkType(""); + infraRequests0.setRequestAction("Y;5!~N0v@x"); + infraRequests0.setLastModifiedBy(""); + infraRequests0.setSource(""); + infraRequests0.setAction(""); + infraRequests0.setTenantId(""); + infraRequests0.setAicCloudRegion(""); + infraRequests0.getRequestScope(); + infraRequests0.setAicNodeClli("Y;5!~N0v@x"); + infraRequests0.getAicCloudRegion(); + infraRequests0.setVnfId("qn|b,'x[1 h*z\"#h"); + assertNull(infraRequests0.getRequestScope()); + } + + @Test(timeout = 4000) + public void test059() throws Throwable { + InfraRequests infraRequests0 = new InfraRequests("", ""); + infraRequests0.setVnfType("SRPBs.zeX&dK@&XRQj"); + infraRequests0.setCallBackUrl(""); + infraRequests0.setVnfType("%a26GFoFhBEe"); + infraRequests0.setServiceInstanceName((String) null); + infraRequests0.setVfModuleName((String) null); + infraRequests0.getLastModifiedBy(); + infraRequests0.getVnfType(); + String string0 = infraRequests0.getServiceInstanceName(); + assertNull(string0); + } + + @Test(timeout = 4000) + public void test060() throws Throwable { + InfraRequests infraRequests0 = new InfraRequests(); + infraRequests0.getEndTime(); + MockDate mockDate0 = new MockDate(965L); + Instant instant0 = mockDate0.toInstant(); + Date.from(instant0); + infraRequests0.setEndTime((Timestamp) null); + infraRequests0.getEndTime(); + infraRequests0.getCorrelator(); + Long long0 = new Long(965L); + infraRequests0.setProgress(long0); + String string0 = infraRequests0.getTenantId(); + assertNull(string0); + } + + @Test(timeout = 4000) + public void test061() throws Throwable { + InfraRequests infraRequests0 = new InfraRequests("qx?)", "qx?)"); + Timestamp timestamp0 = new Timestamp(1390L); + infraRequests0.setStartTime(timestamp0); + infraRequests0.getRequestScope(); + infraRequests0.setVolumeGroupId("qx?)"); + infraRequests0.getVolumeGroupId(); + infraRequests0.setProvStatus((String) null); + timestamp0.setNanos(0); + infraRequests0.setCorrelator(""); + infraRequests0.setVnfOutputs(""); + infraRequests0.setModifyTime(timestamp0); + infraRequests0.getServiceType(); + infraRequests0.setVolumeGroupName("5#&B!D"); + infraRequests0.setVfModuleId("a"); + infraRequests0.setNetworkName("a"); + infraRequests0.getClientRequestId(); + infraRequests0.setRequestScope("qx?)"); + infraRequests0.setVolumeGroupName((String) null); + infraRequests0.getRequestId(); + infraRequests0.setRequestScope("-W#aB<Km<U("); + infraRequests0.getVnfParams(); + infraRequests0.getServiceInstanceName(); + infraRequests0.getCorrelator(); + infraRequests0.setAicNodeClli(""); + infraRequests0.setAction(""); + infraRequests0.setStartTime(timestamp0); + assertNull(infraRequests0.getServiceInstanceName()); + } + + @Test(timeout = 4000) + public void test062() throws Throwable { + InfraRequests infraRequests0 = new InfraRequests("N.Z5|phE", ""); + infraRequests0.getClientRequestId(); + assertEquals("N.Z5|phE", infraRequests0.getRequestId()); + assertEquals("", infraRequests0.getAction()); + } + + @Test(timeout = 4000) + public void test063() throws Throwable { + InfraRequests infraRequests0 = new InfraRequests("", "h."); + infraRequests0.setRequestStatus(""); + infraRequests0.getVnfParams(); + infraRequests0.setNetworkType(""); + assertEquals("h.", infraRequests0.getAction()); + assertEquals("", infraRequests0.getRequestId()); + } + + @Test(timeout = 4000) + public void test064() throws Throwable { + InfraRequests infraRequests0 = new InfraRequests("", ""); + infraRequests0.setRequestType(""); + infraRequests0.getServiceInstanceId(); + infraRequests0.setVnfParams("`jECciBa[T7M"); + infraRequests0.setRequestBody("4ap}Bu0R,P"); + String string0 = infraRequests0.getRequestType(); + assertEquals("", string0); + } + + @Test(timeout = 4000) + public void test065() throws Throwable { + InfraRequests infraRequests0 = new InfraRequests(); + String string0 = infraRequests0.getAicCloudRegion(); + assertNull(string0); + } + + @Test(timeout = 4000) + public void test066() throws Throwable { + InfraRequests infraRequests0 = new InfraRequests("org.openecomp.mso.requestsdb.InfraRequests", "org.openecomp.mso.requestsdb.InfraRequests"); + infraRequests0.setRequestStatus(""); + infraRequests0.getResponseBody(); + String string0 = infraRequests0.getRequestAction(); + assertNull(string0); + } + + @Test(timeout = 4000) + public void test067() throws Throwable { + InfraRequests infraRequests0 = new InfraRequests("", (String) null); + infraRequests0.setNetworkId("x^qIF~ru"); + infraRequests0.setServiceInstanceId("IL'5l;^7N^;>0"); + infraRequests0.setLastModifiedBy("h dET"); + infraRequests0.setVfModuleModelName("h dET"); + infraRequests0.setVnfType(""); + infraRequests0.setVfModuleId(""); + infraRequests0.setVfModuleName(""); + infraRequests0.setClientRequestId(""); + infraRequests0.setVnfId("W1Vd+"); + infraRequests0.getVnfName(); + infraRequests0.getNetworkType(); + infraRequests0.getServiceInstanceId(); + infraRequests0.setNetworkName("o-"); + assertNull(infraRequests0.getServiceType()); + } + + @Test(timeout = 4000) + public void test068() throws Throwable { + InfraRequests infraRequests0 = new InfraRequests("4E!AHGB", ""); + infraRequests0.getRequestStatus(); + String string0 = infraRequests0.getRequestId(); + assertEquals("4E!AHGB", string0); + + infraRequests0.setRequestScope("F"); + infraRequests0.getVfModuleId(); + infraRequests0.setAicNodeClli("zM4bS"); + infraRequests0.setServiceInstanceName("4E!AHGB"); + infraRequests0.setServiceType(""); + infraRequests0.getVnfType(); + infraRequests0.setAicNodeClli((String) null); + assertEquals("", infraRequests0.getAction()); + } + + @Test(timeout = 4000) + public void test069() throws Throwable { + InfraRequests infraRequests0 = new InfraRequests(); + infraRequests0.setServiceInstanceName("}<+55QA6'/xzr"); + infraRequests0.getModifyTime(); + infraRequests0.getProvStatus(); + infraRequests0.setVnfOutputs(""); + infraRequests0.getAction(); + infraRequests0.setAicCloudRegion("~W -^JP41(-Dg'.+|p$"); + assertNull(infraRequests0.getServiceType()); + } + + @Test(timeout = 4000) + public void test070() throws Throwable { + InfraRequests infraRequests0 = new InfraRequests(); + infraRequests0.setAaiServiceId("PJ60cl#^59FDR_>aLqF"); + infraRequests0.setLastModifiedBy("PJ60cl#^59FDR_>aLqF"); + infraRequests0.setCorrelator(""); + infraRequests0.getNetworkType(); + infraRequests0.setAaiServiceId("PJ60cl#^59FDR_>aLqF"); + infraRequests0.getAicNodeClli(); + String string0 = infraRequests0.getVnfType(); + assertNull(string0); + } + + @Test(timeout = 4000) + public void test071() throws Throwable { + InfraRequests infraRequests0 = new InfraRequests(" ?)Ec.r]zDe6pa).i", "LZP&!xPsP /f"); + infraRequests0.setVnfType("5YWNFYfj=3.[9u?N"); + infraRequests0.setSource("LZP&!xPsP /f"); + infraRequests0.setVfModuleName("9"); + infraRequests0.getVnfId(); + Timestamp timestamp0 = new Timestamp(2083L); + LocalDateTime localDateTime0 = timestamp0.toLocalDateTime(); + Timestamp timestamp1 = Timestamp.valueOf(localDateTime0); + infraRequests0.setModifyTime(timestamp1); + infraRequests0.getCorrelator(); + infraRequests0.getEndTime(); + assertEquals(" ?)Ec.r]zDe6pa).i", infraRequests0.getRequestId()); + assertEquals("LZP&!xPsP /f", infraRequests0.getAction()); + } + + @Test(timeout = 4000) + public void test072() throws Throwable { + InfraRequests infraRequests0 = new InfraRequests(); + infraRequests0.setVnfId(""); + String string0 = infraRequests0.getVnfId(); + assertEquals("", string0); + } + + @Test(timeout = 4000) + public void test073() throws Throwable { + InfraRequests infraRequests0 = new InfraRequests("", ""); + infraRequests0.setAaiServiceId(""); + String string0 = infraRequests0.getServiceType(); + assertNull(string0); + } + + @Test(timeout = 4000) + public void test074() throws Throwable { + InfraRequests infraRequests0 = new InfraRequests(); + infraRequests0.setVolumeGroupName(""); + String string0 = infraRequests0.getVfModuleId(); + assertNull(string0); + } + + @Test(timeout = 4000) + public void test075() throws Throwable { + InfraRequests infraRequests0 = new InfraRequests(); + infraRequests0.setVnfOutputs(""); + infraRequests0.setNetworkId("RU^6`fci#/"); + infraRequests0.getVolumeGroupId(); + infraRequests0.getModifyTime(); + infraRequests0.setVnfType((String) null); + String string0 = infraRequests0.getNetworkName(); + assertNull(string0); + } + + @Test(timeout = 4000) + public void test076() throws Throwable { + InfraRequests infraRequests0 = new InfraRequests(); + Long long0 = new Long((-1725L)); + infraRequests0.setProgress(long0); + Long long1 = infraRequests0.getProgress(); + assertEquals((-1725L), (long)long1); + } + + @Test(timeout = 4000) + public void test077() throws Throwable { + InfraRequests infraRequests0 = new InfraRequests("\"}G", ""); + Timestamp timestamp0 = new Timestamp((-231L)); + infraRequests0.setModifyTime(timestamp0); + infraRequests0.getServiceInstanceId(); + infraRequests0.getVnfName(); + infraRequests0.setVfModuleName("org.openecomp.mso.requestsdb.InfraRequests"); + assertEquals("\"}G", infraRequests0.getRequestId()); + assertEquals("", infraRequests0.getAction()); + } + + @Test(timeout = 4000) + public void test078() throws Throwable { + InfraRequests infraRequests0 = new InfraRequests(); + infraRequests0.getAicNodeClli(); + infraRequests0.getAicNodeClli(); + String string0 = infraRequests0.getVnfOutputs(); + assertNull(string0); + } + + @Test(timeout = 4000) + public void test079() throws Throwable { + InfraRequests infraRequests0 = new InfraRequests(); + InfraRequests infraRequests1 = new InfraRequests(); + infraRequests1.getEndTime(); + infraRequests0.setStartTime((Timestamp) null); + infraRequests0.setTenantId("#X=o2!~:^_LF!mu%"); + assertNull(infraRequests0.getVfModuleModelName()); + } + + @Test(timeout = 4000) + public void test080() throws Throwable { + InfraRequests infraRequests0 = new InfraRequests(); + infraRequests0.getNetworkId(); + infraRequests0.setRequestAction((String) null); + infraRequests0.getSource(); + infraRequests0.setVnfOutputs("5K\u0002}.V3dm%yU_&r"); + assertNull(infraRequests0.getRequestScope()); + } + + @Test(timeout = 4000) + public void test081() throws Throwable { + InfraRequests infraRequests0 = new InfraRequests((String) null, "org.openecomp.mso.requestsdb.InfraRequests"); + infraRequests0.setVfModuleName((String) null); + infraRequests0.setServiceType("org.openecomp.mso.requestsdb.InfraRequests"); + infraRequests0.getServiceInstanceId(); + infraRequests0.getRequestId(); + infraRequests0.getVolumeGroupId(); + String string0 = infraRequests0.getNetworkType(); + assertNull(string0); + } + + @Test(timeout = 4000) + public void test082() throws Throwable { + InfraRequests infraRequests0 = new InfraRequests(); + infraRequests0.setVolumeGroupId("<LXzO"); + assertNull(infraRequests0.getRequestType()); + } + + @Test(timeout = 4000) + public void test083() throws Throwable { + InfraRequests infraRequests0 = new InfraRequests(); + infraRequests0.setRequestAction(""); + infraRequests0.setServiceInstanceId(""); + infraRequests0.setAicNodeClli(""); + assertNull(infraRequests0.getServiceType()); + } + + @Test(timeout = 4000) + public void test084() throws Throwable { + InfraRequests infraRequests0 = new InfraRequests("", "Z={83xlme_b)?zb8"); + infraRequests0.setSource(""); + infraRequests0.getStartTime(); + infraRequests0.getSource(); + infraRequests0.getModifyTime(); + assertEquals("Z={83xlme_b)?zb8", infraRequests0.getAction()); + assertEquals("", infraRequests0.getRequestId()); + } + + @Test(timeout = 4000) + public void test085() throws Throwable { + InfraRequests infraRequests0 = new InfraRequests(); + infraRequests0.setVnfName("d(8}Oc 4|@w8hBNICH"); + infraRequests0.setRequestScope("d(8}Oc 4|@w8hBNICH"); + String string0 = infraRequests0.getAaiServiceId(); + assertNull(string0); + } + + @Test(timeout = 4000) + public void test086() throws Throwable { + InfraRequests infraRequests0 = new InfraRequests(); + infraRequests0.setVfModuleId("bS&'!@{LdL0&"); + infraRequests0.setRequestStatus("bS&'!@{LdL0&"); + infraRequests0.setRequestAction((String) null); + infraRequests0.setVfModuleModelName("z"); + infraRequests0.getSource(); + infraRequests0.getServiceInstanceName(); + infraRequests0.getVnfName(); + String string0 = infraRequests0.getAction(); + assertNull(string0); + } + + @Test(timeout = 4000) + public void test087() throws Throwable { + InfraRequests infraRequests0 = new InfraRequests(); + infraRequests0.getRequestType(); + infraRequests0.setVnfOutputs((String) null); + infraRequests0.getCorrelator(); + infraRequests0.setCallBackUrl((String) null); + infraRequests0.setVnfParams(">'n"); + assertNull(infraRequests0.getVfModuleModelName()); + } + + @Test(timeout = 4000) + public void test088() throws Throwable { + InfraRequests infraRequests0 = new InfraRequests("I\"as", (String) null); + infraRequests0.getVolumeGroupName(); + infraRequests0.getRequestBody(); + infraRequests0.setTenantId((String) null); + infraRequests0.getResponseBody(); + // Undeclared exception! + try { + MockURI.create((String) null); + fail("Expecting exception: NullPointerException"); + + } catch(NullPointerException e) { + // + // no message in exception (getMessage() returned null) + // + verifyException("java.net.URI$Parser", e); + } + } + + @Test(timeout = 4000) + public void test089() throws Throwable { + InfraRequests infraRequests0 = new InfraRequests("", ""); + infraRequests0.setResponseBody(""); + infraRequests0.setRequestId(""); + infraRequests0.setNetworkId(""); + infraRequests0.getEndTime(); + infraRequests0.getVolumeGroupId(); + String string0 = infraRequests0.getStatusMessage(); + assertNull(string0); + } + + @Test(timeout = 4000) + public void test090() throws Throwable { + InfraRequests infraRequests0 = new InfraRequests((String) null, "&6KF"); + infraRequests0.setRequestBody("&6KF"); + assertNull(infraRequests0.getRequestScope()); + } + + @Test(timeout = 4000) + public void test091() throws Throwable { + InfraRequests infraRequests0 = new InfraRequests("/WcV", "/WcV"); + infraRequests0.setVnfParams("\"w"); + String string0 = infraRequests0.getVnfParams(); + assertEquals("\"w", string0); + } + + @Test(timeout = 4000) + public void test092() throws Throwable { + InfraRequests infraRequests0 = new InfraRequests(">?ozK", ">?ozK"); + infraRequests0.setVnfOutputs(">?ozK"); + infraRequests0.setVnfId(""); + infraRequests0.getLastModifiedBy(); + infraRequests0.setAicCloudRegion((String) null); + infraRequests0.setProvStatus(">?ozK"); + infraRequests0.setStatusMessage((String) null); + String string0 = infraRequests0.getRequestScope(); + assertNull(string0); + } + + @Test(timeout = 4000) + public void test093() throws Throwable { + InfraRequests infraRequests0 = new InfraRequests(); + infraRequests0.setEndTime((Timestamp) null); + infraRequests0.setRequestType(""); + assertNull(infraRequests0.getProvStatus()); + } + + @Test(timeout = 4000) + public void test094() throws Throwable { + InfraRequests infraRequests0 = new InfraRequests("", "Z={83xlme_b)?zb8"); + infraRequests0.getStartTime(); + } + + @Test(timeout = 4000) + public void test095() throws Throwable { + InfraRequests infraRequests0 = new InfraRequests(); + String string0 = infraRequests0.getRequestStatus(); + assertNull(string0); + } + + @Test(timeout = 4000) + public void test096() throws Throwable { + InfraRequests infraRequests0 = new InfraRequests("gpXsJ>b/G", "gpXsJ>b/G"); + infraRequests0.setClientRequestId("gpXsJ>b/G"); + infraRequests0.setCallBackUrl(""); + infraRequests0.setNetworkType("TF3Cf[F..K"); + assertNull(infraRequests0.getAicNodeClli()); + } + + @Test(timeout = 4000) + public void test097() throws Throwable { + InfraRequests infraRequests0 = new InfraRequests(); + infraRequests0.getVfModuleName(); + infraRequests0.setAicCloudRegion((String) null); + String string0 = infraRequests0.getVnfName(); + assertNull(string0); + } + + @Test(timeout = 4000) + public void test098() throws Throwable { + InfraRequests infraRequests0 = new InfraRequests(); + infraRequests0.setNetworkName("K|it"); + infraRequests0.setAction("hc}j,"); + infraRequests0.getServiceInstanceId(); + infraRequests0.getCallBackUrl(); + String string0 = infraRequests0.getVfModuleId(); + assertNull(string0); + } + + @Test(timeout = 4000) + public void test099() throws Throwable { + InfraRequests infraRequests0 = new InfraRequests(); + String string0 = infraRequests0.getServiceInstanceId(); + assertNull(string0); + } + + @Test(timeout = 4000) + public void test100() throws Throwable { + InfraRequests infraRequests0 = new InfraRequests(); + infraRequests0.getProvStatus(); + String string0 = infraRequests0.getVfModuleId(); + assertNull(string0); + } + + @Test(timeout = 4000) + public void test101() throws Throwable { + InfraRequests infraRequests0 = new InfraRequests(); + String string0 = infraRequests0.getCallBackUrl(); + assertNull(string0); + } + + @Test(timeout = 4000) + public void test102() throws Throwable { + InfraRequests infraRequests0 = new InfraRequests("", "j28UDln3go*x"); + assertEquals("j28UDln3go*x", infraRequests0.getAction()); + + infraRequests0.setAction("X;{A n=y"); + infraRequests0.setTenantId(""); + assertEquals("", infraRequests0.getRequestId()); + } +} diff --git a/mso-api-handlers/mso-requests-db/src/test/java/org/openecomp/mso/requestsdb/InfraRequestsESTestscaffolding.java b/mso-api-handlers/mso-requests-db/src/test/java/org/openecomp/mso/requestsdb/InfraRequestsESTestscaffolding.java new file mode 100644 index 0000000000..9ab77f5ad2 --- /dev/null +++ b/mso-api-handlers/mso-requests-db/src/test/java/org/openecomp/mso/requestsdb/InfraRequestsESTestscaffolding.java @@ -0,0 +1,82 @@ +/** + * Scaffolding file used to store all the setups needed to run + * tests automatically generated by EvoSuite + * Wed Dec 14 15:15:48 GMT 2016 + */ + +package org.openecomp.mso.requestsdb; + +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; +import org.evosuite.runtime.sandbox.Sandbox.SandboxMode; + +@EvoSuiteClassExclude +public class InfraRequestsESTestscaffolding { + + @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.requestsdb.InfraRequests"; + 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(InfraRequestsESTestscaffolding.class.getClassLoader() , + "org.openecomp.mso.requestsdb.InfraRequests" + ); + } + + private static void resetClasses() { + org.evosuite.runtime.classhandling.ClassResetter.getInstance().setClassLoader(InfraRequestsESTestscaffolding.class.getClassLoader()); + + org.evosuite.runtime.classhandling.ClassStateSupport.resetClasses( + "org.openecomp.mso.requestsdb.InfraRequests" + ); + } +} diff --git a/mso-api-handlers/mso-requests-db/src/test/java/org/openecomp/mso/requestsdb/RequestsDatabaseESTest.java b/mso-api-handlers/mso-requests-db/src/test/java/org/openecomp/mso/requestsdb/RequestsDatabaseESTest.java new file mode 100644 index 0000000000..7c1b39979a --- /dev/null +++ b/mso-api-handlers/mso-requests-db/src/test/java/org/openecomp/mso/requestsdb/RequestsDatabaseESTest.java @@ -0,0 +1,24 @@ +/* + * This file was automatically generated by EvoSuite + * Wed Dec 14 15:15:27 GMT 2016 + */ + +package org.openecomp.mso.requestsdb; + +import org.junit.Test; +import static org.junit.Assert.*; +import org.evosuite.runtime.EvoRunner; +import org.evosuite.runtime.EvoRunnerParameters; +import org.evosuite.runtime.PrivateAccess; +import org.junit.runner.RunWith; +import org.openecomp.mso.requestsdb.RequestsDatabase; + +@RunWith(EvoRunner.class) @EvoRunnerParameters(mockJVMNonDeterminism = true, useVFS = true, useVNET = true, resetStaticState = true, useJEE = true) +public class RequestsDatabaseESTest extends RequestsDatabaseESTestscaffolding { + + @Test(timeout = 4000) + public void test0() throws Throwable { + RequestsDatabase requestsDatabase0 = (RequestsDatabase)PrivateAccess.callDefaultConstructorOfTheClassUnderTest(); + assertNotNull(requestsDatabase0); + } +} diff --git a/mso-api-handlers/mso-requests-db/src/test/java/org/openecomp/mso/requestsdb/RequestsDatabaseESTestscaffolding.java b/mso-api-handlers/mso-requests-db/src/test/java/org/openecomp/mso/requestsdb/RequestsDatabaseESTestscaffolding.java new file mode 100644 index 0000000000..6d5c31ff57 --- /dev/null +++ b/mso-api-handlers/mso-requests-db/src/test/java/org/openecomp/mso/requestsdb/RequestsDatabaseESTestscaffolding.java @@ -0,0 +1,120 @@ +/** + * Scaffolding file used to store all the setups needed to run + * tests automatically generated by EvoSuite + * Wed Dec 14 15:15:27 GMT 2016 + */ + +package org.openecomp.mso.requestsdb; + +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; +import org.evosuite.runtime.sandbox.Sandbox.SandboxMode; + +@EvoSuiteClassExclude +public class RequestsDatabaseESTestscaffolding { + + @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.requestsdb.RequestsDatabase"; + 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(RequestsDatabaseESTestscaffolding.class.getClassLoader() , + "com.att.eelf.i18n.EELFResourceManager$RESOURCE_TYPES", + "com.att.eelf.configuration.EELFLogger", + "org.hibernate.engine.spi.Mapping", + "org.hibernate.criterion.Order", + "org.openecomp.mso.requestsdb.InfraRequests", + "org.openecomp.mso.requestsdb.HibernateUtil", + "com.att.eelf.configuration.SLF4jWrapper", + "org.hibernate.Query", + "com.att.eelf.i18n.EELFResourceManager", + "org.openecomp.mso.requestsdb.RequestsDatabase", + "org.openecomp.mso.logger.MsoLogger$ErrorCode", + "org.hibernate.criterion.Criterion", + "org.openecomp.mso.requestsdb.InfraActiveRequests", + "org.openecomp.mso.logger.MessageEnum", + "com.att.eelf.i18n.EELFResolvableErrorEnum", + "org.openecomp.mso.logger.MsoLogger$Catalog", + "org.openecomp.mso.logger.MsoLogger$StatusCode", + "org.hibernate.SessionFactory", + "com.att.eelf.configuration.EELFManager", + "com.att.eelf.i18n.EELFMsgs", + "org.openecomp.mso.entity.MsoRequest", + "com.att.eelf.configuration.EELFLogger$Level", + "org.hibernate.BasicQueryContract", + "org.openecomp.mso.logger.MsoLogger$ResponseCode", + "org.openecomp.mso.requestsdb.MockRequestsDatabase", + "org.openecomp.mso.requestsdb.SiteStatus", + "org.openecomp.mso.logger.MsoLogger" + ); + } + + private static void resetClasses() { + org.evosuite.runtime.classhandling.ClassResetter.getInstance().setClassLoader(RequestsDatabaseESTestscaffolding.class.getClassLoader()); + + org.evosuite.runtime.classhandling.ClassStateSupport.resetClasses( + "com.att.eelf.i18n.EELFResourceManager", + "org.openecomp.mso.logger.MessageEnum", + "org.openecomp.mso.logger.MsoLogger$Catalog", + "org.openecomp.mso.logger.MsoLogger", + "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.MsoLogger$ErrorCode", + "org.openecomp.mso.requestsdb.HibernateUtil", + "org.openecomp.mso.logger.MsoLogger$StatusCode", + "org.openecomp.mso.logger.MsoLogger$ResponseCode", + "org.openecomp.mso.requestsdb.RequestsDatabase" + ); + } +} diff --git a/mso-api-handlers/mso-requests-db/src/test/java/org/openecomp/mso/requestsdb/SiteStatusESTest.java b/mso-api-handlers/mso-requests-db/src/test/java/org/openecomp/mso/requestsdb/SiteStatusESTest.java new file mode 100644 index 0000000000..75d7b19c33 --- /dev/null +++ b/mso-api-handlers/mso-requests-db/src/test/java/org/openecomp/mso/requestsdb/SiteStatusESTest.java @@ -0,0 +1,91 @@ +/* + * This file was automatically generated by EvoSuite + * Wed Dec 14 15:16:15 GMT 2016 + */ + +package org.openecomp.mso.requestsdb; + +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.requestsdb.SiteStatus; + +@RunWith(EvoRunner.class) @EvoRunnerParameters(mockJVMNonDeterminism = true, useVFS = true, useVNET = true, resetStaticState = true, useJEE = true) +public class SiteStatusESTest extends SiteStatusESTestscaffolding { + + @Test(timeout = 4000) + public void test0() throws Throwable { + SiteStatus siteStatus0 = new SiteStatus(); + siteStatus0.setSiteName("h8w;`)o;(SRi+0Q-"); + String string0 = siteStatus0.getSiteName(); + assertEquals("h8w;`)o;(SRi+0Q-", string0); + } + + @Test(timeout = 4000) + public void test1() throws Throwable { + SiteStatus siteStatus0 = new SiteStatus(); + siteStatus0.setSiteName(""); + String string0 = siteStatus0.getSiteName(); + assertEquals("", string0); + } + + @Test(timeout = 4000) + public void test2() throws Throwable { + SiteStatus siteStatus0 = new SiteStatus(); + Timestamp timestamp0 = new Timestamp((-1L)); + siteStatus0.setCreated(timestamp0); + Timestamp timestamp1 = siteStatus0.getCreated(); + assertSame(timestamp1, timestamp0); + } + + @Test(timeout = 4000) + public void test3() throws Throwable { + SiteStatus siteStatus0 = new SiteStatus(); + Instant instant0 = MockInstant.ofEpochSecond(5121L); + Timestamp timestamp0 = Timestamp.from(instant0); + siteStatus0.setCreated(timestamp0); + Timestamp timestamp1 = siteStatus0.getCreated(); + assertEquals(0, timestamp1.getNanos()); + } + + @Test(timeout = 4000) + public void test4() throws Throwable { + SiteStatus siteStatus0 = new SiteStatus(); + boolean boolean0 = siteStatus0.getStatus(); + assertFalse(boolean0); + } + + @Test(timeout = 4000) + public void test5() throws Throwable { + SiteStatus siteStatus0 = new SiteStatus(); + String string0 = siteStatus0.getSiteName(); + assertNull(string0); + } + + @Test(timeout = 4000) + public void test6() throws Throwable { + SiteStatus siteStatus0 = new SiteStatus(); + siteStatus0.setStatus(true); + boolean boolean0 = siteStatus0.getStatus(); + assertTrue(boolean0); + } + + @Test(timeout = 4000) + public void test7() throws Throwable { + SiteStatus siteStatus0 = new SiteStatus(); + String string0 = siteStatus0.toString(); + assertEquals("SiteStatus{status=false, siteName='null', created=null}", string0); + } + + @Test(timeout = 4000) + public void test8() throws Throwable { + SiteStatus siteStatus0 = new SiteStatus(); + Timestamp timestamp0 = siteStatus0.getCreated(); + assertNull(timestamp0); + } +} diff --git a/mso-api-handlers/mso-requests-db/src/test/java/org/openecomp/mso/requestsdb/SiteStatusESTestscaffolding.java b/mso-api-handlers/mso-requests-db/src/test/java/org/openecomp/mso/requestsdb/SiteStatusESTestscaffolding.java new file mode 100644 index 0000000000..2d50450c60 --- /dev/null +++ b/mso-api-handlers/mso-requests-db/src/test/java/org/openecomp/mso/requestsdb/SiteStatusESTestscaffolding.java @@ -0,0 +1,105 @@ +/** + * Scaffolding file used to store all the setups needed to run + * tests automatically generated by EvoSuite + * Wed Dec 14 15:16:15 GMT 2016 + */ + +package org.openecomp.mso.requestsdb; + +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; +import org.evosuite.runtime.sandbox.Sandbox.SandboxMode; + +@EvoSuiteClassExclude +public class SiteStatusESTestscaffolding { + + @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.requestsdb.SiteStatus"; + 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(SiteStatusESTestscaffolding.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", + "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.logger.MsoLogger$ResponseCode", + "com.att.eelf.configuration.SLF4jWrapper", + "com.att.eelf.i18n.EELFResourceManager", + "org.openecomp.mso.requestsdb.SiteStatus", + "org.openecomp.mso.logger.MsoLogger", + "org.openecomp.mso.logger.MsoLogger$ErrorCode" + ); + } + + private static void resetClasses() { + org.evosuite.runtime.classhandling.ClassResetter.getInstance().setClassLoader(SiteStatusESTestscaffolding.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.requestsdb.SiteStatus" + ); + } +} diff --git a/mso-api-handlers/mso-requests-db/src/test/java/org/openecomp/mso/requestsdb/adapter/TimestampXMLAdapterESTest.java b/mso-api-handlers/mso-requests-db/src/test/java/org/openecomp/mso/requestsdb/adapter/TimestampXMLAdapterESTest.java new file mode 100644 index 0000000000..ea3238916e --- /dev/null +++ b/mso-api-handlers/mso-requests-db/src/test/java/org/openecomp/mso/requestsdb/adapter/TimestampXMLAdapterESTest.java @@ -0,0 +1,69 @@ +/* + * This file was automatically generated by EvoSuite + * Wed Dec 14 15:14:31 GMT 2016 + */ + +package org.openecomp.mso.requestsdb.adapter; + +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; +import org.openecomp.mso.requestsdb.adapter.TimestampXMLAdapter; + +@RunWith(EvoRunner.class) @EvoRunnerParameters(mockJVMNonDeterminism = true, useVFS = true, useVNET = true, resetStaticState = true, useJEE = true) +public class TimestampXMLAdapterESTest extends TimestampXMLAdapterESTestscaffolding { + + @Test(timeout = 4000) + public void test0() throws Throwable { + TimestampXMLAdapter timestampXMLAdapter0 = new TimestampXMLAdapter(); + Long long0 = new Long((-3027L)); + Timestamp timestamp0 = timestampXMLAdapter0.unmarshal(long0); + Long long1 = timestampXMLAdapter0.marshal(timestamp0); + assertTrue(long1.equals((Object)long0)); + } + + @Test(timeout = 4000) + public void test1() throws Throwable { + TimestampXMLAdapter timestampXMLAdapter0 = new TimestampXMLAdapter(); + Long long0 = new Long(861L); + Timestamp timestamp0 = timestampXMLAdapter0.unmarshal(long0); + Long long1 = timestampXMLAdapter0.marshal(timestamp0); + assertEquals(861L, (long)long1); + } + + @Test(timeout = 4000) + public void test2() throws Throwable { + TimestampXMLAdapter timestampXMLAdapter0 = new TimestampXMLAdapter(); + try { + timestampXMLAdapter0.marshal((Timestamp) null); + fail("Expecting exception: NullPointerException"); + + } catch(NullPointerException e) { + // + // no message in exception (getMessage() returned null) + // + verifyException("org.openecomp.mso.requestsdb.adapter.TimestampXMLAdapter", e); + } + } + + @Test(timeout = 4000) + public void test3() throws Throwable { + TimestampXMLAdapter timestampXMLAdapter0 = new TimestampXMLAdapter(); + Timestamp timestamp0 = timestampXMLAdapter0.unmarshal((Long) null); + Long long0 = timestampXMLAdapter0.marshal(timestamp0); + assertEquals(0L, (long)long0); + } + + @Test(timeout = 4000) + public void test4() throws Throwable { + TimestampXMLAdapter timestampXMLAdapter0 = new TimestampXMLAdapter(); + Long long0 = new Long(497L); + Timestamp timestamp0 = timestampXMLAdapter0.unmarshal(long0); + Long long1 = timestampXMLAdapter0.marshal(timestamp0); + assertEquals(497L, (long)long1); + } +} diff --git a/mso-api-handlers/mso-requests-db/src/test/java/org/openecomp/mso/requestsdb/adapter/TimestampXMLAdapterESTestscaffolding.java b/mso-api-handlers/mso-requests-db/src/test/java/org/openecomp/mso/requestsdb/adapter/TimestampXMLAdapterESTestscaffolding.java new file mode 100644 index 0000000000..0fdfcd2c07 --- /dev/null +++ b/mso-api-handlers/mso-requests-db/src/test/java/org/openecomp/mso/requestsdb/adapter/TimestampXMLAdapterESTestscaffolding.java @@ -0,0 +1,77 @@ +/** + * Scaffolding file used to store all the setups needed to run + * tests automatically generated by EvoSuite + * Wed Dec 14 15:14:31 GMT 2016 + */ + +package org.openecomp.mso.requestsdb.adapter; + +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; +import org.evosuite.runtime.sandbox.Sandbox.SandboxMode; + +@EvoSuiteClassExclude +public class TimestampXMLAdapterESTestscaffolding { + + @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.requestsdb.adapter.TimestampXMLAdapter"; + 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(TimestampXMLAdapterESTestscaffolding.class.getClassLoader() , + "org.openecomp.mso.requestsdb.adapter.TimestampXMLAdapter" + ); + } + + private static void resetClasses() { + } +} |