Update mountpoint-registrar 37/101037/1
authorRavi Pendurty <ravi.pendurty@highstreet-technologies.com>
Mon, 3 Feb 2020 13:24:15 +0000 (14:24 +0100)
committerRavi Pendurty <ravi.pendurty@highstreet-technologies.com>
Mon, 3 Feb 2020 13:24:49 +0000 (14:24 +0100)
Include cleanup for test code

Issue-ID: SDNC-1030
Signed-off-by: Ravi Pendurty <ravi.pendurty@highstreet-technologies.com>
Change-Id: I2ec89f4d74817b61aee888127bc61de6dd335cef

sdnr/wt/mountpoint-registrar/feature/pom.xml
sdnr/wt/mountpoint-registrar/installer/pom.xml
sdnr/wt/mountpoint-registrar/model/pom.xml
sdnr/wt/mountpoint-registrar/pom.xml
sdnr/wt/mountpoint-registrar/provider/pom.xml
sdnr/wt/mountpoint-registrar/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/mountpointregistrar/test/PNFRegistrationConfigTest.java
sdnr/wt/mountpoint-registrar/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/mountpointregistrar/test/TestDMaaPVESMsgConsumerMain.java
sdnr/wt/mountpoint-registrar/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/mountpointregistrar/test/TestFaultConfig.java
sdnr/wt/mountpoint-registrar/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/mountpointregistrar/test/TestMapping.java
sdnr/wt/mountpoint-registrar/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/mountpointregistrar/test/TestMountpointRegistrarImpl.java

index 5cefa76..51af84f 100644 (file)
@@ -28,7 +28,7 @@
     <groupId>org.onap.ccsdk.parent</groupId>
     <artifactId>single-feature-parent</artifactId>
     <version>1.5.2-SNAPSHOT</version>
-    <relativePath/>
+    <relativePath />
   </parent>
 
   <groupId>org.onap.ccsdk.features.sdnr.wt</groupId>
@@ -36,7 +36,7 @@
   <version>0.7.1-SNAPSHOT</version>
   <packaging>feature</packaging>
 
-  <name>ccsdk-features-sdnr-wt :: ${project.artifactId} :: feature</name>
+  <name>ccsdk-features :: ${project.artifactId} :: feature</name>
 
   <dependencyManagement>
     <dependencies>
index 1528893..96dc188 100755 (executable)
@@ -36,7 +36,7 @@
   <version>0.7.1-SNAPSHOT</version>
   <packaging>pom</packaging>
 
-  <name>ccsdk-features-sdnr-wt :: ${project.artifactId}</name>
+  <name>ccsdk-features :: ${project.artifactId}</name>
 
   <properties>
     <application.name>sdnr-wt-mountpoint-registrar</application.name>
index 55d9595..53c0fe9 100644 (file)
@@ -36,7 +36,7 @@
   <version>0.7.1-SNAPSHOT</version>
   <packaging>bundle</packaging>
 
-  <name>ccsdk-features-sdnr-wt :: ${project.artifactId}</name>
+  <name>ccsdk-features :: ${project.artifactId}</name>
   <licenses>
     <license>
       <name>Apache License, Version 2.0</name>
index cc51656..27a6674 100755 (executable)
@@ -36,7 +36,7 @@
     <version>0.7.1-SNAPSHOT</version>
     <packaging>pom</packaging>
 
-    <name>ccsdk-features-sdnr-wt :: ${project.artifactId}</name>
+    <name>ccsdk-features :: ${project.artifactId}</name>
 
     <modules>
         <module>model</module>
index 554ce3a..39f9eb5 100644 (file)
@@ -17,7 +17,7 @@
         <groupId>org.onap.ccsdk.parent</groupId>
         <artifactId>binding-parent</artifactId>
         <version>1.5.2-SNAPSHOT</version>
-        <relativePath/>
+        <relativePath />
     </parent>
 
     <groupId>org.onap.ccsdk.features.sdnr.wt</groupId>
@@ -25,7 +25,7 @@
     <version>0.7.1-SNAPSHOT</version>
     <packaging>bundle</packaging>
 
-    <name>ccsdk-features-sdnr-wt :: ${project.artifactId}</name>
+    <name>ccsdk-features :: ${project.artifactId}</name>
     <licenses>
         <license>
             <name>Apache License, Version 2.0</name>
@@ -38,7 +38,6 @@
         <maven.javadoc.skip>true</maven.javadoc.skip>
         <maven.build.timestamp.format>yyyy-MM-dd HH:mm</maven.build.timestamp.format>
         <buildtime>${maven.build.timestamp} UTC</buildtime>
-        <elasticsearch.version>6.4.3</elasticsearch.version>
     </properties>
 
     <dependencies>
             <version>${project.version}</version>
             <scope>provided</scope>
         </dependency>
-        <dependency>
-            <groupId>org.onap.ccsdk.features.sdnr.wt</groupId>
-            <artifactId>sdnr-wt-data-provider-database</artifactId>
-            <version>${project.version}</version>
-            <scope>provided</scope>
-        </dependency>
     </dependencies>
 
     <build>
index 2bc4149..29da7ad 100644 (file)
@@ -24,6 +24,7 @@ import java.io.File;
 import java.io.IOException;
 import java.nio.charset.StandardCharsets;
 
+import org.junit.After;
 import org.junit.Test;
 import org.onap.ccsdk.features.sdnr.wt.common.configuration.ConfigurationFileRepresentation;
 import org.onap.ccsdk.features.sdnr.wt.mountpointregistrar.impl.PNFRegistrationConfig;
@@ -70,5 +71,15 @@ public class PNFRegistrationConfigTest {
                }
 
        }
+       
+       @After
+       public void cleanUp() {
+               File file = new File("test.properties");
+               if (file.exists()) {
+                       System.out.println("File exists, Deleting it");
+                       file.delete();
+               }
+               
+       }
 
 }
index 9564773..aefeddb 100644 (file)
@@ -107,18 +107,18 @@ public class TestDMaaPVESMsgConsumerMain {
        Map<String, Configuration> configMap = new HashMap<String, Configuration>();
        DMaaPVESMsgConsumerMain dmaapMain;
 
-//     @Before
+       //      @Before
        public void preTest1() {
                try {
-               Files.asCharSink(new File(CONFIGURATIONFILE), StandardCharsets.UTF_8).write(TESTCONFIG_GENERAL);
-               ConfigurationFileRepresentation configFileRepresentation = new ConfigurationFileRepresentation(CONFIGURATIONFILE);
+                       Files.asCharSink(new File(CONFIGURATIONFILE), StandardCharsets.UTF_8).write(TESTCONFIG_GENERAL);
+                       ConfigurationFileRepresentation configFileRepresentation = new ConfigurationFileRepresentation(CONFIGURATIONFILE);
 
-               generalConfig = new GeneralConfig(configFileRepresentation);
-               PNFRegistrationConfig pnfRegConfig = new PNFRegistrationConfig(configFileRepresentation);
-               FaultConfig faultConfig = new FaultConfig(configFileRepresentation);
+                       generalConfig = new GeneralConfig(configFileRepresentation);
+                       PNFRegistrationConfig pnfRegConfig = new PNFRegistrationConfig(configFileRepresentation);
+                       FaultConfig faultConfig = new FaultConfig(configFileRepresentation);
 
-               configMap.put("pnfRegistration", pnfRegConfig);
-               configMap.put("fault", faultConfig);
+                       configMap.put("pnfRegistration", pnfRegConfig);
+                       configMap.put("fault", faultConfig);
                } catch (Exception e) {
                        System.out.println("Failed in preTest execution "+e.getMessage());
                }
@@ -126,15 +126,15 @@ public class TestDMaaPVESMsgConsumerMain {
 
        public void preTest2() {
                try {
-               Files.asCharSink(new File(CONFIGURATIONFILE), StandardCharsets.UTF_8).write(TESTCONFIG_GENERAL_INVALID);
-               ConfigurationFileRepresentation configFileRepresentation = new ConfigurationFileRepresentation(CONFIGURATIONFILE);
+                       Files.asCharSink(new File(CONFIGURATIONFILE), StandardCharsets.UTF_8).write(TESTCONFIG_GENERAL_INVALID);
+                       ConfigurationFileRepresentation configFileRepresentation = new ConfigurationFileRepresentation(CONFIGURATIONFILE);
 
-               generalConfig = new GeneralConfig(configFileRepresentation);
-               PNFRegistrationConfig pnfRegConfig = new PNFRegistrationConfig(configFileRepresentation);
-               FaultConfig faultConfig = new FaultConfig(configFileRepresentation);
+                       generalConfig = new GeneralConfig(configFileRepresentation);
+                       PNFRegistrationConfig pnfRegConfig = new PNFRegistrationConfig(configFileRepresentation);
+                       FaultConfig faultConfig = new FaultConfig(configFileRepresentation);
 
-               configMap.put("pnfRegistration", pnfRegConfig);
-               configMap.put("fault", faultConfig);
+                       configMap.put("pnfRegistration", pnfRegConfig);
+                       configMap.put("fault", faultConfig);
                } catch (Exception e) {
                        System.out.println("Failed in preTest execution "+e.getMessage());
                }
@@ -146,7 +146,7 @@ public class TestDMaaPVESMsgConsumerMain {
                assertNotNull(configMap);
                dmaapMain = new DMaaPVESMsgConsumerMain(configMap);
        }
-       
+
        @Test
        public void testDMaaPVESMsgConsumerMainMapOfStringConfiguration1() {
                preTest2();
@@ -156,11 +156,17 @@ public class TestDMaaPVESMsgConsumerMain {
 
        @After
        public void postTest() {
+               File file = new File("test.properties");
+               if (file.exists()) {
+                       System.out.println("File exists, Deleting it");
+                       file.delete();
+               }
                List<DMaaPVESMsgConsumer> consumers = DMaaPVESMsgConsumerMain.getConsumers();
                for (DMaaPVESMsgConsumer consumer : consumers) {
                        // stop all consumers
                        consumer.stopConsumer();
                }
        }
-
 }
+
+
index cbdb24a..e8573e4 100644 (file)
@@ -24,6 +24,7 @@ import java.io.File;
 import java.io.IOException;
 import java.nio.charset.StandardCharsets;
 
+import org.junit.After;
 import org.junit.Test;
 import org.onap.ccsdk.features.sdnr.wt.common.configuration.ConfigurationFileRepresentation;
 import org.onap.ccsdk.features.sdnr.wt.mountpointregistrar.impl.FaultConfig;
@@ -71,5 +72,15 @@ public class TestFaultConfig {
                        // TODO Auto-generated catch block
                }
        }
+       
+       @After
+       public void cleanUp() {
+               File file = new File("test.properties");
+               if (file.exists()) {
+                       System.out.println("File exists, Deleting it");
+                       file.delete();
+               }
+               
+       }
 
 }
index 5c9fbe3..9790a9c 100644 (file)
 package org.onap.ccsdk.features.sdnr.wt.mountpointregistrar.test;
 
 import com.fasterxml.jackson.core.JsonProcessingException;
+import com.fasterxml.jackson.databind.ObjectMapper;
 import java.util.Optional;
 import org.junit.Test;
-import org.onap.ccsdk.features.sdnr.wt.yangtools.YangToolsMapper;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.DateAndTime;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.SeverityType;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.devicemanager.rev190109.PushFaultNotificationInputBuilder;
 
 public class TestMapping {
 
-    private final YangToolsMapper mapper = new YangToolsMapper();
+    private final ObjectMapper mapper = new ObjectMapper();
 
 
     private static Optional<SeverityType> getSeverity(String faultSeverity) {
index 014a96f..b048c20 100644 (file)
@@ -123,7 +123,7 @@ public class TestMountpointRegistrarImpl {
             Thread.sleep(millis);
         } catch (InterruptedException e) {
             LOG.warn(e.getMessage());
-            Thread.interrupted();
+            Thread.currentThread().interrupt();
         }
     }