diff options
author | Ravi Pendurty <ravi.pendurty@highstreet-technologies.com> | 2020-02-03 14:24:15 +0100 |
---|---|---|
committer | Ravi Pendurty <ravi.pendurty@highstreet-technologies.com> | 2020-02-03 14:24:49 +0100 |
commit | 6af0ccf62efaa371ff337376115a34c8589ca38e (patch) | |
tree | 93626be447d37779165b998e40707213590d3546 /sdnr | |
parent | c96eb1a05d7237767197920ee79668cb508ab6d6 (diff) |
Update mountpoint-registrar
Include cleanup for test code
Issue-ID: SDNC-1030
Signed-off-by: Ravi Pendurty <ravi.pendurty@highstreet-technologies.com>
Change-Id: I2ec89f4d74817b61aee888127bc61de6dd335cef
Diffstat (limited to 'sdnr')
10 files changed, 55 insertions, 34 deletions
diff --git a/sdnr/wt/mountpoint-registrar/feature/pom.xml b/sdnr/wt/mountpoint-registrar/feature/pom.xml index 5cefa7681..51af84fc8 100644 --- a/sdnr/wt/mountpoint-registrar/feature/pom.xml +++ b/sdnr/wt/mountpoint-registrar/feature/pom.xml @@ -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> diff --git a/sdnr/wt/mountpoint-registrar/installer/pom.xml b/sdnr/wt/mountpoint-registrar/installer/pom.xml index 1528893aa..96dc18839 100755 --- a/sdnr/wt/mountpoint-registrar/installer/pom.xml +++ b/sdnr/wt/mountpoint-registrar/installer/pom.xml @@ -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> diff --git a/sdnr/wt/mountpoint-registrar/model/pom.xml b/sdnr/wt/mountpoint-registrar/model/pom.xml index 55d95950c..53c0fe960 100644 --- a/sdnr/wt/mountpoint-registrar/model/pom.xml +++ b/sdnr/wt/mountpoint-registrar/model/pom.xml @@ -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> diff --git a/sdnr/wt/mountpoint-registrar/pom.xml b/sdnr/wt/mountpoint-registrar/pom.xml index cc5165687..27a667429 100755 --- a/sdnr/wt/mountpoint-registrar/pom.xml +++ b/sdnr/wt/mountpoint-registrar/pom.xml @@ -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> diff --git a/sdnr/wt/mountpoint-registrar/provider/pom.xml b/sdnr/wt/mountpoint-registrar/provider/pom.xml index 554ce3ac8..39f9eb536 100644 --- a/sdnr/wt/mountpoint-registrar/provider/pom.xml +++ b/sdnr/wt/mountpoint-registrar/provider/pom.xml @@ -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> @@ -107,12 +106,6 @@ <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> diff --git a/sdnr/wt/mountpoint-registrar/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/mountpointregistrar/test/PNFRegistrationConfigTest.java b/sdnr/wt/mountpoint-registrar/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/mountpointregistrar/test/PNFRegistrationConfigTest.java index 2bc41490d..29da7ad85 100644 --- a/sdnr/wt/mountpoint-registrar/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/mountpointregistrar/test/PNFRegistrationConfigTest.java +++ b/sdnr/wt/mountpoint-registrar/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/mountpointregistrar/test/PNFRegistrationConfigTest.java @@ -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(); + } + + } } diff --git a/sdnr/wt/mountpoint-registrar/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/mountpointregistrar/test/TestDMaaPVESMsgConsumerMain.java b/sdnr/wt/mountpoint-registrar/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/mountpointregistrar/test/TestDMaaPVESMsgConsumerMain.java index 956477379..aefeddb0d 100644 --- a/sdnr/wt/mountpoint-registrar/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/mountpointregistrar/test/TestDMaaPVESMsgConsumerMain.java +++ b/sdnr/wt/mountpoint-registrar/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/mountpointregistrar/test/TestDMaaPVESMsgConsumerMain.java @@ -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(); } } - } + + diff --git a/sdnr/wt/mountpoint-registrar/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/mountpointregistrar/test/TestFaultConfig.java b/sdnr/wt/mountpoint-registrar/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/mountpointregistrar/test/TestFaultConfig.java index cbdb24a03..e8573e4e7 100644 --- a/sdnr/wt/mountpoint-registrar/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/mountpointregistrar/test/TestFaultConfig.java +++ b/sdnr/wt/mountpoint-registrar/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/mountpointregistrar/test/TestFaultConfig.java @@ -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(); + } + + } } diff --git a/sdnr/wt/mountpoint-registrar/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/mountpointregistrar/test/TestMapping.java b/sdnr/wt/mountpoint-registrar/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/mountpointregistrar/test/TestMapping.java index 5c9fbe35d..9790a9ccc 100644 --- a/sdnr/wt/mountpoint-registrar/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/mountpointregistrar/test/TestMapping.java +++ b/sdnr/wt/mountpoint-registrar/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/mountpointregistrar/test/TestMapping.java @@ -18,16 +18,16 @@ 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) { diff --git a/sdnr/wt/mountpoint-registrar/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/mountpointregistrar/test/TestMountpointRegistrarImpl.java b/sdnr/wt/mountpoint-registrar/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/mountpointregistrar/test/TestMountpointRegistrarImpl.java index 014a96f03..b048c201c 100644 --- a/sdnr/wt/mountpoint-registrar/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/mountpointregistrar/test/TestMountpointRegistrarImpl.java +++ b/sdnr/wt/mountpoint-registrar/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/mountpointregistrar/test/TestMountpointRegistrarImpl.java @@ -123,7 +123,7 @@ public class TestMountpointRegistrarImpl { Thread.sleep(millis); } catch (InterruptedException e) { LOG.warn(e.getMessage()); - Thread.interrupted(); + Thread.currentThread().interrupt(); } } |