package com.amaonaws.bigdatablog.indexcommoncrawl;

import org.junit.Before;
import org.junit.Test;
import cascading.flow.FlowDef;
import cascading.flow.local.LocalFlowConnector;
import java.util.Properties;
import com.amazonaws.bigdatablog.indexcommoncrawl.ConfigReader;
import com.amazonaws.bigdatablog.indexcommoncrawl.CommonCrawlIndex;


public class CommonCrawlIndexTest {

    @Before
    public void doNotCareAboutOsStuff() {
        System.setProperty("line.separator", "\n");
    }

    @Test
    public void testMain() throws Exception {
        Properties properties = new ConfigReader().renderProperties(CommonCrawlIndexTest.class);
        FlowDef flowDef = CommonCrawlIndex.buildFlowDef(properties);
        //Using cascading Local connector to exclude Hadoop and just test the logic
        new LocalFlowConnector(properties).connect(flowDef).complete();
    }


}

@@ -172,16 +172,44 @@
 nector;%0A
+import java.io.IOException;%0A
 import j
@@ -229,16 +229,16 @@
 erties;%0A
-
 import c
@@ -569,16 +569,17 @@
 ption %7B%0A
+%0A
         
@@ -601,16 +601,61 @@
 erties =
+ null;%0A        try %7B%0A            properties =
  new Con
@@ -708,24 +708,118 @@
 est.class);%0A
+            if (properties.getProperty(%22platform%22).toString().compareTo(%22LOCAL%22)==0)%7B%0A        
         Flow
@@ -871,24 +871,32 @@
 roperties);%0A
+        
         //Us
@@ -967,16 +967,24 @@
 e logic%0A
+        
         
@@ -1051,14 +1051,169 @@
 ();%0A
+            %7D%0A        %7D catch (IOException e) %7B%0A            System.out.println(%22Could not read your config.properties file%22);e.printStackTrace();%0A        %7D%0A
     %7D%0A
-%0A%0A
 %7D%0A
+%0A

Update CommonCrawlIndexTest.java