9399b91ce1f89c540f7b84a1dd7dfd97b0cceace
[sdc.git] /
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.Rule;
6 import org.junit.Test;
7 import org.junit.rules.ExpectedException;
8 import org.openecomp.sdc.common.errors.CoreException;
9 import org.openecomp.sdc.logging.api.Logger;
10 import org.openecomp.sdc.logging.api.LoggerFactory;
11 import org.openecomp.sdc.translator.services.heattotosca.impl.resourcetranslation.BaseFullTranslationTest;
12
13 import java.io.IOException;
14
15 public class UnifiedCompositionMixPatternFullTest extends BaseFullTranslationTest {
16
17   private final Logger log = (Logger) LoggerFactory.getLogger(this.getClass().getName());
18
19   @Override
20   @Before
21   public void setUp() throws IOException {
22     // do not delete this function. it prevents the superclass setup from running
23   }
24
25   @Rule
26   public ExpectedException exception = ExpectedException.none();
27
28   @Test
29   public void testMixPatterns() throws IOException {
30     inputFilesPath =
31         "/mock/services/heattotosca/fulltest/mixPatterns/oneAppearancePerPattern/in";
32     outputFilesPath =
33         "/mock/services/heattotosca/fulltest/mixPatterns/oneAppearancePerPattern/out";
34
35     testTranslationWithInit();
36   }
37
38   @Test
39   public void testMixPatternsWithConnectivityBetweenPatterns() throws IOException {
40     inputFilesPath =
41         "/mock/services/heattotosca/fulltest/mixPatterns/connectivityBetweenPatterns/in";
42     outputFilesPath =
43         "/mock/services/heattotosca/fulltest/mixPatterns/connectivityBetweenPatterns/out";
44
45     testTranslationWithInit();
46   }
47
48   @Test
49   public void testMixPatternsWithConnectivityAndMoreThanOneOccurenceForEachPattern()
50       throws IOException {
51     inputFilesPath =
52         "/mock/services/heattotosca/fulltest/mixPatterns/twoAppearancePerPatternWithConnectivities/in";
53     outputFilesPath =
54         "/mock/services/heattotosca/fulltest/mixPatterns/twoAppearancePerPatternWithConnectivities/out";
55
56     testTranslationWithInit();
57   }
58
59   @Test
60   public void testDuplicateResourceIdsInDiffAddOnFiles() throws IOException {
61     exception.expect(CoreException.class);
62     exception.expectMessage("Resource with id lb_0_int_oam_int_0_port occurs more " +
63         "than once in different addOn files");
64
65     inputFilesPath =
66         "/mock/services/heattotosca/fulltest/mixPatterns/duplicateResourceIdsInDiffAddOnFiles/in";
67     testTranslationWithInit();
68   }
69
70   @Test
71   public void testMixPatternsWithDependencyConnectivity() throws IOException {
72     inputFilesPath =
73         "/mock/services/heattotosca/fulltest/mixPatterns/dependencyConnectivity/in";
74     outputFilesPath =
75         "/mock/services/heattotosca/fulltest/mixPatterns/dependencyConnectivity/out";
76
77     testTranslationWithInit();
78   }
79
80 }