1 package org.openecomp.sdc.common.util;
5 import javax.annotation.Generated;
7 import org.junit.Assert;
11 public class ValidationUtilsTest {
13 private ValidationUtils createTestSubject() {
14 return new ValidationUtils();
19 public void testValidateArtifactLabel() throws Exception {
24 result = ValidationUtils.validateArtifactLabel(label);
29 public void testValidateArtifactDisplayName() throws Exception {
30 String displayName = "";
34 result = ValidationUtils.validateArtifactDisplayName(displayName);
41 public void testNormalizeCategoryName4Display() throws Exception {
47 result = ValidationUtils.normalizeCategoryName4Display(str);
48 Assert.assertEquals("123", result);
52 result = ValidationUtils.normalizeCategoryName4Display(str);
53 Assert.assertEquals("123#123", result);
58 public void testNormalizeCategoryName4Uniqueness() throws Exception {
63 result = ValidationUtils.normalizeCategoryName4Uniqueness(str);
68 public void testValidateCategoryDisplayNameLength() throws Exception {
73 result = ValidationUtils.validateCategoryDisplayNameLength(label);
78 public void testValidateProductFullNameLength() throws Exception {
83 result = ValidationUtils.validateProductFullNameLength(fullName);
88 public void testValidateArtifactLabelLength() throws Exception {
93 result = ValidationUtils.validateArtifactLabelLength(label);
98 public void testValidateResourceInstanceNameLength() throws Exception {
99 String resourceInstanceName = "";
103 result = ValidationUtils.validateResourceInstanceNameLength(resourceInstanceName);
108 public void testValidateResourceInstanceName() throws Exception {
109 String resourceInstanceName = "";
113 result = ValidationUtils.validateResourceInstanceName(resourceInstanceName);
118 public void testValidateUrlLength() throws Exception {
123 result = ValidationUtils.validateUrlLength(url);
128 public void testValidateArtifactNameLength() throws Exception {
129 String artifactName = "";
133 result = ValidationUtils.validateArtifactNameLength(artifactName);
138 public void testValidateComponentNamePattern() throws Exception {
139 String componentName = "";
143 result = ValidationUtils.validateComponentNamePattern(componentName);
148 public void testValidateComponentNameLength() throws Exception {
149 String componentName = "";
153 result = ValidationUtils.validateComponentNameLength(componentName);
158 public void testValidateIcon() throws Exception {
163 result = ValidationUtils.validateIcon(icon);
168 public void testValidateIconLength() throws Exception {
173 result = ValidationUtils.validateIconLength(icon);
178 public void testValidateProjectCode() throws Exception {
179 String projectCode = "";
183 result = ValidationUtils.validateProjectCode(projectCode);
188 public void testValidateProjectCodeLegth() throws Exception {
189 String projectCode = "";
193 result = ValidationUtils.validateProjectCodeLegth(projectCode);
198 public void testValidateContactId() throws Exception {
199 String contactId = "";
203 result = ValidationUtils.validateContactId(contactId);
208 public void testValidateCost() throws Exception {
213 result = ValidationUtils.validateCost(cost);
218 public void testRemoveHtmlTags() throws Exception {
223 result = ValidationUtils.removeHtmlTags(str);
228 public void testRemoveAllTags() throws Exception {
229 String htmlText = "";
233 result = ValidationUtils.removeAllTags(htmlText);
238 public void testNormaliseWhitespace() throws Exception {
243 result = ValidationUtils.normaliseWhitespace(str);
248 public void testStripOctets() throws Exception {
253 result = ValidationUtils.stripOctets(str);
258 public void testRemoveNoneUtf8Chars() throws Exception {
263 result = ValidationUtils.removeNoneUtf8Chars(input);
268 public void testValidateIsEnglish() throws Exception {
273 result = ValidationUtils.validateIsEnglish(input);
278 public void testValidateIsAscii() throws Exception {
283 result = ValidationUtils.validateIsAscii(input);
288 public void testConvertHtmlTagsToEntities() throws Exception {
293 result = ValidationUtils.convertHtmlTagsToEntities(input);
304 public void testValidateTagListLength() throws Exception {
305 int tagListLength = 0;
309 result = ValidationUtils.validateTagListLength(tagListLength);
314 public void testValidateDescriptionLength() throws Exception {
315 String description = "";
319 result = ValidationUtils.validateDescriptionLength(description);
324 public void testValidateStringNotEmpty() throws Exception {
330 result = ValidationUtils.validateStringNotEmpty(value);
331 Assert.assertEquals(false, result);
335 result = ValidationUtils.validateStringNotEmpty(value);
336 Assert.assertEquals(false, result);
341 public void testValidateListNotEmpty() throws Exception {
347 result = ValidationUtils.validateListNotEmpty(list);
348 Assert.assertEquals(false, result);
353 public void testValidateVendorName() throws Exception {
354 String vendorName = "";
358 result = ValidationUtils.validateVendorName(vendorName);
363 public void testValidateVendorNameLength() throws Exception {
364 String vendorName = "";
368 result = ValidationUtils.validateVendorNameLength(vendorName);
373 public void testValidateResourceVendorModelNumberLength() throws Exception {
374 String resourceVendorModelNumber = "";
378 result = ValidationUtils.validateResourceVendorModelNumberLength(resourceVendorModelNumber);
383 public void testValidateVendorRelease() throws Exception {
384 String vendorRelease = "";
388 result = ValidationUtils.validateVendorRelease(vendorRelease);
393 public void testValidateVendorReleaseLength() throws Exception {
394 String vendorRelease = "";
398 result = ValidationUtils.validateVendorReleaseLength(vendorRelease);
403 public void testValidateServiceTypeLength() throws Exception {
404 String serviceType = "";
408 result = ValidationUtils.validateServiceTypeLength(serviceType);
413 public void testValidateServiceRoleLength() throws Exception {
414 String serviceRole = "";
418 result = ValidationUtils.validateServiceRoleLength(serviceRole);
423 public void testHasBeenCertified() throws Exception {
428 result = ValidationUtils.hasBeenCertified(version);
433 public void testNormaliseComponentName() throws Exception {
438 result = ValidationUtils.normaliseComponentName(name);
443 public void testNormalizeComponentInstanceName() throws Exception {
448 result = ValidationUtils.normalizeComponentInstanceName(name);
456 public void testConvertToSystemName() throws Exception {
461 result = ValidationUtils.convertToSystemName(name);
466 public void testNormalizeFileName() throws Exception {
467 String filename = "";
471 result = ValidationUtils.normalizeFileName(filename);
479 public void testValidateUrl() throws Exception {
484 result = ValidationUtils.validateUrl(url);
489 public void testCleanArtifactDisplayName() throws Exception {
494 result = ValidationUtils.cleanArtifactDisplayName(strIn);
499 public void testNormalizeArtifactLabel() throws Exception {
504 result = ValidationUtils.normalizeArtifactLabel(strIn);
509 public void testValidateAdditionalInformationKeyName() throws Exception {
514 result = ValidationUtils.validateAdditionalInformationKeyName(str);
525 public void testValidateConsumerName() throws Exception {
526 String consumerName = "";
530 result = ValidationUtils.validateConsumerName(consumerName);
535 public void testIsUTF8Str() throws Exception {
540 result = ValidationUtils.isUTF8Str(str);
545 public void testValidateConsumerPassSalt() throws Exception {
546 String consumerSalt = "";
550 result = ValidationUtils.validateConsumerPassSalt(consumerSalt);
555 public void testIsFloatNumber() throws Exception {
560 result = ValidationUtils.isFloatNumber(number);
565 public void testValidateCertifiedVersion() throws Exception {
570 result = ValidationUtils.validateCertifiedVersion(version);
575 public void testValidateMinorVersion() throws Exception {
580 result = ValidationUtils.validateMinorVersion(version);
585 public void testNormaliseProductName() throws Exception {
590 result = ValidationUtils.normaliseProductName(name);
598 public void testRemoveHtmlTagsOnly() throws Exception {
599 String htmlText = "";
603 result = ValidationUtils.removeHtmlTagsOnly(htmlText);