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

ASF GitHub Bot commented on SDAP-161:
-------------------------------------

lewismc 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_r239538820
 
 

 ##########
 File path: 
core/src/test/java/org/apache/sdap/mudrod/discoveryengine/WeblogDiscoveryEngineTest.java
 ##########
 @@ -0,0 +1,127 @@
+package org.apache.sdap.mudrod.discoveryengine;
+
+import static org.junit.Assert.*;
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.FileNotFoundException;
+import java.io.FileReader;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Properties;
+import org.apache.sdap.mudrod.driver.ESDriver;
+import org.apache.sdap.mudrod.driver.SparkDriver;
+import org.apache.sdap.mudrod.main.AbstractElasticsearchIntegrationTest;
+import org.apache.sdap.mudrod.main.MudrodConstants;
+import org.apache.sdap.mudrod.main.MudrodEngine;
+import org.junit.AfterClass;
+import org.junit.Assert;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+public class WeblogDiscoveryEngineTest extends 
AbstractElasticsearchIntegrationTest {
+
+  private static WeblogDiscoveryEngine weblogEngine = null;
+
+  @BeforeClass
+  public static void setUp() {
+    MudrodEngine mudrodEngine = new MudrodEngine();
+    Properties props = mudrodEngine.loadConfig();
+    ESDriver es = new ESDriver(props);
+    SparkDriver spark = new SparkDriver(props);
+    String dataDir = getTestDataPath();
+    System.out.println(dataDir);
+    props.setProperty(MudrodConstants.DATA_DIR, dataDir);
+    MudrodEngine.loadPathConfig(mudrodEngine, dataDir);
+    weblogEngine = new WeblogDiscoveryEngine(props, es, spark);
+  }
+
+  @AfterClass
+  public static void tearDown() {
+    // TODO
+  }
+
+  private static String getTestDataPath() {
+    File resourcesDirectory = new File("src/test/resources/");
+    String resourcedir = "/Testing_Data_1_3dayLog+Meta+Onto/";
+    String dataDir = resourcesDirectory.getAbsolutePath() + resourcedir;
+    return dataDir;
+  }
+
+  @Test
+  public void testPreprocess() throws IOException {
+
+    weblogEngine.preprocess();
+    testPreprocess_userHistory();
+    testPreprocess_clickStream();
+  }
+
+  private void testPreprocess_userHistory() throws IOException {
 
 Review comment:
   Additionally, ```testPreprocess_userHistory``` is not how to write Java 
methods. Please use camelCase as is shown elsewhere throughout the codebase. 

----------------------------------------------------------------
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)

Reply via email to