diff options
author | Pavel Aharoni <pa0916@att.com> | 2017-04-02 09:21:38 +0300 |
---|---|---|
committer | Pavel Aharoni <pa0916@att.com> | 2017-04-02 09:36:55 +0300 |
commit | b51f888ee16f8bf92c7d9a0331eaa05e3bb938d2 (patch) | |
tree | 40c712b9c720283d64ca2b4d3a1079de8d1e8a5e /sdc-distribution-ci/src/main/java | |
parent | 905dce200dd3cf37bfc3b444a0d70b57232a30dc (diff) |
[SDC-8] adding factory/parser init logic
Change-Id: I4ed1581a2871915e12f0795de304f90fcab7d0db
Signed-off-by: Pavel Aharoni <pa0916@att.com>
Diffstat (limited to 'sdc-distribution-ci/src/main/java')
-rw-r--r-- | sdc-distribution-ci/src/main/java/org/openecomp/test/ClientTest.java | 28 |
1 files changed, 7 insertions, 21 deletions
diff --git a/sdc-distribution-ci/src/main/java/org/openecomp/test/ClientTest.java b/sdc-distribution-ci/src/main/java/org/openecomp/test/ClientTest.java index 519684b..5e8dafd 100644 --- a/sdc-distribution-ci/src/main/java/org/openecomp/test/ClientTest.java +++ b/sdc-distribution-ci/src/main/java/org/openecomp/test/ClientTest.java @@ -20,16 +20,12 @@ package org.openecomp.test; -import java.io.IOException; - import org.openecomp.sdc.api.IDistributionClient; import org.openecomp.sdc.api.consumer.INotificationCallback; import org.openecomp.sdc.api.results.IDistributionClientResult; import org.openecomp.sdc.impl.DistributionClientFactory; -import org.openecomp.sdc.tosca.parser.impl.SdcCsarHelperImpl; -import org.openecomp.sdc.toscaparser.ToscaParser; -import org.openecomp.sdc.toscaparser.ToscaParserFactory; -import org.openecomp.sdc.toscaparser.api.ToscaTemplate; +import org.openecomp.sdc.tosca.parser.api.ISdcCsarHelper; +import org.openecomp.sdc.tosca.parser.impl.SdcToscaParserFactory; import org.slf4j.LoggerFactory; import ch.qos.logback.classic.Level; @@ -37,24 +33,14 @@ import ch.qos.logback.classic.LoggerContext; public class ClientTest { public static void main(String[] args) throws Exception { - /* ToscaParserFactory toscaParserFactory = null; - try { - toscaParserFactory = new ToscaParserFactory(); - ToscaParser parser = toscaParserFactory.create(); - ToscaTemplate toscaTemplate = parser.parse("test.csar"); - SdcCsarHelperImpl csarHelper = new SdcCsarHelperImpl(toscaTemplate); + try (SdcToscaParserFactory toscaParserFactory = SdcToscaParserFactory.getInstance()){ + //ISdcCsarHelper csarHelper = toscaParserFactory.getSdcCsarHelper("C:\\Users\\pa0916\\Desktop\\Work\\ASDC\\CSARs\\service-ServiceFdnt-csar-nt-metadata.csar"); + ISdcCsarHelper csarHelper = toscaParserFactory.getSdcCsarHelper("C:\\Users\\pa0916\\Desktop\\Work\\ASDC\\CSARs\\service-ServiceFdnt-csar.csar"); String serviceSubstitutionMappingsTypeName = csarHelper.getServiceSubstitutionMappingsTypeName(); System.out.println("serviceSubstitutionMappingsTypeName is "+serviceSubstitutionMappingsTypeName); + String nodeTemplatePropertyLeafValue = csarHelper.getNodeTemplatePropertyLeafValue(csarHelper.getServiceVfList().get(0), "nf_role"); + System.out.println("property is "+nodeTemplatePropertyLeafValue); } - catch (Exception e){ - System.out.println(e); - } - finally{ - if (toscaParserFactory != null){ - toscaParserFactory.close(); - } - }*/ - LoggerContext lc = (LoggerContext) LoggerFactory.getILoggerFactory(); lc.getLogger("org.apache.http").setLevel(Level.INFO); |