[GitHub] quintinali commented on a change in pull request #35: SDAP-161 MUDROD embedded unit test

2018-12-03 Thread GitBox
quintinali commented on a change in pull request #35: SDAP-161 MUDROD embedded 
unit test
URL: 
https://github.com/apache/incubator-sdap-mudrod/pull/35#discussion_r238313448
 
 

 ##
 File path: core/src/main/java/org/apache/sdap/mudrod/main/MudrodEngine.java
 ##
 @@ -391,12 +391,12 @@ public static void main(String[] args) {
   me.end();
 } catch (Exception e) {
   HelpFormatter formatter = new HelpFormatter();
-  formatter.printHelp("MudrodEngine: 'dataDir' argument is mandatory. " + 
"User must also provide an ingest method.", true);
+  formatter.printHelp("MudrodEngine: 'dataDir' argument is mandatory. " + 
"User must also provide an ingest method.", options, true);
   LOG.error("Error whilst parsing command line.", e);
 }
   }
 
-  private static void loadPathConfig(MudrodEngine me, String dataDir) {
+  public static void loadPathConfig(MudrodEngine me, String dataDir) {
 
 Review comment:
   loadPathConfig is invoked outside MudrodEngine in the test code. 
https://github.com/quintinali/incubator-sdap-mudrod/blob/b3ef470a39f8df68ddf80805c6948f870feeb2ce/core/src/test/java/org/apache/sdap/mudrod/discoveryengine/WeblogDiscoveryEngineTest.java#L31


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] quintinali commented on a change in pull request #35: SDAP-161 MUDROD embedded unit test

2018-12-03 Thread GitBox
quintinali commented on a change in pull request #35: SDAP-161 MUDROD embedded 
unit test
URL: 
https://github.com/apache/incubator-sdap-mudrod/pull/35#discussion_r238314526
 
 

 ##
 File path: 
core/src/main/java/org/apache/sdap/mudrod/weblog/pre/SessionStatistic.java
 ##
 @@ -229,7 +229,7 @@ public int processSession(ESDriver es, String sessionId) 
throws IOException, Int
   String[] keywordList = keywords.split(",");
   for (String item : items) {
 if (!Arrays.asList(keywordList).contains(item)) {
-  keywords = keywords + item + ",";
+  keywords = keywords + "," + item + ",";
 
 Review comment:
   
https://github.com/quintinali/incubator-sdap-mudrod/blob/b3ef470a39f8df68ddf80805c6948f870feeb2ce/core/src/test/java/org/apache/sdap/mudrod/discoveryengine/WeblogDiscoveryEngineTest.java#L61
 In the test case, I found the result generated from the old code is not the 
same as expected thus I changed the code


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[jira] [Commented] (SDAP-161) MUDROD embedded unit test

2018-12-03 Thread ASF GitHub Bot (JIRA)


[ 
https://issues.apache.org/jira/browse/SDAP-161?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16707368#comment-16707368
 ] 

ASF GitHub Bot commented on SDAP-161:
-

quintinali commented on a change in pull request #35: SDAP-161 MUDROD embedded 
unit test
URL: 
https://github.com/apache/incubator-sdap-mudrod/pull/35#discussion_r238313448
 
 

 ##
 File path: core/src/main/java/org/apache/sdap/mudrod/main/MudrodEngine.java
 ##
 @@ -391,12 +391,12 @@ public static void main(String[] args) {
   me.end();
 } catch (Exception e) {
   HelpFormatter formatter = new HelpFormatter();
-  formatter.printHelp("MudrodEngine: 'dataDir' argument is mandatory. " + 
"User must also provide an ingest method.", true);
+  formatter.printHelp("MudrodEngine: 'dataDir' argument is mandatory. " + 
"User must also provide an ingest method.", options, true);
   LOG.error("Error whilst parsing command line.", e);
 }
   }
 
-  private static void loadPathConfig(MudrodEngine me, String dataDir) {
+  public static void loadPathConfig(MudrodEngine me, String dataDir) {
 
 Review comment:
   loadPathConfig is invoked outside MudrodEngine in the test code. 
https://github.com/quintinali/incubator-sdap-mudrod/blob/b3ef470a39f8df68ddf80805c6948f870feeb2ce/core/src/test/java/org/apache/sdap/mudrod/discoveryengine/WeblogDiscoveryEngineTest.java#L31


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> MUDROD embedded unit test
> -
>
> Key: SDAP-161
> URL: https://issues.apache.org/jira/browse/SDAP-161
> Project: Apache Science Data Analytics Platform
>  Issue Type: Improvement
>  Components: mudrod
>Affects Versions: 1.0
>Reporter: Yun Li
>Priority: Major
>




--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (SDAP-161) MUDROD embedded unit test

2018-12-03 Thread ASF GitHub Bot (JIRA)


[ 
https://issues.apache.org/jira/browse/SDAP-161?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16707371#comment-16707371
 ] 

ASF GitHub Bot commented on SDAP-161:
-

quintinali commented on a change in pull request #35: SDAP-161 MUDROD embedded 
unit test
URL: 
https://github.com/apache/incubator-sdap-mudrod/pull/35#discussion_r238314526
 
 

 ##
 File path: 
core/src/main/java/org/apache/sdap/mudrod/weblog/pre/SessionStatistic.java
 ##
 @@ -229,7 +229,7 @@ public int processSession(ESDriver es, String sessionId) 
throws IOException, Int
   String[] keywordList = keywords.split(",");
   for (String item : items) {
 if (!Arrays.asList(keywordList).contains(item)) {
-  keywords = keywords + item + ",";
+  keywords = keywords + "," + item + ",";
 
 Review comment:
   
https://github.com/quintinali/incubator-sdap-mudrod/blob/b3ef470a39f8df68ddf80805c6948f870feeb2ce/core/src/test/java/org/apache/sdap/mudrod/discoveryengine/WeblogDiscoveryEngineTest.java#L61
 In the test case, I found the result generated from the old code is not the 
same as expected thus I changed the code


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> MUDROD embedded unit test
> -
>
> Key: SDAP-161
> URL: https://issues.apache.org/jira/browse/SDAP-161
> Project: Apache Science Data Analytics Platform
>  Issue Type: Improvement
>  Components: mudrod
>Affects Versions: 1.0
>Reporter: Yun Li
>Priority: Major
>




--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[GitHub] quintinali commented on a change in pull request #35: SDAP-161 MUDROD embedded unit test

2018-12-03 Thread GitBox
quintinali commented on a change in pull request #35: SDAP-161 MUDROD embedded 
unit test
URL: 
https://github.com/apache/incubator-sdap-mudrod/pull/35#discussion_r238318734
 
 

 ##
 File path: 
core/src/test/java/org/apache/sdap/mudrod/weblog/structure/log/GeoIpTest.java
 ##
 @@ -0,0 +1,18 @@
+package org.apache.sdap.mudrod.weblog.structure.log;
+
+import static org.junit.Assert.*;
+
+import org.junit.Assert;
+import org.junit.Test;
+
+public class GeoIpTest {
+
+   @Test
+   public void testToLocation() {
+   GeoIp ip = new GeoIp();
+   String iptest = "185.10.104.194";
+   Coordinates result = ip.toLocation(iptest);
+   Assert.assertEquals("failed in geoip function!", 
"22.283001,114.150002", result.latlon);
+   }
+
+}
 
 Review comment:
   I cannot understand which resource do you mean should be decompressed?  
There is not a specific reason for choosing logs from 2015.


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[jira] [Commented] (SDAP-161) MUDROD embedded unit test

2018-12-03 Thread ASF GitHub Bot (JIRA)


[ 
https://issues.apache.org/jira/browse/SDAP-161?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16707378#comment-16707378
 ] 

ASF GitHub Bot commented on SDAP-161:
-

quintinali commented on a change in pull request #35: SDAP-161 MUDROD embedded 
unit test
URL: 
https://github.com/apache/incubator-sdap-mudrod/pull/35#discussion_r238318734
 
 

 ##
 File path: 
core/src/test/java/org/apache/sdap/mudrod/weblog/structure/log/GeoIpTest.java
 ##
 @@ -0,0 +1,18 @@
+package org.apache.sdap.mudrod.weblog.structure.log;
+
+import static org.junit.Assert.*;
+
+import org.junit.Assert;
+import org.junit.Test;
+
+public class GeoIpTest {
+
+   @Test
+   public void testToLocation() {
+   GeoIp ip = new GeoIp();
+   String iptest = "185.10.104.194";
+   Coordinates result = ip.toLocation(iptest);
+   Assert.assertEquals("failed in geoip function!", 
"22.283001,114.150002", result.latlon);
+   }
+
+}
 
 Review comment:
   I cannot understand which resource do you mean should be decompressed?  
There is not a specific reason for choosing logs from 2015.


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> MUDROD embedded unit test
> -
>
> Key: SDAP-161
> URL: https://issues.apache.org/jira/browse/SDAP-161
> Project: Apache Science Data Analytics Platform
>  Issue Type: Improvement
>  Components: mudrod
>Affects Versions: 1.0
>Reporter: Yun Li
>Priority: Major
>




--
This message was sent by Atlassian JIRA
(v7.6.3#76005)