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