diff options
author | 2018-08-04 20:32:31 +0300 | |
---|---|---|
committer | 2018-08-05 17:39:27 +0000 | |
commit | 6e6a179914fd6b8516c697991a501535bfc53172 (patch) | |
tree | 13b39810c35d5a4ea461b408608943225aa1be0a /common-app-api/src/test/java/org/openecomp/sdc/common | |
parent | 8d532a40d92455239e789aad996e699dfefd19cb (diff) |
add removed unit tests
Change-Id: Iabd593d8d9ab0efeb32032d5c4d72b8fa1c27e63
Issue-ID: SDC-1590
Signed-off-by: Michael Lando <ml636r@att.com>
Diffstat (limited to 'common-app-api/src/test/java/org/openecomp/sdc/common')
18 files changed, 2073 insertions, 0 deletions
diff --git a/common-app-api/src/test/java/org/openecomp/sdc/common/api/ArtifactTypeEnumTest.java b/common-app-api/src/test/java/org/openecomp/sdc/common/api/ArtifactTypeEnumTest.java new file mode 100644 index 0000000000..525080e535 --- /dev/null +++ b/common-app-api/src/test/java/org/openecomp/sdc/common/api/ArtifactTypeEnumTest.java @@ -0,0 +1,54 @@ +package org.openecomp.sdc.common.api; + +import java.util.List; + +import org.junit.Test; + + +public class ArtifactTypeEnumTest { + + private ArtifactTypeEnum createTestSubject() { + return ArtifactTypeEnum.AAI_SERVICE_MODEL; + } + + + @Test + public void testGetType() throws Exception { + ArtifactTypeEnum testSubject; + String result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getType(); + } + + + @Test + public void testSetType() throws Exception { + ArtifactTypeEnum testSubject; + String type = ""; + + // default test + testSubject = createTestSubject(); + testSubject.setType(type); + } + + + @Test + public void testFindType() throws Exception { + String type = ""; + ArtifactTypeEnum result; + + // default test + result = ArtifactTypeEnum.findType(type); + } + + + @Test + public void testGetAllTypes() throws Exception { + List<String> result; + + // default test + result = ArtifactTypeEnum.getAllTypes(); + } +}
\ No newline at end of file diff --git a/common-app-api/src/test/java/org/openecomp/sdc/common/api/ResponseInfoTest.java b/common-app-api/src/test/java/org/openecomp/sdc/common/api/ResponseInfoTest.java new file mode 100644 index 0000000000..d05484db40 --- /dev/null +++ b/common-app-api/src/test/java/org/openecomp/sdc/common/api/ResponseInfoTest.java @@ -0,0 +1,59 @@ +package org.openecomp.sdc.common.api; + +import org.junit.Test; +import org.openecomp.sdc.common.api.ResponseInfo.ResponseStatusEnum; + + +public class ResponseInfoTest { + + private ResponseInfo createTestSubject() { + return new ResponseInfo(null, ""); + } + + + @Test + public void testGetApplicativeStatus() throws Exception { + ResponseInfo testSubject; + ResponseStatusEnum result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getApplicativeStatus(); + } + + + @Test + public void testSetApplicativeStatus() throws Exception { + ResponseInfo testSubject; + ResponseStatusEnum applicativeStatus = null; + + // default test + testSubject = createTestSubject(); + testSubject.setApplicativeStatus(applicativeStatus); + } + + + @Test + public void testGetDescription() throws Exception { + ResponseInfo testSubject; + String result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getDescription(); + } + + + @Test + public void testSetDescription() throws Exception { + ResponseInfo testSubject; + String description = ""; + + // default test + testSubject = createTestSubject(); + testSubject.setDescription(description); + } + + + +}
\ No newline at end of file diff --git a/common-app-api/src/test/java/org/openecomp/sdc/common/api/ToscaNodeTypeInfoTest.java b/common-app-api/src/test/java/org/openecomp/sdc/common/api/ToscaNodeTypeInfoTest.java new file mode 100644 index 0000000000..42b057e521 --- /dev/null +++ b/common-app-api/src/test/java/org/openecomp/sdc/common/api/ToscaNodeTypeInfoTest.java @@ -0,0 +1,134 @@ +package org.openecomp.sdc.common.api; + +import java.util.List; + +import org.junit.Test; + + +public class ToscaNodeTypeInfoTest { + + private ToscaNodeTypeInfo createTestSubject() { + return new ToscaNodeTypeInfo(); + } + + + @Test + public void testGetTemplateName() throws Exception { + ToscaNodeTypeInfo testSubject; + String result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getTemplateName(); + } + + + @Test + public void testSetTemplateName() throws Exception { + ToscaNodeTypeInfo testSubject; + String templateName = ""; + + // default test + testSubject = createTestSubject(); + testSubject.setTemplateName(templateName); + } + + + @Test + public void testGetNodeName() throws Exception { + ToscaNodeTypeInfo testSubject; + String result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getNodeName(); + } + + + @Test + public void testSetNodeName() throws Exception { + ToscaNodeTypeInfo testSubject; + String nodeName = ""; + + // default test + testSubject = createTestSubject(); + testSubject.setNodeName(nodeName); + } + + + @Test + public void testGetTemplateVersion() throws Exception { + ToscaNodeTypeInfo testSubject; + String result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getTemplateVersion(); + } + + + @Test + public void testSetTemplateVersion() throws Exception { + ToscaNodeTypeInfo testSubject; + String templateVersion = ""; + + // default test + testSubject = createTestSubject(); + testSubject.setTemplateVersion(templateVersion); + } + + + @Test + public void testGetInterfaces() throws Exception { + ToscaNodeTypeInfo testSubject; + List<ToscaNodeTypeInterface> result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getInterfaces(); + } + + + @Test + public void testSetInterfaces() throws Exception { + ToscaNodeTypeInfo testSubject; + List<ToscaNodeTypeInterface> interfaces = null; + + // default test + testSubject = createTestSubject(); + testSubject.setInterfaces(interfaces); + } + + + @Test + public void testGetIconPath() throws Exception { + ToscaNodeTypeInfo testSubject; + String result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getIconPath(); + } + + + @Test + public void testSetIconPath() throws Exception { + ToscaNodeTypeInfo testSubject; + String iconPath = ""; + + // default test + testSubject = createTestSubject(); + testSubject.setIconPath(iconPath); + } + + + @Test + public void testToString() throws Exception { + ToscaNodeTypeInfo testSubject; + String result; + + // default test + testSubject = createTestSubject(); + result = testSubject.toString(); + } +}
\ No newline at end of file diff --git a/common-app-api/src/test/java/org/openecomp/sdc/common/api/ToscaNodeTypeInterfaceTest.java b/common-app-api/src/test/java/org/openecomp/sdc/common/api/ToscaNodeTypeInterfaceTest.java new file mode 100644 index 0000000000..9c19d3132d --- /dev/null +++ b/common-app-api/src/test/java/org/openecomp/sdc/common/api/ToscaNodeTypeInterfaceTest.java @@ -0,0 +1,35 @@ +package org.openecomp.sdc.common.api; + +import java.util.List; + +import org.junit.Test; + + +public class ToscaNodeTypeInterfaceTest { + + private ToscaNodeTypeInterface createTestSubject() { + return new ToscaNodeTypeInterface(); + } + + + @Test + public void testGetScripts() throws Exception { + ToscaNodeTypeInterface testSubject; + List<String> result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getScripts(); + } + + + @Test + public void testSetScripts() throws Exception { + ToscaNodeTypeInterface testSubject; + List<String> scripts = null; + + // default test + testSubject = createTestSubject(); + testSubject.setScripts(scripts); + } +}
\ No newline at end of file diff --git a/common-app-api/src/test/java/org/openecomp/sdc/common/api/YamlSuffixEnumTest.java b/common-app-api/src/test/java/org/openecomp/sdc/common/api/YamlSuffixEnumTest.java new file mode 100644 index 0000000000..aeea08999f --- /dev/null +++ b/common-app-api/src/test/java/org/openecomp/sdc/common/api/YamlSuffixEnumTest.java @@ -0,0 +1,44 @@ +package org.openecomp.sdc.common.api; + +import java.util.List; + +import org.junit.Test; + + +public class YamlSuffixEnumTest { + + private YamlSuffixEnum createTestSubject() { + return YamlSuffixEnum.YAML; + } + + + @Test + public void testGetSuffix() throws Exception { + YamlSuffixEnum testSubject; + String result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getSuffix(); + } + + + @Test + public void testSetSuufix() throws Exception { + YamlSuffixEnum testSubject; + String suffix = ""; + + // default test + testSubject = createTestSubject(); + testSubject.setSuufix(suffix); + } + + + @Test + public void testGetSuffixes() throws Exception { + List<String> result; + + // default test + result = YamlSuffixEnum.getSuffixes(); + } +}
\ No newline at end of file diff --git a/common-app-api/src/test/java/org/openecomp/sdc/common/datastructure/AuditingFieldsKeyTest.java b/common-app-api/src/test/java/org/openecomp/sdc/common/datastructure/AuditingFieldsKeyTest.java new file mode 100644 index 0000000000..18bbdb7e71 --- /dev/null +++ b/common-app-api/src/test/java/org/openecomp/sdc/common/datastructure/AuditingFieldsKeyTest.java @@ -0,0 +1,44 @@ +package org.openecomp.sdc.common.datastructure; + +import org.junit.Test; + + +public class AuditingFieldsKeyTest { + + private AuditingFieldsKey createTestSubject() { + return AuditingFieldsKey.AUDIT_ACTION; + } + + + @Test + public void testGetValueClass() throws Exception { + AuditingFieldsKey testSubject; + Class<?> result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getValueClass(); + } + + + @Test + public void testGetDisplayName() throws Exception { + AuditingFieldsKey testSubject; + String result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getDisplayName(); + } + + + @Test + public void testSetDisplayName() throws Exception { + AuditingFieldsKey testSubject; + String displayName = ""; + + // default test + testSubject = createTestSubject(); + testSubject.setDisplayName(displayName); + } +}
\ No newline at end of file diff --git a/common-app-api/src/test/java/org/openecomp/sdc/common/datastructure/ESTimeBasedEventTest.java b/common-app-api/src/test/java/org/openecomp/sdc/common/datastructure/ESTimeBasedEventTest.java new file mode 100644 index 0000000000..4d5d97b7fa --- /dev/null +++ b/common-app-api/src/test/java/org/openecomp/sdc/common/datastructure/ESTimeBasedEventTest.java @@ -0,0 +1,117 @@ +package org.openecomp.sdc.common.datastructure; + +import java.util.Map; + +import org.junit.Test; + + +public class ESTimeBasedEventTest { + + private ESTimeBasedEvent createTestSubject() { + return new ESTimeBasedEvent(); + } + + + + + @Test + public void testCalculateYearIndexSuffix() throws Exception { + ESTimeBasedEvent testSubject; + String result; + + // default test + testSubject = createTestSubject(); + result = testSubject.calculateYearIndexSuffix(); + } + + + @Test + public void testCalculateMonthIndexSuffix() throws Exception { + ESTimeBasedEvent testSubject; + String result; + + // default test + testSubject = createTestSubject(); + result = testSubject.calculateMonthIndexSuffix(); + } + + + @Test + public void testCalculateDayIndexSuffix() throws Exception { + ESTimeBasedEvent testSubject; + String result; + + // default test + testSubject = createTestSubject(); + result = testSubject.calculateDayIndexSuffix(); + } + + + @Test + public void testCalculateHourIndexSuffix() throws Exception { + ESTimeBasedEvent testSubject; + String result; + + // default test + testSubject = createTestSubject(); + result = testSubject.calculateHourIndexSuffix(); + } + + + @Test + public void testCalculateMinuteIndexSuffix() throws Exception { + ESTimeBasedEvent testSubject; + String result; + + // default test + testSubject = createTestSubject(); + result = testSubject.calculateMinuteIndexSuffix(); + } + + + + + + @Test + public void testGetTimestamp() throws Exception { + ESTimeBasedEvent testSubject; + String result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getTimestamp(); + } + + + @Test + public void testSetTimestamp() throws Exception { + ESTimeBasedEvent testSubject; + String timestamp = ""; + + // default test + testSubject = createTestSubject(); + testSubject.setTimestamp(timestamp); + } + + + @Test + public void testGetFields() throws Exception { + ESTimeBasedEvent testSubject; + Map<String, Object> result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getFields(); + } + + + @Test + public void testSetFields() throws Exception { + ESTimeBasedEvent testSubject; + Map<String, Object> fields = null; + + // default test + testSubject = createTestSubject(); + testSubject.setFields(fields); + } +}
\ No newline at end of file diff --git a/common-app-api/src/test/java/org/openecomp/sdc/common/datastructure/MonitoringFieldsKeysEnumTest.java b/common-app-api/src/test/java/org/openecomp/sdc/common/datastructure/MonitoringFieldsKeysEnumTest.java new file mode 100644 index 0000000000..515ee0bb76 --- /dev/null +++ b/common-app-api/src/test/java/org/openecomp/sdc/common/datastructure/MonitoringFieldsKeysEnumTest.java @@ -0,0 +1,44 @@ +package org.openecomp.sdc.common.datastructure; + +import org.junit.Test; + + +public class MonitoringFieldsKeysEnumTest { + + private MonitoringFieldsKeysEnum createTestSubject() { + return MonitoringFieldsKeysEnum.MONITORING_APP_ID; + } + + + @Test + public void testGetValueClass() throws Exception { + MonitoringFieldsKeysEnum testSubject; + Class<?> result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getValueClass(); + } + + + @Test + public void testGetDisplayName() throws Exception { + MonitoringFieldsKeysEnum testSubject; + String result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getDisplayName(); + } + + + @Test + public void testSetDisplayName() throws Exception { + MonitoringFieldsKeysEnum testSubject; + String displayName = ""; + + // default test + testSubject = createTestSubject(); + testSubject.setDisplayName(displayName); + } +}
\ No newline at end of file diff --git a/common-app-api/src/test/java/org/openecomp/sdc/common/datastructure/WrapperTest.java b/common-app-api/src/test/java/org/openecomp/sdc/common/datastructure/WrapperTest.java new file mode 100644 index 0000000000..9c18861d40 --- /dev/null +++ b/common-app-api/src/test/java/org/openecomp/sdc/common/datastructure/WrapperTest.java @@ -0,0 +1,24 @@ +package org.openecomp.sdc.common.datastructure; + +import org.junit.Test; + + +public class WrapperTest { + + private Wrapper createTestSubject() { + return new Wrapper(null); + } + + + + + @Test + public void testIsEmpty() throws Exception { + Wrapper testSubject; + boolean result; + + // default test + testSubject = createTestSubject(); + result = testSubject.isEmpty(); + } +}
\ No newline at end of file diff --git a/common-app-api/src/test/java/org/openecomp/sdc/common/ecomplog/LoggerMetricTest.java b/common-app-api/src/test/java/org/openecomp/sdc/common/ecomplog/LoggerMetricTest.java new file mode 100644 index 0000000000..982d869c69 --- /dev/null +++ b/common-app-api/src/test/java/org/openecomp/sdc/common/ecomplog/LoggerMetricTest.java @@ -0,0 +1,302 @@ +package org.openecomp.sdc.common.ecomplog; + +import org.junit.Test; + +import org.openecomp.sdc.common.log.elements.LoggerFactory; +import org.openecomp.sdc.common.log.elements.LoggerMetric; +import org.openecomp.sdc.common.log.enums.Severity; +import org.openecomp.sdc.common.log.wrappers.Logger; + + +public class LoggerMetricTest { + private static final Logger log = Logger.getLogger(LoggerMetricTest.class.getName()); + + private LoggerMetric createTestSubject() { + return LoggerFactory.getLogger(LoggerMetric.class,log); + } + + + @Test + public void testStartTimer() throws Exception { + LoggerMetric testSubject; + LoggerMetric result; + + // default test + testSubject = createTestSubject(); + result = testSubject.startTimer(); + } + + + @Test + public void testSetKeyRequestId() throws Exception { + LoggerMetric testSubject; + String keyRequestId = ""; + LoggerMetric result; + + // default test + testSubject = createTestSubject(); + result = testSubject.setKeyRequestId(keyRequestId); + } + + + @Test + public void testStopTimer() throws Exception { + LoggerMetric testSubject; + LoggerMetric result; + + // default test + testSubject = createTestSubject(); + result = testSubject.stopTimer(); + } + + + @Test + public void testSetAutoServerFQDN() throws Exception { + LoggerMetric testSubject; + String serverFQDN = ""; + LoggerMetric result; + + // default test + testSubject = createTestSubject(); + result = testSubject.setAutoServerFQDN(serverFQDN); + } + + + @Test + public void testSetAutoServerIPAddress() throws Exception { + LoggerMetric testSubject; + String serverIPAddress = ""; + LoggerMetric result; + + // default test + testSubject = createTestSubject(); + result = testSubject.setAutoServerIPAddress(serverIPAddress); + } + + + @Test + public void testSetInstanceUUID() throws Exception { + LoggerMetric testSubject; + String instanceUUID = ""; + LoggerMetric result; + + // default test + testSubject = createTestSubject(); + result = testSubject.setInstanceUUID(instanceUUID); + } + + + @Test + public void testSetOptProcessKey() throws Exception { + LoggerMetric testSubject; + String processKey = ""; + LoggerMetric result; + + // default test + testSubject = createTestSubject(); + result = testSubject.setOptProcessKey(processKey); + } + + + @Test + public void testSetOptAlertSeverity() throws Exception { + LoggerMetric testSubject; + Severity alertSeverity = null; + LoggerMetric result; + + // default test + testSubject = createTestSubject(); + result = testSubject.setOptAlertSeverity(alertSeverity.OK); + } + + + @Test + public void testSetOptCustomField1() throws Exception { + LoggerMetric testSubject; + String customField1 = ""; + LoggerMetric result; + + // default test + testSubject = createTestSubject(); + result = testSubject.setOptCustomField1(customField1); + } + + + @Test + public void testSetOptCustomField2() throws Exception { + LoggerMetric testSubject; + String customField2 = ""; + LoggerMetric result; + + // default test + testSubject = createTestSubject(); + result = testSubject.setOptCustomField2(customField2); + } + + + @Test + public void testSetOptCustomField3() throws Exception { + LoggerMetric testSubject; + String customField3 = ""; + LoggerMetric result; + + // default test + testSubject = createTestSubject(); + result = testSubject.setOptCustomField3(customField3); + } + + + @Test + public void testSetOptCustomField4() throws Exception { + LoggerMetric testSubject; + String customField4 = ""; + LoggerMetric result; + + // default test + testSubject = createTestSubject(); + result = testSubject.setOptCustomField4(customField4); + } + + + @Test + public void testSetRemoteHost() throws Exception { + LoggerMetric testSubject; + String remoteHost = ""; + LoggerMetric result; + + // default test + testSubject = createTestSubject(); + result = testSubject.setRemoteHost(remoteHost); + } + + + @Test + public void testSetServiceName() throws Exception { + LoggerMetric testSubject; + String serviceName = ""; + LoggerMetric result; + + // default test + testSubject = createTestSubject(); + result = testSubject.setServiceName(serviceName); + } + + + @Test + public void testSetStatusCode() throws Exception { + LoggerMetric testSubject; + String statusCode = ""; + LoggerMetric result; + + // default test + testSubject = createTestSubject(); + result = testSubject.setStatusCode(statusCode); + } + + + @Test + public void testSetPartnerName() throws Exception { + LoggerMetric testSubject; + String partnerName = ""; + LoggerMetric result; + + // default test + testSubject = createTestSubject(); + result = testSubject.setPartnerName(partnerName); + } + + + @Test + public void testSetResponseCode() throws Exception { + LoggerMetric testSubject; + int responseCode = 0; + LoggerMetric result; + + // default test + testSubject = createTestSubject(); + result = testSubject.setResponseCode(responseCode); + } + + + @Test + public void testSetResponseDesc() throws Exception { + LoggerMetric testSubject; + String responseDesc = ""; + LoggerMetric result; + + // default test + testSubject = createTestSubject(); + result = testSubject.setResponseDesc(responseDesc); + } + + + @Test + public void testSetOptServiceInstanceId() throws Exception { + LoggerMetric testSubject; + String serviceInstanceId = ""; + LoggerMetric result; + + // default test + testSubject = createTestSubject(); + result = testSubject.setOptServiceInstanceId(serviceInstanceId); + } + + + @Test + public void testSetOptClassName() throws Exception { + LoggerMetric testSubject; + String className = ""; + LoggerMetric result; + + // default test + testSubject = createTestSubject(); + result = testSubject.setOptClassName(className); + } + + + @Test + public void testSetTargetEntity() throws Exception { + LoggerMetric testSubject; + String targetEntity = ""; + LoggerMetric result; + + // default test + testSubject = createTestSubject(); + result = testSubject.setTargetEntity(targetEntity); + } + + + @Test + public void testSetTargetServiceName() throws Exception { + LoggerMetric testSubject; + String targetServiceName = ""; + LoggerMetric result; + + // default test + testSubject = createTestSubject(); + result = testSubject.setTargetServiceName(targetServiceName); + } + + + @Test + public void testSetTargetVirtualEntity() throws Exception { + LoggerMetric testSubject; + String targetVirtualEntity = ""; + LoggerMetric result; + + // default test + testSubject = createTestSubject(); + result = testSubject.setTargetVirtualEntity(targetVirtualEntity); + } + + + @Test + public void testClear() throws Exception { + LoggerMetric testSubject; + LoggerMetric result; + + // default test + testSubject = createTestSubject(); + result = testSubject.clear(); + } +}
\ No newline at end of file diff --git a/common-app-api/src/test/java/org/openecomp/sdc/common/kpi/api/ASDCKpiApiTest.java b/common-app-api/src/test/java/org/openecomp/sdc/common/kpi/api/ASDCKpiApiTest.java new file mode 100644 index 0000000000..3ff24f2b07 --- /dev/null +++ b/common-app-api/src/test/java/org/openecomp/sdc/common/kpi/api/ASDCKpiApiTest.java @@ -0,0 +1,51 @@ +package org.openecomp.sdc.common.kpi.api; + +import org.junit.Test; + + +public class ASDCKpiApiTest { + + private ASDCKpiApi createTestSubject() { + return new ASDCKpiApi(); + } + + + @Test + public void testCountImportResourcesKPI() throws Exception { + + // default test + ASDCKpiApi.countImportResourcesKPI(); + } + + + @Test + public void testCountCreatedResourcesKPI() throws Exception { + + // default test + ASDCKpiApi.countCreatedResourcesKPI(); + } + + + @Test + public void testCountCreatedServicesKPI() throws Exception { + + // default test + ASDCKpiApi.countCreatedServicesKPI(); + } + + + @Test + public void testCountUsersAuthorizations() throws Exception { + + // default test + ASDCKpiApi.countUsersAuthorizations(); + } + + + @Test + public void testCountActivatedDistribution() throws Exception { + + // default test + ASDCKpiApi.countActivatedDistribution(); + } +}
\ No newline at end of file diff --git a/common-app-api/src/test/java/org/openecomp/sdc/common/listener/AppContextListenerTest.java b/common-app-api/src/test/java/org/openecomp/sdc/common/listener/AppContextListenerTest.java new file mode 100644 index 0000000000..298f6fe85d --- /dev/null +++ b/common-app-api/src/test/java/org/openecomp/sdc/common/listener/AppContextListenerTest.java @@ -0,0 +1,42 @@ +package org.openecomp.sdc.common.listener; + +import java.util.Map; + +import javax.servlet.ServletContext; +import javax.servlet.ServletContextEvent; + +import org.junit.Test; + + +public class AppContextListenerTest { + + private AppContextListener createTestSubject() { + return new AppContextListener(); + } + + + + + + @Test + public void testContextDestroyed() throws Exception { + AppContextListener testSubject; + ServletContextEvent context = null; + + // default test + testSubject = createTestSubject(); + testSubject.contextDestroyed(context); + } + + + + +// @Test + public void testGetManifestInfo() throws Exception { + ServletContext application = null; + Map<String, String> result; + + // default test + result = AppContextListener.getManifestInfo(application); + } +}
\ No newline at end of file diff --git a/common-app-api/src/test/java/org/openecomp/sdc/common/monitoring/MonitoringEventTest.java b/common-app-api/src/test/java/org/openecomp/sdc/common/monitoring/MonitoringEventTest.java new file mode 100644 index 0000000000..66f519197c --- /dev/null +++ b/common-app-api/src/test/java/org/openecomp/sdc/common/monitoring/MonitoringEventTest.java @@ -0,0 +1,242 @@ +package org.openecomp.sdc.common.monitoring; + +import org.junit.Test; + + +public class MonitoringEventTest { + + private MonitoringEvent createTestSubject() { + return new MonitoringEvent(); + } + + + @Test + public void testGetHostid() throws Exception { + MonitoringEvent testSubject; + String result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getHostid(); + } + + + @Test + public void testSetHostid() throws Exception { + MonitoringEvent testSubject; + String hostid = ""; + + // default test + testSubject = createTestSubject(); + testSubject.setHostid(hostid); + } + + + @Test + public void testGetHostcpu() throws Exception { + MonitoringEvent testSubject; + Long result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getHostcpu(); + } + + + @Test + public void testSetHostcpu() throws Exception { + MonitoringEvent testSubject; + Long hostcpu = null; + + // default test + testSubject = createTestSubject(); + testSubject.setHostcpu(hostcpu); + } + + + @Test + public void testGetHostmem() throws Exception { + MonitoringEvent testSubject; + Double result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getHostmem(); + } + + + @Test + public void testSetHostmem() throws Exception { + MonitoringEvent testSubject; + Double hostmem = null; + + // default test + testSubject = createTestSubject(); + testSubject.setHostmem(hostmem); + } + + + @Test + public void testGetHostdisk() throws Exception { + MonitoringEvent testSubject; + String result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getHostdisk(); + } + + + @Test + public void testSetHostdisk() throws Exception { + MonitoringEvent testSubject; + String hostdisk = ""; + + // default test + testSubject = createTestSubject(); + testSubject.setHostdisk(hostdisk); + } + + + @Test + public void testGetJvmid() throws Exception { + MonitoringEvent testSubject; + String result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getJvmid(); + } + + + @Test + public void testSetJvmid() throws Exception { + MonitoringEvent testSubject; + String jvmid = ""; + + // default test + testSubject = createTestSubject(); + testSubject.setJvmid(jvmid); + } + + + @Test + public void testGetJvmcpu() throws Exception { + MonitoringEvent testSubject; + Long result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getJvmcpu(); + } + + + @Test + public void testSetJvmcpu() throws Exception { + MonitoringEvent testSubject; + Long jvmcpu = null; + + // default test + testSubject = createTestSubject(); + testSubject.setJvmcpu(jvmcpu); + } + + + @Test + public void testGetJvmmem() throws Exception { + MonitoringEvent testSubject; + Long result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getJvmmem(); + } + + + @Test + public void testSetJvmmem() throws Exception { + MonitoringEvent testSubject; + Long jvmmem = null; + + // default test + testSubject = createTestSubject(); + testSubject.setJvmmem(jvmmem); + } + + + @Test + public void testGetJvmtnum() throws Exception { + MonitoringEvent testSubject; + Integer result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getJvmtnum(); + } + + + @Test + public void testSetJvmtnum() throws Exception { + MonitoringEvent testSubject; + Integer jvmtnum = 0; + + // default test + testSubject = createTestSubject(); + testSubject.setJvmtnum(jvmtnum); + } + + + @Test + public void testGetAppid() throws Exception { + MonitoringEvent testSubject; + String result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getAppid(); + } + + + @Test + public void testSetAppid() throws Exception { + MonitoringEvent testSubject; + String appid = ""; + + // default test + testSubject = createTestSubject(); + testSubject.setAppid(appid); + } + + + @Test + public void testGetAppstat() throws Exception { + MonitoringEvent testSubject; + String result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getAppstat(); + } + + + @Test + public void testSetAppstat() throws Exception { + MonitoringEvent testSubject; + String appstat = ""; + + // default test + testSubject = createTestSubject(); + testSubject.setAppstat(appstat); + } + + + @Test + public void testToString() throws Exception { + MonitoringEvent testSubject; + String result; + + // default test + testSubject = createTestSubject(); + result = testSubject.toString(); + } +}
\ No newline at end of file diff --git a/common-app-api/src/test/java/org/openecomp/sdc/common/rest/api/RestConfigurationInfoTest.java b/common-app-api/src/test/java/org/openecomp/sdc/common/rest/api/RestConfigurationInfoTest.java new file mode 100644 index 0000000000..efbb7d799d --- /dev/null +++ b/common-app-api/src/test/java/org/openecomp/sdc/common/rest/api/RestConfigurationInfoTest.java @@ -0,0 +1,110 @@ +package org.openecomp.sdc.common.rest.api; + +import org.junit.Test; + + +public class RestConfigurationInfoTest { + + private RestConfigurationInfo createTestSubject() { + return new RestConfigurationInfo(); + } + + + @Test + public void testGetReadTimeoutInSec() throws Exception { + RestConfigurationInfo testSubject; + Integer result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getReadTimeoutInSec(); + } + + + @Test + public void testSetReadTimeoutInSec() throws Exception { + RestConfigurationInfo testSubject; + Integer readTimeoutInSec = 0; + + // default test + testSubject = createTestSubject(); + testSubject.setReadTimeoutInSec(readTimeoutInSec); + } + + + @Test + public void testGetIgnoreCertificate() throws Exception { + RestConfigurationInfo testSubject; + Boolean result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getIgnoreCertificate(); + } + + + @Test + public void testSetIgnoreCertificate() throws Exception { + RestConfigurationInfo testSubject; + Boolean ignoreCertificate = null; + + // default test + testSubject = createTestSubject(); + testSubject.setIgnoreCertificate(ignoreCertificate); + } + + + @Test + public void testGetConnectionPoolSize() throws Exception { + RestConfigurationInfo testSubject; + Integer result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getConnectionPoolSize(); + } + + + @Test + public void testSetConnectionPoolSize() throws Exception { + RestConfigurationInfo testSubject; + Integer connectionPoolSize = 0; + + // default test + testSubject = createTestSubject(); + testSubject.setConnectionPoolSize(connectionPoolSize); + } + + + @Test + public void testGetConnectTimeoutInSec() throws Exception { + RestConfigurationInfo testSubject; + Integer result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getConnectTimeoutInSec(); + } + + + @Test + public void testSetConnectTimeoutInSec() throws Exception { + RestConfigurationInfo testSubject; + Integer connectTimeoutInSec = 0; + + // default test + testSubject = createTestSubject(); + testSubject.setConnectTimeoutInSec(connectTimeoutInSec); + } + + + @Test + public void testToString() throws Exception { + RestConfigurationInfo testSubject; + String result; + + // default test + testSubject = createTestSubject(); + result = testSubject.toString(); + } +}
\ No newline at end of file diff --git a/common-app-api/src/test/java/org/openecomp/sdc/common/util/CapabilityTypeNameEnumTest.java b/common-app-api/src/test/java/org/openecomp/sdc/common/util/CapabilityTypeNameEnumTest.java new file mode 100644 index 0000000000..67862928ce --- /dev/null +++ b/common-app-api/src/test/java/org/openecomp/sdc/common/util/CapabilityTypeNameEnumTest.java @@ -0,0 +1,22 @@ +package org.openecomp.sdc.common.util; + +import org.junit.Test; + + +public class CapabilityTypeNameEnumTest { + + private CapabilityTypeNameEnum createTestSubject() { + return CapabilityTypeNameEnum.ATTACHMENT; + } + + + @Test + public void testGetCapabilityName() throws Exception { + CapabilityTypeNameEnum testSubject; + String result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getCapabilityName(); + } +}
\ No newline at end of file diff --git a/common-app-api/src/test/java/org/openecomp/sdc/common/util/GeneralUtilityTest.java b/common-app-api/src/test/java/org/openecomp/sdc/common/util/GeneralUtilityTest.java new file mode 100644 index 0000000000..ebfffe572a --- /dev/null +++ b/common-app-api/src/test/java/org/openecomp/sdc/common/util/GeneralUtilityTest.java @@ -0,0 +1,124 @@ +package org.openecomp.sdc.common.util; + +import java.util.List; + +import org.junit.Assert; +import org.junit.Test; + + +public class GeneralUtilityTest { + + private GeneralUtility createTestSubject() { + return new GeneralUtility(); + } + + + @Test + public void testGenerateTextFile() throws Exception { + String fileName = ""; + String fileData = ""; + boolean result; + + // default test + result = GeneralUtility.generateTextFile(fileName, fileData); + } + + + @Test + public void testIsBase64Encoded() throws Exception { + byte[] data = new byte[] { ' ' }; + boolean result; + + // default test + result = GeneralUtility.isBase64Encoded(data); + } + + + @Test + public void testIsBase64Encoded_1() throws Exception { + String str = ""; + boolean result; + + // default test + result = GeneralUtility.isBase64Encoded(str); + } + + + @Test + public void testIsExceedingLimit() throws Exception { + String str = ""; + int limit = 0; + boolean result; + + // test 1 + str = null; + result = GeneralUtility.isExceedingLimit(str, limit); + Assert.assertEquals(false, result); + + // test 2 + str = ""; + result = GeneralUtility.isExceedingLimit(str, limit); + Assert.assertEquals(false, result); + } + + + @Test + public void testIsExceedingLimit_1() throws Exception { + List<String> strList = null; + int limit = 0; + int delimiterLength = 0; + boolean result; + + // test 1 + strList = null; + result = GeneralUtility.isExceedingLimit(strList, limit, delimiterLength); + Assert.assertEquals(false, result); + } + + + @Test + public void testGetFilenameExtension() throws Exception { + String fileName = ""; + String result; + + // test 1 + fileName = null; + result = GeneralUtility.getFilenameExtension(fileName); + Assert.assertEquals("", result); + + // test 2 + fileName = ""; + result = GeneralUtility.getFilenameExtension(fileName); + Assert.assertEquals("", result); + } + + + @Test + public void testCalculateMD5Base64EncodedByByteArray() throws Exception { + byte[] payload = new byte[] { ' ' }; + String result; + + // default test + result = GeneralUtility.calculateMD5Base64EncodedByByteArray(payload); + } + + + @Test + public void testCalculateMD5Base64EncodedByString() throws Exception { + String data = ""; + String result; + + // default test + result = GeneralUtility.calculateMD5Base64EncodedByString(data); + } + + + @Test + public void testIsEmptyString() throws Exception { + String str = ""; + boolean result; + + // default test + result = GeneralUtility.isEmptyString(str); + } +}
\ No newline at end of file diff --git a/common-app-api/src/test/java/org/openecomp/sdc/common/util/GsonFactoryTest.java b/common-app-api/src/test/java/org/openecomp/sdc/common/util/GsonFactoryTest.java new file mode 100644 index 0000000000..0840d27934 --- /dev/null +++ b/common-app-api/src/test/java/org/openecomp/sdc/common/util/GsonFactoryTest.java @@ -0,0 +1,22 @@ +package org.openecomp.sdc.common.util; + +import org.junit.Test; + +import com.google.gson.Gson; + + +public class GsonFactoryTest { + + private GsonFactory createTestSubject() { + return new GsonFactory(); + } + + + @Test + public void testGetGson() throws Exception { + Gson result; + + // default test + result = GsonFactory.getGson(); + } +}
\ No newline at end of file diff --git a/common-app-api/src/test/java/org/openecomp/sdc/common/util/ValidationUtilsTest.java b/common-app-api/src/test/java/org/openecomp/sdc/common/util/ValidationUtilsTest.java new file mode 100644 index 0000000000..9b30039023 --- /dev/null +++ b/common-app-api/src/test/java/org/openecomp/sdc/common/util/ValidationUtilsTest.java @@ -0,0 +1,603 @@ +package org.openecomp.sdc.common.util; + +import java.util.List; + +import org.junit.Assert; +import org.junit.Test; + + +public class ValidationUtilsTest { + + private ValidationUtils createTestSubject() { + return new ValidationUtils(); + } + + + @Test + public void testValidateArtifactLabel() throws Exception { + String label = ""; + boolean result; + + // default test + result = ValidationUtils.validateArtifactLabel(label); + } + + + @Test + public void testValidateArtifactDisplayName() throws Exception { + String displayName = ""; + boolean result; + + // default test + result = ValidationUtils.validateArtifactDisplayName(displayName); + } + + + + + @Test + public void testNormalizeCategoryName4Display() throws Exception { + String str = ""; + String result; + + // test 1 + str = "123"; + result = ValidationUtils.normalizeCategoryName4Display(str); + Assert.assertEquals("123", result); + + // test 2 + str = "123#123"; + result = ValidationUtils.normalizeCategoryName4Display(str); + Assert.assertEquals("123#123", result); + } + + + @Test + public void testNormalizeCategoryName4Uniqueness() throws Exception { + String str = ""; + String result; + + // default test + result = ValidationUtils.normalizeCategoryName4Uniqueness(str); + } + + + @Test + public void testValidateCategoryDisplayNameLength() throws Exception { + String label = ""; + boolean result; + + // default test + result = ValidationUtils.validateCategoryDisplayNameLength(label); + } + + + @Test + public void testValidateProductFullNameLength() throws Exception { + String fullName = ""; + boolean result; + + // default test + result = ValidationUtils.validateProductFullNameLength(fullName); + } + + + @Test + public void testValidateArtifactLabelLength() throws Exception { + String label = ""; + boolean result; + + // default test + result = ValidationUtils.validateArtifactLabelLength(label); + } + + + @Test + public void testValidateResourceInstanceNameLength() throws Exception { + String resourceInstanceName = ""; + boolean result; + + // default test + result = ValidationUtils.validateResourceInstanceNameLength(resourceInstanceName); + } + + + @Test + public void testValidateResourceInstanceName() throws Exception { + String resourceInstanceName = ""; + boolean result; + + // default test + result = ValidationUtils.validateResourceInstanceName(resourceInstanceName); + } + + + @Test + public void testValidateUrlLength() throws Exception { + String url = ""; + boolean result; + + // default test + result = ValidationUtils.validateUrlLength(url); + } + + + @Test + public void testValidateArtifactNameLength() throws Exception { + String artifactName = ""; + boolean result; + + // default test + result = ValidationUtils.validateArtifactNameLength(artifactName); + } + + + @Test + public void testValidateComponentNamePattern() throws Exception { + String componentName = ""; + boolean result; + + // default test + result = ValidationUtils.validateComponentNamePattern(componentName); + } + + + @Test + public void testValidateComponentNameLength() throws Exception { + String componentName = ""; + boolean result; + + // default test + result = ValidationUtils.validateComponentNameLength(componentName); + } + + + @Test + public void testValidateIcon() throws Exception { + String icon = ""; + boolean result; + + // default test + result = ValidationUtils.validateIcon(icon); + } + + + @Test + public void testValidateIconLength() throws Exception { + String icon = ""; + boolean result; + + // default test + result = ValidationUtils.validateIconLength(icon); + } + + + @Test + public void testValidateProjectCode() throws Exception { + String projectCode = ""; + boolean result; + + // default test + result = ValidationUtils.validateProjectCode(projectCode); + } + + + @Test + public void testValidateProjectCodeLegth() throws Exception { + String projectCode = ""; + boolean result; + + // default test + result = ValidationUtils.validateProjectCodeLegth(projectCode); + } + + + @Test + public void testValidateContactId() throws Exception { + String contactId = ""; + boolean result; + + // default test + result = ValidationUtils.validateContactId(contactId); + } + + + @Test + public void testValidateCost() throws Exception { + String cost = ""; + boolean result; + + // default test + result = ValidationUtils.validateCost(cost); + } + + + @Test + public void testRemoveHtmlTags() throws Exception { + String str = ""; + String result; + + // default test + result = ValidationUtils.removeHtmlTags(str); + } + + + @Test + public void testRemoveAllTags() throws Exception { + String htmlText = ""; + String result; + + // default test + result = ValidationUtils.removeAllTags(htmlText); + } + + + @Test + public void testNormaliseWhitespace() throws Exception { + String str = ""; + String result; + + // default test + result = ValidationUtils.normaliseWhitespace(str); + } + + + @Test + public void testStripOctets() throws Exception { + String str = ""; + String result; + + // default test + result = ValidationUtils.stripOctets(str); + } + + + @Test + public void testRemoveNoneUtf8Chars() throws Exception { + String input = ""; + String result; + + // default test + result = ValidationUtils.removeNoneUtf8Chars(input); + } + + + @Test + public void testValidateIsEnglish() throws Exception { + String input = ""; + boolean result; + + // default test + result = ValidationUtils.validateIsEnglish(input); + } + + + @Test + public void testValidateIsAscii() throws Exception { + String input = ""; + boolean result; + + // default test + result = ValidationUtils.validateIsAscii(input); + } + + + @Test + public void testConvertHtmlTagsToEntities() throws Exception { + String input = ""; + String result; + + // default test + result = ValidationUtils.convertHtmlTagsToEntities(input); + } + + + + + + + + + @Test + public void testValidateTagListLength() throws Exception { + int tagListLength = 0; + boolean result; + + // default test + result = ValidationUtils.validateTagListLength(tagListLength); + } + + + @Test + public void testValidateDescriptionLength() throws Exception { + String description = ""; + boolean result; + + // default test + result = ValidationUtils.validateDescriptionLength(description); + } + + + @Test + public void testValidateStringNotEmpty() throws Exception { + String value = ""; + boolean result; + + // test 1 + value = null; + result = ValidationUtils.validateStringNotEmpty(value); + Assert.assertEquals(false, result); + + // test 2 + value = ""; + result = ValidationUtils.validateStringNotEmpty(value); + Assert.assertEquals(false, result); + } + + + @Test + public void testValidateListNotEmpty() throws Exception { + List<?> list = null; + boolean result; + + // test 1 + list = null; + result = ValidationUtils.validateListNotEmpty(list); + Assert.assertEquals(false, result); + } + + + @Test + public void testValidateVendorName() throws Exception { + String vendorName = ""; + boolean result; + + // default test + result = ValidationUtils.validateVendorName(vendorName); + } + + + @Test + public void testValidateVendorNameLength() throws Exception { + String vendorName = ""; + boolean result; + + // default test + result = ValidationUtils.validateVendorNameLength(vendorName); + } + + + @Test + public void testValidateResourceVendorModelNumberLength() throws Exception { + String resourceVendorModelNumber = ""; + boolean result; + + // default test + result = ValidationUtils.validateResourceVendorModelNumberLength(resourceVendorModelNumber); + } + + + @Test + public void testValidateVendorRelease() throws Exception { + String vendorRelease = ""; + boolean result; + + // default test + result = ValidationUtils.validateVendorRelease(vendorRelease); + } + + + @Test + public void testValidateVendorReleaseLength() throws Exception { + String vendorRelease = ""; + boolean result; + + // default test + result = ValidationUtils.validateVendorReleaseLength(vendorRelease); + } + + + @Test + public void testValidateServiceTypeLength() throws Exception { + String serviceType = ""; + boolean result; + + // default test + result = ValidationUtils.validateServiceTypeLength(serviceType); + } + + + @Test + public void testValidateServiceRoleLength() throws Exception { + String serviceRole = ""; + boolean result; + + // default test + result = ValidationUtils.validateServiceRoleLength(serviceRole); + } + + + @Test + public void testHasBeenCertified() throws Exception { + String version = ""; + boolean result; + + // default test + result = ValidationUtils.hasBeenCertified(version); + } + + + @Test + public void testNormaliseComponentName() throws Exception { + String name = ""; + String result; + + // default test + result = ValidationUtils.normaliseComponentName(name); + } + + + @Test + public void testNormalizeComponentInstanceName() throws Exception { + String name = ""; + String result; + + // default test + result = ValidationUtils.normalizeComponentInstanceName(name); + } + + + + + + @Test + public void testConvertToSystemName() throws Exception { + String name = ""; + String result; + + // default test + result = ValidationUtils.convertToSystemName(name); + } + + + @Test + public void testNormalizeFileName() throws Exception { + String filename = ""; + String result; + + // default test + result = ValidationUtils.normalizeFileName(filename); + } + + + + + + @Test + public void testValidateUrl() throws Exception { + String url = ""; + boolean result; + + // default test + result = ValidationUtils.validateUrl(url); + } + + + @Test + public void testCleanArtifactDisplayName() throws Exception { + String strIn = ""; + String result; + + // default test + result = ValidationUtils.cleanArtifactDisplayName(strIn); + } + + + @Test + public void testNormalizeArtifactLabel() throws Exception { + String strIn = ""; + String result; + + // default test + result = ValidationUtils.normalizeArtifactLabel(strIn); + } + + + @Test + public void testValidateAdditionalInformationKeyName() throws Exception { + String str = ""; + boolean result; + + // default test + result = ValidationUtils.validateAdditionalInformationKeyName(str); + } + + + + + + + + + @Test + public void testValidateConsumerName() throws Exception { + String consumerName = ""; + boolean result; + + // default test + result = ValidationUtils.validateConsumerName(consumerName); + } + + + @Test + public void testIsUTF8Str() throws Exception { + String str = ""; + boolean result; + + // default test + result = ValidationUtils.isUTF8Str(str); + } + + + @Test + public void testValidateConsumerPassSalt() throws Exception { + String consumerSalt = ""; + boolean result; + + // default test + result = ValidationUtils.validateConsumerPassSalt(consumerSalt); + } + + + @Test + public void testIsFloatNumber() throws Exception { + String number = ""; + boolean result; + + // default test + result = ValidationUtils.isFloatNumber(number); + } + + + @Test + public void testValidateCertifiedVersion() throws Exception { + String version = ""; + boolean result; + + // default test + result = ValidationUtils.validateCertifiedVersion(version); + } + + + @Test + public void testValidateMinorVersion() throws Exception { + String version = ""; + boolean result; + + // default test + result = ValidationUtils.validateMinorVersion(version); + } + + + @Test + public void testNormaliseProductName() throws Exception { + String name = ""; + String result; + + // default test + result = ValidationUtils.normaliseProductName(name); + } + + + + + + @Test + public void testRemoveHtmlTagsOnly() throws Exception { + String htmlText = ""; + String result; + + // default test + result = ValidationUtils.removeHtmlTagsOnly(htmlText); + } +}
\ No newline at end of file |