diff --git a/pom.xml b/pom.xml index 99628f8..88e33c5 100644 --- a/pom.xml +++ b/pom.xml @@ -45,7 +45,7 @@ com.loafle.overflow - crawler_java + crawler 1.0.0-SNAPSHOT diff --git a/src/main/java/com/loafle/overflow/crawler/sql/SQLCrawler.java b/src/main/java/com/loafle/overflow/crawler/sql/SQLCrawler.java index 422f9ed..996a004 100644 --- a/src/main/java/com/loafle/overflow/crawler/sql/SQLCrawler.java +++ b/src/main/java/com/loafle/overflow/crawler/sql/SQLCrawler.java @@ -21,7 +21,7 @@ public class SQLCrawler extends Crawler { } - private List> getMetrics(Map config) { + private Object getMetrics(Map config) { Connection conn = null; Statement stmt = null; @@ -58,8 +58,7 @@ public class SQLCrawler extends Crawler { return datas; } catch (Exception e) { - - e.printStackTrace(); + new Exception(e.getMessage()).printStackTrace(); } finally { if (conn != null) { @@ -87,7 +86,6 @@ public class SQLCrawler extends Crawler { } } - return null; } diff --git a/src/test/java/com/loafle/overflow/AppTest.java b/src/test/java/com/loafle/overflow/AppTest.java index dd52e30..44fe4fc 100644 --- a/src/test/java/com/loafle/overflow/AppTest.java +++ b/src/test/java/com/loafle/overflow/AppTest.java @@ -1,8 +1,8 @@ package com.loafle.overflow; -import com.loafle.overflow.crawler.Crawler; import com.loafle.overflow.crawler.sql.SQLCrawler; +import org.junit.Ignore; import org.junit.Test; import java.util.HashMap; @@ -36,6 +36,7 @@ public class AppTest { // info.setQuery("select * from v$sysstat"); @Test + @Ignore public void testSQL() { SQLCrawler sc = new SQLCrawler(); Map config = new HashMap(); @@ -45,9 +46,8 @@ public class AppTest { config.put("ssl", false); config.put("query", "show session status"); - List> result = (List>)sc.getInternal(config); - - for(Map m : result) { + Object result = sc.getInternal(config); + for(Map m : (List>)result) { for (Map.Entry entry : m.entrySet()) { System.out.println("Key = " + entry.getKey() + ", Value = " + entry.getValue()); }