Added oparent to sdc main
[sdc.git] / common-app-api / src / test / java / org / openecomp / sdc / common / util / ValidationUtilsTest.java
1 /*-
2  * ============LICENSE_START=======================================================
3  * SDC
4  * ================================================================================
5  * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
6  * ================================================================================
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  * 
11  *      http://www.apache.org/licenses/LICENSE-2.0
12  * 
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  * ============LICENSE_END=========================================================
19  */
20
21 package org.openecomp.sdc.common.util;
22
23 import java.util.List;
24
25 import org.junit.Assert;
26 import org.junit.Test;
27
28
29 public class ValidationUtilsTest {
30
31         private ValidationUtils createTestSubject() {
32                 return new ValidationUtils();
33         }
34
35         
36         @Test
37         public void testValidateArtifactLabel() throws Exception {
38                 String label = "";
39                 boolean result;
40
41                 // default test
42                 result = ValidationUtils.validateArtifactLabel(label);
43         }
44
45         
46         @Test
47         public void testValidateArtifactDisplayName() throws Exception {
48                 String displayName = "";
49                 boolean result;
50
51                 // default test
52                 result = ValidationUtils.validateArtifactDisplayName(displayName);
53         }
54
55         
56
57         
58         @Test
59         public void testNormalizeCategoryName4Display() throws Exception {
60                 String str = "";
61                 String result;
62
63                 // test 1
64                 str = "123";
65                 result = ValidationUtils.normalizeCategoryName4Display(str);
66                 Assert.assertEquals("123", result);
67
68                 // test 2
69                 str = "123#123";
70                 result = ValidationUtils.normalizeCategoryName4Display(str);
71                 Assert.assertEquals("123#123", result);
72         }
73
74         
75         @Test
76         public void testNormalizeCategoryName4Uniqueness() throws Exception {
77                 String str = "";
78                 String result;
79
80                 // default test
81                 result = ValidationUtils.normalizeCategoryName4Uniqueness(str);
82         }
83
84         
85         @Test
86         public void testValidateCategoryDisplayNameLength() throws Exception {
87                 String label = "";
88                 boolean result;
89
90                 // default test
91                 result = ValidationUtils.validateCategoryDisplayNameLength(label);
92         }
93
94         
95         @Test
96         public void testValidateProductFullNameLength() throws Exception {
97                 String fullName = "";
98                 boolean result;
99
100                 // default test
101                 result = ValidationUtils.validateProductFullNameLength(fullName);
102         }
103
104         
105         @Test
106         public void testValidateArtifactLabelLength() throws Exception {
107                 String label = "";
108                 boolean result;
109
110                 // default test
111                 result = ValidationUtils.validateArtifactLabelLength(label);
112         }
113
114         
115         @Test
116         public void testValidateResourceInstanceNameLength() throws Exception {
117                 String resourceInstanceName = "";
118                 boolean result;
119
120                 // default test
121                 result = ValidationUtils.validateResourceInstanceNameLength(resourceInstanceName);
122         }
123
124         
125         @Test
126         public void testValidateResourceInstanceName() throws Exception {
127                 String resourceInstanceName = "";
128                 boolean result;
129
130                 // default test
131                 result = ValidationUtils.validateResourceInstanceName(resourceInstanceName);
132         }
133
134         
135         @Test
136         public void testValidateUrlLength() throws Exception {
137                 String url = "";
138                 boolean result;
139
140                 // default test
141                 result = ValidationUtils.validateUrlLength(url);
142         }
143
144         
145         @Test
146         public void testValidateArtifactNameLength() throws Exception {
147                 String artifactName = "";
148                 boolean result;
149
150                 // default test
151                 result = ValidationUtils.validateArtifactNameLength(artifactName);
152         }
153
154         
155         @Test
156         public void testValidateComponentNamePattern() throws Exception {
157                 String componentName = "";
158                 boolean result;
159
160                 // default test
161                 result = ValidationUtils.validateComponentNamePattern(componentName);
162         }
163
164         
165         @Test
166         public void testValidateComponentNameLength() throws Exception {
167                 String componentName = "";
168                 boolean result;
169
170                 // default test
171                 result = ValidationUtils.validateComponentNameLength(componentName);
172         }
173
174         
175         @Test
176         public void testValidateIcon() throws Exception {
177                 String icon = "";
178                 boolean result;
179
180                 // default test
181                 result = ValidationUtils.validateIcon(icon);
182         }
183
184         
185         @Test
186         public void testValidateIconLength() throws Exception {
187                 String icon = "";
188                 boolean result;
189
190                 // default test
191                 result = ValidationUtils.validateIconLength(icon);
192         }
193
194         
195         @Test
196         public void testValidateProjectCode() throws Exception {
197                 String projectCode = "";
198                 boolean result;
199
200                 // default test
201                 result = ValidationUtils.validateProjectCode(projectCode);
202         }
203
204         
205         @Test
206         public void testValidateProjectCodeLegth() throws Exception {
207                 String projectCode = "";
208                 boolean result;
209
210                 // default test
211                 result = ValidationUtils.validateProjectCodeLegth(projectCode);
212         }
213
214         
215         @Test
216         public void testValidateContactId() throws Exception {
217                 String contactId = "";
218                 boolean result;
219
220                 // default test
221                 result = ValidationUtils.validateContactId(contactId);
222         }
223
224         
225         @Test
226         public void testValidateCost() throws Exception {
227                 String cost = "";
228                 boolean result;
229
230                 // default test
231                 result = ValidationUtils.validateCost(cost);
232         }
233
234         
235         @Test
236         public void testRemoveHtmlTags() throws Exception {
237                 String str = "";
238                 String result;
239
240                 // default test
241                 result = ValidationUtils.removeHtmlTags(str);
242         }
243
244         
245         @Test
246         public void testRemoveAllTags() throws Exception {
247                 String htmlText = "";
248                 String result;
249
250                 // default test
251                 result = ValidationUtils.removeAllTags(htmlText);
252         }
253
254         
255         @Test
256         public void testNormaliseWhitespace() throws Exception {
257                 String str = "";
258                 String result;
259
260                 // default test
261                 result = ValidationUtils.normaliseWhitespace(str);
262         }
263
264         
265         @Test
266         public void testStripOctets() throws Exception {
267                 String str = "";
268                 String result;
269
270                 // default test
271                 result = ValidationUtils.stripOctets(str);
272         }
273
274         
275         @Test
276         public void testRemoveNoneUtf8Chars() throws Exception {
277                 String input = "";
278                 String result;
279
280                 // default test
281                 result = ValidationUtils.removeNoneUtf8Chars(input);
282         }
283
284         
285         @Test
286         public void testValidateIsEnglish() throws Exception {
287                 String input = "";
288                 boolean result;
289
290                 // default test
291                 result = ValidationUtils.validateIsEnglish(input);
292         }
293
294         
295         @Test
296         public void testValidateIsAscii() throws Exception {
297                 String input = "";
298                 boolean result;
299
300                 // default test
301                 result = ValidationUtils.validateIsAscii(input);
302         }
303
304         
305         @Test
306         public void testConvertHtmlTagsToEntities() throws Exception {
307                 String input = "";
308                 String result;
309
310                 // default test
311                 result = ValidationUtils.convertHtmlTagsToEntities(input);
312         }
313
314         
315
316
317         
318
319
320         
321         @Test
322         public void testValidateTagListLength() throws Exception {
323                 int tagListLength = 0;
324                 boolean result;
325
326                 // default test
327                 result = ValidationUtils.validateTagListLength(tagListLength);
328         }
329
330         
331         @Test
332         public void testValidateDescriptionLength() throws Exception {
333                 String description = "";
334                 boolean result;
335
336                 // default test
337                 result = ValidationUtils.validateDescriptionLength(description);
338         }
339
340         
341         @Test
342         public void testValidateStringNotEmpty() throws Exception {
343                 String value = "";
344                 boolean result;
345
346                 // test 1
347                 value = null;
348                 result = ValidationUtils.validateStringNotEmpty(value);
349                 Assert.assertEquals(false, result);
350
351                 // test 2
352                 value = "";
353                 result = ValidationUtils.validateStringNotEmpty(value);
354                 Assert.assertEquals(false, result);
355         }
356
357         
358         @Test
359         public void testValidateListNotEmpty() throws Exception {
360                 List<?> list = null;
361                 boolean result;
362
363                 // test 1
364                 list = null;
365                 result = ValidationUtils.validateListNotEmpty(list);
366                 Assert.assertEquals(false, result);
367         }
368
369         
370         @Test
371         public void testValidateVendorName() throws Exception {
372                 String vendorName = "";
373                 boolean result;
374
375                 // default test
376                 result = ValidationUtils.validateVendorName(vendorName);
377         }
378
379         
380         @Test
381         public void testValidateVendorNameLength() throws Exception {
382                 String vendorName = "";
383                 boolean result;
384
385                 // default test
386                 result = ValidationUtils.validateVendorNameLength(vendorName);
387         }
388
389         
390         @Test
391         public void testValidateResourceVendorModelNumberLength() throws Exception {
392                 String resourceVendorModelNumber = "";
393                 boolean result;
394
395                 // default test
396                 result = ValidationUtils.validateResourceVendorModelNumberLength(resourceVendorModelNumber);
397         }
398
399         
400         @Test
401         public void testValidateVendorRelease() throws Exception {
402                 String vendorRelease = "";
403                 boolean result;
404
405                 // default test
406                 result = ValidationUtils.validateVendorRelease(vendorRelease);
407         }
408
409         
410         @Test
411         public void testValidateVendorReleaseLength() throws Exception {
412                 String vendorRelease = "";
413                 boolean result;
414
415                 // default test
416                 result = ValidationUtils.validateVendorReleaseLength(vendorRelease);
417         }
418
419         
420         @Test
421         public void testValidateServiceTypeLength() throws Exception {
422                 String serviceType = "";
423                 boolean result;
424
425                 // default test
426                 result = ValidationUtils.validateServiceTypeLength(serviceType);
427         }
428
429         
430         @Test
431         public void testValidateServiceRoleLength() throws Exception {
432                 String serviceRole = "";
433                 boolean result;
434
435                 // default test
436                 result = ValidationUtils.validateServiceRoleLength(serviceRole);
437         }
438
439         
440         @Test
441         public void testHasBeenCertified() throws Exception {
442                 String version = "";
443                 boolean result;
444
445                 // default test
446                 result = ValidationUtils.hasBeenCertified(version);
447         }
448
449         
450         @Test
451         public void testNormaliseComponentName() throws Exception {
452                 String name = "";
453                 String result;
454
455                 // default test
456                 result = ValidationUtils.normaliseComponentName(name);
457         }
458
459         
460         @Test
461         public void testNormalizeComponentInstanceName() throws Exception {
462                 String name = "";
463                 String result;
464
465                 // default test
466                 result = ValidationUtils.normalizeComponentInstanceName(name);
467         }
468
469         
470
471
472         
473         @Test
474         public void testConvertToSystemName() throws Exception {
475                 String name = "";
476                 String result;
477
478                 // default test
479                 result = ValidationUtils.convertToSystemName(name);
480         }
481
482         
483         @Test
484         public void testNormalizeFileName() throws Exception {
485                 String filename = "";
486                 String result;
487
488                 // default test
489                 result = ValidationUtils.normalizeFileName(filename);
490         }
491
492         
493
494
495         
496         @Test
497         public void testValidateUrl() throws Exception {
498                 String url = "";
499                 boolean result;
500
501                 // default test
502                 result = ValidationUtils.validateUrl(url);
503         }
504
505         
506         @Test
507         public void testCleanArtifactDisplayName() throws Exception {
508                 String strIn = "";
509                 String result;
510
511                 // default test
512                 result = ValidationUtils.cleanArtifactDisplayName(strIn);
513         }
514
515         
516         @Test
517         public void testNormalizeArtifactLabel() throws Exception {
518                 String strIn = "";
519                 String result;
520
521                 // default test
522                 result = ValidationUtils.normalizeArtifactLabel(strIn);
523         }
524
525         
526         @Test
527         public void testValidateAdditionalInformationKeyName() throws Exception {
528                 String str = "";
529                 boolean result;
530
531                 // default test
532                 result = ValidationUtils.validateAdditionalInformationKeyName(str);
533         }
534
535         
536
537
538         
539
540
541         
542         @Test
543         public void testValidateConsumerName() throws Exception {
544                 String consumerName = "";
545                 boolean result;
546
547                 // default test
548                 result = ValidationUtils.validateConsumerName(consumerName);
549         }
550
551         
552         @Test
553         public void testIsUTF8Str() throws Exception {
554                 String str = "";
555                 boolean result;
556
557                 // default test
558                 result = ValidationUtils.isUTF8Str(str);
559         }
560
561         
562         @Test
563         public void testValidateConsumerPassSalt() throws Exception {
564                 String consumerSalt = "";
565                 boolean result;
566
567                 // default test
568                 result = ValidationUtils.validateConsumerPassSalt(consumerSalt);
569         }
570
571         
572         @Test
573         public void testIsFloatNumber() throws Exception {
574                 String number = "";
575                 boolean result;
576
577                 // default test
578                 result = ValidationUtils.isFloatNumber(number);
579         }
580
581         
582         @Test
583         public void testValidateCertifiedVersion() throws Exception {
584                 String version = "";
585                 boolean result;
586
587                 // default test
588                 result = ValidationUtils.validateCertifiedVersion(version);
589         }
590
591         
592         @Test
593         public void testValidateMinorVersion() throws Exception {
594                 String version = "";
595                 boolean result;
596
597                 // default test
598                 result = ValidationUtils.validateMinorVersion(version);
599         }
600
601         
602         @Test
603         public void testNormaliseProductName() throws Exception {
604                 String name = "";
605                 String result;
606
607                 // default test
608                 result = ValidationUtils.normaliseProductName(name);
609         }
610
611         
612
613
614         
615         @Test
616         public void testRemoveHtmlTagsOnly() throws Exception {
617                 String htmlText = "";
618                 String result;
619
620                 // default test
621                 result = ValidationUtils.removeHtmlTagsOnly(htmlText);
622         }
623 }