resoureloader -> classloader
This commit is contained in:
snoop 2017-04-27 10:51:49 +09:00
parent ff7de5f7ee
commit 6ec6e42df3

View File

@ -5,7 +5,6 @@ import com.fasterxml.jackson.databind.ObjectMapper;
import com.loafle.overflow.crawler.config.Config;
import com.loafle.overflow.crawler.result.OFResultSet;
import com.loafle.overflow.crawler.snmp.SNMPCrawler;
import com.sun.xml.internal.ws.api.ResourceLoader;
import org.junit.Ignore;
import org.junit.Test;
@ -33,7 +32,8 @@ public class AppTest {
public void testSNMP3() throws Exception {
SNMPCrawler c = new SNMPCrawler();
ObjectMapper mapper = new ObjectMapper();
String p = ResourceLoader.class.getClass().getResource("/config/examplev3.json").getPath();
ClassLoader classLoader = getClass().getClassLoader();
String p = classLoader.getResource("config/examplev3.json").getFile();
Config config = mapper.readValue(new File(p),Config.class);
Object result = c.getInternal(config);
@ -51,7 +51,9 @@ public class AppTest {
public void testSNMP2c() throws Exception {
SNMPCrawler c = new SNMPCrawler();
ObjectMapper mapper = new ObjectMapper();
String p = ResourceLoader.class.getClass().getResource("/config/examplev2.json").getPath();
ClassLoader classLoader = getClass().getClassLoader();
String p = classLoader.getResource("config/examplev2.json").getFile();
Config config = mapper.readValue(new File(p),Config.class);
Object result = c.getInternal(config);