summaryrefslogtreecommitdiffstats
path: root/common/onap-common-configuration-management/onap-configuration-management-core/src/test
diff options
context:
space:
mode:
authorMichael Lando <ml636r@att.com>2018-08-06 15:51:35 +0300
committerVitaly Emporopulo <Vitaliy.Emporopulo@amdocs.com>2018-08-07 07:00:42 +0000
commit4da15282e4715d6b359873f260399a7b9a3d8666 (patch)
tree92cf88d72301f30f32af42db163433794d5e028c /common/onap-common-configuration-management/onap-configuration-management-core/src/test
parent7381994de250aac82522c2bdd32768bff4f869a8 (diff)
Revert commit
Fixes of sonar violations sdc and refactor This reverts commit baf7f0a965d0ffebd5308d44758bfa9ba96c0c76. except the catalog files. the onbording files will be resubmited. Change-Id: I84c00cec41665211e0bd16ff9cc0c87073d6b897 Issue-ID: SDC-1484 Signed-off-by: Michael Lando <ml636r@att.com>
Diffstat (limited to 'common/onap-common-configuration-management/onap-configuration-management-core/src/test')
-rw-r--r--common/onap-common-configuration-management/onap-configuration-management-core/src/test/java/org/onap/config/type/NonConfigResourceTest.java82
1 files changed, 0 insertions, 82 deletions
diff --git a/common/onap-common-configuration-management/onap-configuration-management-core/src/test/java/org/onap/config/type/NonConfigResourceTest.java b/common/onap-common-configuration-management/onap-configuration-management-core/src/test/java/org/onap/config/type/NonConfigResourceTest.java
deleted file mode 100644
index 0671996fb5..0000000000
--- a/common/onap-common-configuration-management/onap-configuration-management-core/src/test/java/org/onap/config/type/NonConfigResourceTest.java
+++ /dev/null
@@ -1,82 +0,0 @@
-package org.onap.config.type;
-
-import com.google.common.collect.ImmutableMap;
-import org.junit.Test;
-import org.onap.config.NonConfigResource;
-
-import java.io.File;
-import java.net.MalformedURLException;
-import java.net.URISyntaxException;
-import java.net.URL;
-import java.nio.file.Path;
-import java.nio.file.Paths;
-import java.util.Map;
-
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertTrue;
-
-public class NonConfigResourceTest {
-
- private final URL sampleUrlResource = NonConfigResourceTest.class.getResource("NonConfigResourceTest.class");
- private final String sampleResourcePath = sampleUrlResource.getPath();
- private final File sampleResourceFile = new File(sampleResourcePath);
-
- @Test
- public void testShouldLocateResourceWhenAbsPathProvided2() {
- Map<String, String> properties = ImmutableMap.of();
- Path actualResourcePath = NonConfigResource.create(properties::get).locate(sampleResourceFile.toString());
-
- assertTrue(actualResourcePath.compareTo(sampleResourceFile.toPath()) == 0);
- }
-
- @Test
- public void testShouldLocateResourceWhenPresentInFiles2() {
- Map<String, String> properties = ImmutableMap.of();
- NonConfigResource testedObject = NonConfigResource.create(properties::get);
- testedObject.add(sampleResourceFile);
-
- Path thisFilePath = testedObject.locate("NonConfigResourceTest.class");
-
- assertTrue(thisFilePath.compareTo(sampleResourceFile.toPath()) == 0);
- }
-
- @Test
- public void testShouldLocateResourceWhenNodeConfigPropertyIsSet2() throws URISyntaxException, MalformedURLException {
- Map<String, String> properties = ImmutableMap.of("node.config.location", new File(sampleResourcePath).getParentFile().getPath());
- NonConfigResource testedNonConfigResource = NonConfigResource.create(properties::get);
- System.getProperties().setProperty("node.config.location", new File(sampleResourcePath).getParentFile().getPath());
- Path thisFilePath = testedNonConfigResource.locate("NonConfigResourceTest.class");
-
- assertTrue(thisFilePath.compareTo(new File(sampleResourcePath).toPath()) == 0);
- }
-
- @Test
- public void testShouldLocateResourceWhenConfigPropertyIsSet2() {
- Map<String, String> properties = ImmutableMap.of("config.location", new File(sampleResourcePath).getParentFile().getPath());
- NonConfigResource testedNonConfigResource = NonConfigResource.create(properties::get);
- Path thisFilePath = testedNonConfigResource.locate("NonConfigResourceTest.class");
-
- assertTrue(thisFilePath.compareTo(new File(sampleResourcePath).toPath()) == 0);
- }
-
- @Test
- public void testShouldLocatePathWhenResourcePresentInUrls2() throws URISyntaxException {
- Map<String, String> properties = ImmutableMap.of();
- NonConfigResource testedObject = NonConfigResource.create(properties::get);
- testedObject.add(sampleUrlResource);
-
- Path thisFilePath = testedObject.locate("NonConfigResourceTest.class");
-
- assertTrue(thisFilePath.compareTo(Paths.get(sampleUrlResource.toURI())) == 0);
- }
-
- @Test
- public void testShouldNotLocateResource2() throws URISyntaxException {
- Map<String, String> properties = ImmutableMap.of();
- NonConfigResource testedObject = NonConfigResource.create(properties::get);
-
- Path thisFilePath = testedObject.locate("nonexistingresource");
-
- assertNull(thisFilePath);
- }
-}