diff options
Diffstat (limited to 'sdnr/wt/common/src/test/java/org/onap/ccsdk/features/sdnr/wt/common/test/TestPomfile.java')
-rw-r--r-- | sdnr/wt/common/src/test/java/org/onap/ccsdk/features/sdnr/wt/common/test/TestPomfile.java | 17 |
1 files changed, 4 insertions, 13 deletions
diff --git a/sdnr/wt/common/src/test/java/org/onap/ccsdk/features/sdnr/wt/common/test/TestPomfile.java b/sdnr/wt/common/src/test/java/org/onap/ccsdk/features/sdnr/wt/common/test/TestPomfile.java index 9de285d1b..7089a809d 100644 --- a/sdnr/wt/common/src/test/java/org/onap/ccsdk/features/sdnr/wt/common/test/TestPomfile.java +++ b/sdnr/wt/common/src/test/java/org/onap/ccsdk/features/sdnr/wt/common/test/TestPomfile.java @@ -24,12 +24,9 @@ package org.onap.ccsdk.features.sdnr.wt.common.test; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.fail; - import java.io.ByteArrayInputStream; -import java.io.FileInputStream; import java.io.IOException; import javax.xml.parsers.ParserConfigurationException; - import org.junit.Test; import org.onap.ccsdk.features.sdnr.wt.common.file.PomFile; import org.onap.ccsdk.features.sdnr.wt.common.file.PomPropertiesFile; @@ -39,17 +36,16 @@ public class TestPomfile { private static final String TESTPROPERTY_KEY = "elasticsearch-rest-client.version"; private static final String TESTPROPERTY_VALUE = "6.4.3"; - private static final String POMFILENAME = "pom.xml"; + private static final String POMFILENAME = "/testpom.xml"; private static final String POM_PROPERTY = "#Generated by org.apache.felix.bundleplugin\n" + "#Tue Nov 19 11:20:33 CET 2019\n" + "version=0.7.0-SNAPSHOT\n" + "groupId=org.onap.ccsdk.features.sdnr.wt\n" + "artifactId=sdnr-wt-data-provider-provider\n"; - //private static final Date DATE_EXPECTED = new Date(119, 10, 19, 11, 20, 33); @Test public void test() { PomFile pom = null; try { - pom = new PomFile(new FileInputStream(POMFILENAME)); + pom = new PomFile(this.getClass().getResourceAsStream(POMFILENAME)); } catch (ParserConfigurationException | SAXException | IOException e) { fail(e.getMessage()); } @@ -59,14 +55,9 @@ public class TestPomfile { } @Test - public void testProp() { + public void testProp() throws IOException { PomPropertiesFile file = null; - try { - file = new PomPropertiesFile(new ByteArrayInputStream(POM_PROPERTY.getBytes())); - } catch (IOException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } + file = new PomPropertiesFile(new ByteArrayInputStream(POM_PROPERTY.getBytes())); assertNotNull(file); assertNotNull(file.getBuildDate()); } |