aboutsummaryrefslogtreecommitdiffstats
path: root/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/impl/heattotosca/outputs/HeatOutputConversionTest.java
blob: fd3543a051bcb9034eb87dd0cc82f0d4eed665be (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
package org.openecomp.sdc.translator.impl.heattotosca.outputs;

import org.openecomp.sdc.translator.services.heattotosca.impl.BaseResourceTranslationTest;
import org.junit.Test;

public class HeatOutputConversionTest extends BaseResourceTranslationTest {

  {
    inputFilesPath = "/mock/heat/outputs/inputs";
    outputFilesPath = "/mock/heat/outputs/expectedoutputfiles";
  }

  @Test
  public void testTranslate() throws Exception {
    testTranslation();
  }


  //private static final String MANIFEST_NAME = "MANIFEST.json";

   /* @Test
    public void testTranslate_outputs() throws IOException {

        HeatToToscaTranslator heatToToscaTranslator = HeatToToscaTranslatorFactory.getInstance().createInterface();
        URL url = this.getClass().getResource("/mock/heat/outputs");
        File manifestFile = new File(url.getPath());
        File[] files = manifestFile.listFiles();
        FileInputStream fis;
        byte[] fileContent;
        for (File file : files) {
            fis = new FileInputStream(file);
            fileContent = FileUtils.toByteArray(fis);
            if (file.getName().equals(MANIFEST_NAME)) {
                heatToToscaTranslator.addManifest(MANIFEST_NAME, new String(fileContent));
            } else {
                heatToToscaTranslator.addFile(file.getName(), fileContent);
            }
        }

        TranslatorOutput translatorOutput = heatToToscaTranslator.translate();
        Assert.assertNotNull(translatorOutput);
        File file = new File("Outputs.zip");
        FileOutputStream fos = new FileOutputStream(file);
        fos.write(translatorOutput.getTranslationContent());
        fos.close();

    }*/


}