5db90c2230ec8a01e93807c149ca8c6b54b6de53
[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.translator.services.heattotosca.impl.resourcetranslation.BaseFullTranslationTest;
7
8 import java.io.IOException;
9
10 public class UnifiedCompositionMixPatternFullTest extends BaseFullTranslationTest {
11
12   @Override
13   @Before
14   public void setUp() throws IOException {
15     // do not delete this function. it prevents the superclass setup from running
16   }
17
18   @Test
19   public void testMixPatterns() throws IOException {
20     inputFilesPath =
21         "/mock/services/heattotosca/fulltest/mixPatterns/oneAppearancePerPattern/in";
22     outputFilesPath =
23         "/mock/services/heattotosca/fulltest/mixPatterns/oneAppearancePerPattern/out";
24
25     testTranslationWithInit();
26   }
27
28   @Test
29   public void testMixPatternsWithConnectivityBetweenPatterns() throws IOException {
30     inputFilesPath =
31         "/mock/services/heattotosca/fulltest/mixPatterns/connectivityBetweenPatterns/in";
32     outputFilesPath =
33         "/mock/services/heattotosca/fulltest/mixPatterns/connectivityBetweenPatterns/out";
34
35     testTranslationWithInit();
36   }
37
38   @Test
39   public void testMixPatternsWithConnectivityAndMoreThanOneOccurenceForEachPattern()
40       throws IOException {
41     inputFilesPath =
42         "/mock/services/heattotosca/fulltest/mixPatterns/twoAppearancePerPatternWithConnectivities/in";
43     outputFilesPath =
44         "/mock/services/heattotosca/fulltest/mixPatterns/twoAppearancePerPatternWithConnectivities/out";
45
46     testTranslationWithInit();
47   }
48
49   @Test
50   public void testDuplicateResourceIdsInDiffAddOnFiles() throws IOException {
51     inputFilesPath =
52         "/mock/services/heattotosca/fulltest/mixPatterns/duplicateResourceIdsInDiffAddOnFiles/in";
53
54     try {
55       testTranslationWithInit();
56     }catch(Exception e){
57       Assert.assertEquals(e.getMessage(), "Resource with id lb_0_int_oam_int_0_port occures more " +
58           "than once in different addOn files");
59     }
60   }
61
62   @Test
63   public void testMixPatternsWithDependencyConnectivity() throws IOException {
64     inputFilesPath =
65         "/mock/services/heattotosca/fulltest/mixPatterns/dependencyConnectivity/in";
66     outputFilesPath =
67         "/mock/services/heattotosca/fulltest/mixPatterns/dependencyConnectivity/out";
68
69     testTranslationWithInit();
70   }
71
72 }