diff --git a/appc-directed-graph/appc-dgraph/provider/.gitignore b/appc-directed-graph/appc-dgraph/provider/.gitignore
index 468fdf6..e0b88df 100644
--- a/appc-directed-graph/appc-dgraph/provider/.gitignore
+++ b/appc-directed-graph/appc-dgraph/provider/.gitignore
@@ -7,3 +7,4 @@
 log/
 target/
 /bin/
+/target-ide/
diff --git a/appc-directed-graph/appc-dgraph/provider/pom.xml b/appc-directed-graph/appc-dgraph/provider/pom.xml
index 31d472e..e2a9f0c 100644
--- a/appc-directed-graph/appc-dgraph/provider/pom.xml
+++ b/appc-directed-graph/appc-dgraph/provider/pom.xml
@@ -94,7 +94,7 @@
                     </execution>
                 </executions>
                 <configuration>
-                    <mainClass>org.openecomp.sdnc.dg.loader.DGXMLGenerator</mainClass>
+                    <mainClass>org.onap.sdnc.dg.loader.DGXMLGenerator</mainClass>
                     <arguments>
                         <argument>${project.basedir}/src/main/resources/json</argument>
                         <argument>${project.basedir}/src/main/resources/xml</argument>
diff --git a/appc-directed-graph/dg-loader/provider/.gitignore b/appc-directed-graph/dg-loader/provider/.gitignore
index 841e8d9..ba6a009 100644
--- a/appc-directed-graph/dg-loader/provider/.gitignore
+++ b/appc-directed-graph/dg-loader/provider/.gitignore
@@ -6,3 +6,4 @@
 # Maven
 log/
 target/
+/target-ide/
diff --git a/appc-directed-graph/dg-loader/provider/src/main/java/org/onap/sdnc/dg/loader/DGLoaderActivator.java b/appc-directed-graph/dg-loader/provider/src/main/java/org/onap/sdnc/dg/loader/DGLoaderActivator.java
index 99f7f8b..db437a9 100644
--- a/appc-directed-graph/dg-loader/provider/src/main/java/org/onap/sdnc/dg/loader/DGLoaderActivator.java
+++ b/appc-directed-graph/dg-loader/provider/src/main/java/org/onap/sdnc/dg/loader/DGLoaderActivator.java
@@ -18,37 +18,34 @@
  * ============LICENSE_END=========================================================
  */
 
-package org.openecomp.sdnc.dg.loader;
+package org.onap.sdnc.dg.loader;
 
 import java.util.LinkedList;
 import java.util.List;
-
 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;
 
-public class DGLoaderActivator implements BundleActivator{
+public class DGLoaderActivator implements BundleActivator {
 
     private List<ServiceRegistration> registrations = new LinkedList<ServiceRegistration>();
 
 
-    private static final EELFLogger log = EELFManager.getInstance().getLogger(DGLoaderActivator.class);
+    private static final EELFLogger log =
+            EELFManager.getInstance().getLogger(DGLoaderActivator.class);
 
     @Override
-    public void start(BundleContext ctx) throws Exception
-    {
+    public void start(BundleContext ctx) throws Exception {
 
-        
+
 
     }
+
     @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;
         }
diff --git a/appc-directed-graph/dg-loader/provider/src/main/java/org/onap/sdnc/dg/loader/DGXMLActivate.java b/appc-directed-graph/dg-loader/provider/src/main/java/org/onap/sdnc/dg/loader/DGXMLActivate.java
index 6af4477..9050fa0 100644
--- a/appc-directed-graph/dg-loader/provider/src/main/java/org/onap/sdnc/dg/loader/DGXMLActivate.java
+++ b/appc-directed-graph/dg-loader/provider/src/main/java/org/onap/sdnc/dg/loader/DGXMLActivate.java
@@ -22,12 +22,11 @@
  * ============LICENSE_END=========================================================
  */
 
-package org.openecomp.sdnc.dg.loader;
+package org.onap.sdnc.dg.loader;
 
 import java.io.File;
 import java.util.ArrayList;
 import java.util.List;
-
 import org.apache.commons.io.FileUtils;
 import org.apache.commons.lang.StringUtils;
 import org.onap.ccsdk.sli.core.sli.SvcLogicGraph;
@@ -44,63 +43,70 @@
     private final SvcLogicStore store;
     public static String STRING_ENCODING = "utf-8";
 
-    public DGXMLActivate(String propfile) throws Exception{
-        if(StringUtils.isBlank(propfile)){
+    public DGXMLActivate(String propfile) throws Exception {
+        if (StringUtils.isBlank(propfile)) {
             throw new Exception(propfile + " Profile file is not defined");
         }
         this.store = SvcLogicStoreFactory.getSvcLogicStore(propfile);
     }
-    
+
     protected DGXMLActivate(SvcLogicStore store) {
         this.store = store;
     }
 
 
     public void activateDg(String activateFilePath) throws Exception {
-        logger.info("******************** Activating DG into Database *****************************");
+        logger.info(
+                "******************** Activating DG into Database *****************************");
         try {
             List<String> errors = new ArrayList<String>();
-            if(this.store != null){
+            if (this.store != null) {
                 File activateFile = new File(activateFilePath);
-                if(activateFile != null && activateFile.isFile()){
-                    List<String> fileLines = FileUtils.readLines(activateFile,STRING_ENCODING);
-                    if(fileLines != null ){
+                if (activateFile != null && activateFile.isFile()) {
+                    List<String> fileLines = FileUtils.readLines(activateFile, STRING_ENCODING);
+                    if (fileLines != null) {
                         for (String line : fileLines) {
-                            if(line != null && ! line.trim().startsWith("#")){
+                            if (line != null && !line.trim().startsWith("#")) {
                                 String lineArray[] = line.trim().split(":");
                                 try {
-                                    if(lineArray != null && lineArray.length >= 4){
+                                    if (lineArray != null && lineArray.length >= 4) {
                                         String module = lineArray[0];
                                         String rpc = lineArray[1];
                                         String version = lineArray[2];
                                         String mode = lineArray[3];
-                                        if(StringUtils.isNotBlank(module) && StringUtils.isNotBlank(rpc)
-                                                && StringUtils.isNotBlank(version) && StringUtils.isNotBlank(mode)){
+                                        if (StringUtils.isNotBlank(module)
+                                                && StringUtils.isNotBlank(rpc)
+                                                && StringUtils.isNotBlank(version)
+                                                && StringUtils.isNotBlank(mode)) {
                                             logger.info("Activating DG :" + line);
-                                            SvcLogicGraph graph = this.store.fetch(module, rpc, version, mode);
-                                            if(graph != null){
-                                                logger.info("Found Graph :" + line + " Activating ...");
+                                            SvcLogicGraph graph =
+                                                    this.store.fetch(module, rpc, version, mode);
+                                            if (graph != null) {
+                                                logger.info(
+                                                        "Found Graph :" + line + " Activating ...");
                                                 this.store.activate(graph);
-                                            }else{
-                                                throw new Exception("Failed to fetch from Database");
+                                            } else {
+                                                throw new Exception(
+                                                        "Failed to fetch from Database");
                                             }
                                         }
                                     }
                                 } catch (Exception e) {
                                     e.printStackTrace();
-                                    errors.add("Failed to Activate "+line + ", "+e.getMessage());
+                                    errors.add(
+                                            "Failed to Activate " + line + ", " + e.getMessage());
                                 }
                             }
                         }
                     }
-                }else{
+                } else {
                     throw new Exception(activateFile + " is not a valid Activate file Path");
                 }
-            }else{
+            } else {
                 throw new Exception("Failed to initialise SvcLogicStore");
             }
 
-            if(errors.size() > 0){
+            if (errors.size() > 0) {
                 throw new Exception(errors.toString());
             }
         } catch (Exception e) {
@@ -114,18 +120,19 @@
             String activateFile = null;
             String propertyPath = null;
 
-            if(args != null && args.length >= 2){
+            if (args != null && args.length >= 2) {
                 activateFile = args[0];
                 propertyPath = args[1];
-            }else{
-                throw new Exception("Sufficient inputs for DGXMLActivate are missing <activatefile> <dbPropertyfile>");
+            } else {
+                throw new Exception(
+                        "Sufficient inputs for DGXMLActivate are missing <activatefile> <dbPropertyfile>");
             }
 
             DGXMLActivate dgXmlActivate = new DGXMLActivate(propertyPath);
             dgXmlActivate.activateDg(activateFile);
         } catch (Exception e) {
             e.printStackTrace();
-        }finally {
+        } finally {
             System.exit(1);
         }
     }
diff --git a/appc-directed-graph/dg-loader/provider/src/main/java/org/onap/sdnc/dg/loader/DGXMLGenerator.java b/appc-directed-graph/dg-loader/provider/src/main/java/org/onap/sdnc/dg/loader/DGXMLGenerator.java
index 60fcd5b..0d60a71 100644
--- a/appc-directed-graph/dg-loader/provider/src/main/java/org/onap/sdnc/dg/loader/DGXMLGenerator.java
+++ b/appc-directed-graph/dg-loader/provider/src/main/java/org/onap/sdnc/dg/loader/DGXMLGenerator.java
@@ -18,15 +18,14 @@
  * ============LICENSE_END=========================================================
  */
 
-package org.openecomp.sdnc.dg.loader;
+package org.onap.sdnc.dg.loader;
+
 import java.io.File;
 import java.util.ArrayList;
 import java.util.List;
-
 import javax.script.Invocable;
 import javax.script.ScriptEngine;
 import javax.script.ScriptEngineManager;
-
 import org.apache.commons.io.FileUtils;
 import org.apache.commons.io.IOUtils;
 import org.slf4j.Logger;
@@ -41,8 +40,9 @@
     public static String JS_METHOD_GET_NODE_TO_XML = "getNodeToXml";
     public static String GENERATOR_TEMPLATE_FILE = "js/dg_xml2json.js";
 
-    public void generateXMLFromJSON(String jsonPath, String xmlpath, String propertyPath) throws Exception {
-        try{
+    public void generateXMLFromJSON(String jsonPath, String xmlpath, String propertyPath)
+            throws Exception {
+        try {
             ScriptEngineManager manager = new ScriptEngineManager();
             ScriptEngine engine = manager.getEngineByName("JavaScript");
             if (!(engine instanceof Invocable)) {
@@ -50,52 +50,57 @@
                 return;
             }
             Invocable inv = (Invocable) engine;
-            //        engine.eval(new FileReader(DGXMLGenerator.class.getClassLoader().getResource(GENERATOR_TEMPLATE_FILE).getPath()));
-            String js = IOUtils.toString(DGXMLGenerator.class.getClassLoader().getResourceAsStream(GENERATOR_TEMPLATE_FILE),STRING_ENCODING);
+            // engine.eval(new
+            // FileReader(DGXMLGenerator.class.getClassLoader().getResource(GENERATOR_TEMPLATE_FILE).getPath()));
+            String js = IOUtils.toString(DGXMLGenerator.class.getClassLoader()
+                    .getResourceAsStream(GENERATOR_TEMPLATE_FILE), STRING_ENCODING);
             engine.eval(js);
 
             Object dgconverter = engine.get(JS_INTERFACE_DG_CONVERTOR);
 
             List<File> files = new ArrayList<File>();
-            if(dgconverter != null){
+            if (dgconverter != null) {
                 File jsonPathFile = new File(jsonPath);
-                if(jsonPathFile.isDirectory()){
-                    String[] extensions = new String[] { "json", "JSON" };
+                if (jsonPathFile.isDirectory()) {
+                    String[] extensions = new String[] {"json", "JSON"};
                     files = (List<File>) FileUtils.listFiles(jsonPathFile, extensions, true);
-                }else if(jsonPathFile.isFile()){
+                } else if (jsonPathFile.isFile()) {
                     files.add(jsonPathFile);
-                }else{
-                    throw new Exception("Failed to get the nature of the JSON path :"+ jsonPath);
+                } else {
+                    throw new Exception("Failed to get the nature of the JSON path :" + jsonPath);
                 }
 
-                logger.info("JSON Files identified "+ files.size());
+                logger.info("JSON Files identified " + files.size());
 
-                if(files.size() > 0){
+                if (files.size() > 0) {
                     boolean isXmlPathDeleted = FileUtils.deleteQuietly(new File(xmlpath));
-                    logger.info("Cleaning old DG XML under : " + xmlpath + ", delete status :" + isXmlPathDeleted);
+                    logger.info("Cleaning old DG XML under : " + xmlpath + ", delete status :"
+                            + isXmlPathDeleted);
 
                     for (File file : files) {
-                        String dgJson = FileUtils.readFileToString(file,STRING_ENCODING);
+                        String dgJson = FileUtils.readFileToString(file, STRING_ENCODING);
                         logger.info("Generating XML from  :" + file.getName());
-                        String xmlFileName = xmlpath +"/"+file.getName().replace(".json", ".xml");
+                        String xmlFileName =
+                                xmlpath + "/" + file.getName().replace(".json", ".xml");
 
-                        Object dgXMl = inv.invokeMethod(dgconverter, JS_METHOD_GET_NODE_TO_XML, dgJson);
+                        Object dgXMl =
+                                inv.invokeMethod(dgconverter, JS_METHOD_GET_NODE_TO_XML, dgJson);
                         // Write the XML File
-                        if(dgXMl != null){
+                        if (dgXMl != null) {
                             File xmlFile = new File(xmlFileName);
                             FileUtils.writeStringToFile(xmlFile, dgXMl.toString(), STRING_ENCODING);
                             logger.info("Generated XML File under  :" + xmlFile.getCanonicalPath());
                         }
                     }
 
-                }else{
+                } else {
                     logger.info("No JSON Files to generate XML");
                 }
-            }else{
+            } else {
                 logger.error("Couldn't get Java Script Engine..");
             }
-        }catch (Exception e) {
-            logger.error("Failed to generate generateXMLFromJSON :"+e.getMessage());
+        } catch (Exception e) {
+            logger.error("Failed to generate generateXMLFromJSON :" + e.getMessage());
         }
     }
 
@@ -107,19 +112,19 @@
             String xmlPath = null;
             String propertyPath = null;
             // Generate, GenerateLoad, GenerateLoadActivate
-            //args = new String[]{"src/main/resources/json","src/test/resources/xml"};
-            logger.info("DGXML Conversion Started with arguments :"+ args[0] +":"+ args[1]);
-            if(args != null && args.length >= 2){
+            // args = new String[]{"src/main/resources/json","src/test/resources/xml"};
+            logger.info("DGXML Conversion Started with arguments :" + args[0] + ":" + args[1]);
+            if (args != null && args.length >= 2) {
                 jsonPath = args[0];
                 xmlPath = args[1];
-            }else{
+            } else {
                 throw new Exception("Sufficient inputs are missing <jsonPath> <xmlPath>");
             }
 
             application.generateXMLFromJSON(jsonPath, xmlPath, propertyPath);
             logger.info("DGXML Conversion Completed...");
         } catch (Exception e) {
-            logger.error("Failed in DG XML Generation :"+e.getMessage());
+            logger.error("Failed in DG XML Generation :" + e.getMessage());
             e.printStackTrace();
         }
 
diff --git a/appc-directed-graph/dg-loader/provider/src/main/java/org/onap/sdnc/dg/loader/DGXMLLoad.java b/appc-directed-graph/dg-loader/provider/src/main/java/org/onap/sdnc/dg/loader/DGXMLLoad.java
index 1b6116c..ced6b00 100644
--- a/appc-directed-graph/dg-loader/provider/src/main/java/org/onap/sdnc/dg/loader/DGXMLLoad.java
+++ b/appc-directed-graph/dg-loader/provider/src/main/java/org/onap/sdnc/dg/loader/DGXMLLoad.java
@@ -22,17 +22,15 @@
  * ============LICENSE_END=========================================================
  */
 
-package org.openecomp.sdnc.dg.loader;
+package org.onap.sdnc.dg.loader;
 
 import java.io.File;
 import java.util.ArrayList;
 import java.util.List;
-
 import org.apache.commons.io.FileUtils;
 import org.apache.commons.lang.StringUtils;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
-
 import org.onap.ccsdk.sli.core.sli.SvcLogicException;
 import org.onap.ccsdk.sli.core.sli.SvcLogicParser;
 import org.onap.ccsdk.sli.core.sli.SvcLogicStore;
@@ -43,48 +41,50 @@
     private final SvcLogicStore store;
     public static String STRING_ENCODING = "utf-8";
 
-    public DGXMLLoad(String propfile) throws Exception{
-        if(StringUtils.isBlank(propfile)){
+    public DGXMLLoad(String propfile) throws Exception {
+        if (StringUtils.isBlank(propfile)) {
             throw new Exception(propfile + " Profile file is not defined");
         }
         this.store = SvcLogicStoreFactory.getSvcLogicStore(propfile);
     }
 
     protected DGXMLLoad(SvcLogicStore store) throws Exception {
-        this.store=store;
+        this.store = store;
     }
-    
-    public void loadDGXMLFile(String dgXMLpath) throws SvcLogicException{
-        if(dgXMLpath != null ){
+
+    public void loadDGXMLFile(String dgXMLpath) throws SvcLogicException {
+        if (dgXMLpath != null) {
             SvcLogicParser.load(dgXMLpath, this.store);
         }
     }
 
     private void loadDGXMLDir(String xmlPath) throws Exception {
         try {
-            logger.info("******************** Loading DG into Database *****************************");
+            logger.info(
+                    "******************** Loading DG into Database *****************************");
             List<String> errors = new ArrayList<String>();
-            if(this.store != null){
+            if (this.store != null) {
                 File xmlDir = new File(xmlPath);
-                if(xmlDir != null && xmlDir.isDirectory()){
-                    String[] extensions = new String[] { "xml", "XML" };
+                if (xmlDir != null && xmlDir.isDirectory()) {
+                    String[] extensions = new String[] {"xml", "XML"};
                     List<File> files = (List<File>) FileUtils.listFiles(xmlDir, extensions, true);
                     for (File file : files) {
                         logger.info("Loading DG XML file :" + file.getCanonicalPath());
-                        try{
+                        try {
                             SvcLogicParser.load(file.getCanonicalPath(), this.store);
-                        }catch (Exception e) {
-                            errors.add("Failed to load XML "+file.getCanonicalPath() + ", Exception : "+e.getMessage());
+                        } catch (Exception e) {
+                            errors.add("Failed to load XML " + file.getCanonicalPath()
+                                    + ", Exception : " + e.getMessage());
                         }
                     }
-                }else{
+                } else {
                     throw new Exception(xmlPath + " is not a valid XML Directory");
                 }
-            }else{
+            } else {
                 throw new Exception("Failed to initialise SvcLogicStore");
             }
 
-            if(errors.size() > 0){
+            if (errors.size() > 0) {
                 throw new Exception(errors.toString());
             }
         } catch (Exception e) {
@@ -97,17 +97,18 @@
             String xmlPath = null;
             String propertyPath = null;
 
-            if(args != null && args.length >= 2){
+            if (args != null && args.length >= 2) {
                 xmlPath = args[0];
                 propertyPath = args[1];
-            }else{
-                throw new Exception("Sufficient inputs for DGXMLLoadNActivate are missing <xmlpath> <dbPropertyfile>");
+            } else {
+                throw new Exception(
+                        "Sufficient inputs for DGXMLLoadNActivate are missing <xmlpath> <dbPropertyfile>");
             }
             DGXMLLoad dgXMLLoadDB = new DGXMLLoad(propertyPath);
             dgXMLLoadDB.loadDGXMLDir(xmlPath);
         } catch (Exception e) {
             e.printStackTrace();
-        }finally {
+        } finally {
             System.exit(1);
         }
     }
diff --git a/appc-directed-graph/dg-loader/provider/src/main/java/org/onap/sdnc/dg/loader/DGXMLLoadNActivate.java b/appc-directed-graph/dg-loader/provider/src/main/java/org/onap/sdnc/dg/loader/DGXMLLoadNActivate.java
index 54f1091..490a1f9 100644
--- a/appc-directed-graph/dg-loader/provider/src/main/java/org/onap/sdnc/dg/loader/DGXMLLoadNActivate.java
+++ b/appc-directed-graph/dg-loader/provider/src/main/java/org/onap/sdnc/dg/loader/DGXMLLoadNActivate.java
@@ -22,17 +22,15 @@
  * ============LICENSE_END=========================================================
  */
 
-package org.openecomp.sdnc.dg.loader;
+package org.onap.sdnc.dg.loader;
 
 import java.io.File;
 import java.util.ArrayList;
 import java.util.List;
-
 import org.apache.commons.io.FileUtils;
 import org.apache.commons.lang.StringUtils;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
-
 import org.onap.ccsdk.sli.core.sli.SvcLogicException;
 import org.onap.ccsdk.sli.core.sli.SvcLogicGraph;
 import org.onap.ccsdk.sli.core.sli.SvcLogicParser;
@@ -44,48 +42,50 @@
     private final SvcLogicStore store;
     public static String STRING_ENCODING = "utf-8";
 
-    public DGXMLLoadNActivate(String propfile) throws Exception{
-        if(StringUtils.isBlank(propfile)){
+    public DGXMLLoadNActivate(String propfile) throws Exception {
+        if (StringUtils.isBlank(propfile)) {
             throw new Exception(propfile + " Profile file is not defined");
         }
         this.store = SvcLogicStoreFactory.getSvcLogicStore(propfile);
     }
 
     protected DGXMLLoadNActivate(SvcLogicStore store) {
-        this.store=store;
+        this.store = store;
     }
 
-    public void loadDGXMLFile(String dgXMLpath) throws SvcLogicException{
-        if(dgXMLpath != null ){
+    public void loadDGXMLFile(String dgXMLpath) throws SvcLogicException {
+        if (dgXMLpath != null) {
             SvcLogicParser.load(dgXMLpath, this.store);
         }
     }
 
     private void loadDGXMLDir(String xmlPath) throws Exception {
         try {
-            logger.info("******************** Loading DG into Database *****************************");
+            logger.info(
+                    "******************** Loading DG into Database *****************************");
             List<String> errors = new ArrayList<String>();
-            if(this.store != null){
+            if (this.store != null) {
                 File xmlDir = new File(xmlPath);
-                if(xmlDir.isDirectory()){
-                    String[] extensions = new String[] { "xml", "XML" };
+                if (xmlDir.isDirectory()) {
+                    String[] extensions = new String[] {"xml", "XML"};
                     List<File> files = (List<File>) FileUtils.listFiles(xmlDir, extensions, true);
                     for (File file : files) {
                         logger.info("Loading DG XML file :" + file.getCanonicalPath());
-                        try{
+                        try {
                             SvcLogicParser.load(file.getCanonicalPath(), this.store);
-                        }catch (Exception e) {
-                            errors.add("Failed to load XML "+file.getCanonicalPath() + ", Exception : "+e.getMessage());
+                        } catch (Exception e) {
+                            errors.add("Failed to load XML " + file.getCanonicalPath()
+                                    + ", Exception : " + e.getMessage());
                         }
                     }
-                }else{
+                } else {
                     throw new Exception(xmlPath + " is not a valid XML Directory");
                 }
-            }else{
+            } else {
                 throw new Exception("Failed to initialise SvcLogicStore");
             }
 
-            if(errors.size() > 0){
+            if (errors.size() > 0) {
                 throw new Exception(errors.toString());
             }
         } catch (Exception e) {
@@ -94,50 +94,57 @@
     }
 
     public void activateDg(String activateFilePath) throws Exception {
-        logger.info("******************** Activating DG into Database *****************************");
+        logger.info(
+                "******************** Activating DG into Database *****************************");
         try {
             List<String> errors = new ArrayList<String>();
-            if(this.store != null){
+            if (this.store != null) {
                 File activateFile = new File(activateFilePath);
-                if(activateFile.isFile()){
-                    List<String> fileLines = FileUtils.readLines(activateFile,STRING_ENCODING);
-                    if(fileLines != null ){
+                if (activateFile.isFile()) {
+                    List<String> fileLines = FileUtils.readLines(activateFile, STRING_ENCODING);
+                    if (fileLines != null) {
                         for (String line : fileLines) {
-                            if(line != null && ! line.trim().startsWith("#")){
+                            if (line != null && !line.trim().startsWith("#")) {
                                 String lineArray[] = line.trim().split(":");
                                 try {
-                                    if(lineArray != null && lineArray.length >= 4){
+                                    if (lineArray != null && lineArray.length >= 4) {
                                         String module = lineArray[0];
                                         String rpc = lineArray[1];
                                         String version = lineArray[2];
                                         String mode = lineArray[3];
-                                        if(StringUtils.isNotBlank(module) && StringUtils.isNotBlank(rpc)
-                                                && StringUtils.isNotBlank(version) && StringUtils.isNotBlank(mode)){
+                                        if (StringUtils.isNotBlank(module)
+                                                && StringUtils.isNotBlank(rpc)
+                                                && StringUtils.isNotBlank(version)
+                                                && StringUtils.isNotBlank(mode)) {
                                             logger.info("Activating DG :" + line);
-                                            SvcLogicGraph graph = this.store.fetch(module, rpc, version, mode);
-                                            if(graph != null){
-                                                logger.info("Found Graph :" + line + " Activating ...");
+                                            SvcLogicGraph graph =
+                                                    this.store.fetch(module, rpc, version, mode);
+                                            if (graph != null) {
+                                                logger.info(
+                                                        "Found Graph :" + line + " Activating ...");
                                                 this.store.activate(graph);
-                                            }else{
-                                                throw new Exception("Failed to fetch from Database");
+                                            } else {
+                                                throw new Exception(
+                                                        "Failed to fetch from Database");
                                             }
                                         }
                                     }
                                 } catch (Exception e) {
                                     e.printStackTrace();
-                                    errors.add("Failed to Activate "+line + ", "+e.getMessage());
+                                    errors.add(
+                                            "Failed to Activate " + line + ", " + e.getMessage());
                                 }
                             }
                         }
                     }
-                }else{
+                } else {
                     throw new Exception(activateFile + " is not a valid Activate file Path");
                 }
-            }else{
+            } else {
                 throw new Exception("Failed to initialise SvcLogicStore");
             }
 
-            if(errors.size() > 0){
+            if (errors.size() > 0) {
                 throw new Exception(errors.toString());
             }
         } catch (Exception e) {
@@ -152,23 +159,26 @@
             String propertyPath = null;
             String activateFile = null;
 
-            if(args != null && args.length >= 3){
+            if (args != null && args.length >= 3) {
                 xmlPath = args[0];
                 activateFile = args[1];
                 propertyPath = args[2];
-            }else{
-                throw new Exception("Sufficient inputs for DGXMLLoadNActivate are missing <xmlpath> <activatefile> <dbPropertyfile>");
+            } else {
+                throw new Exception(
+                        "Sufficient inputs for DGXMLLoadNActivate are missing <xmlpath> <activatefile> <dbPropertyfile>");
             }
 
-            //propertyPath = "/Users/bs2796/0Source/ecomp/bvc-3.2.2/others/properties/dblib.properties";
-            //xmlPath = DGXMLLoadNActivate.class.getClassLoader().getResource(".").getPath() +"/xml" ;
+            // propertyPath =
+            // "/Users/bs2796/0Source/ecomp/bvc-3.2.2/others/properties/dblib.properties";
+            // xmlPath = DGXMLLoadNActivate.class.getClassLoader().getResource(".").getPath()
+            // +"/xml" ;
 
             DGXMLLoadNActivate dgXMLLoadDB = new DGXMLLoadNActivate(propertyPath);
             dgXMLLoadDB.loadDGXMLDir(xmlPath);
             dgXMLLoadDB.activateDg(activateFile);
         } catch (Exception e) {
             e.printStackTrace();
-        }finally {
+        } finally {
             System.exit(1);
         }
     }
diff --git a/appc-directed-graph/dg-loader/provider/src/main/resources/scripts/dg_load_activate.sh b/appc-directed-graph/dg-loader/provider/src/main/resources/scripts/dg_load_activate.sh
index e92efce..da11736 100644
--- a/appc-directed-graph/dg-loader/provider/src/main/resources/scripts/dg_load_activate.sh
+++ b/appc-directed-graph/dg-loader/provider/src/main/resources/scripts/dg_load_activate.sh
@@ -39,12 +39,12 @@
 rm -rf ${DG_JSON_DIR}/xml
 
 ################## To Genetare XML from JSON ########################
-$JAVA_HOME/bin/java -cp ${DG_DIR}/lib/dg-loader-provider.jar org.openecomp.sdnc.dg.loader.DGXMLGenerator ${DG_JSON_DIR} ${DG_JSON_DIR}/xml
+$JAVA_HOME/bin/java -cp ${DG_DIR}/lib/dg-loader-provider.jar org.onap.sdnc.dg.loader.DGXMLGenerator ${DG_JSON_DIR} ${DG_JSON_DIR}/xml
 
 ################## To Load DG XML ########################
-$JAVA_HOME/bin/java -cp ${DG_DIR}/lib/dg-loader-provider.jar org.openecomp.sdnc.dg.loader.DGXMLLoad ${DG_JSON_DIR}/xml ${BVC_DIR}/properties/dblib.properties
+$JAVA_HOME/bin/java -cp ${DG_DIR}/lib/dg-loader-provider.jar org.onap.sdnc.dg.loader.DGXMLLoad ${DG_JSON_DIR}/xml ${BVC_DIR}/properties/dblib.properties
 
 ################## To Activate ########################
-$JAVA_HOME/bin/java -cp ${DG_DIR}/lib/dg-loader-provider.jar org.openecomp.sdnc.dg.loader.DGXMLActivate ${DG_JSON_DIR}/dg_activate.txt ${BVC_DIR}/properties/dblib.properties
+$JAVA_HOME/bin/java -cp ${DG_DIR}/lib/dg-loader-provider.jar org.onap.sdnc.dg.loader.DGXMLActivate ${DG_JSON_DIR}/dg_activate.txt ${BVC_DIR}/properties/dblib.properties
 
 exit 0
diff --git a/appc-directed-graph/dg-loader/provider/src/test/java/org/onap/sdnc/dg/loader/DGLoaderTest.java b/appc-directed-graph/dg-loader/provider/src/test/java/org/onap/sdnc/dg/loader/DGLoaderTest.java
index 084929b..ea83213 100644
--- a/appc-directed-graph/dg-loader/provider/src/test/java/org/onap/sdnc/dg/loader/DGLoaderTest.java
+++ b/appc-directed-graph/dg-loader/provider/src/test/java/org/onap/sdnc/dg/loader/DGLoaderTest.java
@@ -22,31 +22,19 @@
  * ============LICENSE_END=========================================================
  */
 
-package org.openecomp.sdnc.dg.loader;
+package org.onap.sdnc.dg.loader;
 
-import static org.junit.Assert.*;
-
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
 import java.io.File;
 import java.util.ArrayList;
 import java.util.List;
-import java.util.Properties;
-
 import org.apache.commons.io.FileUtils;
-import org.eclipse.osgi.framework.internal.core.BundleContextImpl;
-import org.eclipse.osgi.framework.internal.core.BundleHost;
-import org.junit.Rule;
 import org.junit.Test;
-import org.mockito.Mockito;
-import org.onap.ccsdk.sli.core.sli.ConfigurationException;
-import org.onap.ccsdk.sli.core.sli.SvcLogicException;
-import org.onap.ccsdk.sli.core.sli.SvcLogicStore;
-import org.onap.ccsdk.sli.core.sli.SvcLogicStoreFactory;
-import org.osgi.framework.BundleContext;
 import org.powermock.reflect.Whitebox;
-import org.powermock.*;
 
 public class DGLoaderTest {
-    
+
     @Test
     public void testXMLGenerator() throws Exception {
         DGXMLGenerator application = new DGXMLGenerator();
@@ -54,58 +42,58 @@
         String xmlPath = null;
         String propertyPath = "somePath";
         // Generate, GenerateLoad, GenerateLoadActivate
-        String []args = new String[]{"src/test/resources/json","src/test/resources/xml"};
-        //logger.info("DGXML Conversion Started with arguments :"+ args[0] +":"+ args[1]);
-        if(args != null && args.length >= 2){
+        String[] args = new String[] {"src/test/resources/json", "src/test/resources/xml"};
+        // logger.info("DGXML Conversion Started with arguments :"+ args[0] +":"+ args[1]);
+        if (args != null && args.length >= 2) {
             jsonPath = args[0];
             xmlPath = args[1];
         }
-    
+
         application.generateXMLFromJSON(jsonPath, xmlPath, propertyPath);
-        File dir=new File("src/test/resources/xml");
-        String extensions[]=new String[] {"xml","XML"};
+        File dir = new File("src/test/resources/xml");
+        String extensions[] = new String[] {"xml", "XML"};
         List<File> files = new ArrayList<File>();
-        files=(List<File>) FileUtils.listFiles(dir, extensions, true);
+        files = (List<File>) FileUtils.listFiles(dir, extensions, true);
         assertNotNull(files.get(0));
         assertNotNull(files.get(0).getName());
     }
-    
+
     @Test
     public void testXMLGeneratorMain() throws Exception {
-        String []args = new String[]{"src/test/resources/json","src/test/resources/xml"};
+        String[] args = new String[] {"src/test/resources/json", "src/test/resources/xml"};
         DGXMLGenerator.main(args);
-        File dir=new File("src/test/resources/xml");
-        String extensions[]=new String[] {"xml","XML"};
+        File dir = new File("src/test/resources/xml");
+        String extensions[] = new String[] {"xml", "XML"};
         List<File> files = new ArrayList<File>();
-        files=(List<File>) FileUtils.listFiles(dir, extensions, true);
+        files = (List<File>) FileUtils.listFiles(dir, extensions, true);
         assertNotNull(files.get(0));
         assertNotNull(files.get(0).getName());
     }
-        
+
     @Test
     public void testDGLoader() throws Exception {
         String propertyPath = "src/test/resources/dummy.properties";
         String xmlPath = "src/test/resources/xml/Appc_UniTest.xml";
         DGXMLLoad dgXMLLoad = new MockDGXMLLoad();
         dgXMLLoad.loadDGXMLFile(xmlPath);
-       }
-    
+    }
+
     @Test
     public void testDGLoaderWithDir() throws Exception {
         String propertyPath = "src/test/resources/dummy.properties";
         String xmlPath = "src/test/resources/xml";
         DGXMLLoad dgXMLLoad = new MockDGXMLLoad();
-        Whitebox.invokeMethod(dgXMLLoad, "loadDGXMLDir",xmlPath);
+        Whitebox.invokeMethod(dgXMLLoad, "loadDGXMLDir", xmlPath);
     }
-    
+
     @Test
     public void testDGLoaderWithDirThrowsException() throws Exception {
         String propertyPath = "src/test/resources/dummy.properties";
         String xmlPath = "src/test/resources/xml/xml";
         DGXMLLoad dgXMLLoad = new MockDGXMLLoad();
-        Whitebox.invokeMethod(dgXMLLoad, "loadDGXMLDir",xmlPath);
+        Whitebox.invokeMethod(dgXMLLoad, "loadDGXMLDir", xmlPath);
     }
-    
+
     @Test
     public void testDGActivate() throws Exception {
         String propertyPath = "src/test/resources/dummy.properties";
@@ -114,7 +102,7 @@
         dgXMLActivate.activateDg(activateFilePath);
 
     }
-    
+
     @Test
     public void testDGActivateThrowsException() throws Exception {
         String propertyPath = "src/test/resources/dummy.properties";
@@ -123,7 +111,7 @@
         dgXMLActivate.activateDg(activateFilePath);
 
     }
-    
+
     @Test
     public void testDGLoadNActivate() throws Exception {
         String propertyPath = "src/test/resources/dummy.properties";
@@ -133,7 +121,7 @@
         dgXMLLoadNActivate.loadDGXMLFile(xmlPath);
         dgXMLLoadNActivate.activateDg(activateFilePath);
     }
-    
+
     @Test
     public void testDGLoadNActivateThrowsException() throws Exception {
         String propertyPath = "src/test/resources/dummy.properties";
@@ -143,21 +131,21 @@
         dgXMLLoadNActivate.loadDGXMLFile(xmlPath);
         dgXMLLoadNActivate.activateDg(activateFilePath);
     }
-    
+
     @Test
     public void testDGLoadNActivateloadDGXMLDir() throws Exception {
         String xmlPath = "src/test/resources/xml";
         DGXMLLoadNActivate dgXMLLoadNActivate = new MockDGXMLLoadNActivate();
-        Whitebox.invokeMethod(dgXMLLoadNActivate,"loadDGXMLDir",xmlPath);
-     }
-    
-    
+        Whitebox.invokeMethod(dgXMLLoadNActivate, "loadDGXMLDir", xmlPath);
+    }
+
+
     public void testDGLoadNActivateloadDGXMLDirThrowsException() throws Exception {
         String xmlPath = "src/test/resources/someDir";
         DGXMLLoadNActivate dgXMLLoadNActivate = new MockDGXMLLoadNActivate();
-        Whitebox.invokeMethod(dgXMLLoadNActivate,"loadDGXMLDir",xmlPath);
-     }
-    
+        Whitebox.invokeMethod(dgXMLLoadNActivate, "loadDGXMLDir", xmlPath);
+    }
+
     @Test
     public void testDGLoaderActivator() throws Exception {
         String xmlPath = "src/test/resources/xml";
@@ -167,22 +155,22 @@
         assertTrue(true);
     }
 
-    @Test (expected=Exception.class)
+    @Test(expected = Exception.class)
     public void testDGActivateConstructorThrowsException() throws Exception {
-        String somePath="";
+        String somePath = "";
         DGXMLActivate dgXMLActivate = new DGXMLActivate(somePath);
     }
-    
-    @Test (expected=Exception.class)
+
+    @Test(expected = Exception.class)
     public void testDGXMLLoadConstructorThrowsException() throws Exception {
-        String somePath="";
+        String somePath = "";
         DGXMLLoad dgXMLLoad = new DGXMLLoad(somePath);
     }
-    
-    @Test (expected=Exception.class)
+
+    @Test(expected = Exception.class)
     public void testDGLoadNActivateConstructorThrowsException() throws Exception {
-        String somePath="";
+        String somePath = "";
         DGXMLLoadNActivate dgXMLLoadNActivate = new DGXMLLoadNActivate(somePath);
     }
-    
+
 }
diff --git a/appc-directed-graph/dg-loader/provider/src/test/java/org/onap/sdnc/dg/loader/MockDGXMLActivate.java b/appc-directed-graph/dg-loader/provider/src/test/java/org/onap/sdnc/dg/loader/MockDGXMLActivate.java
index 41f1d09..09de232 100644
--- a/appc-directed-graph/dg-loader/provider/src/test/java/org/onap/sdnc/dg/loader/MockDGXMLActivate.java
+++ b/appc-directed-graph/dg-loader/provider/src/test/java/org/onap/sdnc/dg/loader/MockDGXMLActivate.java
@@ -22,12 +22,13 @@
  * ============LICENSE_END=========================================================
  */
 
-package org.openecomp.sdnc.dg.loader;
+package org.onap.sdnc.dg.loader;
 
 import org.onap.ccsdk.sli.core.sli.SvcLogicStore;
 
 public class MockDGXMLActivate extends DGXMLActivate {
-    private final static SvcLogicStore storeChild=MockSvcLogicFactory.getMockSvcLogicStore();;
+    private final static SvcLogicStore storeChild = MockSvcLogicFactory.getMockSvcLogicStore();;
+
     MockDGXMLActivate() throws Exception {
         super(storeChild);
     }
diff --git a/appc-directed-graph/dg-loader/provider/src/test/java/org/onap/sdnc/dg/loader/MockDGXMLLoad.java b/appc-directed-graph/dg-loader/provider/src/test/java/org/onap/sdnc/dg/loader/MockDGXMLLoad.java
index 27336d3..bbca6af 100644
--- a/appc-directed-graph/dg-loader/provider/src/test/java/org/onap/sdnc/dg/loader/MockDGXMLLoad.java
+++ b/appc-directed-graph/dg-loader/provider/src/test/java/org/onap/sdnc/dg/loader/MockDGXMLLoad.java
@@ -22,14 +22,14 @@
  * ============LICENSE_END=========================================================
  */
 
-package org.openecomp.sdnc.dg.loader;
+package org.onap.sdnc.dg.loader;
 
-import org.mockito.internal.util.reflection.Whitebox;
 import org.onap.ccsdk.sli.core.sli.SvcLogicStore;
 
-public class MockDGXMLLoad extends DGXMLLoad{
+public class MockDGXMLLoad extends DGXMLLoad {
 
-    private final static SvcLogicStore storeChild=MockSvcLogicFactory.getMockSvcLogicStore();;
+    private final static SvcLogicStore storeChild = MockSvcLogicFactory.getMockSvcLogicStore();;
+
     MockDGXMLLoad() throws Exception {
         super(storeChild);
     }
diff --git a/appc-directed-graph/dg-loader/provider/src/test/java/org/onap/sdnc/dg/loader/MockDGXMLLoadNActivate.java b/appc-directed-graph/dg-loader/provider/src/test/java/org/onap/sdnc/dg/loader/MockDGXMLLoadNActivate.java
index f60e6ab..dd3590a 100644
--- a/appc-directed-graph/dg-loader/provider/src/test/java/org/onap/sdnc/dg/loader/MockDGXMLLoadNActivate.java
+++ b/appc-directed-graph/dg-loader/provider/src/test/java/org/onap/sdnc/dg/loader/MockDGXMLLoadNActivate.java
@@ -22,13 +22,14 @@
  * ============LICENSE_END=========================================================
  */
 
-package org.openecomp.sdnc.dg.loader;
+package org.onap.sdnc.dg.loader;
 
 import org.onap.ccsdk.sli.core.sli.SvcLogicStore;
 
 public class MockDGXMLLoadNActivate extends DGXMLLoadNActivate {
-    private final static SvcLogicStore storeChild=MockSvcLogicFactory.getMockSvcLogicStore();;
-        MockDGXMLLoadNActivate() throws Exception {
+    private final static SvcLogicStore storeChild = MockSvcLogicFactory.getMockSvcLogicStore();;
+
+    MockDGXMLLoadNActivate() throws Exception {
         super(storeChild);
     }
 }
diff --git a/appc-directed-graph/dg-loader/provider/src/test/java/org/onap/sdnc/dg/loader/MockSvcLogicDblibStore.java b/appc-directed-graph/dg-loader/provider/src/test/java/org/onap/sdnc/dg/loader/MockSvcLogicDblibStore.java
index fdfe0ab..f3c1072 100644
--- a/appc-directed-graph/dg-loader/provider/src/test/java/org/onap/sdnc/dg/loader/MockSvcLogicDblibStore.java
+++ b/appc-directed-graph/dg-loader/provider/src/test/java/org/onap/sdnc/dg/loader/MockSvcLogicDblibStore.java
@@ -22,11 +22,9 @@
  * ============LICENSE_END=========================================================
  */
 
-package org.openecomp.sdnc.dg.loader;
+package org.onap.sdnc.dg.loader;
 
 import java.util.Properties;
-
-import org.onap.ccsdk.sli.core.sli.SvcLogicDblibStore;
 import org.onap.ccsdk.sli.core.sli.SvcLogicException;
 import org.onap.ccsdk.sli.core.sli.SvcLogicGraph;
 import org.onap.ccsdk.sli.core.sli.SvcLogicStore;
@@ -34,53 +32,61 @@
 public class MockSvcLogicDblibStore implements SvcLogicStore {
 
     @Override
-    public boolean hasGraph(String module, String rpc, String version,
-            String mode) {
+    public boolean hasGraph(String module, String rpc, String version, String mode) {
         return true;
     }
+
     @Override
-    public SvcLogicGraph fetch(String module, String rpc, String version,
-            String mode) throws SvcLogicException {
-        SvcLogicGraph retVal=new SvcLogicGraph();
+    public SvcLogicGraph fetch(String module, String rpc, String version, String mode)
+            throws SvcLogicException {
+        SvcLogicGraph retVal = new SvcLogicGraph();
         retVal.setMode("sync");
         retVal.setModule("Appc");
         retVal.setRpc("unitTestDG");
         retVal.setVersion("4.0.0");
         return retVal;
-        
+
     }
+
     @Override
     public void store(SvcLogicGraph graph) throws SvcLogicException {
 
     }
+
     @Override
     public void init(Properties props) throws SvcLogicException {
         // TODO Auto-generated method stub
-        
+
     }
+
     @Override
     public void registerNodeType(String nodeType) throws SvcLogicException {
         // TODO Auto-generated method stub
-        
+
     }
+
     @Override
     public void unregisterNodeType(String nodeType) throws SvcLogicException {
         // TODO Auto-generated method stub
-        
+
     }
+
     @Override
     public boolean isValidNodeType(String nodeType) throws SvcLogicException {
         // TODO Auto-generated method stub
         return true;
     }
+
     @Override
-    public void delete(String module, String rpc, String version, String mode) throws SvcLogicException {
+    public void delete(String module, String rpc, String version, String mode)
+            throws SvcLogicException {
         // TODO Auto-generated method stub
-        
+
     }
+
     @Override
     public void activate(SvcLogicGraph graph) throws SvcLogicException {
         // TODO Auto-generated method stub
-        
+
     }
 }
diff --git a/appc-directed-graph/dg-loader/provider/src/test/java/org/onap/sdnc/dg/loader/MockSvcLogicFactory.java b/appc-directed-graph/dg-loader/provider/src/test/java/org/onap/sdnc/dg/loader/MockSvcLogicFactory.java
index 82f75a0..8a0343a 100644
--- a/appc-directed-graph/dg-loader/provider/src/test/java/org/onap/sdnc/dg/loader/MockSvcLogicFactory.java
+++ b/appc-directed-graph/dg-loader/provider/src/test/java/org/onap/sdnc/dg/loader/MockSvcLogicFactory.java
@@ -22,15 +22,14 @@
  * ============LICENSE_END=========================================================
  */
 
-package org.openecomp.sdnc.dg.loader;
+package org.onap.sdnc.dg.loader;
 
 import org.onap.ccsdk.sli.core.sli.SvcLogicStore;
 import org.onap.ccsdk.sli.core.sli.SvcLogicStoreFactory;
-import org.onap.ccsdk.sli.core.sli.SvcLogicDblibStore;
 
 public class MockSvcLogicFactory extends SvcLogicStoreFactory {
     static SvcLogicStore getMockSvcLogicStore() {
-         SvcLogicStore store=new MockSvcLogicDblibStore();
-         return store;
+        SvcLogicStore store = new MockSvcLogicDblibStore();
+        return store;
     }
 }
