Fixed SONAR issues
[sdc.git] / openecomp-be / lib / openecomp-sdc-translator-lib / openecomp-sdc-translator-core / src / test / java / org / openecomp / sdc / translator / services / heattotosca / impl / fulltest / UnifiedCompositionMixPatternFullTest.java
1 package org.openecomp.sdc.translator.services.heattotosca.impl.fulltest;
2
3 import org.junit.Assert;
4 import org.junit.Before;
5 import org.junit.Test;
6 import org.openecomp.sdc.logging.api.Logger;
7 import org.openecomp.sdc.logging.api.LoggerFactory;
8 import org.openecomp.sdc.translator.services.heattotosca.impl.resourcetranslation.BaseFullTranslationTest;
9
10 import java.io.IOException;
11
12 public class UnifiedCompositionMixPatternFullTest extends BaseFullTranslationTest {
13
14   private final Logger log = (Logger) LoggerFactory.getLogger(this.getClass().getName());
15
16   @Override
17   @Before
18   public void setUp() throws IOException {
19     // do not delete this function. it prevents the superclass setup from running
20   }
21
22   @Test
23   public void testMixPatterns() throws IOException {
24     inputFilesPath =
25         "/mock/services/heattotosca/fulltest/mixPatterns/oneAppearancePerPattern/in";
26     outputFilesPath =
27         "/mock/services/heattotosca/fulltest/mixPatterns/oneAppearancePerPattern/out";
28
29     testTranslationWithInit();
30   }
31
32   @Test
33   public void testMixPatternsWithConnectivityBetweenPatterns() throws IOException {
34     inputFilesPath =
35         "/mock/services/heattotosca/fulltest/mixPatterns/connectivityBetweenPatterns/in";
36     outputFilesPath =
37         "/mock/services/heattotosca/fulltest/mixPatterns/connectivityBetweenPatterns/out";
38
39     testTranslationWithInit();
40   }
41
42   @Test
43   public void testMixPatternsWithConnectivityAndMoreThanOneOccurenceForEachPattern()
44       throws IOException {
45     inputFilesPath =
46         "/mock/services/heattotosca/fulltest/mixPatterns/twoAppearancePerPatternWithConnectivities/in";
47     outputFilesPath =
48         "/mock/services/heattotosca/fulltest/mixPatterns/twoAppearancePerPatternWithConnectivities/out";
49
50     testTranslationWithInit();
51   }
52
53   @Test
54   public void testDuplicateResourceIdsInDiffAddOnFiles() throws IOException {
55     inputFilesPath =
56         "/mock/services/heattotosca/fulltest/mixPatterns/duplicateResourceIdsInDiffAddOnFiles/in";
57
58     try {
59       testTranslationWithInit();
60     }catch(Exception e){
61       log.debug("",e);
62       Assert.assertEquals(e.getMessage(), "Resource with id lb_0_int_oam_int_0_port occures more " +
63           "than once in different addOn files");
64     }
65   }
66
67   @Test
68   public void testMixPatternsWithDependencyConnectivity() throws IOException {
69     inputFilesPath =
70         "/mock/services/heattotosca/fulltest/mixPatterns/dependencyConnectivity/in";
71     outputFilesPath =
72         "/mock/services/heattotosca/fulltest/mixPatterns/dependencyConnectivity/out";
73
74     testTranslationWithInit();
75   }
76
77 }