blob: 2f0da7f09b45ce097d878a534839d776f927328b (
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
|
package org.openecomp.sdc.impl;
import org.openecomp.sdc.toscaparser.api.NodeTemplate;
import org.testng.annotations.Test;
import org.openecomp.sdc.tosca.parser.api.ISdcCsarHelper;
import org.openecomp.sdc.tosca.parser.exceptions.SdcToscaParserException;
import org.openecomp.sdc.tosca.parser.impl.SdcToscaParserFactory;
import java.io.File;
import java.util.List;
import static org.openecomp.sdc.impl.SdcToscaParserBasicTest.getCsarHelper;
public class myTest {
static SdcToscaParserFactory factory;
static ISdcCsarHelper fdntCsarHelper;
@Test
public void testNoValidationIssues() throws SdcToscaParserException {
// factory = SdcToscaParserFactory.getInstance();
// fdntCsarHelper = getCsarHelper("csars/service-Oren1-csar-4.csar");
//
//
// List<NodeTemplate> serviceNodeTemplatesByType = fdntCsarHelper.getServiceNodeTemplatesByType("org.openecomp.nodes.ForwardingPath");
//
// String target_range = fdntCsarHelper.getNodeTemplatePropertyLeafValue(serviceNodeTemplatesByType.get(0), "target_range");
}
protected static ISdcCsarHelper getCsarHelper(String path) throws SdcToscaParserException {
System.out.println("Parsing CSAR "+path+"...");
String fileStr1 = SdcToscaParserBasicTest.class.getClassLoader().getResource(path).getFile();
File file1 = new File(fileStr1);
ISdcCsarHelper sdcCsarHelper = factory.getSdcCsarHelper(file1.getAbsolutePath());
return sdcCsarHelper;
}
}
|