From dfe4de71289d7779d15af87853ed83df7fad7f3e Mon Sep 17 00:00:00 2001 From: snoop Date: Tue, 23 May 2017 19:11:19 +0900 Subject: [PATCH] added new error --- .../overflow/crawler/wmi/WMICrawlerLinux.java | 3 +-- .../overflow/crawler/wmi/WMICrawlerTest.java | 25 +++++++++++++++++++ 2 files changed, 26 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/loafle/overflow/crawler/wmi/WMICrawlerLinux.java b/src/main/java/com/loafle/overflow/crawler/wmi/WMICrawlerLinux.java index ec46255..2342057 100644 --- a/src/main/java/com/loafle/overflow/crawler/wmi/WMICrawlerLinux.java +++ b/src/main/java/com/loafle/overflow/crawler/wmi/WMICrawlerLinux.java @@ -77,8 +77,7 @@ public class WMICrawlerLinux extends WMICrawlerOS { String errStr = checkError(result); if(errStr.length() > 0) { -// map.put("ERROR", errStr); - return null; + throw new Exception(errStr); } String[] lines = result.split("\\n"); 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 ebe04c9..7e50dc2 100644 --- a/src/test/java/com/loafle/overflow/crawler/wmi/WMICrawlerTest.java +++ b/src/test/java/com/loafle/overflow/crawler/wmi/WMICrawlerTest.java @@ -205,6 +205,31 @@ public class WMICrawlerTest { + } + + @Test + public void testMap() { + + + Map aa = new HashMap<>(); + + aa.put("111", "123123123"); + aa.put("222", "123123123"); + + Map bb = new HashMap<>(); + + + bb.put("333", "123123123"); + bb.put("444", "123123123"); + + + aa.putAll(bb); + + for( String key : aa.keySet() ){ + System.out.println( String.format("key : %s ||| value : %s", key, aa.get(key)) ); + } + + } } \ No newline at end of file