Update appc-config-generator to use onap packaging 89/26489/6
authorTakamune Cho <tc012c@att.com>
Tue, 19 Dec 2017 01:39:40 +0000 (19:39 -0600)
committerPatrick Brady <pb071s@att.com>
Tue, 19 Dec 2017 16:18:21 +0000 (08:18 -0800)
Change-Id: Ia89d9eb8f56c8ac0e46cbe1b473f7cfced32228a
Issue-ID: APPC-13
Signed-off-by: Takamune Cho <tc012c@att.com>
35 files changed:
appc-config/appc-config-generator/installer/src/assembly/assemble_installer_zip.xml
appc-config/appc-config-generator/installer/src/assembly/assemble_mvnrepo_zip.xml
appc-config/appc-config-generator/installer/src/main/resources/scripts/install-feature.sh
appc-config/appc-config-generator/provider/src/main/java/org/onap/sdnc/config/generator/ConfigGeneratorActivator.java
appc-config/appc-config-generator/provider/src/main/java/org/onap/sdnc/config/generator/ConfigGeneratorConstant.java
appc-config/appc-config-generator/provider/src/main/java/org/onap/sdnc/config/generator/convert/ConvertNode.java
appc-config/appc-config-generator/provider/src/main/java/org/onap/sdnc/config/generator/merge/MergeNode.java
appc-config/appc-config-generator/provider/src/main/java/org/onap/sdnc/config/generator/pattern/PatternNode.java
appc-config/appc-config-generator/provider/src/main/java/org/onap/sdnc/config/generator/reader/ReaderNode.java
appc-config/appc-config-generator/provider/src/main/java/org/onap/sdnc/config/generator/tool/CheckDataTool.java
appc-config/appc-config-generator/provider/src/main/java/org/onap/sdnc/config/generator/tool/Constants.java
appc-config/appc-config-generator/provider/src/main/java/org/onap/sdnc/config/generator/tool/CustomJsonNodeFactory.java
appc-config/appc-config-generator/provider/src/main/java/org/onap/sdnc/config/generator/tool/CustomTextNode.java
appc-config/appc-config-generator/provider/src/main/java/org/onap/sdnc/config/generator/tool/DbServiceUtil.java
appc-config/appc-config-generator/provider/src/main/java/org/onap/sdnc/config/generator/tool/EscapeUtils.java
appc-config/appc-config-generator/provider/src/main/java/org/onap/sdnc/config/generator/tool/JSONTool.java
appc-config/appc-config-generator/provider/src/main/java/org/onap/sdnc/config/generator/tool/LogParserTool.java
appc-config/appc-config-generator/provider/src/main/java/org/onap/sdnc/config/generator/tool/MergeTool.java
appc-config/appc-config-generator/provider/src/main/java/org/onap/sdnc/config/generator/transform/XSLTTransformerNode.java
appc-config/appc-config-generator/provider/src/main/java/org/onap/sdnc/config/generator/writer/FileWriterNode.java
appc-config/appc-config-generator/provider/src/main/resources/adaptor.properties
appc-config/appc-config-generator/provider/src/test/java/org/onap/sdnc/config/generator/convert/TestConvertNode.java
appc-config/appc-config-generator/provider/src/test/java/org/onap/sdnc/config/generator/merge/TestMergeNode.java
appc-config/appc-config-generator/provider/src/test/java/org/onap/sdnc/config/generator/pattern/TestPatternNode.java
appc-config/appc-config-generator/provider/src/test/java/org/onap/sdnc/config/generator/reader/TestReaderNode.java
appc-config/appc-config-generator/provider/src/test/java/org/onap/sdnc/config/generator/tool/TestDataTool.java
appc-config/appc-config-generator/provider/src/test/java/org/onap/sdnc/config/generator/transform/TestXSLTTransformerNode.java
appc-config/appc-config-generator/provider/src/test/java/org/onap/sdnc/config/generator/writer/TestFileWriterNode.java
appc-config/appc-config-generator/provider/src/test/resources/convert/escape/config_vdbe.xml
appc-config/appc-config-generator/provider/src/test/resources/merge/complex/vdbe_template.xml
appc-config/appc-config-generator/provider/src/test/resources/merge/vdbe_template.xml
appc-config/appc-config-generator/provider/src/test/resources/pattern/xml_data.xml
appc-config/appc-config-generator/provider/src/test/resources/transform/request.xml
appc-config/appc-config-generator/provider/src/test/resources/transform/template.xsl
appc-directed-graph/appc-dgraph/provider/src/test/java/org/onap/appc/dg/TestCommonConfig.java

index 23323ab..cecc5a7 100644 (file)
@@ -1,9 +1,11 @@
 <!--
   ============LICENSE_START=======================================================
 <!--
   ============LICENSE_START=======================================================
-  ONAP : APP-C
+  ONAP : APPC
   ================================================================================
   ================================================================================
-  Copyright (C) 2017 AT&T Intellectual Property.  All rights reserved.
+  Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
   ================================================================================
   ================================================================================
+  Copyright (C) 2017 Amdocs
+  =============================================================================
   Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with the License.
   You may obtain a copy of the License at
   Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with the License.
   You may obtain a copy of the License at
@@ -15,6 +17,8 @@
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.
+  
+  ECOMP is a trademark and service mark of AT&T Intellectual Property.
   ============LICENSE_END=========================================================
   ECOMP is a trademark and service mark of AT&T Intellectual Property.
   -->
   ============LICENSE_END=========================================================
   ECOMP is a trademark and service mark of AT&T Intellectual Property.
   -->
 <!-- Defines how we build the .zip file which is our distribution. -->
 
 <assembly
 <!-- Defines how we build the .zip file which is our distribution. -->
 
 <assembly
-       xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0"
-       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-       xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0 http://maven.apache.org/xsd/assembly-1.1.0.xsd">
-       <id>generator</id>
-       <formats>
-               <format>zip</format>
-       </formats>
+    xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0"
+    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+    xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0 http://maven.apache.org/xsd/assembly-1.1.0.xsd">
+    <id>generator</id>
+    <formats>
+        <format>zip</format>
+    </formats>
 
 
-       <!--  we want "system" and related files right at the root level
-                 as this file is suppose to be unzip on top of a karaf
-                 distro. -->
-       <includeBaseDirectory>false</includeBaseDirectory>
+    <!--  we want "system" and related files right at the root level
+          as this file is suppose to be unzip on top of a karaf
+          distro. -->
+    <includeBaseDirectory>false</includeBaseDirectory>
 
 
-       <fileSets>
-               <fileSet>
-                       <directory>target/stage/</directory>
-                       <outputDirectory>${application.name}</outputDirectory>
-                       <fileMode>755</fileMode>
-                       <includes>
-                               <include>*.sh</include>
-                       </includes>
-               </fileSet>
-               <fileSet>
-                       <directory>target/stage/</directory>
-                       <outputDirectory>${application.name}</outputDirectory>
-                       <fileMode>644</fileMode>
-                       <excludes>
-                               <exclude>*.sh</exclude>
-                       </excludes>
-               </fileSet>
-       </fileSets>
+    <fileSets>
+        <fileSet>
+            <directory>target/stage/</directory>
+            <outputDirectory>${application.name}</outputDirectory>
+            <fileMode>755</fileMode>
+            <includes>
+                <include>*.sh</include>
+            </includes>
+        </fileSet>
+        <fileSet>
+            <directory>target/stage/</directory>
+            <outputDirectory>${application.name}</outputDirectory>
+            <fileMode>644</fileMode>
+            <excludes>
+                <exclude>*.sh</exclude>
+            </excludes>
+        </fileSet>
+    </fileSets>
 
 
 
 
 
 
index 9a1eaf4..edeb288 100644 (file)
@@ -1,9 +1,11 @@
 <!--
   ============LICENSE_START=======================================================
 <!--
   ============LICENSE_START=======================================================
-  ONAP : APP-C
+  ONAP : APPC
   ================================================================================
   ================================================================================
-  Copyright (C) 2017 AT&T Intellectual Property.  All rights reserved.
+  Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
   ================================================================================
   ================================================================================
+  Copyright (C) 2017 Amdocs
+  =============================================================================
   Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with the License.
   You may obtain a copy of the License at
   Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with the License.
   You may obtain a copy of the License at
@@ -15,6 +17,8 @@
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.
+  
+  ECOMP is a trademark and service mark of AT&T Intellectual Property.
   ============LICENSE_END=========================================================
   ECOMP is a trademark and service mark of AT&T Intellectual Property.
   -->
   ============LICENSE_END=========================================================
   ECOMP is a trademark and service mark of AT&T Intellectual Property.
   -->
 <!-- Defines how we build the .zip file which is our distribution. -->
 
 <assembly
 <!-- Defines how we build the .zip file which is our distribution. -->
 
 <assembly
-       xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0"
-       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-       xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0 http://maven.apache.org/xsd/assembly-1.1.0.xsd">
-       <id>generator</id>
-       <formats>
-               <format>zip</format>
-       </formats>
+    xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0"
+    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+    xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0 http://maven.apache.org/xsd/assembly-1.1.0.xsd">
+    <id>generator</id>
+    <formats>
+        <format>zip</format>
+    </formats>
 
 
-       <!--  we want "system" and related files right at the root level
-                 as this file is suppose to be unzip on top of a karaf
-                 distro. -->
-       <includeBaseDirectory>false</includeBaseDirectory>
+    <!--  we want "system" and related files right at the root level
+          as this file is suppose to be unzip on top of a karaf
+          distro. -->
+    <includeBaseDirectory>false</includeBaseDirectory>
 
 
-       <fileSets>
-               <fileSet>
-                       <directory>target/assembly/</directory>
-                       <outputDirectory>.</outputDirectory>
-                       <excludes>
-                       </excludes>
-               </fileSet>
-       </fileSets>
+    <fileSets>
+        <fileSet>
+            <directory>target/assembly/</directory>
+            <outputDirectory>.</outputDirectory>
+            <excludes>
+            </excludes>
+        </fileSet>
+    </fileSets>
 
 </assembly>
 
 </assembly>
index d3d2ea6..0dad46d 100644 (file)
@@ -1,9 +1,11 @@
 ###
 # ============LICENSE_START=======================================================
 ###
 # ============LICENSE_START=======================================================
-# ONAP : APP-C
+# ONAP : APPC
 # ================================================================================
 # ================================================================================
-# Copyright (C) 2017 AT&T Intellectual Property.  All rights reserved.
+# Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
 # ================================================================================
 # ================================================================================
+# Copyright (C) 2017 Amdocs
+# =============================================================================
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
 # You may obtain a copy of the License at
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
 # You may obtain a copy of the License at
@@ -15,6 +17,8 @@
 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 # See the License for the specific language governing permissions and
 # limitations under the License.
 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 # See the License for the specific language governing permissions and
 # limitations under the License.
+# 
+# ECOMP is a trademark and service mark of AT&T Intellectual Property.
 # ============LICENSE_END=========================================================
 # ECOMP is a trademark and service mark of AT&T Intellectual Property.
 ###
 # ============LICENSE_END=========================================================
 # ECOMP is a trademark and service mark of AT&T Intellectual Property.
 ###
@@ -30,10 +34,10 @@ REPOZIP=${INSTALLERDIR}/${features.boot}-${project.version}.zip
 
 if [ -f ${REPOZIP} ]
 then
 
 if [ -f ${REPOZIP} ]
 then
-       unzip -n -d ${ODL_HOME} ${REPOZIP}
+    unzip -n -d ${ODL_HOME} ${REPOZIP}
 else
 else
-       echo "ERROR : repo zip ($REPOZIP) not found"
-       exit 1
+    echo "ERROR : repo zip ($REPOZIP) not found"
+    exit 1
 fi
 
 ${ODL_KARAF_CLIENT} ${ODL_KARAF_CLIENT_OPTS} feature:repo-add ${features.repositories}
 fi
 
 ${ODL_KARAF_CLIENT} ${ODL_KARAF_CLIENT_OPTS} feature:repo-add ${features.repositories}
index f2987d2..48858c0 100644 (file)
@@ -1,9 +1,11 @@
 /*-
  * ============LICENSE_START=======================================================
 /*-
  * ============LICENSE_START=======================================================
- * ONAP : APP-C
+ * ONAP : APPC
  * ================================================================================
  * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property.  All rights reserved.
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
  * ================================================================================
  * ================================================================================
+ * Copyright (C) 2017 Amdocs
+ * =============================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
+ * 
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
  * ============LICENSE_END=========================================================
  */
 
  * ============LICENSE_END=========================================================
  */
 
-package org.openecomp.sdnc.config.generator;
+package org.onap.sdnc.config.generator;
 
 import java.util.LinkedList;
 import java.util.List;
 
 import java.util.LinkedList;
 import java.util.List;
-
-import org.openecomp.sdnc.config.generator.convert.ConvertNode;
-import org.openecomp.sdnc.config.generator.merge.MergeNode;
-import org.openecomp.sdnc.config.generator.pattern.PatternNode;
-import org.openecomp.sdnc.config.generator.reader.ReaderNode;
-import org.openecomp.sdnc.config.generator.writer.FileWriterNode;
+import org.onap.sdnc.config.generator.convert.ConvertNode;
+import org.onap.sdnc.config.generator.merge.MergeNode;
+import org.onap.sdnc.config.generator.pattern.PatternNode;
+import org.onap.sdnc.config.generator.reader.ReaderNode;
+import org.onap.sdnc.config.generator.writer.FileWriterNode;
 import org.osgi.framework.BundleActivator;
 import org.osgi.framework.BundleContext;
 import org.osgi.framework.ServiceRegistration;
 import org.osgi.framework.BundleActivator;
 import org.osgi.framework.BundleContext;
 import org.osgi.framework.ServiceRegistration;
-
 import com.att.eelf.configuration.EELFLogger;
 import com.att.eelf.configuration.EELFManager;
 
 import com.att.eelf.configuration.EELFLogger;
 import com.att.eelf.configuration.EELFManager;
 
-public class ConfigGeneratorActivator implements BundleActivator{
+public class ConfigGeneratorActivator implements BundleActivator {
 
     private List<ServiceRegistration> registrations = new LinkedList<ServiceRegistration>();
 
 
 
     private List<ServiceRegistration> registrations = new LinkedList<ServiceRegistration>();
 
 
-    private static final EELFLogger log = EELFManager.getInstance().getLogger(ConfigGeneratorActivator.class);
+    private static final EELFLogger log =
+            EELFManager.getInstance().getLogger(ConfigGeneratorActivator.class);
 
     @Override
 
     @Override
-    public void start(BundleContext ctx) throws Exception
-    {
+    public void start(BundleContext ctx) throws Exception {
 
         ConvertNode convertNode = new ConvertNode();
 
         ConvertNode convertNode = new ConvertNode();
-        log.info("Registering service "+ convertNode.getClass().getName());
+        log.info("Registering service " + convertNode.getClass().getName());
         registrations.add(ctx.registerService(convertNode.getClass().getName(), convertNode, null));
         registrations.add(ctx.registerService(convertNode.getClass().getName(), convertNode, null));
-        log.info("Registering service sccessful for  "+ convertNode.getClass().getName());
+        log.info("Registering service sccessful for  " + convertNode.getClass().getName());
 
         MergeNode mergeNode = new MergeNode();
 
         MergeNode mergeNode = new MergeNode();
-        log.info("Registering service "+ mergeNode.getClass().getName());
+        log.info("Registering service " + mergeNode.getClass().getName());
         registrations.add(ctx.registerService(mergeNode.getClass().getName(), mergeNode, null));
         registrations.add(ctx.registerService(mergeNode.getClass().getName(), mergeNode, null));
-        log.info("Registering service sccessful for "+ mergeNode.getClass().getName());
+        log.info("Registering service sccessful for " + mergeNode.getClass().getName());
 
         PatternNode patternNode = new PatternNode();
 
         PatternNode patternNode = new PatternNode();
-        log.info("Registering service "+ patternNode.getClass().getName());
+        log.info("Registering service " + patternNode.getClass().getName());
         registrations.add(ctx.registerService(patternNode.getClass().getName(), patternNode, null));
         registrations.add(ctx.registerService(patternNode.getClass().getName(), patternNode, null));
-        log.info("Registering service sccessful for "+ patternNode.getClass().getName());
+        log.info("Registering service sccessful for " + patternNode.getClass().getName());
 
         ReaderNode readerNode = new ReaderNode();
 
         ReaderNode readerNode = new ReaderNode();
-        log.info("Registering service "+ readerNode.getClass().getName());
+        log.info("Registering service " + readerNode.getClass().getName());
         registrations.add(ctx.registerService(readerNode.getClass().getName(), readerNode, null));
         registrations.add(ctx.registerService(readerNode.getClass().getName(), readerNode, null));
-        log.info("Registering service sccessful for "+ readerNode.getClass().getName());
-        
+        log.info("Registering service sccessful for " + readerNode.getClass().getName());
+
         FileWriterNode writerNode = new FileWriterNode();
         FileWriterNode writerNode = new FileWriterNode();
-        log.info("Registering service "+ writerNode.getClass().getName());
+        log.info("Registering service " + writerNode.getClass().getName());
         registrations.add(ctx.registerService(writerNode.getClass().getName(), writerNode, null));
         registrations.add(ctx.registerService(writerNode.getClass().getName(), writerNode, null));
-        log.info("Registering service sccessful for "+ writerNode.getClass().getName());
+        log.info("Registering service sccessful for " + writerNode.getClass().getName());
 
     }
 
     }
+
     @Override
     @Override
-    public void stop(BundleContext arg0) throws Exception
-    {
-        for (ServiceRegistration registration: registrations)
-        {
+    public void stop(BundleContext arg0) throws Exception {
+        for (ServiceRegistration registration : registrations) {
             registration.unregister();
             registration = null;
         }
             registration.unregister();
             registration = null;
         }
index cdfc342..2ddd89a 100644 (file)
@@ -1,9 +1,11 @@
 /*-
  * ============LICENSE_START=======================================================
 /*-
  * ============LICENSE_START=======================================================
- * ONAP : APP-C
+ * ONAP : APPC
  * ================================================================================
  * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property.  All rights reserved.
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
  * ================================================================================
  * ================================================================================
+ * Copyright (C) 2017 Amdocs
+ * =============================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
+ * 
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
  * ============LICENSE_END=========================================================
  */
 
  * ============LICENSE_END=========================================================
  */
 
-package org.openecomp.sdnc.config.generator;
+package org.onap.sdnc.config.generator;
 
 public class ConfigGeneratorConstant {
 
 
 public class ConfigGeneratorConstant {
 
-    
+
     public static String STRING_ENCODING = "utf-8";
     public static String Y = "Y";
     public static String N = "N";
     public static String STRING_ENCODING = "utf-8";
     public static String Y = "Y";
     public static String N = "N";
@@ -61,7 +65,7 @@ public class ConfigGeneratorConstant {
 
     public static String OUTPUT_STATUS_SUCCESS = "success";
     public static String OUTPUT_STATUS_FAILURE = "failure";
 
     public static String OUTPUT_STATUS_SUCCESS = "success";
     public static String OUTPUT_STATUS_FAILURE = "failure";
-    
+
     public static final Object INPUT_PARAM_CONTEXT_KEY = "contextKey";
     public static final Object INPUT_PARAM_JSON_CONTENT = "jsonContent";
 
     public static final Object INPUT_PARAM_CONTEXT_KEY = "contextKey";
     public static final Object INPUT_PARAM_JSON_CONTENT = "jsonContent";
 
index f6a9043..ccc0d90 100644 (file)
@@ -1,9 +1,11 @@
 /*-
  * ============LICENSE_START=======================================================
 /*-
  * ============LICENSE_START=======================================================
- * ONAP : APP-C
+ * ONAP : APPC
  * ================================================================================
  * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property.  All rights reserved.
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
  * ================================================================================
  * ================================================================================
+ * Copyright (C) 2017 Amdocs
+ * =============================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
+ * 
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
  * ============LICENSE_END=========================================================
  */
 
  * ============LICENSE_END=========================================================
  */
 
-package org.openecomp.sdnc.config.generator.convert;
+package org.onap.sdnc.config.generator.convert;
 
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.List;
 import java.util.Map;
 import java.util.Set;
 
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.List;
 import java.util.Map;
 import java.util.Set;
-
 import org.apache.commons.lang.StringEscapeUtils;
 import org.apache.commons.lang3.StringUtils;
 import org.apache.commons.lang.StringEscapeUtils;
 import org.apache.commons.lang3.StringUtils;
-import org.openecomp.sdnc.config.generator.ConfigGeneratorConstant;
-import org.openecomp.sdnc.config.generator.tool.EscapeUtils;
-import org.openecomp.sdnc.config.generator.tool.JSONTool;
+import org.onap.ccsdk.sli.core.sli.SvcLogicContext;
+import org.onap.ccsdk.sli.core.sli.SvcLogicException;
 import org.onap.ccsdk.sli.core.sli.SvcLogicJavaPlugin;
 import org.onap.ccsdk.sli.core.sli.SvcLogicJavaPlugin;
-
+import org.onap.sdnc.config.generator.ConfigGeneratorConstant;
+import org.onap.sdnc.config.generator.tool.EscapeUtils;
+import org.onap.sdnc.config.generator.tool.JSONTool;
 import com.att.eelf.configuration.EELFLogger;
 import com.att.eelf.configuration.EELFManager;
 import com.fasterxml.jackson.databind.ObjectMapper;
 import com.fasterxml.jackson.databind.node.ObjectNode;
 
 import com.att.eelf.configuration.EELFLogger;
 import com.att.eelf.configuration.EELFManager;
 import com.fasterxml.jackson.databind.ObjectMapper;
 import com.fasterxml.jackson.databind.node.ObjectNode;
 
-import org.onap.ccsdk.sli.core.sli.SvcLogicContext;
-import org.onap.ccsdk.sli.core.sli.SvcLogicException;
-
 public class ConvertNode implements SvcLogicJavaPlugin {
 
 public class ConvertNode implements SvcLogicJavaPlugin {
 
-    private static final  EELFLogger log = EELFManager.getInstance().getLogger(ConvertNode.class);
+    private static final EELFLogger log = EELFManager.getInstance().getLogger(ConvertNode.class);
 
 
-    public void convertJson2DGContext( Map<String, String> inParams, SvcLogicContext ctx) throws SvcLogicException {
+    public void convertJson2DGContext(Map<String, String> inParams, SvcLogicContext ctx)
+            throws SvcLogicException {
         log.trace("Received convertJson2DGContext call with params : " + inParams);
         String responsePrefix = inParams.get(ConfigGeneratorConstant.INPUT_PARAM_RESPONSE_PRIFIX);
         try {
         log.trace("Received convertJson2DGContext call with params : " + inParams);
         String responsePrefix = inParams.get(ConfigGeneratorConstant.INPUT_PARAM_RESPONSE_PRIFIX);
         try {
-            String jsonData =  inParams.get(ConfigGeneratorConstant.INPUT_PARAM_JSON_DATA);
-            String isEscaped =  inParams.get(ConfigGeneratorConstant.INPUT_PARAM_IS_ESCAPED);
-            String blockKey =  inParams.get(ConfigGeneratorConstant.INPUT_PARAM_BLOCK_KEYS);
-            responsePrefix = StringUtils.isNotBlank(responsePrefix) ? (responsePrefix+".") : "";
+            String jsonData = inParams.get(ConfigGeneratorConstant.INPUT_PARAM_JSON_DATA);
+            String isEscaped = inParams.get(ConfigGeneratorConstant.INPUT_PARAM_IS_ESCAPED);
+            String blockKey = inParams.get(ConfigGeneratorConstant.INPUT_PARAM_BLOCK_KEYS);
+            responsePrefix = StringUtils.isNotBlank(responsePrefix) ? (responsePrefix + ".") : "";
 
 
-            if(StringUtils.isNotBlank(jsonData)){
-                if(StringUtils.isNotBlank(isEscaped) && isEscaped.equalsIgnoreCase("Y")){
+            if (StringUtils.isNotBlank(jsonData)) {
+                if (StringUtils.isNotBlank(isEscaped) && isEscaped.equalsIgnoreCase("Y")) {
                     jsonData = StringEscapeUtils.unescapeJavaScript(jsonData);
                 }
 
                 List<String> blockKeys = new ArrayList<String>();
                     jsonData = StringEscapeUtils.unescapeJavaScript(jsonData);
                 }
 
                 List<String> blockKeys = new ArrayList<String>();
-                if(blockKey != null){
+                if (blockKey != null) {
                     blockKeys = Arrays.asList(blockKey.split(","));
                 }
 
                 Map<String, String> dgContext = JSONTool.convertToProperties(jsonData, blockKeys);
                     blockKeys = Arrays.asList(blockKey.split(","));
                 }
 
                 Map<String, String> dgContext = JSONTool.convertToProperties(jsonData, blockKeys);
-                log.trace("DG Context Populated:"+dgContext);
+                log.trace("DG Context Populated:" + dgContext);
 
                 for (Map.Entry<String, String> entry : dgContext.entrySet()) {
 
                 for (Map.Entry<String, String> entry : dgContext.entrySet()) {
-                    if(entry != null && entry.getKey() != null){
+                    if (entry != null && entry.getKey() != null) {
                         ctx.setAttribute(entry.getKey(), entry.getValue());
                     }
                 }
             }
                         ctx.setAttribute(entry.getKey(), entry.getValue());
                     }
                 }
             }
-            ctx.setAttribute(responsePrefix + ConfigGeneratorConstant.OUTPUT_PARAM_STATUS, ConfigGeneratorConstant.OUTPUT_STATUS_SUCCESS);
+            ctx.setAttribute(responsePrefix + ConfigGeneratorConstant.OUTPUT_PARAM_STATUS,
+                    ConfigGeneratorConstant.OUTPUT_STATUS_SUCCESS);
 
         } catch (Exception e) {
 
         } catch (Exception e) {
-            ctx.setAttribute(responsePrefix + ConfigGeneratorConstant.OUTPUT_PARAM_STATUS, ConfigGeneratorConstant.OUTPUT_STATUS_FAILURE);
-            ctx.setAttribute(responsePrefix + ConfigGeneratorConstant.OUTPUT_PARAM_ERROR_MESSAGE,e.getMessage());
+            ctx.setAttribute(responsePrefix + ConfigGeneratorConstant.OUTPUT_PARAM_STATUS,
+                    ConfigGeneratorConstant.OUTPUT_STATUS_FAILURE);
+            ctx.setAttribute(responsePrefix + ConfigGeneratorConstant.OUTPUT_PARAM_ERROR_MESSAGE,
+                    e.getMessage());
             log.error("Failed in JSON to DGContext Conversion" + e.getMessage());
             throw new SvcLogicException(e.getMessage());
         }
     }
 
 
             log.error("Failed in JSON to DGContext Conversion" + e.getMessage());
             throw new SvcLogicException(e.getMessage());
         }
     }
 
 
-    public void escapeData( Map<String, String> inParams, SvcLogicContext ctx) throws SvcLogicException {
+    public void escapeData(Map<String, String> inParams, SvcLogicContext ctx)
+            throws SvcLogicException {
         log.trace("Received escapeData call with params : " + inParams);
         String responsePrefix = inParams.get(ConfigGeneratorConstant.INPUT_PARAM_RESPONSE_PRIFIX);
         try {
         log.trace("Received escapeData call with params : " + inParams);
         String responsePrefix = inParams.get(ConfigGeneratorConstant.INPUT_PARAM_RESPONSE_PRIFIX);
         try {
-            responsePrefix = StringUtils.isNotBlank(responsePrefix) ? (responsePrefix+".") : "";
-            String unEscapeData =  inParams.get(ConfigGeneratorConstant.INPUT_PARAM_UNESCAPE_DATA);
-            String dataType =  inParams.get(ConfigGeneratorConstant.INPUT_PARAM_DATA_TYPE);
+            responsePrefix = StringUtils.isNotBlank(responsePrefix) ? (responsePrefix + ".") : "";
+            String unEscapeData = inParams.get(ConfigGeneratorConstant.INPUT_PARAM_UNESCAPE_DATA);
+            String dataType = inParams.get(ConfigGeneratorConstant.INPUT_PARAM_DATA_TYPE);
 
 
-            if(StringUtils.isBlank(unEscapeData)){
-                throw new Exception("Unescape ("+ConfigGeneratorConstant.INPUT_PARAM_UNESCAPE_DATA +") param is missing for escapeData conversion." + unEscapeData);
+            if (StringUtils.isBlank(unEscapeData)) {
+                throw new Exception("Unescape (" + ConfigGeneratorConstant.INPUT_PARAM_UNESCAPE_DATA
+                        + ") param is missing for escapeData conversion." + unEscapeData);
             }
 
             }
 
-            if(StringUtils.isBlank(dataType)){
-                throw new Exception(" Datatype ("+ConfigGeneratorConstant.INPUT_PARAM_DATA_TYPE+")param is missing for escapeData conversion.");
+            if (StringUtils.isBlank(dataType)) {
+                throw new Exception(" Datatype (" + ConfigGeneratorConstant.INPUT_PARAM_DATA_TYPE
+                        + ")param is missing for escapeData conversion.");
             }
 
             String escapedData = null;
             }
 
             String escapedData = null;
-            if(ConfigGeneratorConstant.DATA_TYPE_JSON.equalsIgnoreCase(dataType)){
+            if (ConfigGeneratorConstant.DATA_TYPE_JSON.equalsIgnoreCase(dataType)) {
                 escapedData = StringEscapeUtils.escapeJavaScript(unEscapeData);
                 escapedData = StringEscapeUtils.escapeJavaScript(unEscapeData);
-            }else if(ConfigGeneratorConstant.DATA_TYPE_XML.equalsIgnoreCase(dataType)){
+            } else if (ConfigGeneratorConstant.DATA_TYPE_XML.equalsIgnoreCase(dataType)) {
                 escapedData = StringEscapeUtils.escapeXml(unEscapeData);
                 escapedData = StringEscapeUtils.escapeXml(unEscapeData);
-            }else if(ConfigGeneratorConstant.DATA_TYPE_SQL.equalsIgnoreCase(dataType)){
+            } else if (ConfigGeneratorConstant.DATA_TYPE_SQL.equalsIgnoreCase(dataType)) {
                 escapedData = EscapeUtils.escapeSql(unEscapeData);
                 escapedData = EscapeUtils.escapeSql(unEscapeData);
-            }else{
-                throw new Exception(" Datatype ("+ConfigGeneratorConstant.INPUT_PARAM_DATA_TYPE+") param  value ("+dataType+")is not supported  for escapeData conversion.");
+            } else {
+                throw new Exception(" Datatype (" + ConfigGeneratorConstant.INPUT_PARAM_DATA_TYPE
+                        + ") param  value (" + dataType
+                        + ")is not supported  for escapeData conversion.");
             }
             }
-            ctx.setAttribute(responsePrefix + ConfigGeneratorConstant.OUTPUT_PARAM_ESCAPE_DATA, escapedData);
-            ctx.setAttribute(responsePrefix + ConfigGeneratorConstant.OUTPUT_PARAM_STATUS, ConfigGeneratorConstant.OUTPUT_STATUS_SUCCESS);
+            ctx.setAttribute(responsePrefix + ConfigGeneratorConstant.OUTPUT_PARAM_ESCAPE_DATA,
+                    escapedData);
+            ctx.setAttribute(responsePrefix + ConfigGeneratorConstant.OUTPUT_PARAM_STATUS,
+                    ConfigGeneratorConstant.OUTPUT_STATUS_SUCCESS);
             log.trace("Data escapeData Successfully :" + ctx.getAttributeKeySet());
         } catch (Exception e) {
             log.trace("Data escapeData Successfully :" + ctx.getAttributeKeySet());
         } catch (Exception e) {
-            ctx.setAttribute(responsePrefix + ConfigGeneratorConstant.OUTPUT_PARAM_STATUS, ConfigGeneratorConstant.OUTPUT_STATUS_FAILURE);
-            ctx.setAttribute(responsePrefix + ConfigGeneratorConstant.OUTPUT_PARAM_ERROR_MESSAGE,e.getMessage());
+            ctx.setAttribute(responsePrefix + ConfigGeneratorConstant.OUTPUT_PARAM_STATUS,
+                    ConfigGeneratorConstant.OUTPUT_STATUS_FAILURE);
+            ctx.setAttribute(responsePrefix + ConfigGeneratorConstant.OUTPUT_PARAM_ERROR_MESSAGE,
+                    e.getMessage());
             log.error("Failed in escapeData Conversion" + e.getMessage());
             throw new SvcLogicException(e.getMessage());
         }
     }
 
             log.error("Failed in escapeData Conversion" + e.getMessage());
             throw new SvcLogicException(e.getMessage());
         }
     }
 
-    public void unEscapeData( Map<String, String> inParams, SvcLogicContext ctx) throws SvcLogicException {
+    public void unEscapeData(Map<String, String> inParams, SvcLogicContext ctx)
+            throws SvcLogicException {
         log.trace("Received unEscapeData call with params : " + inParams);
         String responsePrefix = inParams.get(ConfigGeneratorConstant.INPUT_PARAM_RESPONSE_PRIFIX);
         try {
         log.trace("Received unEscapeData call with params : " + inParams);
         String responsePrefix = inParams.get(ConfigGeneratorConstant.INPUT_PARAM_RESPONSE_PRIFIX);
         try {
-            responsePrefix = StringUtils.isNotBlank(responsePrefix) ? (responsePrefix+".") : "";
-            String escapeData =  inParams.get(ConfigGeneratorConstant.INPUT_PARAM_ESCAPE_DATA);
-            String dataType =  inParams.get(ConfigGeneratorConstant.INPUT_PARAM_DATA_TYPE);
+            responsePrefix = StringUtils.isNotBlank(responsePrefix) ? (responsePrefix + ".") : "";
+            String escapeData = inParams.get(ConfigGeneratorConstant.INPUT_PARAM_ESCAPE_DATA);
+            String dataType = inParams.get(ConfigGeneratorConstant.INPUT_PARAM_DATA_TYPE);
 
 
-            if(StringUtils.isBlank(escapeData)){
-                throw new Exception("Escape ("+ConfigGeneratorConstant.INPUT_PARAM_ESCAPE_DATA +") param is missing for escapeData conversion.");
+            if (StringUtils.isBlank(escapeData)) {
+                throw new Exception("Escape (" + ConfigGeneratorConstant.INPUT_PARAM_ESCAPE_DATA
+                        + ") param is missing for escapeData conversion.");
             }
 
             }
 
-            if(StringUtils.isBlank(dataType)){
-                throw new Exception(" Datatype ("+ConfigGeneratorConstant.INPUT_PARAM_DATA_TYPE+")param is missing for escapeData conversion.");
+            if (StringUtils.isBlank(dataType)) {
+                throw new Exception(" Datatype (" + ConfigGeneratorConstant.INPUT_PARAM_DATA_TYPE
+                        + ")param is missing for escapeData conversion.");
             }
 
             String unEscapedData = null;
             }
 
             String unEscapedData = null;
-            if(ConfigGeneratorConstant.DATA_TYPE_JSON.equalsIgnoreCase(dataType)){
+            if (ConfigGeneratorConstant.DATA_TYPE_JSON.equalsIgnoreCase(dataType)) {
                 unEscapedData = StringEscapeUtils.unescapeJavaScript(escapeData);
                 unEscapedData = StringEscapeUtils.unescapeJavaScript(escapeData);
-            }else if(ConfigGeneratorConstant.DATA_TYPE_XML.equalsIgnoreCase(dataType)){
+            } else if (ConfigGeneratorConstant.DATA_TYPE_XML.equalsIgnoreCase(dataType)) {
                 unEscapedData = StringEscapeUtils.unescapeXml(escapeData);
                 unEscapedData = StringEscapeUtils.unescapeXml(escapeData);
-            }else{
-                throw new Exception(" Datatype ("+ConfigGeneratorConstant.INPUT_PARAM_DATA_TYPE+") param  value ("+dataType+")is not supported  for unEscapeData conversion.");
+            } else {
+                throw new Exception(" Datatype (" + ConfigGeneratorConstant.INPUT_PARAM_DATA_TYPE
+                        + ") param  value (" + dataType
+                        + ")is not supported  for unEscapeData conversion.");
             }
             }
-            ctx.setAttribute(responsePrefix + ConfigGeneratorConstant.OUTPUT_PARAM_UNESCAPE_DATA, unEscapedData);
-            ctx.setAttribute(responsePrefix + ConfigGeneratorConstant.OUTPUT_PARAM_STATUS, ConfigGeneratorConstant.OUTPUT_STATUS_SUCCESS);
+            ctx.setAttribute(responsePrefix + ConfigGeneratorConstant.OUTPUT_PARAM_UNESCAPE_DATA,
+                    unEscapedData);
+            ctx.setAttribute(responsePrefix + ConfigGeneratorConstant.OUTPUT_PARAM_STATUS,
+                    ConfigGeneratorConstant.OUTPUT_STATUS_SUCCESS);
             log.trace("Converted unEscapeData Successfully :" + ctx.getAttributeKeySet());
         } catch (Exception e) {
             log.trace("Converted unEscapeData Successfully :" + ctx.getAttributeKeySet());
         } catch (Exception e) {
-            ctx.setAttribute(responsePrefix + ConfigGeneratorConstant.OUTPUT_PARAM_STATUS, ConfigGeneratorConstant.OUTPUT_STATUS_FAILURE);
-            ctx.setAttribute(responsePrefix + ConfigGeneratorConstant.OUTPUT_PARAM_ERROR_MESSAGE,e.getMessage());
+            ctx.setAttribute(responsePrefix + ConfigGeneratorConstant.OUTPUT_PARAM_STATUS,
+                    ConfigGeneratorConstant.OUTPUT_STATUS_FAILURE);
+            ctx.setAttribute(responsePrefix + ConfigGeneratorConstant.OUTPUT_PARAM_ERROR_MESSAGE,
+                    e.getMessage());
             log.error("Failed in unEscapeData Conversion" + e.getMessage());
             throw new SvcLogicException(e.getMessage());
         }
     }
             log.error("Failed in unEscapeData Conversion" + e.getMessage());
             throw new SvcLogicException(e.getMessage());
         }
     }
-    
-    
-     public void convertContextToJson(Map<String, String> inParams, SvcLogicContext ctx) throws SvcLogicException{
+
+
+    public void convertContextToJson(Map<String, String> inParams, SvcLogicContext ctx)
+            throws SvcLogicException {
         log.trace("Received convertContextToJson call with params : " + inParams);
         String responsePrefix = inParams.get(ConfigGeneratorConstant.INPUT_PARAM_RESPONSE_PRIFIX);
         String contextKey = inParams.get(ConfigGeneratorConstant.INPUT_PARAM_CONTEXT_KEY);
         try {
         log.trace("Received convertContextToJson call with params : " + inParams);
         String responsePrefix = inParams.get(ConfigGeneratorConstant.INPUT_PARAM_RESPONSE_PRIFIX);
         String contextKey = inParams.get(ConfigGeneratorConstant.INPUT_PARAM_CONTEXT_KEY);
         try {
-            responsePrefix = StringUtils.isNotBlank(responsePrefix) ? (responsePrefix+".") : "";
-            
+            responsePrefix = StringUtils.isNotBlank(responsePrefix) ? (responsePrefix + ".") : "";
+
             ObjectMapper mapper = new ObjectMapper();
             ObjectNode objectNode = mapper.createObjectNode();
             ObjectMapper mapper = new ObjectMapper();
             ObjectNode objectNode = mapper.createObjectNode();
-            
-            Set<String> keys = ctx.getAttributeKeySet();    
+
+            Set<String> keys = ctx.getAttributeKeySet();
             for (String key : keys) {
             for (String key : keys) {
-                if(key.startsWith(contextKey +".")){
-                     String objkey=  key.replaceFirst(contextKey + ".", "");
-                     objectNode.put(objkey, ctx.getAttribute(key));
-                     
-                }                
+                if (key.startsWith(contextKey + ".")) {
+                    String objkey = key.replaceFirst(contextKey + ".", "");
+                    objectNode.put(objkey, ctx.getAttribute(key));
+
+                }
             }
             }
-            ctx.setAttribute(responsePrefix + ConfigGeneratorConstant.INPUT_PARAM_JSON_CONTENT, objectNode.toString());
-            ctx.setAttribute(responsePrefix + ConfigGeneratorConstant.OUTPUT_PARAM_STATUS, ConfigGeneratorConstant.OUTPUT_STATUS_SUCCESS);
-            log.trace("convertContextToJson Successful" );
+            ctx.setAttribute(responsePrefix + ConfigGeneratorConstant.INPUT_PARAM_JSON_CONTENT,
+                    objectNode.toString());
+            ctx.setAttribute(responsePrefix + ConfigGeneratorConstant.OUTPUT_PARAM_STATUS,
+                    ConfigGeneratorConstant.OUTPUT_STATUS_SUCCESS);
+            log.trace("convertContextToJson Successful");
         } catch (Exception e) {
         } catch (Exception e) {
-            ctx.setAttribute(responsePrefix + ConfigGeneratorConstant.OUTPUT_PARAM_STATUS, ConfigGeneratorConstant.OUTPUT_STATUS_FAILURE);
-            ctx.setAttribute(responsePrefix + ConfigGeneratorConstant.OUTPUT_PARAM_ERROR_MESSAGE,e.getMessage());
+            ctx.setAttribute(responsePrefix + ConfigGeneratorConstant.OUTPUT_PARAM_STATUS,
+                    ConfigGeneratorConstant.OUTPUT_STATUS_FAILURE);
+            ctx.setAttribute(responsePrefix + ConfigGeneratorConstant.OUTPUT_PARAM_ERROR_MESSAGE,
+                    e.getMessage());
             log.error("Failed in convertContextToJson" + e.getMessage());
             throw new SvcLogicException(e.getMessage());
         }
             log.error("Failed in convertContextToJson" + e.getMessage());
             throw new SvcLogicException(e.getMessage());
         }
-     }
+    }
 
 }
 
 }
index 3369f75..48814ce 100644 (file)
@@ -1,12 +1,13 @@
-
 /*-
  * ============LICENSE_START=======================================================
 /*-
  * ============LICENSE_START=======================================================
- * ONAP : APP-C
+ * ONAP : APPC
  * ================================================================================
  * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property.  All rights reserved.
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
  * ================================================================================
  * ================================================================================
+ * Copyright (C) 2017 Amdocs
+ * =============================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * Licensed under the Apache License, Version 2.0 (the "License");
-i * you may not use this file except in compliance with the License.
+ * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  * 
  *      http://www.apache.org/licenses/LICENSE-2.0
  * You may obtain a copy of the License at
  * 
  *      http://www.apache.org/licenses/LICENSE-2.0
@@ -16,116 +17,135 @@ i * you may not use this file except in compliance with the License.
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
+ * 
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
  * ============LICENSE_END=========================================================
  */
 
  * ============LICENSE_END=========================================================
  */
 
-package org.openecomp.sdnc.config.generator.merge;
+package org.onap.sdnc.config.generator.merge;
 
 import java.nio.charset.Charset;
 import java.util.Map;
 
 import java.nio.charset.Charset;
 import java.util.Map;
-
 import org.apache.commons.io.IOUtils;
 import org.apache.commons.lang3.StringUtils;
 import org.apache.commons.io.IOUtils;
 import org.apache.commons.lang3.StringUtils;
-import org.openecomp.sdnc.config.generator.ConfigGeneratorConstant;
-import org.openecomp.sdnc.config.generator.tool.JSONTool;
-import org.openecomp.sdnc.config.generator.tool.MergeTool;
-import org.openecomp.sdnc.config.generator.tool.EscapeUtils;
-
-import com.att.eelf.configuration.EELFLogger;
-import com.att.eelf.configuration.EELFManager;
 import org.onap.ccsdk.sli.core.sli.SvcLogicContext;
 import org.onap.ccsdk.sli.core.sli.SvcLogicException;
 import org.onap.ccsdk.sli.core.sli.SvcLogicJavaPlugin;
 import org.onap.ccsdk.sli.core.sli.SvcLogicContext;
 import org.onap.ccsdk.sli.core.sli.SvcLogicException;
 import org.onap.ccsdk.sli.core.sli.SvcLogicJavaPlugin;
+import org.onap.sdnc.config.generator.ConfigGeneratorConstant;
+import org.onap.sdnc.config.generator.tool.EscapeUtils;
+import org.onap.sdnc.config.generator.tool.JSONTool;
+import org.onap.sdnc.config.generator.tool.MergeTool;
+import com.att.eelf.configuration.EELFLogger;
+import com.att.eelf.configuration.EELFManager;
 
 public class MergeNode implements SvcLogicJavaPlugin {
 
 
 public class MergeNode implements SvcLogicJavaPlugin {
 
-    private static final  EELFLogger log = EELFManager.getInstance().getLogger(MergeNode.class);
+    private static final EELFLogger log = EELFManager.getInstance().getLogger(MergeNode.class);
 
 
-    public void mergeDataOnTemplate(Map<String, String> inParams, SvcLogicContext ctx) throws SvcLogicException {
+    public void mergeDataOnTemplate(Map<String, String> inParams, SvcLogicContext ctx)
+            throws SvcLogicException {
 
     }
 
 
     }
 
-    public void mergeJsonDataOnTemplate(Map<String, String> inParams, SvcLogicContext ctx) throws SvcLogicException {
+    public void mergeJsonDataOnTemplate(Map<String, String> inParams, SvcLogicContext ctx)
+            throws SvcLogicException {
         log.info("Received mergeJsonDataOnTemplate call with params : " + inParams);
         String responsePrefix = inParams.get(ConfigGeneratorConstant.INPUT_PARAM_RESPONSE_PRIFIX);
         log.info("Received mergeJsonDataOnTemplate call with params : " + inParams);
         String responsePrefix = inParams.get(ConfigGeneratorConstant.INPUT_PARAM_RESPONSE_PRIFIX);
-        try{
-            responsePrefix = StringUtils.isNotBlank(responsePrefix) ? (responsePrefix+".") : "";
-            String jsonData =  inParams.get(ConfigGeneratorConstant.INPUT_PARAM_JSON_DATA);
-            if(StringUtils.isBlank(jsonData)){
+        try {
+            responsePrefix = StringUtils.isNotBlank(responsePrefix) ? (responsePrefix + ".") : "";
+            String jsonData = inParams.get(ConfigGeneratorConstant.INPUT_PARAM_JSON_DATA);
+            if (StringUtils.isBlank(jsonData)) {
                 throw new Exception("JSON Data is missing");
             }
 
                 throw new Exception("JSON Data is missing");
             }
 
-            String templateData =  inParams.get(ConfigGeneratorConstant.INPUT_PARAM_TEMPLATE_DATA);
-            String templateFile =  inParams.get(ConfigGeneratorConstant.INPUT_PARAM_TEMPLATE_FILE);
+            String templateData = inParams.get(ConfigGeneratorConstant.INPUT_PARAM_TEMPLATE_DATA);
+            String templateFile = inParams.get(ConfigGeneratorConstant.INPUT_PARAM_TEMPLATE_FILE);
 
 
-            if(StringUtils.isBlank(templateData) && StringUtils.isBlank(templateFile)){
+            if (StringUtils.isBlank(templateData) && StringUtils.isBlank(templateFile)) {
                 throw new Exception("Template data or Template file is missing");
             }
                 throw new Exception("Template data or Template file is missing");
             }
-            if(StringUtils.isBlank(templateData)){
+            if (StringUtils.isBlank(templateData)) {
                 String path = MergeNode.class.getClassLoader().getResource(".").toString();
                 String path = MergeNode.class.getClassLoader().getResource(".").toString();
-                templateData = IOUtils.toString(MergeNode.class.getClassLoader().getResourceAsStream(templateFile));
+                templateData = IOUtils.toString(
+                        MergeNode.class.getClassLoader().getResourceAsStream(templateFile));
             }
 
             }
 
-            String templateType =  inParams.get(ConfigGeneratorConstant.INPUT_PARAM_TEMPLATE_TYPE);
+            String templateType = inParams.get(ConfigGeneratorConstant.INPUT_PARAM_TEMPLATE_TYPE);
 
 
-            Map<String, String> dataMap  = JSONTool.convertToProperties(jsonData);
+            Map<String, String> dataMap = JSONTool.convertToProperties(jsonData);
             log.info("Data Maps created :" + dataMap);
             log.info("Data Maps created :" + dataMap);
-            if(dataMap != null){
+            if (dataMap != null) {
                 String mergedData = MergeTool.mergeMap2TemplateData(templateData, dataMap);
                 String mergedData = MergeTool.mergeMap2TemplateData(templateData, dataMap);
-                if(mergedData != null){
-                   // ctx.setAttribute(responsePrefix + ConfigGeneratorConstant.OUTPUT_PARAM_MERGED_DATA,mergedData);
-                  ctx.setAttribute(responsePrefix + ConfigGeneratorConstant.OUTPUT_PARAM_MERGED_DATA,EscapeUtils.unescapeSql(mergedData));
-                       
+                if (mergedData != null) {
+                    // Changed for E2E defect 266908 Quote issue
+                    // ctx.setAttribute(responsePrefix +
+                    // ConfigGeneratorConstant.OUTPUT_PARAM_MERGED_DATA,mergedData);
+                    ctx.setAttribute(
+                            responsePrefix + ConfigGeneratorConstant.OUTPUT_PARAM_MERGED_DATA,
+                            EscapeUtils.unescapeSql(mergedData));
                 }
             }
                 }
             }
-            ctx.setAttribute(responsePrefix + ConfigGeneratorConstant.OUTPUT_PARAM_STATUS, ConfigGeneratorConstant.OUTPUT_STATUS_SUCCESS);
+            ctx.setAttribute(responsePrefix + ConfigGeneratorConstant.OUTPUT_PARAM_STATUS,
+                    ConfigGeneratorConstant.OUTPUT_STATUS_SUCCESS);
             log.info("Data Merge Successful :" + ctx);
         } catch (Exception e) {
             log.info("Data Merge Successful :" + ctx);
         } catch (Exception e) {
-            ctx.setAttribute(responsePrefix + ConfigGeneratorConstant.OUTPUT_PARAM_STATUS, ConfigGeneratorConstant.OUTPUT_STATUS_FAILURE);
-            ctx.setAttribute(responsePrefix + ConfigGeneratorConstant.OUTPUT_PARAM_ERROR_MESSAGE,e.getMessage());
+            ctx.setAttribute(responsePrefix + ConfigGeneratorConstant.OUTPUT_PARAM_STATUS,
+                    ConfigGeneratorConstant.OUTPUT_STATUS_FAILURE);
+            ctx.setAttribute(responsePrefix + ConfigGeneratorConstant.OUTPUT_PARAM_ERROR_MESSAGE,
+                    e.getMessage());
             log.error("Failed in merging data to template " + e.getMessage());
             throw new SvcLogicException(e.getMessage());
         }
     }
             log.error("Failed in merging data to template " + e.getMessage());
             throw new SvcLogicException(e.getMessage());
         }
     }
-    
-    public void mergeComplexJsonDataOnTemplate(Map<String, String> inParams, SvcLogicContext ctx) throws SvcLogicException {
-        //log.info("Received mergeJsonComplexDataOnTemplate call with params : " + inParams);
+
+    public void mergeComplexJsonDataOnTemplate(Map<String, String> inParams, SvcLogicContext ctx)
+            throws SvcLogicException {
+        // log.info("Received mergeJsonComplexDataOnTemplate call with params : " + inParams);
         String responsePrefix = inParams.get(ConfigGeneratorConstant.INPUT_PARAM_RESPONSE_PRIFIX);
         String responsePrefix = inParams.get(ConfigGeneratorConstant.INPUT_PARAM_RESPONSE_PRIFIX);
-        try{
-            responsePrefix = StringUtils.isNotBlank(responsePrefix) ? (responsePrefix+".") : "";
-            String jsonData =  inParams.get(ConfigGeneratorConstant.INPUT_PARAM_JSON_DATA);
-            if(StringUtils.isBlank(jsonData)){
+        try {
+            responsePrefix = StringUtils.isNotBlank(responsePrefix) ? (responsePrefix + ".") : "";
+            String jsonData = inParams.get(ConfigGeneratorConstant.INPUT_PARAM_JSON_DATA);
+            if (StringUtils.isBlank(jsonData)) {
                 throw new Exception("JSON Data is missing");
             }
 
                 throw new Exception("JSON Data is missing");
             }
 
-            String templateData =  inParams.get(ConfigGeneratorConstant.INPUT_PARAM_TEMPLATE_DATA);
-            String templateFile =  inParams.get(ConfigGeneratorConstant.INPUT_PARAM_TEMPLATE_FILE);
+            String templateData = inParams.get(ConfigGeneratorConstant.INPUT_PARAM_TEMPLATE_DATA);
+            String templateFile = inParams.get(ConfigGeneratorConstant.INPUT_PARAM_TEMPLATE_FILE);
 
 
-            if(StringUtils.isBlank(templateData) && StringUtils.isBlank(templateFile)){
+            if (StringUtils.isBlank(templateData) && StringUtils.isBlank(templateFile)) {
                 throw new Exception("Template data or Template file is missing");
             }
                 throw new Exception("Template data or Template file is missing");
             }
-            if(StringUtils.isBlank(templateData)){
-                //String path = MergeNode.class.getClassLoader().getResource(".").toString();
-                templateData = IOUtils.toString(MergeNode.class.getClassLoader().getResourceAsStream(templateFile), Charset.defaultCharset());
+            if (StringUtils.isBlank(templateData)) {
+                // String path = MergeNode.class.getClassLoader().getResource(".").toString();
+                templateData = IOUtils.toString(
+                        MergeNode.class.getClassLoader().getResourceAsStream(templateFile),
+                        Charset.defaultCharset());
             }
 
             }
 
-            String templateType =  inParams.get(ConfigGeneratorConstant.INPUT_PARAM_TEMPLATE_TYPE);
-            String doPrettyOutput =  inParams.get(ConfigGeneratorConstant.INPUT_PARAM_DO_PRETTY_OUTPUT);
-            
-            String mergedData = MergeTool.mergeJson2TemplateData(templateData, jsonData, templateType, doPrettyOutput);
-            ctx.setAttribute(responsePrefix + ConfigGeneratorConstant.OUTPUT_PARAM_MERGED_DATA,mergedData);
-            
-            ctx.setAttribute(responsePrefix + ConfigGeneratorConstant.OUTPUT_PARAM_STATUS, ConfigGeneratorConstant.OUTPUT_STATUS_SUCCESS);
-            //log.info("Data Merge Successful :" + ctx);
+            String templateType = inParams.get(ConfigGeneratorConstant.INPUT_PARAM_TEMPLATE_TYPE);
+            String doPrettyOutput =
+                    inParams.get(ConfigGeneratorConstant.INPUT_PARAM_DO_PRETTY_OUTPUT);
+
+            String mergedData = MergeTool.mergeJson2TemplateData(templateData, jsonData,
+                    templateType, doPrettyOutput);
+            ctx.setAttribute(responsePrefix + ConfigGeneratorConstant.OUTPUT_PARAM_MERGED_DATA,
+                    mergedData);
+
+            ctx.setAttribute(responsePrefix + ConfigGeneratorConstant.OUTPUT_PARAM_STATUS,
+                    ConfigGeneratorConstant.OUTPUT_STATUS_SUCCESS);
+            // log.info("Data Merge Successful :" + ctx);
         } catch (Exception e) {
         } catch (Exception e) {
-            ctx.setAttribute(responsePrefix + ConfigGeneratorConstant.OUTPUT_PARAM_STATUS, ConfigGeneratorConstant.OUTPUT_STATUS_FAILURE);
-            ctx.setAttribute(responsePrefix + ConfigGeneratorConstant.OUTPUT_PARAM_ERROR_MESSAGE,e.getMessage());
+            ctx.setAttribute(responsePrefix + ConfigGeneratorConstant.OUTPUT_PARAM_STATUS,
+                    ConfigGeneratorConstant.OUTPUT_STATUS_FAILURE);
+            ctx.setAttribute(responsePrefix + ConfigGeneratorConstant.OUTPUT_PARAM_ERROR_MESSAGE,
+                    e.getMessage());
             log.error("Failed in merging data to template " + e.getMessage());
             throw new SvcLogicException(e.getMessage());
         }
     }
 
             log.error("Failed in merging data to template " + e.getMessage());
             throw new SvcLogicException(e.getMessage());
         }
     }
 
-    public void mergeYamlDataOnTemplate(Map<String, String> inParams, SvcLogicContext ctx) throws SvcLogicException {
+    public void mergeYamlDataOnTemplate(Map<String, String> inParams, SvcLogicContext ctx)
+            throws SvcLogicException {
 
     }
 
 
     }
 
index 67a5d2c..4333cfd 100644 (file)
@@ -1,9 +1,11 @@
 /*-
  * ============LICENSE_START=======================================================
 /*-
  * ============LICENSE_START=======================================================
- * ONAP : APP-C
+ * ONAP : APPC
  * ================================================================================
  * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property.  All rights reserved.
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
  * ================================================================================
  * ================================================================================
+ * Copyright (C) 2017 Amdocs
+ * =============================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
+ * 
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
  * ============LICENSE_END=========================================================
  */
 
  * ============LICENSE_END=========================================================
  */
 
-package org.openecomp.sdnc.config.generator.pattern;
+package org.onap.sdnc.config.generator.pattern;
 
 import java.util.Map;
 
 import java.util.Map;
-
 import org.apache.commons.lang3.StringUtils;
 import org.apache.commons.lang3.StringUtils;
-import org.openecomp.sdnc.config.generator.ConfigGeneratorConstant;
-import org.openecomp.sdnc.config.generator.tool.CheckDataTool;
-import org.openecomp.sdnc.config.generator.tool.LogParserTool;
-
-import com.att.eelf.configuration.EELFLogger;
-import com.att.eelf.configuration.EELFManager;
 import org.onap.ccsdk.sli.core.sli.SvcLogicContext;
 import org.onap.ccsdk.sli.core.sli.SvcLogicException;
 import org.onap.ccsdk.sli.core.sli.SvcLogicJavaPlugin;
 import org.onap.ccsdk.sli.core.sli.SvcLogicContext;
 import org.onap.ccsdk.sli.core.sli.SvcLogicException;
 import org.onap.ccsdk.sli.core.sli.SvcLogicJavaPlugin;
+import org.onap.sdnc.config.generator.ConfigGeneratorConstant;
+import org.onap.sdnc.config.generator.tool.CheckDataTool;
+import org.onap.sdnc.config.generator.tool.LogParserTool;
+import com.att.eelf.configuration.EELFLogger;
+import com.att.eelf.configuration.EELFManager;
 
 public class PatternNode implements SvcLogicJavaPlugin {
 
 
 public class PatternNode implements SvcLogicJavaPlugin {
 
-    private static final  EELFLogger log = EELFManager.getInstance().getLogger(PatternNode.class);
+    private static final EELFLogger log = EELFManager.getInstance().getLogger(PatternNode.class);
 
 
-    public void parseErrorLog(Map<String, String> inParams, SvcLogicContext ctx) throws SvcLogicException {
+    public void parseErrorLog(Map<String, String> inParams, SvcLogicContext ctx)
+            throws SvcLogicException {
         log.info("Received parseErroLog call with params : " + inParams);
         String responsePrefix = inParams.get(ConfigGeneratorConstant.INPUT_PARAM_RESPONSE_PRIFIX);
         log.info("Received parseErroLog call with params : " + inParams);
         String responsePrefix = inParams.get(ConfigGeneratorConstant.INPUT_PARAM_RESPONSE_PRIFIX);
-        try{
-            responsePrefix = StringUtils.isNotBlank(responsePrefix) ? (responsePrefix+".") : "";
-            String logData =  inParams.get(ConfigGeneratorConstant.INPUT_PARAM_LOG_DATA);
-            if(StringUtils.isBlank(logData)){
+        try {
+            responsePrefix = StringUtils.isNotBlank(responsePrefix) ? (responsePrefix + ".") : "";
+            String logData = inParams.get(ConfigGeneratorConstant.INPUT_PARAM_LOG_DATA);
+            if (StringUtils.isBlank(logData)) {
                 throw new Exception("Log Data is missing");
             }
                 throw new Exception("Log Data is missing");
             }
-            LogParserTool logParserTool = new  LogParserTool();
+            LogParserTool logParserTool = new LogParserTool();
             String parsedError = logParserTool.parseErrorLog(logData);
             String parsedError = logParserTool.parseErrorLog(logData);
-            ctx.setAttribute(responsePrefix + ConfigGeneratorConstant.OUTPUT_PARAM_PARSED_ERROR, parsedError);
-            ctx.setAttribute(responsePrefix + ConfigGeneratorConstant.OUTPUT_PARAM_STATUS, ConfigGeneratorConstant.OUTPUT_STATUS_SUCCESS);
+            ctx.setAttribute(responsePrefix + ConfigGeneratorConstant.OUTPUT_PARAM_PARSED_ERROR,
+                    parsedError);
+            ctx.setAttribute(responsePrefix + ConfigGeneratorConstant.OUTPUT_PARAM_STATUS,
+                    ConfigGeneratorConstant.OUTPUT_STATUS_SUCCESS);
         } catch (Exception e) {
         } catch (Exception e) {
-            ctx.setAttribute(responsePrefix + ConfigGeneratorConstant.OUTPUT_PARAM_STATUS, ConfigGeneratorConstant.OUTPUT_STATUS_FAILURE);
-            ctx.setAttribute(responsePrefix + ConfigGeneratorConstant.OUTPUT_PARAM_ERROR_MESSAGE,e.getMessage());
+            ctx.setAttribute(responsePrefix + ConfigGeneratorConstant.OUTPUT_PARAM_STATUS,
+                    ConfigGeneratorConstant.OUTPUT_STATUS_FAILURE);
+            ctx.setAttribute(responsePrefix + ConfigGeneratorConstant.OUTPUT_PARAM_ERROR_MESSAGE,
+                    e.getMessage());
             log.error("Failed in parsing error log " + e.getMessage());
             throw new SvcLogicException(e.getMessage());
         }
     }
 
             log.error("Failed in parsing error log " + e.getMessage());
             throw new SvcLogicException(e.getMessage());
         }
     }
 
-    public void checkDataType(Map<String, String> inParams, SvcLogicContext ctx) throws SvcLogicException {
+    public void checkDataType(Map<String, String> inParams, SvcLogicContext ctx)
+            throws SvcLogicException {
         log.info("Received checkDataType call with params : " + inParams);
         String responsePrefix = inParams.get(ConfigGeneratorConstant.INPUT_PARAM_RESPONSE_PRIFIX);
         log.info("Received checkDataType call with params : " + inParams);
         String responsePrefix = inParams.get(ConfigGeneratorConstant.INPUT_PARAM_RESPONSE_PRIFIX);
-        try{
-            responsePrefix = StringUtils.isNotBlank(responsePrefix) ? (responsePrefix+".") : "";
-            String checkData =  inParams.get(ConfigGeneratorConstant.INPUT_PARAM_CHECK_DATA);
-            if(StringUtils.isBlank(checkData)){
+        try {
+            responsePrefix = StringUtils.isNotBlank(responsePrefix) ? (responsePrefix + ".") : "";
+            String checkData = inParams.get(ConfigGeneratorConstant.INPUT_PARAM_CHECK_DATA);
+            if (StringUtils.isBlank(checkData)) {
                 throw new Exception("Check Data is missing");
             }
             String dataType = CheckDataTool.checkData(checkData);
                 throw new Exception("Check Data is missing");
             }
             String dataType = CheckDataTool.checkData(checkData);
-            ctx.setAttribute(responsePrefix + ConfigGeneratorConstant.OUTPUT_PARAM_DATA_TYPE, dataType);
-            ctx.setAttribute(responsePrefix + ConfigGeneratorConstant.OUTPUT_PARAM_STATUS, ConfigGeneratorConstant.OUTPUT_STATUS_SUCCESS);
+            ctx.setAttribute(responsePrefix + ConfigGeneratorConstant.OUTPUT_PARAM_DATA_TYPE,
+                    dataType);
+            ctx.setAttribute(responsePrefix + ConfigGeneratorConstant.OUTPUT_PARAM_STATUS,
+                    ConfigGeneratorConstant.OUTPUT_STATUS_SUCCESS);
         } catch (Exception e) {
         } catch (Exception e) {
-            ctx.setAttribute(responsePrefix + ConfigGeneratorConstant.OUTPUT_PARAM_STATUS, ConfigGeneratorConstant.OUTPUT_STATUS_FAILURE);
-            ctx.setAttribute(responsePrefix + ConfigGeneratorConstant.OUTPUT_PARAM_ERROR_MESSAGE,e.getMessage());
+            ctx.setAttribute(responsePrefix + ConfigGeneratorConstant.OUTPUT_PARAM_STATUS,
+                    ConfigGeneratorConstant.OUTPUT_STATUS_FAILURE);
+            ctx.setAttribute(responsePrefix + ConfigGeneratorConstant.OUTPUT_PARAM_ERROR_MESSAGE,
+                    e.getMessage());
             log.error("Failed in checkDataType " + e.getMessage());
             throw new SvcLogicException(e.getMessage());
         }
             log.error("Failed in checkDataType " + e.getMessage());
             throw new SvcLogicException(e.getMessage());
         }
index 379b7c7..501df63 100644 (file)
@@ -1,9 +1,11 @@
 /*-
  * ============LICENSE_START=======================================================
 /*-
  * ============LICENSE_START=======================================================
- * ONAP : APP-C
+ * ONAP : APPC
  * ================================================================================
  * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property.  All rights reserved.
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
  * ================================================================================
  * ================================================================================
+ * Copyright (C) 2017 Amdocs
+ * =============================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
+ * 
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
  * ============LICENSE_END=========================================================
  */
 
  * ============LICENSE_END=========================================================
  */
 
-package org.openecomp.sdnc.config.generator.reader;
+package org.onap.sdnc.config.generator.reader;
 
 import java.io.File;
 import java.util.Map;
 
 import java.io.File;
 import java.util.Map;
-
 import org.apache.commons.io.FileUtils;
 import org.apache.commons.lang3.StringUtils;
 import org.apache.commons.io.FileUtils;
 import org.apache.commons.lang3.StringUtils;
-import org.openecomp.sdnc.config.generator.ConfigGeneratorConstant;
-import org.openecomp.sdnc.config.generator.merge.MergeNode;
-
-import com.att.eelf.configuration.EELFLogger;
-import com.att.eelf.configuration.EELFManager;
 import org.onap.ccsdk.sli.core.sli.SvcLogicContext;
 import org.onap.ccsdk.sli.core.sli.SvcLogicException;
 import org.onap.ccsdk.sli.core.sli.SvcLogicJavaPlugin;
 import org.onap.ccsdk.sli.core.sli.SvcLogicContext;
 import org.onap.ccsdk.sli.core.sli.SvcLogicException;
 import org.onap.ccsdk.sli.core.sli.SvcLogicJavaPlugin;
+import org.onap.sdnc.config.generator.ConfigGeneratorConstant;
+import org.onap.sdnc.config.generator.merge.MergeNode;
+import com.att.eelf.configuration.EELFLogger;
+import com.att.eelf.configuration.EELFManager;
 
 public class ReaderNode implements SvcLogicJavaPlugin {
 
 
 public class ReaderNode implements SvcLogicJavaPlugin {
 
-    private static final  EELFLogger log = EELFManager.getInstance().getLogger(MergeNode.class);
-    
-    
-    public void getFileData(Map<String, String> inParams, SvcLogicContext ctx) throws SvcLogicException {
+    private static final EELFLogger log = EELFManager.getInstance().getLogger(MergeNode.class);
+
+
+    public void getFileData(Map<String, String> inParams, SvcLogicContext ctx)
+            throws SvcLogicException {
         log.info("Received getFileData call with params : " + inParams);
         String responsePrefix = inParams.get(ConfigGeneratorConstant.INPUT_PARAM_RESPONSE_PRIFIX);
         log.info("Received getFileData call with params : " + inParams);
         String responsePrefix = inParams.get(ConfigGeneratorConstant.INPUT_PARAM_RESPONSE_PRIFIX);
-        try{
-            responsePrefix = StringUtils.isNotBlank(responsePrefix) ? (responsePrefix+".") : "";
-            String fileName =  inParams.get(ConfigGeneratorConstant.INPUT_PARAM_FILE_NAME);
-            
-            String fileData = FileUtils.readFileToString(new File(fileName), ConfigGeneratorConstant.STRING_ENCODING);
-
-            ctx.setAttribute(responsePrefix + ConfigGeneratorConstant.OUTPUT_PARAM_FILE_DATA,fileData);            
-            ctx.setAttribute(responsePrefix + ConfigGeneratorConstant.OUTPUT_PARAM_STATUS, ConfigGeneratorConstant.OUTPUT_STATUS_SUCCESS);
+        try {
+            responsePrefix = StringUtils.isNotBlank(responsePrefix) ? (responsePrefix + ".") : "";
+            String fileName = inParams.get(ConfigGeneratorConstant.INPUT_PARAM_FILE_NAME);
+
+            String fileData = FileUtils.readFileToString(new File(fileName),
+                    ConfigGeneratorConstant.STRING_ENCODING);
+
+            ctx.setAttribute(responsePrefix + ConfigGeneratorConstant.OUTPUT_PARAM_FILE_DATA,
+                    fileData);
+            ctx.setAttribute(responsePrefix + ConfigGeneratorConstant.OUTPUT_PARAM_STATUS,
+                    ConfigGeneratorConstant.OUTPUT_STATUS_SUCCESS);
         } catch (Exception e) {
         } catch (Exception e) {
-            ctx.setAttribute(responsePrefix + ConfigGeneratorConstant.OUTPUT_PARAM_STATUS, ConfigGeneratorConstant.OUTPUT_STATUS_FAILURE);
-            ctx.setAttribute(responsePrefix + ConfigGeneratorConstant.OUTPUT_PARAM_ERROR_MESSAGE,e.getMessage());
+            ctx.setAttribute(responsePrefix + ConfigGeneratorConstant.OUTPUT_PARAM_STATUS,
+                    ConfigGeneratorConstant.OUTPUT_STATUS_FAILURE);
+            ctx.setAttribute(responsePrefix + ConfigGeneratorConstant.OUTPUT_PARAM_ERROR_MESSAGE,
+                    e.getMessage());
             log.error("Failed in merging data to template " + e.getMessage());
             throw new SvcLogicException(e.getMessage());
         }
     }
 
             log.error("Failed in merging data to template " + e.getMessage());
             throw new SvcLogicException(e.getMessage());
         }
     }
 
-    
+
 }
 }
index 316e821..4488e0b 100644 (file)
@@ -1,9 +1,11 @@
 /*-
  * ============LICENSE_START=======================================================
 /*-
  * ============LICENSE_START=======================================================
- * ONAP : APP-C
+ * ONAP : APPC
  * ================================================================================
  * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property.  All rights reserved.
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
  * ================================================================================
  * ================================================================================
+ * Copyright (C) 2017 Amdocs
+ * =============================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
+ * 
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
  * ============LICENSE_END=========================================================
  */
 
  * ============LICENSE_END=========================================================
  */
 
-package org.openecomp.sdnc.config.generator.tool;
+package org.onap.sdnc.config.generator.tool;
 
 import java.io.StringReader;
 
 import java.io.StringReader;
-
 import javax.xml.parsers.DocumentBuilder;
 import javax.xml.parsers.DocumentBuilderFactory;
 import javax.xml.parsers.DocumentBuilder;
 import javax.xml.parsers.DocumentBuilderFactory;
-
 import org.codehaus.jettison.json.JSONArray;
 import org.codehaus.jettison.json.JSONException;
 import org.codehaus.jettison.json.JSONObject;
 import org.codehaus.jettison.json.JSONArray;
 import org.codehaus.jettison.json.JSONException;
 import org.codehaus.jettison.json.JSONObject;
-import org.openecomp.sdnc.config.generator.ConfigGeneratorConstant;
+import org.onap.sdnc.config.generator.ConfigGeneratorConstant;
 import org.w3c.dom.Document;
 import org.xml.sax.InputSource;
 
 public class CheckDataTool {
 
 import org.w3c.dom.Document;
 import org.xml.sax.InputSource;
 
 public class CheckDataTool {
 
-    public static String checkData(String data){
+    public static String checkData(String data) {
         boolean isJSON = isJSON(data);
         boolean isJSON = isJSON(data);
-        if(isJSON){
+        if (isJSON) {
             return ConfigGeneratorConstant.DATA_TYPE_JSON;
         }
 
         boolean isXML = isXML(data);
             return ConfigGeneratorConstant.DATA_TYPE_JSON;
         }
 
         boolean isXML = isXML(data);
-        if(isXML){
+        if (isXML) {
             return ConfigGeneratorConstant.DATA_TYPE_XML;
         }
 
             return ConfigGeneratorConstant.DATA_TYPE_XML;
         }
 
@@ -60,13 +62,13 @@ public class CheckDataTool {
         }
         return true;
 
         }
         return true;
 
-        //        try {
-        //            final ObjectMapper mapper = new ObjectMapper();
-        //            mapper.readTree(data);
-        //            return true;
-        //         } catch (IOException e) {
-        //            return false;
-        //         }
+        // try {
+        // final ObjectMapper mapper = new ObjectMapper();
+        // mapper.readTree(data);
+        // return true;
+        // } catch (IOException e) {
+        // return false;
+        // }
     }
 
     public static boolean isXML(String data) {
     }
 
     public static boolean isXML(String data) {
index d8af571..c368eb6 100644 (file)
@@ -1,9 +1,11 @@
 /*-
  * ============LICENSE_START=======================================================
 /*-
  * ============LICENSE_START=======================================================
- * ONAP : APP-C
+ * ONAP : APPC
  * ================================================================================
  * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property.  All rights reserved.
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
  * ================================================================================
  * ================================================================================
+ * Copyright (C) 2017 Amdocs
+ * =============================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
+ * 
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
  * ============LICENSE_END=========================================================
  */
 
  * ============LICENSE_END=========================================================
  */
 
-package org.openecomp.sdnc.config.generator.tool;
+package org.onap.sdnc.config.generator.tool;
+
+public class Constants {
 
 
-public class Constants 
-{
+    public static final String DBLIB_SERVICE =
+            "org.openecomp.sdnc.sli.resource.dblib.DBResourceManager";
+    public static final String DEVICE_AUTHENTICATION = "DEVICE_AUTHENTICATION";
+    public static final String SCHEMA_SDNCTL = "SDNCTL";
 
 
-    public static final String DBLIB_SERVICE = "org.openecomp.sdnc.sli.resource.dblib.DBResourceManager";
-    public static final String DEVICE_AUTHENTICATION="DEVICE_AUTHENTICATION";
-    public static final String SCHEMA_SDNCTL="SDNCTL";
+    public static final String APPC_CONFIG_DIR = "/opt/app/bvc/properties";
 
 
-    public static final String APPC_CONFIG_DIR="/opt/app/bvc/properties";
-    
 }
 }
index 5820cea..7a44b8b 100644 (file)
@@ -1,9 +1,11 @@
 /*-
  * ============LICENSE_START=======================================================
 /*-
  * ============LICENSE_START=======================================================
- * ONAP : APP-C
+ * ONAP : APPC
  * ================================================================================
  * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property.  All rights reserved.
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
  * ================================================================================
  * ================================================================================
+ * Copyright (C) 2017 Amdocs
+ * =============================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
+ * 
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
  * ============LICENSE_END=========================================================
  */
 
  * ============LICENSE_END=========================================================
  */
 
-package org.openecomp.sdnc.config.generator.tool;
+package org.onap.sdnc.config.generator.tool;
 
 import com.fasterxml.jackson.databind.node.JsonNodeFactory;
 import com.fasterxml.jackson.databind.node.TextNode;
 
 public class CustomJsonNodeFactory extends JsonNodeFactory {
 
 
 import com.fasterxml.jackson.databind.node.JsonNodeFactory;
 import com.fasterxml.jackson.databind.node.TextNode;
 
 public class CustomJsonNodeFactory extends JsonNodeFactory {
 
-    public TextNode textNode(String text) { 
-        return new CustomTextNode(text); 
+    public TextNode textNode(String text) {
+        return new CustomTextNode(text);
     }
 
 }
     }
 
 }
index 93e252a..2cfc643 100644 (file)
@@ -1,9 +1,11 @@
 /*-
  * ============LICENSE_START=======================================================
 /*-
  * ============LICENSE_START=======================================================
- * ONAP : APP-C
+ * ONAP : APPC
  * ================================================================================
  * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property.  All rights reserved.
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
  * ================================================================================
  * ================================================================================
+ * Copyright (C) 2017 Amdocs
+ * =============================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
+ * 
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
  * ============LICENSE_END=========================================================
  */
 
  * ============LICENSE_END=========================================================
  */
 
-package org.openecomp.sdnc.config.generator.tool;
+package org.onap.sdnc.config.generator.tool;
 
 
 import com.fasterxml.jackson.core.io.CharTypes;
 import com.fasterxml.jackson.databind.node.TextNode;
 
 
 
 import com.fasterxml.jackson.core.io.CharTypes;
 import com.fasterxml.jackson.databind.node.TextNode;
 
-public class CustomTextNode extends TextNode{
+public class CustomTextNode extends TextNode {
 
     public CustomTextNode(String v) {
         super(v);
     }
 
     public CustomTextNode(String v) {
         super(v);
     }
-    
+
     @Override
     @Override
-    public String toString()
-    {
+    public String toString() {
         int len = textValue().length();
         len = len + 2 + (len >> 4);
         StringBuilder sb = new StringBuilder(len);
         int len = textValue().length();
         len = len + 2 + (len >> 4);
         StringBuilder sb = new StringBuilder(len);
@@ -40,11 +43,10 @@ public class CustomTextNode extends TextNode{
         return sb.toString();
     }
 
         return sb.toString();
     }
 
-    protected static void appendQuoted(StringBuilder sb, String content)
-    {
-       // sb.append('"');
+    protected static void appendQuoted(StringBuilder sb, String content) {
+        // sb.append('"');
         CharTypes.appendQuoted(sb, content);
         CharTypes.appendQuoted(sb, content);
-       // sb.append('"');
+        // sb.append('"');
     }
     }
-    
+
 }
 }
index c834081..94b346c 100644 (file)
@@ -1,9 +1,11 @@
 /*-
  * ============LICENSE_START=======================================================
 /*-
  * ============LICENSE_START=======================================================
- * ONAP : APP-C
+ * ONAP : APPC
  * ================================================================================
  * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property.  All rights reserved.
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
  * ================================================================================
  * ================================================================================
+ * Copyright (C) 2017 Amdocs
+ * =============================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
+ * 
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
  * ============LICENSE_END=========================================================
  */
 
  * ============LICENSE_END=========================================================
  */
 
-package org.openecomp.sdnc.config.generator.tool;
+package org.onap.sdnc.config.generator.tool;
 
 import java.io.File;
 import java.net.URL;
 import java.sql.SQLException;
 import java.util.ArrayList;
 import java.util.Properties;
 
 import java.io.File;
 import java.net.URL;
 import java.sql.SQLException;
 import java.util.ArrayList;
 import java.util.Properties;
-
 import javax.sql.rowset.CachedRowSet;
 import javax.sql.rowset.CachedRowSet;
-
+import org.onap.ccsdk.sli.core.dblib.DBResourceManager;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import org.onap.ccsdk.sli.core.dblib.DBResourceManager;
-import org.onap.ccsdk.sli.core.dblib.DbLibService;
+public class DbServiceUtil {
+    private static final Logger log = LoggerFactory.getLogger(DbServiceUtil.class);
 
 
-public class DbServiceUtil
-{    
-    private static final Logger log = LoggerFactory
-            .getLogger(DbServiceUtil.class);
-    
     private static Properties props;
     private static DBResourceManager jdbcDataSource = null;
     private static Properties props;
     private static DBResourceManager jdbcDataSource = null;
-    
 
 
-    public static boolean updateDB(String tableName, ArrayList inputArgs, String scema, String whereClause, String setCluase) throws SQLException  
-    {
-            String updatePasswordString = "update " + tableName + " set " +  setCluase +  " where " + whereClause ;
-            boolean result = jdbcDataSource.writeData(updatePasswordString, inputArgs,Constants.SCHEMA_SDNCTL);
-            return result;
+
+    public static boolean updateDB(String tableName, ArrayList inputArgs, String scema,
+            String whereClause, String setCluase) throws SQLException {
+        String updatePasswordString =
+                "update " + tableName + " set " + setCluase + " where " + whereClause;
+        boolean result =
+                jdbcDataSource.writeData(updatePasswordString, inputArgs, Constants.SCHEMA_SDNCTL);
+        return result;
+    }
+
+
+    public static CachedRowSet getData(String tableName, ArrayList argList, String schema,
+            String getselectData, String getDataClasue) throws SQLException {
+        String selectQuery =
+                "select " + getselectData + "from " + tableName + " where " + getDataClasue;
+        CachedRowSet data = jdbcDataSource.getData(selectQuery, argList, schema);
+        return data;
     }
     }
-    
-    
-     public static CachedRowSet getData(String tableName, ArrayList argList, String schema, String getselectData, String getDataClasue ) throws SQLException
-     {         
-         String selectQuery = "select " + getselectData + "from " + tableName + " where " + getDataClasue ;         
-         CachedRowSet data = jdbcDataSource.getData(selectQuery, argList, schema);         
-         return data;         
-     }
-
-
-    public static DBResourceManager initDbLibService() throws Exception 
-    {
+
+
+    public static DBResourceManager initDbLibService() throws Exception {
         props = new Properties();
         props = new Properties();
-        File file = new File("/opt/app/bvc/properties/dblib.properties");        
-        URL propURL = file.toURI().toURL();    
-        props.load(propURL.openStream());        
+        File file = new File("/opt/app/bvc/properties/dblib.properties");
+        URL propURL = file.toURI().toURL();
+        props.load(propURL.openStream());
+
+                // this is an expected difference in CCSDK
         jdbcDataSource = new DBResourceManager(props);
         jdbcDataSource = new DBResourceManager(props);
+
         return jdbcDataSource;
         return jdbcDataSource;
-        
+
     }
 
 
     }
 
 
index 36afe76..bd8b2f5 100644 (file)
@@ -1,9 +1,11 @@
 /*-
  * ============LICENSE_START=======================================================
 /*-
  * ============LICENSE_START=======================================================
- * ONAP : APP-C
+ * ONAP : APPC
  * ================================================================================
  * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property.  All rights reserved.
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
  * ================================================================================
  * ================================================================================
+ * Copyright (C) 2017 Amdocs
+ * =============================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
+ * 
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
  * ============LICENSE_END=========================================================
  */
 
  * ============LICENSE_END=========================================================
  */
 
-package org.openecomp.sdnc.config.generator.tool;
+package org.onap.sdnc.config.generator.tool;
 
 import org.apache.commons.lang3.StringUtils;
 
 
 import org.apache.commons.lang3.StringUtils;
 
@@ -32,16 +36,20 @@ public class EscapeUtils {
         if (str == null) {
             return null;
         }
         if (str == null) {
             return null;
         }
-        String searchList[] = new String[]{"'","\\"};
-        String replacementList[] = new String[]{ "''","\\\\"};
-        return StringUtils.replaceEach(str,searchList, replacementList);
+        String searchList[] = new String[] {"'", "\\"};
+        String replacementList[] = new String[] {"''", "\\\\"};
+        return StringUtils.replaceEach(str, searchList, replacementList);
     }
     }
-    
+
+    // Added for E2E defect 266908 Quote issue
     public static String unescapeSql(String str) {
         if (str == null) {
             return null;
         }
     public static String unescapeSql(String str) {
         if (str == null) {
             return null;
         }
-        
+        /*
+         * String searchList[] = new String[]{"''", "\\\\"}; String replacementList[] = new
+         * String[]{ "'", "\\"};
+         */
         String searchList[] = new String[] {"''"};
         String replacementList[] = new String[] {"'"};
         return StringUtils.replaceEach(str, searchList, replacementList);
         String searchList[] = new String[] {"''"};
         String replacementList[] = new String[] {"'"};
         return StringUtils.replaceEach(str, searchList, replacementList);
@@ -59,13 +67,13 @@ public class EscapeUtils {
         for (int i = 0; i < length; i++) {
             char c = s.charAt(i);
             switch (c) {
         for (int i = 0; i < length; i++) {
             char c = s.charAt(i);
             switch (c) {
-            case '\\':
-            case '\"':
-            case '\'':
-            case '\0': {
-                newLength += 1;
-            }
-                break;
+                case '\\':
+                case '\"':
+                case '\'':
+                case '\0': {
+                    newLength += 1;
+                }
+                    break;
             }
         }
         if (length == newLength) {
             }
         }
         if (length == newLength) {
@@ -76,25 +84,25 @@ public class EscapeUtils {
         for (int i = 0; i < length; i++) {
             char c = s.charAt(i);
             switch (c) {
         for (int i = 0; i < length; i++) {
             char c = s.charAt(i);
             switch (c) {
-            case '\\': {
-                sb.append("\\\\");
-            }
-                break;
-            case '\"': {
-                sb.append("\\\"");
-            }
-                break;
-            case '\'': {
-                sb.append("\\\'");
-            }
-                break;
-            case '\0': {
-                sb.append("\\0");
-            }
-                break;
-            default: {
-                sb.append(c);
-            }
+                case '\\': {
+                    sb.append("\\\\");
+                }
+                    break;
+                case '\"': {
+                    sb.append("\\\"");
+                }
+                    break;
+                case '\'': {
+                    sb.append("\\\'");
+                }
+                    break;
+                case '\0': {
+                    sb.append("\\0");
+                }
+                    break;
+                default: {
+                    sb.append(c);
+                }
             }
         }
         return sb.toString();
             }
         }
         return sb.toString();
index 63fd700..a473109 100644 (file)
@@ -1,9 +1,11 @@
 /*-
  * ============LICENSE_START=======================================================
 /*-
  * ============LICENSE_START=======================================================
- * ONAP : APP-C
+ * ONAP : APPC
  * ================================================================================
  * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property.  All rights reserved.
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
  * ================================================================================
  * ================================================================================
+ * Copyright (C) 2017 Amdocs
+ * =============================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
+ * 
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
  * ============LICENSE_END=========================================================
  */
 
  * ============LICENSE_END=========================================================
  */
 
-package org.openecomp.sdnc.config.generator.tool;
+package org.onap.sdnc.config.generator.tool;
 
 import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
 
 import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
-
 import org.codehaus.jettison.json.JSONArray;
 import org.codehaus.jettison.json.JSONException;
 import org.codehaus.jettison.json.JSONObject;
 import org.codehaus.jettison.json.JSONArray;
 import org.codehaus.jettison.json.JSONException;
 import org.codehaus.jettison.json.JSONObject;
-
 import com.att.eelf.configuration.EELFLogger;
 import com.att.eelf.configuration.EELFManager;
 import com.att.eelf.configuration.EELFLogger;
 import com.att.eelf.configuration.EELFManager;
-import com.fasterxml.jackson.databind.JsonNode;
-import com.fasterxml.jackson.databind.ObjectMapper;
 
 
 
 public class JSONTool {
 
 
 
 
 public class JSONTool {
 
-    private static final  EELFLogger log = EELFManager.getInstance().getLogger(JSONTool.class);
+    private static final EELFLogger log = EELFManager.getInstance().getLogger(JSONTool.class);
 
     public static Map<String, String> convertToProperties(String s) throws JSONException {
         return convertToProperties(s, null);
     }
 
 
     public static Map<String, String> convertToProperties(String s) throws JSONException {
         return convertToProperties(s, null);
     }
 
-    public static Map<String, String> convertToProperties(String s,List<String> blockKeys) throws JSONException {
+    public static Map<String, String> convertToProperties(String s, List<String> blockKeys)
+            throws JSONException {
         JSONObject json = new JSONObject(s);
         Map<String, String> mm = new HashMap<String, String>();
 
         JSONObject json = new JSONObject(s);
         Map<String, String> mm = new HashMap<String, String>();
 
@@ -64,70 +65,14 @@ public class JSONTool {
                 wm.remove(key);
 
 
                 wm.remove(key);
 
 
-                if(blockKeys != null && blockKeys.contains(key) && o != null){
-                    //log.info("Adding JSON Block Keys : " + key + "=" + o.toString());
-                    mm.put("block_" +key,o.toString());
-                }
-
-                if (o instanceof Boolean || o instanceof Number || o instanceof String) {
-                    mm.put(key, o.toString());
-                    //log.info("Added property: " + key + ": " + o.toString());
-                }
-
-                else if (o instanceof JSONObject) {
-                    JSONObject jo = (JSONObject) o;
-                    Iterator<String> i = jo.keys();
-                    while (i.hasNext()) {
-                        String key1 = i.next();
-                        wm.put(key + "." + key1, jo.get(key1));
-                    }
-                }
-
-                else if (o instanceof JSONArray) {
-                    JSONArray ja = (JSONArray) o;
-                    mm.put("size_"+key, String.valueOf(ja.length()));
-
-                    //log.info("Added property: " + key + "_length" + ": " + String.valueOf(ja.length()));
-
-                    for (int i = 0; i < ja.length(); i++)
-                        wm.put(key + '[' + i + ']', ja.get(i));
-                }
-            }
-
-        return mm;
-    }
-    
-    /*
-    public static Map<String, String> convertToProperties1(String s,List<String> blockKeys) throws Exception {
-        ObjectMapper objectMapper = new ObjectMapper();
-        
-        JsonNode rootNode = objectMapper.readTree(s);
-        
-        Map<String, String> mm = new HashMap<String, String>();
-
-        Map<String, Object> wm = new HashMap<String, Object>();
-        Iterator<String> ii = rootNode.fieldNames();
-        while (ii.hasNext()) {
-            String key1 = ii.next();
-            wm.put(key1, rootNode.get(key1));
-
-
-        }
-
-        while (!wm.isEmpty())
-            for (String key : new ArrayList<>(wm.keySet())) {
-                Object o = wm.get(key);
-                wm.remove(key);
-
-
-                if(blockKeys != null && blockKeys.contains(key) && o != null){
-                    //log.info("Adding JSON Block Keys : " + key + "=" + o.toString());
-                    mm.put("block_" +key,o.toString());
+                if (blockKeys != null && blockKeys.contains(key) && o != null) {
+                    // log.info("Adding JSON Block Keys : " + key + "=" + o.toString());
+                    mm.put("block_" + key, o.toString());
                 }
 
                 if (o instanceof Boolean || o instanceof Number || o instanceof String) {
                     mm.put(key, o.toString());
                 }
 
                 if (o instanceof Boolean || o instanceof Number || o instanceof String) {
                     mm.put(key, o.toString());
-                    //log.info("Added property: " + key + ": " + o.toString());
+                    // log.info("Added property: " + key + ": " + o.toString());
                 }
 
                 else if (o instanceof JSONObject) {
                 }
 
                 else if (o instanceof JSONObject) {
@@ -141,9 +86,10 @@ public class JSONTool {
 
                 else if (o instanceof JSONArray) {
                     JSONArray ja = (JSONArray) o;
 
                 else if (o instanceof JSONArray) {
                     JSONArray ja = (JSONArray) o;
-                    mm.put("size_"+key, String.valueOf(ja.length()));
+                    mm.put("size_" + key, String.valueOf(ja.length()));
 
 
-                    //log.info("Added property: " + key + "_length" + ": " + String.valueOf(ja.length()));
+                    // log.info("Added property: " + key + "_length" + ": " +
+                    // String.valueOf(ja.length()));
 
                     for (int i = 0; i < ja.length(); i++)
                         wm.put(key + '[' + i + ']', ja.get(i));
 
                     for (int i = 0; i < ja.length(); i++)
                         wm.put(key + '[' + i + ']', ja.get(i));
@@ -152,6 +98,5 @@ public class JSONTool {
 
         return mm;
     }
 
         return mm;
     }
-*/
 
 }
 
 }
index 54823bc..0c228b8 100644 (file)
@@ -1,9 +1,11 @@
 /*-
  * ============LICENSE_START=======================================================
 /*-
  * ============LICENSE_START=======================================================
- * ONAP : APP-C
+ * ONAP : APPC
  * ================================================================================
  * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property.  All rights reserved.
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
  * ================================================================================
  * ================================================================================
+ * Copyright (C) 2017 Amdocs
+ * =============================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
+ * 
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
  * ============LICENSE_END=========================================================
  */
 
  * ============LICENSE_END=========================================================
  */
 
-package org.openecomp.sdnc.config.generator.tool;
+package org.onap.sdnc.config.generator.tool;
 
 import java.text.ParseException;
 import java.text.SimpleDateFormat;
 import java.util.ArrayList;
 import java.util.Date;
 import java.util.List;
 
 import java.text.ParseException;
 import java.text.SimpleDateFormat;
 import java.util.ArrayList;
 import java.util.Date;
 import java.util.List;
-
 import com.att.eelf.configuration.EELFLogger;
 import com.att.eelf.configuration.EELFManager;
 
 import com.att.eelf.configuration.EELFLogger;
 import com.att.eelf.configuration.EELFManager;
 
-public class LogParserTool  {
-    private static final  EELFLogger log = EELFManager.getInstance().getLogger(JSONTool.class);
+public class LogParserTool {
+    private static final EELFLogger log = EELFManager.getInstance().getLogger(JSONTool.class);
 
     private String[] singleLines;
 
     private String[] singleLines;
-    private List<String> recentErrors = new ArrayList<String> ();;
+    private List<String> recentErrors = new ArrayList<String>();;
     private Date todaysDate = new Date();
     private SimpleDateFormat dFormat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss");
     private final int minMilli = 60000;
     private Date todaysDate = new Date();
     private SimpleDateFormat dFormat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss");
     private final int minMilli = 60000;
@@ -41,7 +44,7 @@ public class LogParserTool  {
     private final int NOT_IN_TIME = 1;
     private final int NO_DATE = 2;
 
     private final int NOT_IN_TIME = 1;
     private final int NO_DATE = 2;
 
-    public String parseErrorLog(String data){
+    public String parseErrorLog(String data) {
         singleLines = data.split("\\r?\\n");
         try {
             getNearestDates();
         singleLines = data.split("\\r?\\n");
         try {
             getNearestDates();
@@ -49,40 +52,42 @@ public class LogParserTool  {
         } catch (Exception e) {
             e.printStackTrace();
         }
         } catch (Exception e) {
             e.printStackTrace();
         }
-        if(recentErrors.size() == 0){
+        if (recentErrors.size() == 0) {
             recentErrors.clear();
             return "Did not find the string 'Starting orchestration of file backed up to /var/opt/MetaSwitch/orch/orch_conf.json' in the log file with timestamp within the last 5 minutes";
             recentErrors.clear();
             return "Did not find the string 'Starting orchestration of file backed up to /var/opt/MetaSwitch/orch/orch_conf.json' in the log file with timestamp within the last 5 minutes";
-        }else if(recentErrors.size() == 1){
+        } else if (recentErrors.size() == 1) {
             recentErrors.clear();
             recentErrors.clear();
-            return "Did not find the string â€˜Error parsing orchestration file’ in the log file with timestamp within the last 5 minutes";
-        }else{
+            return "Did not find the string ?Error parsing orchestration file? in the log file with timestamp within the last 5 minutes";
+        } else {
             String error = recentErrors.get(0);
             recentErrors.clear();
             String error = recentErrors.get(0);
             recentErrors.clear();
-            return "Error: "+ error.substring(error.indexOf("Error parsing orchestration file:")+34);
+            return "Error: "
+                    + error.substring(error.indexOf("Error parsing orchestration file:") + 34);
         }
     }
 
         }
     }
 
-    public void getNearestDates() throws ParseException{
+    public void getNearestDates() throws ParseException {
         int result;
         int result;
-        for( int i = singleLines.length-1; i >= 0 ; i--){
-            if(singleLines[i].contains("Starting orchestration of file backed up to") || singleLines[i].contains("Error parsing orchestration file:")){
+        for (int i = singleLines.length - 1; i >= 0; i--) {
+            if (singleLines[i].contains("Starting orchestration of file backed up to")
+                    || singleLines[i].contains("Error parsing orchestration file:")) {
                 result = checkDateTime(singleLines[i]);
                 result = checkDateTime(singleLines[i]);
-                ifresult == IN_TIME)
+                if (result == IN_TIME)
                     recentErrors.add(singleLines[i]);
                     recentErrors.add(singleLines[i]);
-                else if(result == NOT_IN_TIME){
+                else if (result == NOT_IN_TIME) {
                     return;
                 }
             }
         }
     }
 
                     return;
                 }
             }
         }
     }
 
-    private int checkDateTime(String line){
+    private int checkDateTime(String line) {
         Date newDate;
         try {
             newDate = dFormat.parse(line.substring(0, 19));
         Date newDate;
         try {
             newDate = dFormat.parse(line.substring(0, 19));
-            if((todaysDate.getTime() - newDate.getTime()) <= 5*minMilli){
+            if ((todaysDate.getTime() - newDate.getTime()) <= 5 * minMilli) {
                 return IN_TIME;
                 return IN_TIME;
-            }else
+            } else
                 return NOT_IN_TIME;
         } catch (ParseException e) {
             e.printStackTrace();
                 return NOT_IN_TIME;
         } catch (ParseException e) {
             e.printStackTrace();
index 0958dee..a7f0b9d 100644 (file)
@@ -1,9 +1,11 @@
 /*-
  * ============LICENSE_START=======================================================
 /*-
  * ============LICENSE_START=======================================================
- * ONAP : APP-C
+ * ONAP : APPC
  * ================================================================================
  * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property.  All rights reserved.
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
  * ================================================================================
  * ================================================================================
+ * Copyright (C) 2017 Amdocs
+ * =============================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
+ * 
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
  * ============LICENSE_END=========================================================
  */
 
  * ============LICENSE_END=========================================================
  */
 
-package org.openecomp.sdnc.config.generator.tool;
+package org.onap.sdnc.config.generator.tool;
 
 import java.io.IOException;
 import java.io.StringWriter;
 import java.util.Iterator;
 import java.util.Map;
 
 import java.io.IOException;
 import java.io.StringWriter;
 import java.util.Iterator;
 import java.util.Map;
-
 import org.apache.commons.lang3.StringUtils;
 import org.apache.velocity.Template;
 import org.apache.velocity.VelocityContext;
 import org.apache.commons.lang3.StringUtils;
 import org.apache.velocity.Template;
 import org.apache.velocity.VelocityContext;
@@ -33,8 +36,7 @@ import org.apache.velocity.app.VelocityEngine;
 import org.apache.velocity.runtime.RuntimeConstants;
 import org.apache.velocity.runtime.resource.loader.StringResourceLoader;
 import org.apache.velocity.runtime.resource.util.StringResourceRepository;
 import org.apache.velocity.runtime.RuntimeConstants;
 import org.apache.velocity.runtime.resource.loader.StringResourceLoader;
 import org.apache.velocity.runtime.resource.util.StringResourceRepository;
-import org.openecomp.sdnc.config.generator.ConfigGeneratorConstant;
-
+import org.onap.sdnc.config.generator.ConfigGeneratorConstant;
 import com.att.eelf.configuration.EELFLogger;
 import com.att.eelf.configuration.EELFManager;
 import com.fasterxml.jackson.core.JsonParseException;
 import com.att.eelf.configuration.EELFLogger;
 import com.att.eelf.configuration.EELFManager;
 import com.fasterxml.jackson.core.JsonParseException;
@@ -45,10 +47,10 @@ import com.fasterxml.jackson.databind.ObjectMapper;
 
 public class MergeTool {
 
 
 public class MergeTool {
 
-    private static final  EELFLogger log = EELFManager.getInstance().getLogger(MergeTool.class);
+    private static final EELFLogger log = EELFManager.getInstance().getLogger(MergeTool.class);
 
 
-    public static String mergeMap2TemplateData(String template, Map< String, String> dataMap ){
-        log.info("MergeMap2TemplateData Template :"+ template + " Maps :"+ dataMap);
+    public static String mergeMap2TemplateData(String template, Map<String, String> dataMap) {
+        log.info("MergeMap2TemplateData Template :" + template + " Maps :" + dataMap);
         StringWriter writer = new StringWriter();
         VelocityEngine ve = new VelocityEngine();
         ve.setProperty(RuntimeConstants.RESOURCE_LOADER, "string");
         StringWriter writer = new StringWriter();
         VelocityEngine ve = new VelocityEngine();
         ve.setProperty(RuntimeConstants.RESOURCE_LOADER, "string");
@@ -56,13 +58,14 @@ public class MergeTool {
         ve.addProperty("string.resource.loader.repository.static", "false");
         ve.init();
 
         ve.addProperty("string.resource.loader.repository.static", "false");
         ve.init();
 
-        StringResourceRepository repo = (StringResourceRepository)ve.getApplicationAttribute(StringResourceLoader.REPOSITORY_NAME_DEFAULT);
+        StringResourceRepository repo = (StringResourceRepository) ve
+                .getApplicationAttribute(StringResourceLoader.REPOSITORY_NAME_DEFAULT);
         repo.putStringResource("TemplateResource", template);
 
         Template t = ve.getTemplate("TemplateResource");
         VelocityContext context = new VelocityContext();
         Iterator<Map.Entry<String, String>> entries = dataMap.entrySet().iterator();
         repo.putStringResource("TemplateResource", template);
 
         Template t = ve.getTemplate("TemplateResource");
         VelocityContext context = new VelocityContext();
         Iterator<Map.Entry<String, String>> entries = dataMap.entrySet().iterator();
-        while (entries.hasNext())        {
+        while (entries.hasNext()) {
             Map.Entry<String, String> entry = entries.next();
             context.put(entry.getKey(), entry.getValue());
         }
             Map.Entry<String, String> entry = entries.next();
             context.put(entry.getKey(), entry.getValue());
         }
@@ -71,33 +74,36 @@ public class MergeTool {
     }
 
 
     }
 
 
-    public static String mergeJson2TemplateData(String template, String jsonData, String templateType, String doPrettyOutput) throws JsonParseException, JsonMappingException, IOException{
+    public static String mergeJson2TemplateData(String template, String jsonData,
+            String templateType, String doPrettyOutput)
+            throws JsonParseException, JsonMappingException, IOException {
         String mergedData = template;
         String mergedData = template;
-        if( StringUtils.isNotBlank(template) && StringUtils.isNotBlank(jsonData)){    
+        if (StringUtils.isNotBlank(template) && StringUtils.isNotBlank(jsonData)) {
             Velocity.init();
 
             Velocity.init();
 
-            ObjectMapper mapper = new ObjectMapper();        
-            CustomJsonNodeFactory f = new CustomJsonNodeFactory();        
+            ObjectMapper mapper = new ObjectMapper();
+            CustomJsonNodeFactory f = new CustomJsonNodeFactory();
             mapper.setNodeFactory(f);
 
             mapper.setNodeFactory(f);
 
-            JsonNode jsonObj = mapper.readValue(jsonData, JsonNode.class);    
+            JsonNode jsonObj = mapper.readValue(jsonData, JsonNode.class);
 
 
-            VelocityContext context = new VelocityContext();            
+            VelocityContext context = new VelocityContext();
             Iterator<String> ii = jsonObj.fieldNames();
             while (ii.hasNext()) {
                 String key = ii.next();
                 context.put(key, jsonObj.get(key));
             Iterator<String> ii = jsonObj.fieldNames();
             while (ii.hasNext()) {
                 String key = ii.next();
                 context.put(key, jsonObj.get(key));
-            }            
+            }
 
 
-            StringWriter writer = new StringWriter();            
+            StringWriter writer = new StringWriter();
             Velocity.evaluate(context, writer, "TemplateData", template);
             writer.flush();
             Velocity.evaluate(context, writer, "TemplateData", template);
             writer.flush();
-            mergedData =  writer.toString();    
+            mergedData = writer.toString();
 
 
-            if(StringUtils.isNotBlank(templateType) && StringUtils.isNotBlank(doPrettyOutput)
+            if (StringUtils.isNotBlank(templateType) && StringUtils.isNotBlank(doPrettyOutput)
                     && ConfigGeneratorConstant.Y.equalsIgnoreCase(doPrettyOutput)
                     && ConfigGeneratorConstant.Y.equalsIgnoreCase(doPrettyOutput)
-                    && ( ConfigGeneratorConstant.DATA_TYPE_JSON.equalsIgnoreCase(templateType)
-                            || ConfigGeneratorConstant.DATA_TYPE_XML.equalsIgnoreCase(templateType)) ){
+                    && (ConfigGeneratorConstant.DATA_TYPE_JSON.equalsIgnoreCase(templateType)
+                            || ConfigGeneratorConstant.DATA_TYPE_XML
+                                    .equalsIgnoreCase(templateType))) {
                 // Perform Prettying
 
             }
                 // Perform Prettying
 
             }
index 682b3f2..2aacc58 100644 (file)
@@ -1,9 +1,11 @@
 /*-
  * ============LICENSE_START=======================================================
 /*-
  * ============LICENSE_START=======================================================
- * ONAP : APP-C
+ * ONAP : APPC
  * ================================================================================
  * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property.  All rights reserved.
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
  * ================================================================================
  * ================================================================================
+ * Copyright (C) 2017 Amdocs
+ * =============================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
+ * 
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
  * ============LICENSE_END=========================================================
  */
 
  * ============LICENSE_END=========================================================
  */
 
-package org.openecomp.sdnc.config.generator.transform;
+package org.onap.sdnc.config.generator.transform;
 
 import java.io.File;
 import java.io.StringReader;
 import java.io.StringWriter;
 import java.nio.charset.Charset;
 import java.util.Map;
 
 import java.io.File;
 import java.io.StringReader;
 import java.io.StringWriter;
 import java.nio.charset.Charset;
 import java.util.Map;
-
-import org.apache.commons.io.FileUtils;
-import org.apache.commons.lang3.StringUtils;
-import org.openecomp.sdnc.config.generator.ConfigGeneratorConstant;
-
-import com.att.eelf.configuration.EELFLogger;
-import com.att.eelf.configuration.EELFManager;
-import org.onap.ccsdk.sli.core.sli.SvcLogicContext;
-import org.onap.ccsdk.sli.core.sli.SvcLogicException;
-import org.onap.ccsdk.sli.core.sli.SvcLogicJavaPlugin;
-
 import javax.xml.transform.Transformer;
 import javax.xml.transform.TransformerConfigurationException;
 import javax.xml.transform.TransformerException;
 import javax.xml.transform.TransformerFactory;
 import javax.xml.transform.stream.StreamResult;
 import javax.xml.transform.stream.StreamSource;
 import javax.xml.transform.Transformer;
 import javax.xml.transform.TransformerConfigurationException;
 import javax.xml.transform.TransformerException;
 import javax.xml.transform.TransformerFactory;
 import javax.xml.transform.stream.StreamResult;
 import javax.xml.transform.stream.StreamSource;
+import org.apache.commons.io.FileUtils;
+import org.apache.commons.lang3.StringUtils;
+import org.onap.ccsdk.sli.core.sli.SvcLogicContext;
+import org.onap.ccsdk.sli.core.sli.SvcLogicException;
+import org.onap.ccsdk.sli.core.sli.SvcLogicJavaPlugin;
+import org.onap.sdnc.config.generator.ConfigGeneratorConstant;
+import com.att.eelf.configuration.EELFLogger;
+import com.att.eelf.configuration.EELFManager;
 
 
 public class XSLTTransformerNode implements SvcLogicJavaPlugin {
 
 
 
 public class XSLTTransformerNode implements SvcLogicJavaPlugin {
 
-    private static final EELFLogger log = EELFManager.getInstance().getLogger(XSLTTransformerNode.class);
+    private static final EELFLogger log =
+            EELFManager.getInstance().getLogger(XSLTTransformerNode.class);
 
 
-    public void transformData(Map<String, String> inParams, SvcLogicContext ctx) throws SvcLogicException {
+    public void transformData(Map<String, String> inParams, SvcLogicContext ctx)
+            throws SvcLogicException {
         log.trace("Received convertJson2DGContext call with params : " + inParams);
         String responsePrefix = inParams.get(ConfigGeneratorConstant.INPUT_PARAM_RESPONSE_PRIFIX);
         try {
         log.trace("Received convertJson2DGContext call with params : " + inParams);
         String responsePrefix = inParams.get(ConfigGeneratorConstant.INPUT_PARAM_RESPONSE_PRIFIX);
         try {
@@ -57,9 +60,11 @@ public class XSLTTransformerNode implements SvcLogicJavaPlugin {
             String templateData = inParams.get(ConfigGeneratorConstant.INPUT_PARAM_TEMPLATE_DATA);
 
             if (StringUtils.isNotBlank(templateData)) {
             String templateData = inParams.get(ConfigGeneratorConstant.INPUT_PARAM_TEMPLATE_DATA);
 
             if (StringUtils.isNotBlank(templateData)) {
-                String templateFile = inParams.get(ConfigGeneratorConstant.INPUT_PARAM_TEMPLATE_FILE);
+                String templateFile =
+                        inParams.get(ConfigGeneratorConstant.INPUT_PARAM_TEMPLATE_FILE);
                 if (StringUtils.isNotBlank(templateFile)) {
                 if (StringUtils.isNotBlank(templateFile)) {
-                    templateData = FileUtils.readFileToString(new File(templateFile), Charset.defaultCharset());
+                    templateData = FileUtils.readFileToString(new File(templateFile),
+                            Charset.defaultCharset());
                 }
             }
             if (StringUtils.isBlank(templateData)) {
                 }
             }
             if (StringUtils.isBlank(templateData)) {
@@ -72,14 +77,17 @@ public class XSLTTransformerNode implements SvcLogicJavaPlugin {
             }
 
             String transformedData = transform(requestData, templateData);
             }
 
             String transformedData = transform(requestData, templateData);
-            log.trace("Transformed Data : "+ transformedData);
-            ctx.setAttribute(responsePrefix + ConfigGeneratorConstant.OUTPUT_PARAM_TRANSFORMED_DATA, transformedData);
-            ctx.setAttribute(responsePrefix + ConfigGeneratorConstant.OUTPUT_PARAM_STATUS, ConfigGeneratorConstant.OUTPUT_STATUS_SUCCESS);    
+            log.trace("Transformed Data : " + transformedData);
+            ctx.setAttribute(responsePrefix + ConfigGeneratorConstant.OUTPUT_PARAM_TRANSFORMED_DATA,
+                    transformedData);
+            ctx.setAttribute(responsePrefix + ConfigGeneratorConstant.OUTPUT_PARAM_STATUS,
+                    ConfigGeneratorConstant.OUTPUT_STATUS_SUCCESS);
         } catch (Exception e) {
             e.printStackTrace();
             ctx.setAttribute(responsePrefix + ConfigGeneratorConstant.OUTPUT_PARAM_STATUS,
                     ConfigGeneratorConstant.OUTPUT_STATUS_FAILURE);
         } catch (Exception e) {
             e.printStackTrace();
             ctx.setAttribute(responsePrefix + ConfigGeneratorConstant.OUTPUT_PARAM_STATUS,
                     ConfigGeneratorConstant.OUTPUT_STATUS_FAILURE);
-            ctx.setAttribute(responsePrefix + ConfigGeneratorConstant.OUTPUT_PARAM_ERROR_MESSAGE, e.getMessage());
+            ctx.setAttribute(responsePrefix + ConfigGeneratorConstant.OUTPUT_PARAM_ERROR_MESSAGE,
+                    e.getMessage());
             log.error("Failed in XSLTTransformerNode : " + e.getMessage());
             throw new SvcLogicException(e.getMessage());
         }
             log.error("Failed in XSLTTransformerNode : " + e.getMessage());
             throw new SvcLogicException(e.getMessage());
         }
@@ -88,8 +96,10 @@ public class XSLTTransformerNode implements SvcLogicJavaPlugin {
     public String transform(String requestData, String templateData)
             throws TransformerConfigurationException, TransformerException {
         StringWriter xmlResultResource = new StringWriter();
     public String transform(String requestData, String templateData)
             throws TransformerConfigurationException, TransformerException {
         StringWriter xmlResultResource = new StringWriter();
-        Transformer xmlTransformer = TransformerFactory.newInstance().newTransformer(new StreamSource(new StringReader(templateData)));
-        xmlTransformer.transform(new StreamSource(new StringReader(requestData)), new StreamResult(xmlResultResource));
+        Transformer xmlTransformer = TransformerFactory.newInstance()
+                .newTransformer(new StreamSource(new StringReader(templateData)));
+        xmlTransformer.transform(new StreamSource(new StringReader(requestData)),
+                new StreamResult(xmlResultResource));
         return xmlResultResource.getBuffer().toString();
     }
 
         return xmlResultResource.getBuffer().toString();
     }
 
index e383476..f7900b7 100644 (file)
@@ -1,9 +1,11 @@
 /*-
  * ============LICENSE_START=======================================================
 /*-
  * ============LICENSE_START=======================================================
- * ONAP : APP-C
+ * ONAP : APPC
  * ================================================================================
  * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property.  All rights reserved.
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
  * ================================================================================
  * ================================================================================
+ * Copyright (C) 2017 Amdocs
+ * =============================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
+ * 
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
  * ============LICENSE_END=========================================================
  */
 
  * ============LICENSE_END=========================================================
  */
 
-package org.openecomp.sdnc.config.generator.writer;
+package org.onap.sdnc.config.generator.writer;
 
 import java.io.File;
 import java.util.Map;
 
 import java.io.File;
 import java.util.Map;
-
 import org.apache.commons.io.FileUtils;
 import org.apache.commons.lang3.StringUtils;
 import org.apache.commons.io.FileUtils;
 import org.apache.commons.lang3.StringUtils;
-import org.openecomp.sdnc.config.generator.ConfigGeneratorConstant;
-
-
-import com.att.eelf.configuration.EELFLogger;
-import com.att.eelf.configuration.EELFManager;
 import org.onap.ccsdk.sli.core.sli.SvcLogicContext;
 import org.onap.ccsdk.sli.core.sli.SvcLogicException;
 import org.onap.ccsdk.sli.core.sli.SvcLogicJavaPlugin;
 import org.onap.ccsdk.sli.core.sli.SvcLogicContext;
 import org.onap.ccsdk.sli.core.sli.SvcLogicException;
 import org.onap.ccsdk.sli.core.sli.SvcLogicJavaPlugin;
+import org.onap.sdnc.config.generator.ConfigGeneratorConstant;
+import com.att.eelf.configuration.EELFLogger;
+import com.att.eelf.configuration.EELFManager;
 
 public class FileWriterNode implements SvcLogicJavaPlugin {
 
 
 public class FileWriterNode implements SvcLogicJavaPlugin {
 
-    private static final  EELFLogger log = EELFManager.getInstance().getLogger(FileWriterNode.class);
-    
-    
-    
-    public void writeFile(Map<String, String> inParams, SvcLogicContext ctx) throws SvcLogicException {
+    private static final EELFLogger log = EELFManager.getInstance().getLogger(FileWriterNode.class);
+
+
+
+    public void writeFile(Map<String, String> inParams, SvcLogicContext ctx)
+            throws SvcLogicException {
         log.info("Received writeFile call with params : " + inParams);
         String responsePrefix = inParams.get(ConfigGeneratorConstant.INPUT_PARAM_RESPONSE_PRIFIX);
         log.info("Received writeFile call with params : " + inParams);
         String responsePrefix = inParams.get(ConfigGeneratorConstant.INPUT_PARAM_RESPONSE_PRIFIX);
-        try{
-               responsePrefix = StringUtils.isNotBlank(responsePrefix) ? (responsePrefix+".") : "";
-               String fileName =  inParams.get(ConfigGeneratorConstant.INPUT_PARAM_FILE_NAME);
-               String fileContents =  inParams.get(ConfigGeneratorConstant.INPUT_PARAM_REQUEST_DATA);
-               
-               
-               File file = new File(fileName);
-               File filePath = file.getParentFile();
-               FileUtils.forceMkdir(filePath);
-               
-               FileUtils.writeStringToFile(file, fileContents, ConfigGeneratorConstant.STRING_ENCODING);
-               
-               
-               ctx.setAttribute(responsePrefix + ConfigGeneratorConstant.OUTPUT_PARAM_STATUS, ConfigGeneratorConstant.OUTPUT_STATUS_SUCCESS);
+        try {
+            responsePrefix = StringUtils.isNotBlank(responsePrefix) ? (responsePrefix + ".") : "";
+            String fileName = inParams.get(ConfigGeneratorConstant.INPUT_PARAM_FILE_NAME);
+            String fileContents = inParams.get(ConfigGeneratorConstant.INPUT_PARAM_REQUEST_DATA);
+
+
+            File file = new File(fileName);
+            File filePath = file.getParentFile();
+            FileUtils.forceMkdir(filePath);
+
+            FileUtils.writeStringToFile(file, fileContents,
+                    ConfigGeneratorConstant.STRING_ENCODING);
+
+
+            ctx.setAttribute(responsePrefix + ConfigGeneratorConstant.OUTPUT_PARAM_STATUS,
+                    ConfigGeneratorConstant.OUTPUT_STATUS_SUCCESS);
         } catch (Exception e) {
         } catch (Exception e) {
-               ctx.setAttribute(responsePrefix + ConfigGeneratorConstant.OUTPUT_PARAM_STATUS, ConfigGeneratorConstant.OUTPUT_STATUS_FAILURE);
-               ctx.setAttribute(responsePrefix + ConfigGeneratorConstant.OUTPUT_PARAM_ERROR_MESSAGE,e.getMessage());
-               log.error("Failed in writeFile " + e.getMessage());
-               throw new SvcLogicException(e.getMessage());
+            ctx.setAttribute(responsePrefix + ConfigGeneratorConstant.OUTPUT_PARAM_STATUS,
+                    ConfigGeneratorConstant.OUTPUT_STATUS_FAILURE);
+            ctx.setAttribute(responsePrefix + ConfigGeneratorConstant.OUTPUT_PARAM_ERROR_MESSAGE,
+                    e.getMessage());
+            log.error("Failed in writeFile " + e.getMessage());
+            throw new SvcLogicException(e.getMessage());
         }
     }
 
 
         }
     }
 
 
-    
+
 }
 }
index b6261a3..d6f041f 100644 (file)
@@ -1,9 +1,11 @@
 ###
 # ============LICENSE_START=======================================================
 ###
 # ============LICENSE_START=======================================================
-# ONAP : APP-C
+# ONAP : APPC
 # ================================================================================
 # ================================================================================
-# Copyright (C) 2017 AT&T Intellectual Property.  All rights reserved.
+# Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
 # ================================================================================
 # ================================================================================
+# Copyright (C) 2017 Amdocs
+# =============================================================================
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
 # You may obtain a copy of the License at
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
 # You may obtain a copy of the License at
@@ -15,6 +17,8 @@
 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 # See the License for the specific language governing permissions and
 # limitations under the License.
 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 # See the License for the specific language governing permissions and
 # limitations under the License.
+# 
+# ECOMP is a trademark and service mark of AT&T Intellectual Property.
 # ============LICENSE_END=========================================================
 ###
 
 # ============LICENSE_END=========================================================
 ###
 
index 0bfb80c..c0d65d2 100644 (file)
@@ -1,9 +1,11 @@
 /*-
  * ============LICENSE_START=======================================================
 /*-
  * ============LICENSE_START=======================================================
- * ONAP : APP-C
+ * ONAP : APPC
  * ================================================================================
  * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property.  All rights reserved.
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
  * ================================================================================
  * ================================================================================
+ * Copyright (C) 2017 Amdocs
+ * =============================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
+ * 
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
  * ============LICENSE_END=========================================================
  */
 
  * ============LICENSE_END=========================================================
  */
 
-package org.openecomp.sdnc.config.generator.convert;
+package org.onap.sdnc.config.generator.convert;
 
 import static org.junit.Assert.assertEquals;
 import java.io.IOException;
 
 import static org.junit.Assert.assertEquals;
 import java.io.IOException;
@@ -26,17 +30,18 @@ import java.util.HashMap;
 import java.util.Map;
 import org.apache.commons.io.IOUtils;
 import org.junit.Test;
 import java.util.Map;
 import org.apache.commons.io.IOUtils;
 import org.junit.Test;
-import org.openecomp.sdnc.config.generator.ConfigGeneratorConstant;
-import org.openecomp.sdnc.config.generator.merge.TestMergeNode;
 import org.onap.ccsdk.sli.core.sli.SvcLogicContext;
 import org.onap.ccsdk.sli.core.sli.SvcLogicException;
 import org.onap.ccsdk.sli.core.sli.SvcLogicContext;
 import org.onap.ccsdk.sli.core.sli.SvcLogicException;
+import org.onap.sdnc.config.generator.ConfigGeneratorConstant;
+import org.onap.sdnc.config.generator.merge.TestMergeNode;
 import org.powermock.reflect.Whitebox;
 import com.att.eelf.configuration.EELFLogger;
 import com.att.eelf.configuration.EELFManager;
 
 public class TestConvertNode {
 import org.powermock.reflect.Whitebox;
 import com.att.eelf.configuration.EELFLogger;
 import com.att.eelf.configuration.EELFManager;
 
 public class TestConvertNode {
-    
-    private static final EELFLogger log = EELFManager.getInstance().getLogger(TestConvertNode.class);
+    private static final EELFLogger log =
+            EELFManager.getInstance().getLogger(TestConvertNode.class);
+
     @Test(expected = Exception.class)
     public void testPayloadParametersConfig() throws Exception {
         SvcLogicContext ctx = new SvcLogicContext();
     @Test(expected = Exception.class)
     public void testPayloadParametersConfig() throws Exception {
         SvcLogicContext ctx = new SvcLogicContext();
@@ -45,8 +50,10 @@ public class TestConvertNode {
         inParams.put(ConfigGeneratorConstant.INPUT_PARAM_BLOCK_KEYS,
                 "configuration-parameters,configuration.configuration-json,configuration.configuration-string");
         convertJson2Context("convert/payload_parameters_config.json", inParams, ctx);
         inParams.put(ConfigGeneratorConstant.INPUT_PARAM_BLOCK_KEYS,
                 "configuration-parameters,configuration.configuration-json,configuration.configuration-string");
         convertJson2Context("convert/payload_parameters_config.json", inParams, ctx);
-        Whitebox.invokeMethod("convertJson2Context", "convert/payload_parameters_config.json", inParams, ctx);
-        log.info("testPayloadParametersConfig Result: " + ctx.getAttribute("block_configuration-parameters"));
+        Whitebox.invokeMethod("convertJson2Context", "convert/payload_parameters_config.json",
+                inParams, ctx);
+        log.info("testPayloadParametersConfig Result: "
+                + ctx.getAttribute("block_configuration-parameters"));
     }
 
     @Test
     }
 
     @Test
@@ -57,8 +64,10 @@ public class TestConvertNode {
         inParams.put(ConfigGeneratorConstant.INPUT_PARAM_BLOCK_KEYS,
                 "configuration-parameters,configuration.configuration-json,configuration.configuration-string");
         convertJson2Context("convert/payload_cli_config.json", inParams, ctx);
         inParams.put(ConfigGeneratorConstant.INPUT_PARAM_BLOCK_KEYS,
                 "configuration-parameters,configuration.configuration-json,configuration.configuration-string");
         convertJson2Context("convert/payload_cli_config.json", inParams, ctx);
-        log.info("testPayloadCliConfig Result: " + ctx.getAttribute("block_configuration-parameters"));
-        log.info("testPayloadCliConfig Result: " + ctx.getAttribute("block_configuration.configuration-string"));
+        log.info("testPayloadCliConfig Result: "
+                + ctx.getAttribute("block_configuration-parameters"));
+        log.info("testPayloadCliConfig Result: "
+                + ctx.getAttribute("block_configuration.configuration-string"));
     }
 
     @Test(expected = Exception.class)
     }
 
     @Test(expected = Exception.class)
@@ -69,8 +78,11 @@ public class TestConvertNode {
         inParams.put(ConfigGeneratorConstant.INPUT_PARAM_BLOCK_KEYS,
                 "configuration-parameters,configuration.configuration-json,configuration.configuration-string");
         convertJson2Context("convert/payload_xml_config.json", inParams, ctx);
         inParams.put(ConfigGeneratorConstant.INPUT_PARAM_BLOCK_KEYS,
                 "configuration-parameters,configuration.configuration-json,configuration.configuration-string");
         convertJson2Context("convert/payload_xml_config.json", inParams, ctx);
-        log.info("testPayloadXMLConfig Result: " + ctx.getAttribute("block_configuration-parameters"));
-        log.info("testPayloadXMLConfig Result: " + ctx.getAttribute("block_configuration.configuration-string"));
+
+        log.info("testPayloadXMLConfig Result: "
+                + ctx.getAttribute("block_configuration-parameters"));
+        log.info("testPayloadXMLConfig Result: "
+                + ctx.getAttribute("block_configuration.configuration-string"));
     }
 
     @Test(expected = Exception.class)
     }
 
     @Test(expected = Exception.class)
@@ -81,15 +93,18 @@ public class TestConvertNode {
         inParams.put(ConfigGeneratorConstant.INPUT_PARAM_BLOCK_KEYS,
                 "configuration-parameters,configuration.configuration-json,configuration.configuration-string");
         convertJson2Context("convert/payload_json_config.json", inParams, ctx);
         inParams.put(ConfigGeneratorConstant.INPUT_PARAM_BLOCK_KEYS,
                 "configuration-parameters,configuration.configuration-json,configuration.configuration-string");
         convertJson2Context("convert/payload_json_config.json", inParams, ctx);
-        log.info("testPayloadJsonConfig Result: " + ctx.getAttribute("block_configuration-parameters"));
-        log.info("testPayloadJsonConfig Result: " + ctx.getAttribute("block_configuration.configuration-json"));
+        log.info("testPayloadJsonConfig Result: "
+                + ctx.getAttribute("block_configuration-parameters"));
+        log.info("testPayloadJsonConfig Result: "
+                + ctx.getAttribute("block_configuration.configuration-json"));
     }
 
     }
 
-    private void convertJson2Context(String jsonFile, Map<String, String> inParams, SvcLogicContext ctx)
-            throws IOException, SvcLogicException {
+    private void convertJson2Context(String jsonFile, Map<String, String> inParams,
+            SvcLogicContext ctx) throws IOException, SvcLogicException {
         ConvertNode convertNode = new ConvertNode();
         inParams.put(ConfigGeneratorConstant.INPUT_PARAM_RESPONSE_PRIFIX, "test");
         ConvertNode convertNode = new ConvertNode();
         inParams.put(ConfigGeneratorConstant.INPUT_PARAM_RESPONSE_PRIFIX, "test");
-        String jsonData = IOUtils.toString(TestMergeNode.class.getClassLoader().getResourceAsStream(jsonFile));
+        String jsonData = IOUtils
+                .toString(TestMergeNode.class.getClassLoader().getResourceAsStream(jsonFile));
         log.info("TestConvertNode.testConvertJson2DGContext()" + jsonData);
         inParams.put(ConfigGeneratorConstant.INPUT_PARAM_JSON_DATA, jsonData);
         convertNode.convertJson2DGContext(inParams, ctx);
         log.info("TestConvertNode.testConvertJson2DGContext()" + jsonData);
         inParams.put(ConfigGeneratorConstant.INPUT_PARAM_JSON_DATA, jsonData);
         convertNode.convertJson2DGContext(inParams, ctx);
@@ -101,12 +116,13 @@ public class TestConvertNode {
     public void testEscapeData() throws Exception {
         SvcLogicContext ctx = new SvcLogicContext();
         Map<String, String> inParams = new HashMap<String, String>();
     public void testEscapeData() throws Exception {
         SvcLogicContext ctx = new SvcLogicContext();
         Map<String, String> inParams = new HashMap<String, String>();
-        String unescapeData = IOUtils
-                .toString(TestMergeNode.class.getClassLoader().getResourceAsStream("convert/escape/config_ssc.txt"));
+        String unescapeData = IOUtils.toString(TestMergeNode.class.getClassLoader()
+                .getResourceAsStream("convert/escape/config_ssc.txt"));
         log.info("TestConvertNode.testEscapeData() unescapeData :" + unescapeData);
         inParams.put(ConfigGeneratorConstant.INPUT_PARAM_RESPONSE_PRIFIX, "test");
         inParams.put(ConfigGeneratorConstant.INPUT_PARAM_UNESCAPE_DATA, unescapeData);
         log.info("TestConvertNode.testEscapeData() unescapeData :" + unescapeData);
         inParams.put(ConfigGeneratorConstant.INPUT_PARAM_RESPONSE_PRIFIX, "test");
         inParams.put(ConfigGeneratorConstant.INPUT_PARAM_UNESCAPE_DATA, unescapeData);
-        inParams.put(ConfigGeneratorConstant.INPUT_PARAM_DATA_TYPE, ConfigGeneratorConstant.DATA_TYPE_SQL);
+        inParams.put(ConfigGeneratorConstant.INPUT_PARAM_DATA_TYPE,
+                ConfigGeneratorConstant.DATA_TYPE_SQL);
         ConvertNode convertNode = new ConvertNode();
         convertNode.escapeData(inParams, ctx);
         log.info("testEscapeData Result: "
         ConvertNode convertNode = new ConvertNode();
         convertNode.escapeData(inParams, ctx);
         log.info("testEscapeData Result: "
@@ -131,6 +147,7 @@ public class TestConvertNode {
                 ConfigGeneratorConstant.OUTPUT_STATUS_SUCCESS);
 
     }
                 ConfigGeneratorConstant.OUTPUT_STATUS_SUCCESS);
 
     }
+
     @Test(expected = Exception.class)
     public void testunEscapeData() throws Exception {
         ConvertNode convertNode = new ConvertNode();
     @Test(expected = Exception.class)
     public void testunEscapeData() throws Exception {
         ConvertNode convertNode = new ConvertNode();
index cd7bb9e..1a40abd 100644 (file)
@@ -1,9 +1,11 @@
 /*-
  * ============LICENSE_START=======================================================
 /*-
  * ============LICENSE_START=======================================================
- * ONAP : APP-C
+ * ONAP : APPC
  * ================================================================================
  * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property.  All rights reserved.
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
  * ================================================================================
  * ================================================================================
+ * Copyright (C) 2017 Amdocs
+ * =============================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
+ * 
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
  * ============LICENSE_END=========================================================
  */
 
  * ============LICENSE_END=========================================================
  */
 
-package org.openecomp.sdnc.config.generator.merge;
+package org.onap.sdnc.config.generator.merge;
 
 
+import static org.junit.Assert.assertEquals;
+import java.util.HashMap;
+import java.util.Map;
 import org.apache.commons.io.IOUtils;
 import org.junit.Test;
 import org.apache.commons.io.IOUtils;
 import org.junit.Test;
-import org.openecomp.sdnc.config.generator.ConfigGeneratorConstant;
-import org.openecomp.sdnc.config.generator.merge.MergeNode;
 import org.onap.ccsdk.sli.core.sli.SvcLogicContext;
 import org.onap.ccsdk.sli.core.sli.SvcLogicException;
 import org.onap.ccsdk.sli.core.sli.SvcLogicContext;
 import org.onap.ccsdk.sli.core.sli.SvcLogicException;
-import static org.junit.Assert.assertEquals;
-import java.util.HashMap;
-import java.util.Map;
+import org.onap.sdnc.config.generator.ConfigGeneratorConstant;
 
 public class TestMergeNode {
 
 
 public class TestMergeNode {
 
@@ -37,11 +40,11 @@ public class TestMergeNode {
         MergeNode mergeNode = new MergeNode();
         Map<String, String> inParams = new HashMap<String, String>();
         inParams.put(ConfigGeneratorConstant.INPUT_PARAM_RESPONSE_PRIFIX, "test");
         MergeNode mergeNode = new MergeNode();
         Map<String, String> inParams = new HashMap<String, String>();
         inParams.put(ConfigGeneratorConstant.INPUT_PARAM_RESPONSE_PRIFIX, "test");
-        String jsonData = IOUtils
-                .toString(TestMergeNode.class.getClassLoader().getResourceAsStream("merge/vdbe_data.json"));
+        String jsonData = IOUtils.toString(
+                TestMergeNode.class.getClassLoader().getResourceAsStream("merge/vdbe_data.json"));
         inParams.put(ConfigGeneratorConstant.INPUT_PARAM_JSON_DATA, jsonData);
         inParams.put(ConfigGeneratorConstant.INPUT_PARAM_JSON_DATA, jsonData);
-        String templateData = IOUtils
-                .toString(TestMergeNode.class.getClassLoader().getResourceAsStream("merge/vdbe_template.xml"));
+        String templateData = IOUtils.toString(TestMergeNode.class.getClassLoader()
+                .getResourceAsStream("merge/vdbe_template.xml"));
         inParams.put(ConfigGeneratorConstant.INPUT_PARAM_TEMPLATE_DATA, templateData);
         SvcLogicContext ctx = new SvcLogicContext();
         mergeNode.mergeJsonDataOnTemplate(inParams, ctx);
         inParams.put(ConfigGeneratorConstant.INPUT_PARAM_TEMPLATE_DATA, templateData);
         SvcLogicContext ctx = new SvcLogicContext();
         mergeNode.mergeJsonDataOnTemplate(inParams, ctx);
@@ -55,14 +58,16 @@ public class TestMergeNode {
         MergeNode mergeNode = new MergeNode();
         Map<String, String> inParams = new HashMap<String, String>();
         inParams.put(ConfigGeneratorConstant.INPUT_PARAM_RESPONSE_PRIFIX, "test");
         MergeNode mergeNode = new MergeNode();
         Map<String, String> inParams = new HashMap<String, String>();
         inParams.put(ConfigGeneratorConstant.INPUT_PARAM_RESPONSE_PRIFIX, "test");
-        String jsonData = IOUtils
-                .toString(TestMergeNode.class.getClassLoader().getResourceAsStream("merge/complex/vdbe_data.json"));
+
+        String jsonData = IOUtils.toString(TestMergeNode.class.getClassLoader()
+                .getResourceAsStream("merge/complex/vdbe_data.json"));
         System.out.println("TestMergeNode.testMergeJsonComplexDataOnTemplate()" + jsonData);
         inParams.put(ConfigGeneratorConstant.INPUT_PARAM_JSON_DATA, jsonData);
 
         System.out.println("TestMergeNode.testMergeJsonComplexDataOnTemplate()" + jsonData);
         inParams.put(ConfigGeneratorConstant.INPUT_PARAM_JSON_DATA, jsonData);
 
-        String templateData = IOUtils
-                .toString(TestMergeNode.class.getClassLoader().getResourceAsStream("merge/complex/vdbe_template.xml"));
+        String templateData = IOUtils.toString(TestMergeNode.class.getClassLoader()
+                .getResourceAsStream("merge/complex/vdbe_template.xml"));
         inParams.put(ConfigGeneratorConstant.INPUT_PARAM_TEMPLATE_DATA, templateData);
         inParams.put(ConfigGeneratorConstant.INPUT_PARAM_TEMPLATE_DATA, templateData);
+
         SvcLogicContext ctx = new SvcLogicContext();
         mergeNode.mergeComplexJsonDataOnTemplate(inParams, ctx);
         assertEquals(ctx.getAttribute("test." + ConfigGeneratorConstant.OUTPUT_PARAM_STATUS),
         SvcLogicContext ctx = new SvcLogicContext();
         mergeNode.mergeComplexJsonDataOnTemplate(inParams, ctx);
         assertEquals(ctx.getAttribute("test." + ConfigGeneratorConstant.OUTPUT_PARAM_STATUS),
@@ -75,8 +80,9 @@ public class TestMergeNode {
         MergeNode mergeNode = new MergeNode();
         Map<String, String> inParams = new HashMap<String, String>();
         inParams.put(ConfigGeneratorConstant.INPUT_PARAM_RESPONSE_PRIFIX, "test");
         MergeNode mergeNode = new MergeNode();
         Map<String, String> inParams = new HashMap<String, String>();
         inParams.put(ConfigGeneratorConstant.INPUT_PARAM_RESPONSE_PRIFIX, "test");
-        String jsonData = IOUtils
-                .toString(TestMergeNode.class.getClassLoader().getResourceAsStream("merge/vdbe_data.json"));
+
+        String jsonData = IOUtils.toString(
+                TestMergeNode.class.getClassLoader().getResourceAsStream("merge/vdbe_data.json"));
         inParams.put(ConfigGeneratorConstant.INPUT_PARAM_JSON_DATA, jsonData);
         inParams.put(ConfigGeneratorConstant.INPUT_PARAM_TEMPLATE_FILE, "merge/vdbe_template.xml");
 
         inParams.put(ConfigGeneratorConstant.INPUT_PARAM_JSON_DATA, jsonData);
         inParams.put(ConfigGeneratorConstant.INPUT_PARAM_TEMPLATE_FILE, "merge/vdbe_template.xml");
 
@@ -85,6 +91,7 @@ public class TestMergeNode {
         assertEquals(ctx.getAttribute("test." + ConfigGeneratorConstant.OUTPUT_PARAM_STATUS),
                 ConfigGeneratorConstant.OUTPUT_STATUS_SUCCESS);
     }
         assertEquals(ctx.getAttribute("test." + ConfigGeneratorConstant.OUTPUT_PARAM_STATUS),
                 ConfigGeneratorConstant.OUTPUT_STATUS_SUCCESS);
     }
+
     @Test
     public void testMmergeDataOnTemplate() throws SvcLogicException {
         MergeNode mergeNode = new MergeNode();
     @Test
     public void testMmergeDataOnTemplate() throws SvcLogicException {
         MergeNode mergeNode = new MergeNode();
index db3fa71..8211e30 100644 (file)
@@ -1,9 +1,11 @@
 /*-
  * ============LICENSE_START=======================================================
 /*-
  * ============LICENSE_START=======================================================
- * ONAP : APP-C
+ * ONAP : APPC
  * ================================================================================
  * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property.  All rights reserved.
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
  * ================================================================================
  * ================================================================================
+ * Copyright (C) 2017 Amdocs
+ * =============================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
+ * 
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
  * ============LICENSE_END=========================================================
  */
 
  * ============LICENSE_END=========================================================
  */
 
-package org.openecomp.sdnc.config.generator.pattern;
+package org.onap.sdnc.config.generator.pattern;
 
 import static org.junit.Assert.assertEquals;
 import java.util.HashMap;
 import java.util.Map;
 import org.apache.commons.io.IOUtils;
 import org.junit.Test;
 
 import static org.junit.Assert.assertEquals;
 import java.util.HashMap;
 import java.util.Map;
 import org.apache.commons.io.IOUtils;
 import org.junit.Test;
-import org.openecomp.sdnc.config.generator.ConfigGeneratorConstant;
-import org.openecomp.sdnc.config.generator.pattern.PatternNode;
 import org.onap.ccsdk.sli.core.sli.SvcLogicContext;
 import org.onap.ccsdk.sli.core.sli.SvcLogicContext;
+import org.onap.sdnc.config.generator.ConfigGeneratorConstant;
 
 public class TestPatternNode {
 
 
 public class TestPatternNode {
 
@@ -36,46 +39,60 @@ public class TestPatternNode {
         PatternNode patternNode = new PatternNode();
         Map<String, String> inParams = new HashMap<String, String>();
         inParams.put(ConfigGeneratorConstant.INPUT_PARAM_RESPONSE_PRIFIX, "test");
         PatternNode patternNode = new PatternNode();
         Map<String, String> inParams = new HashMap<String, String>();
         inParams.put(ConfigGeneratorConstant.INPUT_PARAM_RESPONSE_PRIFIX, "test");
-        String logData = IOUtils.toString(TestPatternNode.class.getClassLoader().getResourceAsStream("pattern/errorlog.txt"),ConfigGeneratorConstant.STRING_ENCODING);
+        String logData = IOUtils.toString(
+                TestPatternNode.class.getClassLoader().getResourceAsStream("pattern/errorlog.txt"),
+                ConfigGeneratorConstant.STRING_ENCODING);
         inParams.put(ConfigGeneratorConstant.INPUT_PARAM_LOG_DATA, logData);
         SvcLogicContext ctx = new SvcLogicContext();
         patternNode.parseErrorLog(inParams, ctx);
         inParams.put(ConfigGeneratorConstant.INPUT_PARAM_LOG_DATA, logData);
         SvcLogicContext ctx = new SvcLogicContext();
         patternNode.parseErrorLog(inParams, ctx);
-        assertEquals(ctx.getAttribute("test."+ConfigGeneratorConstant.OUTPUT_PARAM_STATUS), ConfigGeneratorConstant.OUTPUT_STATUS_SUCCESS);
-    
-   }
-//    @Test(expected=Exception.class)
+        assertEquals(ctx.getAttribute("test." + ConfigGeneratorConstant.OUTPUT_PARAM_STATUS),
+                ConfigGeneratorConstant.OUTPUT_STATUS_SUCCESS);
+
+    }
+
+    // @Test(expected=Exception.class)
     public void checkXMLData() throws Exception {
         PatternNode patternNode = new PatternNode();
         Map<String, String> inParams = new HashMap<String, String>();
         inParams.put(ConfigGeneratorConstant.INPUT_PARAM_RESPONSE_PRIFIX, "test");
 
     public void checkXMLData() throws Exception {
         PatternNode patternNode = new PatternNode();
         Map<String, String> inParams = new HashMap<String, String>();
         inParams.put(ConfigGeneratorConstant.INPUT_PARAM_RESPONSE_PRIFIX, "test");
 
-        String xmlData = IOUtils.toString(TestPatternNode.class.getClassLoader().getResourceAsStream("pattern/xml_data.xml"),ConfigGeneratorConstant.STRING_ENCODING);
+        String xmlData = IOUtils.toString(
+                TestPatternNode.class.getClassLoader().getResourceAsStream("pattern/xml_data.xml"),
+                ConfigGeneratorConstant.STRING_ENCODING);
         inParams.put(ConfigGeneratorConstant.INPUT_PARAM_CHECK_DATA, xmlData);
         SvcLogicContext ctx = new SvcLogicContext();
         patternNode.checkDataType(inParams, ctx);
         inParams.put(ConfigGeneratorConstant.INPUT_PARAM_CHECK_DATA, xmlData);
         SvcLogicContext ctx = new SvcLogicContext();
         patternNode.checkDataType(inParams, ctx);
+        assertEquals(ctx.getAttribute("test." + ConfigGeneratorConstant.OUTPUT_PARAM_STATUS),
+                ConfigGeneratorConstant.OUTPUT_STATUS_SUCCESS);
     }
 
     }
 
-    //@Test
+    // @Test
     public void checkJsonData() throws Exception {
         PatternNode patternNode = new PatternNode();
         Map<String, String> inParams = new HashMap<String, String>();
         inParams.put(ConfigGeneratorConstant.INPUT_PARAM_RESPONSE_PRIFIX, "test");
     public void checkJsonData() throws Exception {
         PatternNode patternNode = new PatternNode();
         Map<String, String> inParams = new HashMap<String, String>();
         inParams.put(ConfigGeneratorConstant.INPUT_PARAM_RESPONSE_PRIFIX, "test");
-        String xmlData = IOUtils.toString(TestPatternNode.class.getClassLoader().getResourceAsStream("pattern/json_data.json"),ConfigGeneratorConstant.STRING_ENCODING);
+        String xmlData =
+                IOUtils.toString(TestPatternNode.class.getClassLoader().getResourceAsStream(
+                        "pattern/json_data.json"), ConfigGeneratorConstant.STRING_ENCODING);
         inParams.put(ConfigGeneratorConstant.INPUT_PARAM_CHECK_DATA, xmlData);
         SvcLogicContext ctx = new SvcLogicContext();
         patternNode.checkDataType(inParams, ctx);
         inParams.put(ConfigGeneratorConstant.INPUT_PARAM_CHECK_DATA, xmlData);
         SvcLogicContext ctx = new SvcLogicContext();
         patternNode.checkDataType(inParams, ctx);
-        assertEquals(ctx.getAttribute("test."+ConfigGeneratorConstant.OUTPUT_PARAM_STATUS), ConfigGeneratorConstant.OUTPUT_STATUS_SUCCESS);
+        assertEquals(ctx.getAttribute("test." + ConfigGeneratorConstant.OUTPUT_PARAM_STATUS),
+                ConfigGeneratorConstant.OUTPUT_STATUS_SUCCESS);
     }
 
     }
 
-    @Test(expected=Exception.class)
+    @Test(expected = Exception.class)
     public void checStringData() throws Exception {
         PatternNode patternNode = new PatternNode();
         Map<String, String> inParams = new HashMap<String, String>();
         inParams.put(ConfigGeneratorConstant.INPUT_PARAM_RESPONSE_PRIFIX, "test");
     public void checStringData() throws Exception {
         PatternNode patternNode = new PatternNode();
         Map<String, String> inParams = new HashMap<String, String>();
         inParams.put(ConfigGeneratorConstant.INPUT_PARAM_RESPONSE_PRIFIX, "test");
-        String stringData = IOUtils.toString(TestPatternNode.class.getClassLoader().getResourceAsStream("pattern/text_data.txt"),ConfigGeneratorConstant.STRING_ENCODING);
+        String stringData = IOUtils.toString(
+                TestPatternNode.class.getClassLoader().getResourceAsStream("pattern/text_data.txt"),
+                ConfigGeneratorConstant.STRING_ENCODING);
         inParams.put(ConfigGeneratorConstant.INPUT_PARAM_CHECK_DATA, stringData);
         SvcLogicContext ctx = new SvcLogicContext();
         patternNode.checkDataType(inParams, ctx);
         inParams.put(ConfigGeneratorConstant.INPUT_PARAM_CHECK_DATA, stringData);
         SvcLogicContext ctx = new SvcLogicContext();
         patternNode.checkDataType(inParams, ctx);
-        assertEquals(ctx.getAttribute("test."+ConfigGeneratorConstant.OUTPUT_PARAM_STATUS), ConfigGeneratorConstant.OUTPUT_STATUS_SUCCESS);
+        assertEquals(ctx.getAttribute("test." + ConfigGeneratorConstant.OUTPUT_PARAM_STATUS),
+                ConfigGeneratorConstant.OUTPUT_STATUS_SUCCESS);
     }
 }
     }
 }
index cda966b..8aeed61 100644 (file)
  * ============LICENSE_END=========================================================
  */
 
  * ============LICENSE_END=========================================================
  */
 
-package org.openecomp.sdnc.config.generator.reader;
+package org.onap.sdnc.config.generator.reader;
 
 import java.io.IOException;
 import java.util.HashMap;
 import java.util.Map;
 import org.apache.commons.io.IOUtils;
 import org.junit.Test;
 
 import java.io.IOException;
 import java.util.HashMap;
 import java.util.Map;
 import org.apache.commons.io.IOUtils;
 import org.junit.Test;
-import org.openecomp.sdnc.config.generator.ConfigGeneratorConstant;
-import org.openecomp.sdnc.config.generator.merge.TestMergeNode;
-import org.openecomp.sdnc.config.generator.reader.ReaderNode;
 import org.onap.ccsdk.sli.core.sli.SvcLogicContext;
 import org.onap.ccsdk.sli.core.sli.SvcLogicException;
 import org.onap.ccsdk.sli.core.sli.SvcLogicContext;
 import org.onap.ccsdk.sli.core.sli.SvcLogicException;
+import org.onap.sdnc.config.generator.ConfigGeneratorConstant;
+import org.onap.sdnc.config.generator.merge.TestMergeNode;
 
 public class TestReaderNode {
     @Test(expected = Exception.class)
 
 public class TestReaderNode {
     @Test(expected = Exception.class)
@@ -41,8 +40,9 @@ public class TestReaderNode {
         ReaderNode r = new ReaderNode();
         Map<String, String> inParams = new HashMap<String, String>();
         inParams.put(ConfigGeneratorConstant.INPUT_PARAM_RESPONSE_PRIFIX, "test");
         ReaderNode r = new ReaderNode();
         Map<String, String> inParams = new HashMap<String, String>();
         inParams.put(ConfigGeneratorConstant.INPUT_PARAM_RESPONSE_PRIFIX, "test");
-        inParams.put(ConfigGeneratorConstant.INPUT_PARAM_FILE_NAME, IOUtils
-                .toString(TestMergeNode.class.getClassLoader().getResourceAsStream("convert/payload_cli_config.json")));
+        inParams.put(ConfigGeneratorConstant.INPUT_PARAM_FILE_NAME,
+                IOUtils.toString(TestMergeNode.class.getClassLoader()
+                        .getResourceAsStream("convert/payload_cli_config.json")));
         SvcLogicContext ctx = new SvcLogicContext();
         r.getFileData(inParams, ctx);
     }
         SvcLogicContext ctx = new SvcLogicContext();
         r.getFileData(inParams, ctx);
     }
index 85230f4..6e1d525 100644 (file)
@@ -22,7 +22,7 @@
  * ============LICENSE_END=========================================================
  */
 
  * ============LICENSE_END=========================================================
  */
 
-package org.openecomp.sdnc.config.generator.tool;
+package org.onap.sdnc.config.generator.tool;
 
 import java.io.IOException;
 import java.util.ArrayList;
 
 import java.io.IOException;
 import java.util.ArrayList;
@@ -32,122 +32,124 @@ import java.util.Map;
 import org.apache.commons.io.IOUtils;
 import org.junit.Test;
 import org.mockito.Mock;
 import org.apache.commons.io.IOUtils;
 import org.junit.Test;
 import org.mockito.Mock;
-import org.openecomp.sdnc.config.generator.ConfigGeneratorConstant;
-import org.openecomp.sdnc.config.generator.pattern.TestPatternNode;
-import org.openecomp.sdnc.config.generator.tool.CheckDataTool;
+import org.onap.sdnc.config.generator.ConfigGeneratorConstant;
+import org.onap.sdnc.config.generator.pattern.TestPatternNode;
 import org.powermock.reflect.Whitebox;
 
 public class TestDataTool {
 import org.powermock.reflect.Whitebox;
 
 public class TestDataTool {
-       @Mock
-       LogParserTool lp = new LogParserTool();
-
-       @Test
-       public void testCheckData() throws IOException {
-               String data = IOUtils.toString(
-                               TestPatternNode.class.getClassLoader().getResourceAsStream("convert/payload_cli_config.json"),
-                               ConfigGeneratorConstant.STRING_ENCODING);
-                CheckDataTool.checkData(data);
-       }
-
-       @Test
-       public void testIsJSON() throws IOException {
-               String data = IOUtils.toString(
-                               TestPatternNode.class.getClassLoader().getResourceAsStream("convert/payload_cli_config.json"),
-                               ConfigGeneratorConstant.STRING_ENCODING);
-               CheckDataTool.isJSON(data);
-       }
-
-       @Test
-       public void testIsXML() throws IOException {
-               String data = IOUtils.toString(
-                               TestPatternNode.class.getClassLoader().getResourceAsStream("pattern/xml_data.xml"),
-                               ConfigGeneratorConstant.STRING_ENCODING);
-               CheckDataTool.isXML(data);
-       }
-
-       @Test
-       public void testNode() {
-               CustomJsonNodeFactory c = new CustomJsonNodeFactory();
-               String text = "test";
-               c.textNode(text);
-       }
-
-       @Test
-       public void testCustomText() {
-               CustomTextNode c = new CustomTextNode("test");
-               c.toString();
-       }
-
-       @Test
-       public void testEscapeUtils() {
-               String s = "test\\";
-               String st = "test\"test";
-               String str = "test\'" + "test";
-               String strng = "test\0";
-               EscapeUtils.escapeSQL(s);
-               EscapeUtils.escapeSql(s);
-               EscapeUtils.escapeSQL(st);
-               EscapeUtils.escapeSQL(str);
-               EscapeUtils.escapeSQL(strng);
-               EscapeUtils.escapeSQL(null);
-       }
-
-//     @Test(expected = Exception.class)
-       public void testgetData() throws Exception {
-               ArrayList argList = null;
-               String schema = "sdnctl";
-               String tableName = "dual";
-               String getselectData = "123";
-               String getDataClasue = "123='123'";
-               DbServiceUtil.getData(tableName, argList, schema, getselectData, getDataClasue);
-       }
-
-//     @Test(expected = Exception.class)
-       public void testupdateDB() throws Exception {
-               String setCluase = null;
-               String schema = "sdnctl";
-               String tableName = "dual";
-               ArrayList inputArgs = null;
-               String whereClause = "123='123'";
-               DbServiceUtil.updateDB(tableName, inputArgs, schema, whereClause, setCluase);
-       }
-
-//     @Test(expected = Exception.class)
-       public void testinitDbLibService() throws Exception {
-               DbServiceUtil.initDbLibService();
-       }
-
-       @Test
-       public void testJSONTool() throws Exception {
-               String data = IOUtils.toString(
-                               TestPatternNode.class.getClassLoader().getResourceAsStream("convert/payload_cli_config.json"),
-                               ConfigGeneratorConstant.STRING_ENCODING);
-               JSONTool.convertToProperties(data);
-               List<String> blockKeys = new ArrayList<String>();
-               blockKeys.add("vnf-type");
-               blockKeys.add("request-parameters");
-               JSONTool.convertToProperties(data, blockKeys);
-       }
-
-       @Test
-       public void testLogParserTool() throws Exception {
-               String data = IOUtils.toString(
-                               TestPatternNode.class.getClassLoader().getResourceAsStream("pattern/errorlog.txt"),
-                               ConfigGeneratorConstant.STRING_ENCODING);
-               LogParserTool lpt = new LogParserTool();
-               lpt.parseErrorLog(data);
-       }
-
-       @Test
-       public void testMergeTool() throws Exception {
-               String template = "test";
-               Map<String, String> dataMap = new HashMap<String, String>();
-               MergeTool.mergeMap2TemplateData(template, dataMap);
-       }
-
-       @Test
-       public void testcheckDateTime() throws Exception {
-               String line = "2017-08-20T17:40:23.100361+00:00";
-               Whitebox.invokeMethod(lp, "checkDateTime", line);
-       }
+    @Mock
+    LogParserTool lp = new LogParserTool();
+
+    @Test
+    public void testCheckData() throws IOException {
+        String data = IOUtils.toString(
+                TestPatternNode.class.getClassLoader()
+                        .getResourceAsStream("convert/payload_cli_config.json"),
+                ConfigGeneratorConstant.STRING_ENCODING);
+        CheckDataTool.checkData(data);
+    }
+
+    @Test
+    public void testIsJSON() throws IOException {
+        String data = IOUtils.toString(
+                TestPatternNode.class.getClassLoader()
+                        .getResourceAsStream("convert/payload_cli_config.json"),
+                ConfigGeneratorConstant.STRING_ENCODING);
+        CheckDataTool.isJSON(data);
+    }
+
+    @Test
+    public void testIsXML() throws IOException {
+        String data = IOUtils.toString(
+                TestPatternNode.class.getClassLoader().getResourceAsStream("pattern/xml_data.xml"),
+                ConfigGeneratorConstant.STRING_ENCODING);
+        CheckDataTool.isXML(data);
+    }
+
+    @Test
+    public void testNode() {
+        CustomJsonNodeFactory c = new CustomJsonNodeFactory();
+        String text = "test";
+        c.textNode(text);
+    }
+
+    @Test
+    public void testCustomText() {
+        CustomTextNode c = new CustomTextNode("test");
+        c.toString();
+    }
+
+    @Test
+    public void testEscapeUtils() {
+        String s = "test\\";
+        String st = "test\"test";
+        String str = "test\'" + "test";
+        String strng = "test\0";
+        EscapeUtils.escapeSQL(s);
+        EscapeUtils.escapeSql(s);
+        EscapeUtils.escapeSQL(st);
+        EscapeUtils.escapeSQL(str);
+        EscapeUtils.escapeSQL(strng);
+        EscapeUtils.escapeSQL(null);
+    }
+
+    // @Test(expected = Exception.class)
+    public void testgetData() throws Exception {
+        ArrayList argList = null;
+        String schema = "sdnctl";
+        String tableName = "dual";
+        String getselectData = "123";
+        String getDataClasue = "123='123'";
+        DbServiceUtil.getData(tableName, argList, schema, getselectData, getDataClasue);
+    }
+
+    // @Test(expected = Exception.class)
+    public void testupdateDB() throws Exception {
+        String setCluase = null;
+        String schema = "sdnctl";
+        String tableName = "dual";
+        ArrayList inputArgs = null;
+        String whereClause = "123='123'";
+        DbServiceUtil.updateDB(tableName, inputArgs, schema, whereClause, setCluase);
+    }
+
+    // @Test(expected = Exception.class)
+    public void testinitDbLibService() throws Exception {
+        DbServiceUtil.initDbLibService();
+    }
+
+    @Test
+    public void testJSONTool() throws Exception {
+        String data = IOUtils.toString(
+                TestPatternNode.class.getClassLoader()
+                        .getResourceAsStream("convert/payload_cli_config.json"),
+                ConfigGeneratorConstant.STRING_ENCODING);
+        JSONTool.convertToProperties(data);
+        List<String> blockKeys = new ArrayList<String>();
+        blockKeys.add("vnf-type");
+        blockKeys.add("request-parameters");
+        JSONTool.convertToProperties(data, blockKeys);
+    }
+
+    @Test
+    public void testLogParserTool() throws Exception {
+        String data = IOUtils.toString(
+                TestPatternNode.class.getClassLoader().getResourceAsStream("pattern/errorlog.txt"),
+                ConfigGeneratorConstant.STRING_ENCODING);
+        LogParserTool lpt = new LogParserTool();
+        lpt.parseErrorLog(data);
+    }
+
+    @Test
+    public void testMergeTool() throws Exception {
+        String template = "test";
+        Map<String, String> dataMap = new HashMap<String, String>();
+        MergeTool.mergeMap2TemplateData(template, dataMap);
+    }
+
+    @Test
+    public void testcheckDateTime() throws Exception {
+        String line = "2017-08-20T17:40:23.100361+00:00";
+        Whitebox.invokeMethod(lp, "checkDateTime", line);
+    }
 }
 }
index e2e8081..d9df4d0 100644 (file)
@@ -1,9 +1,11 @@
 /*-
  * ============LICENSE_START=======================================================
 /*-
  * ============LICENSE_START=======================================================
- * ONAP : APP-C
+ * ONAP : APPC
  * ================================================================================
  * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property.  All rights reserved.
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
  * ================================================================================
  * ================================================================================
+ * Copyright (C) 2017 Amdocs
+ * =============================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
+ * 
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
  * ============LICENSE_END=========================================================
  */
 
  * ============LICENSE_END=========================================================
  */
 
-package org.openecomp.sdnc.config.generator.transform;
+package org.onap.sdnc.config.generator.transform;
 
 import java.nio.charset.Charset;
 import java.util.HashMap;
 import java.util.Map;
 import org.apache.commons.io.IOUtils;
 import org.junit.Test;
 
 import java.nio.charset.Charset;
 import java.util.HashMap;
 import java.util.Map;
 import org.apache.commons.io.IOUtils;
 import org.junit.Test;
-import org.openecomp.sdnc.config.generator.ConfigGeneratorConstant;
-import org.openecomp.sdnc.config.generator.merge.TestMergeNode;
-import org.openecomp.sdnc.config.generator.transform.XSLTTransformerNode;
+import org.onap.ccsdk.sli.core.sli.SvcLogicContext;
+import org.onap.sdnc.config.generator.ConfigGeneratorConstant;
+import org.onap.sdnc.config.generator.merge.TestMergeNode;
 import com.att.eelf.configuration.EELFLogger;
 import com.att.eelf.configuration.EELFManager;
 import com.att.eelf.configuration.EELFLogger;
 import com.att.eelf.configuration.EELFManager;
-import org.onap.ccsdk.sli.core.sli.SvcLogicContext;
 
 public class TestXSLTTransformerNode {
 
 public class TestXSLTTransformerNode {
-    
-    private static final EELFLogger log = EELFManager.getInstance().getLogger(TestXSLTTransformerNode.class);
+
+    private static final EELFLogger log =
+            EELFManager.getInstance().getLogger(TestXSLTTransformerNode.class);
 
     @Test
     public void transformData() throws Exception {
 
     @Test
     public void transformData() throws Exception {
@@ -50,7 +54,9 @@ public class TestXSLTTransformerNode {
         inParams.put(ConfigGeneratorConstant.INPUT_PARAM_REQUEST_DATA, requestData);
         XSLTTransformerNode transformerNode = new XSLTTransformerNode();
         transformerNode.transformData(inParams, ctx);
         inParams.put(ConfigGeneratorConstant.INPUT_PARAM_REQUEST_DATA, requestData);
         XSLTTransformerNode transformerNode = new XSLTTransformerNode();
         transformerNode.transformData(inParams, ctx);
-        log.info("transformData Result: " + ctx.getAttribute(ConfigGeneratorConstant.OUTPUT_PARAM_TRANSFORMED_DATA));
+        log.info("transformData Result: "
+                + ctx.getAttribute(ConfigGeneratorConstant.OUTPUT_PARAM_TRANSFORMED_DATA));
 
     }
 
     }
+
 }
 }
index 74c17bd..553bc7c 100644 (file)
@@ -1,9 +1,11 @@
 /*-
  * ============LICENSE_START=======================================================
 /*-
  * ============LICENSE_START=======================================================
- * ONAP : APP-C
+ * ONAP : APPC
  * ================================================================================
  * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property.  All rights reserved.
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
  * ================================================================================
  * ================================================================================
+ * Copyright (C) 2017 Amdocs
+ * =============================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
+ * 
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
  * ============LICENSE_END=========================================================
  */
 
  * ============LICENSE_END=========================================================
  */
 
-package org.openecomp.sdnc.config.generator.writer;
+package org.onap.sdnc.config.generator.writer;
 
 import static org.junit.Assert.assertEquals;
 import java.util.HashMap;
 import java.util.Map;
 import org.junit.Test;
 
 import static org.junit.Assert.assertEquals;
 import java.util.HashMap;
 import java.util.Map;
 import org.junit.Test;
-import org.openecomp.sdnc.config.generator.ConfigGeneratorConstant;
-import org.openecomp.sdnc.config.generator.writer.FileWriterNode;
 import org.onap.ccsdk.sli.core.sli.SvcLogicContext;
 import org.onap.ccsdk.sli.core.sli.SvcLogicContext;
+import org.onap.sdnc.config.generator.ConfigGeneratorConstant;
 
 public class TestFileWriterNode {
 
 
 public class TestFileWriterNode {
 
@@ -34,8 +37,10 @@ public class TestFileWriterNode {
     public void writeFile() throws Exception {
         FileWriterNode FileWriterNode = new FileWriterNode();
         Map<String, String> inParams = new HashMap<String, String>();
     public void writeFile() throws Exception {
         FileWriterNode FileWriterNode = new FileWriterNode();
         Map<String, String> inParams = new HashMap<String, String>();
-        inParams.put(ConfigGeneratorConstant.INPUT_PARAM_FILE_NAME, "src/test/resources/writer/testcvaas.json");
-        inParams.put(ConfigGeneratorConstant.INPUT_PARAM_REQUEST_DATA, "{'name':'Name','role':'admin'}");
+        inParams.put(ConfigGeneratorConstant.INPUT_PARAM_FILE_NAME,
+                "src/test/resources/writer/testcvaas.json");
+        inParams.put(ConfigGeneratorConstant.INPUT_PARAM_REQUEST_DATA,
+                "{'name':'Name','role':'admin'}");
         inParams.put(ConfigGeneratorConstant.INPUT_PARAM_RESPONSE_PRIFIX, "test");
         SvcLogicContext ctx = new SvcLogicContext();
         FileWriterNode.writeFile(inParams, ctx);
         inParams.put(ConfigGeneratorConstant.INPUT_PARAM_RESPONSE_PRIFIX, "test");
         SvcLogicContext ctx = new SvcLogicContext();
         FileWriterNode.writeFile(inParams, ctx);
index 7877967..76ebf36 100644 (file)
@@ -1,9 +1,11 @@
 <!--
   ============LICENSE_START=======================================================
 <!--
   ============LICENSE_START=======================================================
-  ONAP : APP-C
+  ONAP : APPC
   ================================================================================
   ================================================================================
-  Copyright (C) 2017 AT&T Intellectual Property.  All rights reserved.
+  Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
   ================================================================================
   ================================================================================
+  Copyright (C) 2017 Amdocs
+  =============================================================================
   Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with the License.
   You may obtain a copy of the License at
   Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with the License.
   You may obtain a copy of the License at
@@ -15,5 +17,7 @@
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.
+  
+  ECOMP is a trademark and service mark of AT&T Intellectual Property.
   ============LICENSE_END=========================================================
   -->
   ============LICENSE_END=========================================================
   -->
index 7877967..76ebf36 100644 (file)
@@ -1,9 +1,11 @@
 <!--
   ============LICENSE_START=======================================================
 <!--
   ============LICENSE_START=======================================================
-  ONAP : APP-C
+  ONAP : APPC
   ================================================================================
   ================================================================================
-  Copyright (C) 2017 AT&T Intellectual Property.  All rights reserved.
+  Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
   ================================================================================
   ================================================================================
+  Copyright (C) 2017 Amdocs
+  =============================================================================
   Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with the License.
   You may obtain a copy of the License at
   Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with the License.
   You may obtain a copy of the License at
@@ -15,5 +17,7 @@
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.
+  
+  ECOMP is a trademark and service mark of AT&T Intellectual Property.
   ============LICENSE_END=========================================================
   -->
   ============LICENSE_END=========================================================
   -->
index 7877967..76ebf36 100644 (file)
@@ -1,9 +1,11 @@
 <!--
   ============LICENSE_START=======================================================
 <!--
   ============LICENSE_START=======================================================
-  ONAP : APP-C
+  ONAP : APPC
   ================================================================================
   ================================================================================
-  Copyright (C) 2017 AT&T Intellectual Property.  All rights reserved.
+  Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
   ================================================================================
   ================================================================================
+  Copyright (C) 2017 Amdocs
+  =============================================================================
   Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with the License.
   You may obtain a copy of the License at
   Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with the License.
   You may obtain a copy of the License at
@@ -15,5 +17,7 @@
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.
+  
+  ECOMP is a trademark and service mark of AT&T Intellectual Property.
   ============LICENSE_END=========================================================
   -->
   ============LICENSE_END=========================================================
   -->
index 8be67ba..76ebf36 100644 (file)
@@ -1,19 +1,23 @@
-/*-
- * ============LICENSE_START=======================================================
- * ONAP : APP-C
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property.  All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
+<!--
+  ============LICENSE_START=======================================================
+  ONAP : APPC
+  ================================================================================
+  Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+  ================================================================================
+  Copyright (C) 2017 Amdocs
+  =============================================================================
+  Licensed under the Apache License, Version 2.0 (the "License");
+  you may not use this file except in compliance with the License.
+  You may obtain a copy of the License at
+  
+       http://www.apache.org/licenses/LICENSE-2.0
+  
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+  
+  ECOMP is a trademark and service mark of AT&T Intellectual Property.
+  ============LICENSE_END=========================================================
+  -->
index 9980d20..e67ce6c 100644 (file)
@@ -1,10 +1,12 @@
 <?xml version="1.0"?>
 <!--
   ============LICENSE_START=======================================================
 <?xml version="1.0"?>
 <!--
   ============LICENSE_START=======================================================
-  ONAP : APP-C
+  ONAP : APPC
   ================================================================================
   ================================================================================
-  Copyright (C) 2017 AT&T Intellectual Property.  All rights reserved.
+  Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
   ================================================================================
   ================================================================================
+  Copyright (C) 2017 Amdocs
+  =============================================================================
   Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with the License.
   You may obtain a copy of the License at
   Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with the License.
   You may obtain a copy of the License at
@@ -16,6 +18,8 @@
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.
+  
+  ECOMP is a trademark and service mark of AT&T Intellectual Property.
   ============LICENSE_END=========================================================
   -->
 
   ============LICENSE_END=========================================================
   -->
 
index 0ce46df..684c782 100644 (file)
@@ -1,10 +1,12 @@
 <?xml version="1.0" encoding="ISO-8859-1"?>
 <!--
   ============LICENSE_START=======================================================
 <?xml version="1.0" encoding="ISO-8859-1"?>
 <!--
   ============LICENSE_START=======================================================
-  ONAP : APP-C
+  ONAP : APPC
   ================================================================================
   ================================================================================
-  Copyright (C) 2017 AT&T Intellectual Property.  All rights reserved.
+  Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
   ================================================================================
   ================================================================================
+  Copyright (C) 2017 Amdocs
+  =============================================================================
   Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with the License.
   You may obtain a copy of the License at
   Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with the License.
   You may obtain a copy of the License at
@@ -16,6 +18,8 @@
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.
+  
+  ECOMP is a trademark and service mark of AT&T Intellectual Property.
   ============LICENSE_END=========================================================
   -->
 
   ============LICENSE_END=========================================================
   -->
 
index cd2b9d2..ca8dbdf 100644 (file)
@@ -26,8 +26,8 @@ import java.util.Map;
 import org.junit.Test;
 import org.onap.appc.dg.mock.instance.MockConfigureNodeExecutor;
 import org.onap.appc.dg.mock.instance.MockSvcLogicJavaPlugin;
 import org.junit.Test;
 import org.onap.appc.dg.mock.instance.MockConfigureNodeExecutor;
 import org.onap.appc.dg.mock.instance.MockSvcLogicJavaPlugin;
-import org.openecomp.sdnc.config.generator.convert.ConvertNode;
-import org.openecomp.sdnc.config.generator.merge.MergeNode;
+import org.onap.sdnc.config.generator.convert.ConvertNode;
+import org.onap.sdnc.config.generator.merge.MergeNode;
 /*  move to open source
 import com.att.sdnctl.dgtestlibrary.AbstractDGTestCase;
 import com.att.sdnctl.dgtestlibrary.DGTestCase;
 /*  move to open source
 import com.att.sdnctl.dgtestlibrary.AbstractDGTestCase;
 import com.att.sdnctl.dgtestlibrary.DGTestCase;