From c3f8889bdde96457e1e15400d37247a8c8cba7c3 Mon Sep 17 00:00:00 2001 From: snoop Date: Thu, 27 Apr 2017 10:54:02 +0900 Subject: [PATCH] changed resouceloader - > classloader for maven package error --- .../com/loafle/overflow/crawler/wmi/WMICrawlerTest.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/test/java/com/loafle/overflow/crawler/wmi/WMICrawlerTest.java b/src/test/java/com/loafle/overflow/crawler/wmi/WMICrawlerTest.java index 935518b..ebe04c9 100644 --- a/src/test/java/com/loafle/overflow/crawler/wmi/WMICrawlerTest.java +++ b/src/test/java/com/loafle/overflow/crawler/wmi/WMICrawlerTest.java @@ -106,7 +106,8 @@ public class WMICrawlerTest { ObjectMapper mapper = new ObjectMapper(); - String p = ResourceLoader.class.getClass().getResource("/config/example.json").getPath(); + ClassLoader classLoader = getClass().getClassLoader(); + String p = classLoader.getResource("config/example.json").getFile(); System.out.println(p); @@ -121,7 +122,8 @@ public class WMICrawlerTest { public void testWMIJson() throws Exception { ObjectMapper mapper = new ObjectMapper(); - String p = ResourceLoader.class.getClass().getResource("/config/example.json").getPath(); + ClassLoader classLoader = getClass().getClassLoader(); + String p = classLoader.getResource("config/example.json").getFile(); Config c = mapper.readValue(new File(p),Config.class); // Map map = new HashMap<>();