summaryrefslogtreecommitdiffstats
path: root/src/test
diff options
context:
space:
mode:
authorVarun Gudisena <vg411h@att.com>2017-10-04 01:13:29 -0500
committerVarun Gudisena <vg411h@att.com>2017-10-04 01:13:39 -0500
commitc1db5e88f5db89df99cc2cccd25e830d6bfaac1f (patch)
tree57790798efe0d6576fdb3ed59a550b50eeb5bcef /src/test
parente9adb1321b864d9ba6d1c8385206d2f1ac5b3a82 (diff)
Add unit test cases
Issue-Id: DMAAP-151 Change-Id: I380fd88c4cbe51e4b13b38d71a9d492ff864813a Signed-off-by: Varun Gudisena <vg411h@att.com>
Diffstat (limited to 'src/test')
-rw-r--r--src/test/java/com/att/nsa/dmaap/filemonitor/ServicePropertiesMapTest.java15
-rw-r--r--src/test/resources/test.json3
-rw-r--r--src/test/resources/test.properties1
3 files changed, 14 insertions, 5 deletions
diff --git a/src/test/java/com/att/nsa/dmaap/filemonitor/ServicePropertiesMapTest.java b/src/test/java/com/att/nsa/dmaap/filemonitor/ServicePropertiesMapTest.java
index df3695e..d4e9838 100644
--- a/src/test/java/com/att/nsa/dmaap/filemonitor/ServicePropertiesMapTest.java
+++ b/src/test/java/com/att/nsa/dmaap/filemonitor/ServicePropertiesMapTest.java
@@ -70,15 +70,20 @@ public class ServicePropertiesMapTest {
@Test()
public void testRefreshJsonFile() throws Exception {
- Path resourceDirectory = Paths.get("src/test/resources");
- map.refresh(new File(resourceDirectory+"\\"+"test.json"));
- assertTrue(true);
+ //Path resourceDirectory = Paths.get("src/test/resources");
+ // map.refresh(new File(resourceDirectory+"\\"+"test.json"));
+ ClassLoader classLoader = getClass().getClassLoader();
+ map.refresh(new File(classLoader.getResource("test.json").getFile()));
+
+ assertTrue(true);
}
@Test
public void testRefreshPropsFile() throws Exception {
- Path resourceDirectory = Paths.get("src/test/resources");
- map.refresh(new File(resourceDirectory+"\\"+"test.properties"));
+ /*Path resourceDirectory = Paths.get("src/test/resources");
+ map.refresh(new File(resourceDirectory+"\\"+"test.properties"));*/
+ ClassLoader classLoader = getClass().getClassLoader();
+ map.refresh(new File(classLoader.getResource("test.json").getFile()));
assertTrue(true);
}
diff --git a/src/test/resources/test.json b/src/test/resources/test.json
new file mode 100644
index 0000000..1eac3d1
--- /dev/null
+++ b/src/test/resources/test.json
@@ -0,0 +1,3 @@
+{
+ "testKey":"testValue"
+} \ No newline at end of file
diff --git a/src/test/resources/test.properties b/src/test/resources/test.properties
new file mode 100644
index 0000000..e53f196
--- /dev/null
+++ b/src/test/resources/test.properties
@@ -0,0 +1 @@
+man=power \ No newline at end of file